Struts2 jsp页面url访问查Action中对应指定方法
2017-05-29 22:23
513 查看
①:http://localhost:8080/PractiseStruts/loginAction!login.action;
②:http://localhost:8080/PractiseStruts/loginAction.action?method:login=xxx;
③:struts2的配置文件的action标签中存在一个method属性,用来指定访问特定的方法
<action name="login*" class="LoginAction" method="login">
④:<action name="Login_*" class="LoginAction" method="{1}">
这样在页面中的action路径可写为Login_CheckLogin.action就是访问say方法了;
⑤:若struts2交给spring容器管理。怎可以通过注解方式找到action以及对应的action中方法
@SuppressWarnings("unchecked")
@Action(value = "/admin/editproduct", results = { @Result(name = "update", location = "jsp/login.jsp") })
public String CheckLogin() throws Exception {
。。。。。。。
}
②:http://localhost:8080/PractiseStruts/loginAction.action?method:login=xxx;
③:struts2的配置文件的action标签中存在一个method属性,用来指定访问特定的方法
<action name="login*" class="LoginAction" method="login">
④:<action name="Login_*" class="LoginAction" method="{1}">
这样在页面中的action路径可写为Login_CheckLogin.action就是访问say方法了;
⑤:若struts2交给spring容器管理。怎可以通过注解方式找到action以及对应的action中方法
@SuppressWarnings("unchecked")
@Action(value = "/admin/editproduct", results = { @Result(name = "update", location = "jsp/login.jsp") })
public String CheckLogin() throws Exception {
。。。。。。。
}
相关文章推荐
- Struts2 访问Action和Jsp页面出现的路径问题解决方案之 ---- 为jsp、图片、js、css等获取Web工程的绝对路径的方法
- struts2 action中获取jsp页面的参数的方法
- JSP获取上一个访问页面URL的方法
- struts2中页面访问action的url问题,或许很简单
- Struts2中访问Web元素的3中方法RequestAware,SessionAware,ApplicationAware在jsp页面间传值!
- struts2 action中获取jsp页面的参数的方法
- struts2中action传值到jsp页面的3种方法
- Struts2中访问Web元素的3中方法RequestAware,SessionAware,ApplicationAware在jsp页面间传值!
- struts2中 action获取jsp页面的参数的方法
- Struts2 前端JSP页面获取后台Action属性值的几种方法
- struts2中namespace与jsp页面请求action路径对应关系
- struts2 Action返回JSP页面CSS和JavaScript失效的解决方法。
- JSP页面结合Struts2如何传递复选框对应的id数组到后台action中
- Struts2中Action获取JSP页面传参的方法,及Action获取request的每个方法的区别
- [JavaEE]Struts2路径问题(如何在jsp页面正确访问struts.xml中的action)
- 首次进入页面刷新1次|JSP获取上一个访问页面URL的方法
- struts2中直接访问jsp页面报错解决方法!
- JSP页面加载时同时访问action获取数据( struts标签s:action方法)
- Struts2 -jsp页面位置不同访问方法不同
- 动态方法调用 在Struts2中动态方法调用有三种方式,动态方法调用就是为了解决一个Action对应多个请求的处理,以免Action太多 第一种方式:指定method属性 这种方式我们前面已经用到过