struts convention-plugin
来源:互联网 发布:学籍管理系统c语言 编辑:程序博客网 时间:2024/05/24 03:23
参考说明地址:http://struts.apache.org/2.1.6/docs/convention-plugin.html
Action:
@Results(value = { @Result(name = "success", location = "success.jsp"),@Result(name = "error", location = "error.jsp"),@Result(name = "testMethod", location = "/testMethod.jsp") })public class AnnotationAction extends ActionSupport {public String success() {System.out.println("success method !");return SUCCESS;}public String error() {System.out.println("error method !");return ERROR;}public String testMethod() {System.out.println("testMethod method !");return "testMethod";}}
struts.xml:
<struts><constant name="struts.i18n.encoding" value="GBK" /><constant name="struts.devMode" value="true" /><constant name="struts.configuration.xml.reload" value="true"/><constant name="struts.convention.result.path" value="/WEB-INF/jsp" /><constant name="struts.convention.classes.reload" value="true" /><constant name="struts.convention.package.locators" value="do,action"/><constant name="struts.convention.action.name.separator" value="-" /><package name="default" namespace="/index" extends="struts-default"><action name="test" class="com.jungle.action.TestAction"><result>/index.jsp</result></action></package></struts>
jsp页面:
其中error.jsp和success.jsp都是放在WebRoot/WEB-INF/jsp文件夹下。
testMethod.jsp放在WebRoot下。
<a href="<%=path%>/annotation!success.action" >annotation!success.action</a><a href="${pageContext.request.contextPath}/annotation!error.action" >annotation!error.action</a><a href="${pageContext.request.contextPath}/annotation!testMethod.action" >annotation!testMethod.action</a>
- struts convention-plugin
- struts convention-plugin的使用
- struts 零配置 convention-plugin
- struts使用convention-plugin实现零配置
- Struts使用convention-plugin实现零配置
- Struts使用convention-plugin实现零配置
- Convention Plugin
- Convention Plugin
- Convention Plugin
- Convention Plugin
- Convention Plugin
- Struts2 零配置 详解(struts-Convention-plugin)
- struts2零配置详解(struts-Convention-plugin)
- struts2零配置详解(struts-Convention-plugin)
- struts2 convention plugin from Apache Struts 2 Documentation
- struts2零配置详解(struts-Convention-plugin)
- Struts2 Convention Plugin
- Struts2 Convention Plugin 学习
- VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x
- java中hashcode()和equals()的详解
- varchar和Nvarchar区别
- Android中Notification详解【android进化三十五】
- Jquery全选方法
- struts convention-plugin
- 编程的一些体会
- 数据源绑定
- u-boot顶层Makefile分析(转)
- 蚁群算法的特点
- 几招轻松搞定JVM内存设置
- TCP/IP头格式
- 一个游戏程序员的学习资料
- JVM内存参数调优(看到的比较好的文章,顺便收集一下)