使用Struts2(一)搭建环境(struts2.3.31)
来源:互联网 发布:zz的网络意思 编辑:程序博客网 时间:2024/06/03 13:24
1.web.xml
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"id="WebApp_ID" version="3.0"><display-name>struts2016Test01</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><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping></web-app>
2.struts.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts><constant name="struts.devMode" value="true" /><package name="basicstruts2" extends="struts-default"><action name="index"><result>/test01.jsp</result></action></package></struts>
3.test01.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--> </head> <body> This is my JSP page. ---struts2--test01.jsp<br> </body></html>
4.jar包
5.运行
0 0
- 使用Struts2(一)搭建环境(struts2.3.31)
- Struts2(一)---概述及环境搭建
- 使用myeclipse搭建struts2环境
- Struts2学习笔记(一)搭建struts2
- struts2入门教程一(环境搭建,基本案例实现)
- struts2源码分享(一)---环境搭建篇
- Struts2学习笔记(一):简介和环境搭建
- Maven搭建struts2+spring+hibernate环境(一)
- struts2入门教程一(环境搭建,基本案例实现)
- Maven搭建Spring+Struts2+Mybatis项目(一) Maven环境
- Struts2(一)---struts2的环境搭建及实例
- Struts2学习笔记一 ---- 搭建环境
- Struts2学习笔记一(环境搭建)
- Struts2平凡之路(一)struts2的下载和开发环境搭建
- Struts2学习(一)--maven搭建Struts2框架的开发环境
- struts2 使用Maven搭建Struts2框架的开发环境
- 使用ant手动搭建struts2开发环境
- Struts2开发环境搭建
- Linux帮助命令
- PHP的语法学习
- hdu 1878 欧拉回路(无向图)
- 要求设置一绝对地址为0x67a9的整型变量的值为0xaa55。
- NOIp模拟 电缆建设
- 使用Struts2(一)搭建环境(struts2.3.31)
- 关于在ViewPager中添加Fragment的问题
- malloc和new的区别是摘要
- luogu【P1025】数的划分
- 存储引擎的选择和索引的创建
- 一个webapp应用中配置多个spring容器好吗?
- node调试协议
- vr
- LeetCode No.223 Rectangle Area