"Web Application Technology" learning planning schedule

The content of this course mainly includes Servlet, JSP, SpringMVC, Spring, MyBatis, SSM.



"Web Application Technology" learning planning schedule

week 2

Configuration Environment

1. As a user, visit the imitation Tmall website. You can place an order to experience it yourself. You will see your order information in the background.   Imitate Tmall official website

2. As an administrator, you can access the background management system of the platform to view your own orders, and you can also view category management, user management, etc. Category management

3. Configure Tomcat as a web server. Tomcat Series Textbook (1) - Tutorial

Thinking: What does tomcat do? Why install this server? 

4. Install the integrated tool Eclipse written by the code

Tmall whole station SSM series textbooks (5) - basics - download and configure to run

HelloWorld series of textbooks (8) - Compatible instructions for various software and tool versions

HelloWorld series of textbooks (6) - common usage skills of eclipse

HelloWorld series of textbooks (3) - download eclipse

5. Write the first JSP program

JSP Series Textbook (1) - Tutorial

Textbook p100 pages, 5.10

The first job : install and configure eclipse, and successfully run the first jsp page. (Deadline: Sunday 3.5)

Students who currently have textbooks in hand, please read the textbook p100

For students who do not have teaching materials, take the following example, "Step 5" is to create a new JSP file. Right click --new-JSP file. Omit step 6.7.8. Servlet Series Textbook (13) - Dynamic Web Project - Use Dynamic Web Project to develop J2EE applications

 

You can use the source code of the hello.jsp page:

<%@ page contentType="text/html;charset=utf-8" %>
<HTML><BODY BGCOLOR=cyan>
<h3>This is a simple JSP page</h3>
  <% int i, sum=0 ;
     for(i=1;i<=100;i++){        sum=sum+i;      }   %> <h5> The continuous sum from 1 to 100 is:  <%=sum %>  </h5> </BODY>< /HTML>  






Week 3-4

jsp

(Exercise + homework deadline: 2023.3.18)

Note: Don't just submit an assignment before the deadline, the process of practicing should also be reflected.

This week's task: understand the grammatical features of jsp, understand page instructions, action instructions, java code fragments, and built-in objects, especially the usage of obtaining form information through the request object, etc.

(After practicing every day, post the specific situation of the day's practice in csdn. The title of the practice part of the article is marked: jsp exercise 1, jsp exercise 2, etc. The title of the submitted assignment: the first assignment, the second assignment. This is convenient for me Check out everyone. Note: Don't just submit one assignment before the deadline.)

Exercise : Students who have no teaching materials

          JSP Series Textbook (1) - Tutorial

          JSP form processing_w3cschool

           For students who have textbooks, read Chapter 5 to understand what the syntax of jsp is and what functions each command has. Focus on exercises 5.4 and 5.6. Others are only for understanding.

第二次作业:用JSP实现用户获取用户输入的操作。(仿教材例5-5)

input.jsp

output.jsp

 

第三次作业

用JSP实现用户登录验证的功能。

1、如果用户输入正确的账号密码,则提示问候语句;如果用户输入错误的账号密码,则提示账号密码有误。

2、任意编写3-4个页面,为每个页面添加权限控制。如果用户已经登录,则在每个页面页首提示:欢迎你,**。如果没有登录跳转到这个页面,则提示:非法访问。

 

  

第5周

servlet

学习目标1:会写简单的servlet程序

练习:

一、采用web.xml进行servlet部署

         教材p112页6-2

           或者

           https://how2j.cn/k/servlet/servlet-dynamic-web-project/1306.html

两个地方的案例,对照着看,因为教材有些没有讲清楚的地方,网站的案例会有说明。

注意:

1、新建servlet的时候不要使用包名,否则可能会出现错误。

 2、运行servelt的时候,会出现404错误。因为aaa这个项目没有index.jsp的默认首页,找不到,所以会报这个错。在这个报错的页面填上正确的地址。

 

查看web.xml文件中的servlet的访问路径。此处为/hello

最后的访问路径如下:

3、只要web.xml做了修改,都需要重启启动tomcat服务器,才能发挥作用。因为web.xml只在启动的时候由服务器执行。

问题:web.xml中做如下的配置,到底是什么意思?应该如何配置?教材p112页

二、采用注解方式进行servelt部署

 教材p111-112页,具体的servlet里面的内容可以使用6-2中的代码。

eclipse中自动新建的servelt中自带注解模式。

学习目标2:过滤器-中文问题处理

                    教材p117

                    Filter系列教材 (二)- 使用Filter进行中文问题处理

  修改教材p112页的6-2案例,不使用编码转换的语句,直接使用过滤器处理。

编写过滤器的类(可以复制how2j网站上的代码),修改web.xml

第6周

数据库技术jdbc

任务一:安装mysql,和navicat for mysql或者( mysql-front),并创建数据库和数据库的表

1、安装软件,参考教材或者how2j上面的文章

mysql系列教材 (一)- 安装mysql-server

mysql的安装如果有异常情况卸载以后,再次安装会需要一些处理。参考:

mysql系列教材 (十三)- MySQL 安装失败,提示Apply Security Settings 的处理办法

mysql安装以后,需要配置环境变量。如果不配置环境变量,则出现以下,找不到mysql的命令。

配置环境变量,参见教材p132.

(配置变量以后,cmd命令行要关掉重新打开)

以下提示说明已经能够失败mysql的命令,但是访问被拒绝了。 

-u的意思是访问mysql的用户名是root,-p 意思是输入密码。

出现如下页面,则证明mysql已启动。

启动以后就不要关掉了。只有mysql启动状态才能对数据库进行操作。

2、由于mysql数据库只能命令行进行操作,所以一般会安装界面化的操作软件。可以装navicat或者mysql-front。建议直接安装how2j网站的mysql-front。

3、在mysql中创建数据库及表,参考how2j网站的步骤。

4、注意,使用jsp或者java多数据库进行操作,必须启动mysql。否则不能操作。

任务二:编写jsp页面实现对数据库表的查询

创建表tb_user.有两个方法。(教材中的字段是id,username,password这三个字段,由于password是保留关键字,不能用作字段名,所以我们修改为id,username,mypassword这三个字段。与教材的不一样,大家注意。)

1、可用sql语句创建表

CREATE TABLE tb_user(

  id int(11) AUTO_INCREMENT,

  username varchar(30) ,

  mypassword varchar(30) ,

  PRIMARY KEY (id)

)  DEFAULT CHARSET=utf8;

2、直接在navicat或mysql-front中直接创建。其他操作应该与大家在数据库课程上面的内容差不多。

 

3、在jsp中写查询数据库db_database24中的表tb_user中的所有数据并在页面中显示出来。

注意连接数据库的数据库的名称,表名,数据库连接的账号密码,要修改成自己的。

<%@ page language="java" import="java.sql.*" pageEncoding="UTF-8"%>
<%
    try {
        Class.forName("com.mysql.jdbc.Driver");
    } catch (ClassNotFoundException e) {
        System.out.println("加载数据库驱动时抛出异常,内容如下:");
        e.printStackTrace();
    }
    Connection conn = DriverManager
            .getConnection(
    "jdbc:mysql://localhost/db_database24?useUnicode=true&characterEncoding=utf8",
                    "root", "123");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt
            .executeQuery("select * from tb_user");
    while (rs.next()) {
        out.println("用户名:" + rs.getString(2) + "    密码:" + rs.getString(3)+"<br>");
    }
    rs.close();
    stmt.close();
    conn.close();
%>

(数据库这一章的学习,大家也可以查看网页。这是这里是写的Java类,大家把相关的代码复制,作为java代码片段放到jsp页面中即可。

JDBC系列教材 (一)- Java 使用JDBC之前,先要准备mysql

)

第7周

数据库技术jdbc

任务三:编写jsp页面实现对数据库表的添加删除修改(大家观察一下,这些功能只需要在查询的代码基础上进行修改。所以可以先复制前面的代码,再修改即可。

7-3.jsp

 7-5.jsp

 7-7.jsp(教材delete语句有错误,掉了from)

任务四:自己新建一个表,实现对这个表的增删改查。

CREATE TABLE huiyuan(

  id int(11) AUTO_INCREMENT,

  name varchar(30) ,

  age float ,

  xingbie varchar(30) ,

  PRIMARY KEY (id)

)  DEFAULT CHARSET=utf8;

第8周

MVC

第八周 MVC_wyhwust的博客-CSDN博客

第9周

MVC

MVC系列教材 (三)- 结合Servlet和JSP 实现分页功能

MVC系列教材 (四)- 使用Servlet 验证用户是否登陆

第10周

实例:购物车

购物车系列教材 (一)- 使用Servlet结合JSP开发 购物车 功能

整合后的源代码已上传到课程 QQ群。

 

第11周

实例:购物车

第12周

Spring MVC,程序日志组件

Spring MVC系列教材 (一)- 教程

第周

Spring MVC

第周

MyBatis

Mybatis系列教材 (一)- 基础 - 入门教程

第周

Sping

Spring系列教材 (一)- 教程

第周

SSM框架整合实例

SSM series of textbooks (1) - detailed steps for the integration of the three major frameworks of Spring+Sping MVC + Mybatis

week

New technologies and tools for web development

SpringBoot Series Teaching Materials (1) - Basics - Getting Started with Springboot - Create a running springboot project in Eclipse, non-STS plug-in method


https://how2j.cn/p/10026 (voluntary purchase according to the situation)

Tmall Whole Station Springboot Series Teaching Materials (1) - Basics - Springboot Project Tutorial - Imitating Tmall Whole Station Springboot Edition

Guess you like

Origin blog.csdn.net/wyhwust/article/details/129253865