07 2024 档案
摘要:1. 添加依赖(因为创建的是maven项目 所以不用去创建lib目录去导入包了 方便) 点击查看代码 <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
阅读全文
摘要:1.导包 点击查看代码 <dependencies> <!--Servlet 依赖--> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version>
阅读全文
摘要:1.jsp标签 <jsp:forward page="/www.jsp"> <jsp:param name="xixi" value="wwww"/> </jsp:forward> 2.jstl 表达式 jstl标签库的使用就是为了弥补html的不足 jstl核心标签 使用标签要导入的头文件 <%@
阅读全文
摘要:首先要对项目的pom.xml进行添加依赖 点击查看代码 <dependencies> <!--Servlet 依赖--> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <versi
阅读全文
摘要:1.首先要对本Java文件的 index.jsp 进行修改 点击查看代码 <html> <body> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"
阅读全文
摘要:1.首先在maven项目下创建java class 类 ,然后继承HttpServlet接口。 重写doGet方法。 2.代码如下 点击查看代码 import javax.servlet.ServletException; import javax.servlet.ServletOutputStre
阅读全文
摘要:1.建立maven项目要添加的 archetypeCatalog=internal 确保新的modle中有src文件 2.每个新项目的web.xml中都要修改为 Archetype Created Web Application 点击查看代码 <?xml version="1.0" encoding
阅读全文