创建action
package com.demo.action; public class HelloWorld { private String mess = "我的第一个应用"; public String execute(){ return "success"; } public String getMess() { return mess; } public void setMess(String mess) { this.mess = mess; } }
配置struts.xml
<!-- name 为其他包继承用 namespace 为访问--> <package name="usermanager" extends="struts-default" namespace="/usermanager"> <action name="top" class="com.demo.action.HelloWorld" method="execute" > <result name="success">/WEB-INF/page/mess.jsp</result> </action> </package>
创建视图
<%@ 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></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> ${mess } <br> </body> </html>
浏览器访问路径:http://127.0.0.1:8080/struts2/usermanager/top
OK。
相关推荐
struts2.2.3-hibernate3.3.1-spring3.1.zip jar 包
jackson-annotations-2.2.3.jar jackson-core-2.2.3.jar jackson-databind-2.2.3.jar
pyqt6-plugins-6.4.2.2.3-py3-none-any.whl
jackson开发中用到的三个jar包,包含jackson-annotations-2.2.3.jar jackson-core-2.2.3.jar jackson-databind-2.2.3.jar
Struts2.2.3需要的jar包。 其中包括: commons-fileupload-1.2.2.jar commons-io-2.0.1.jar commons-lang-2.5.jar ...struts2-core-2.2.3.jar struts2-json-plugin-2.2.3.jar xwork-core-2.2.3.jar 支持Json。
asm-2.2.3.jar,asm-commons-2.2.3.jar,asm-util-2.2.3.jar,cglib-nodep-2.1_3.jar
赠送原API文档:jackson-module-jaxb-annotations-2.2.3-javadoc.jar; 赠送源代码:jackson-module-jaxb-annotations-2.2.3-sources.jar; 赠送Maven依赖信息文件:jackson-module-jaxb-annotations-2.2.3.pom; ...
json-lib-2.2.3-jdk15-javadoc.jar json 源代码
struts2-core-2.2.3.jar struts2-dojo-plugin-2.2.3.jar struts2-codebehind-plugin-2.2.3.jar struts2-config-browser-plugin-2.2.3.jar struts2-convention-plugin-2.2.3.jar 等等。。。
struts2.2.3 完整jar包struts2.2.3 完整jar包struts2.2.3 完整jar包
struts-2.2.3 + spring-2.5.6 + hibernate-3.6.8环境搭建包,里面有详细的搭建方法和所需要的全部jar包,采用的是oracle 11g数据库,希望能帮助到在学ssh2的朋友。
struts2-core-2.0.1.jar, struts2-core-2.0.11.1.jar, struts2-core-2.0.11.2.jar, struts2-core-2.0.11.jar, struts2-core-2.0.12.jar, ...struts2-core-2.2.3.jar, struts2-core-2.3.30.jar, struts2-core-2.5.2.jar
struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件struts-2.2.3文件
struts2.2.3.zip基本配置模板 struts2.2.3.zip基本配置模板
Flask-2.2.3-py3-none-any.whl
python库。 资源全名:vistrails-2.2.3-py2-none-any.whl
赠送原API文档:jackson-annotations-2.2.3-javadoc.jar; 赠送源代码:jackson-annotations-2.2.3-sources.jar; 赠送Maven依赖信息文件:jackson-annotations-2.2.3.pom; 包含翻译后的API文档:jackson-...
AMAT-2.2.3-py3-none-any.whl.zip
matplotlib库 matplotlib-2.2.3-cp27-cp27m-win32