Java Dynamic Web Project
2017-07-13 23:39
246 查看
Java Dynamic Web Project
1、创建Dynamic Web Project
2、设置Target runtime,web容器即Apache Tomcat以及容器配置
3、source folder
4、web module,记得勾选产生web.xml部署描述文档,点击finish按键完成工程创建
web.xml
5、右击WebContent添加 java server page — index.jsp
web.xml中已配置文档,程序运行时界面
index.jsp
6、运行工程
7、配置server
8、添加工程到web容器,点击finish运行
运行结果:
1、创建Dynamic Web Project
2、设置Target runtime,web容器即Apache Tomcat以及容器配置
3、source folder
4、web module,记得勾选产生web.xml部署描述文档,点击finish按键完成工程创建
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>dynamicwebprj</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app>
5、右击WebContent添加 java server page — index.jsp
web.xml中已配置文档,程序运行时界面
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>dynamic web project</title> </head> <body> Hello,World! <%="Hello World!" %> <% System.out.println("hello world!"); %> </body> </html>
6、运行工程
7、配置server
8、添加工程到web容器,点击finish运行
运行结果:
相关文章推荐
- Converting a Java Project to a Dynamic Web Project in Eclipse
- java中dynamic web project与web project 的区别 [转]
- 在创建Dynamic Web Project时提示Dynamic Web Module 3.0 requires Java 1.6 or newer错误
- eclipse for java ee 用tomcat运行dynamic web project 404 错误原因之低级错误
- 从java project到dynamic web project
- Eclipse 中 将Java Project 转换为Dynamic Web Project
- Cannot change version of project facet Dynamic Web Module to 3.0 requires Java 1.6 or newer 解决方案
- Eclipse jee中将Java Project转换成为Dynamic Web Project
- 将Java Project转变为Dynamic Web Project
- Solving “Dynamic Web Module 3.0 requires Java 1.6 or newer” in Maven Projects
- Java Project 转 Dynamic Web Project
- 创建java Dynamic Web Project + Struts-2.3.20的心酸
- Eclipse:Java type project to Dynamic Web Project
- Eclipse中将Java Project转换成Dynamic Web Project
- 使用eclipse facete将Java Project转换成Dynamic Web Project
- 使用eclipse facete将Java Project转换成Dynamic Web Project
- java中dynamic web project与web project 的区别
- 如何把Eclipse中普通java project转换成Dynamic Web Project
- 如何新建java 动态web项目(Dynamic Web Project)
- java中dynamic web project与web project 的区别