Struts2 Convention插件的使用(3)方法前的@Action注解
package com.hyy.action;
import org.apache.struts2.convention.annotation.Action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorldTest extends ActionSupport{
private String message;
@Action("/different/url")
public String test() {
message = "hyy";
return "fail";
}
public String getMessage() {
return message;
}
}
由原本的/hello-world-test变为/differrent/url
相应地,返回的视图是/WEB-INF/differrent/url.jsp
Struts2 Convention插件的使用(3)方法前的@Action注解的更多相关文章
- Struts2 Convention插件的使用(4)使用@Action注解返回json数据
package com.hyy.action; import java.util.HashMap; import java.util.Map; import org.apache.struts2.co ...
- struts2 convention插件
1.struts2自2.1以后推荐使用Convention Plugin支持struts零配置支持(引入jar:struts2-convention-plugin-2.x.x.jar)①convent ...
- struts2 Convention插件好处及使用
现在JAVA开发都流行SSH.而很大部分公司也使用了struts2进行开发..因为struts2提供了很多插件和标签方便使用..在之前开发过程中总发现使用了struts2会出现很多相应的配合文件.如果 ...
- Struts2 Convention插件的使用(1)
刚刚查阅官方文档(convention-plugin.html)并学习了Struts2的Convention插件,文章这里只作为一个笔记,建议大家去看官方文档比较清晰和全面. 需要在项目添加这些包 c ...
- struts2 Convention插件零配置,使用注解开发
从struts21开始,struts2不再推荐使用codebehind作为零配置插件,而是改用Convention插件来支持零配置.与以前相比较,Convention插件更彻底. 使用Conventi ...
- Struts2 convention插件试用+ Spring+Hibernate SSH整合
第一步,引入struts2-convention-plugin-2.2.1.jar 然后,改动配置文件. 我是在struts.properties文件里改动的: struts.objectFactor ...
- Struts2 Convention插件的使用
转自:http://chenjumin.iteye.com/blog/668389 1.常量说明 struts.convention.result.path="/WEB-INF/conten ...
- Struts2 Convention插件的使用(2)return视图以及jsp的关系
package com.hyy.action; import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extend ...
- Struts2 注解零配置方法(convention插件使用)
最近接触到一个新的项目,是做一个使用S2SH的电子商务商城的二次开发.之前使用过S2SH,在此之前的项目中,Struts2 使用的是XML配置而这个项目是使用注解.在这个项目中,注解还不需要使用Act ...
随机推荐
- Java实现TCP之Echo客户端和服务端
Java实现TCP之Echo客户端和服务端 代码内容 采用TCP协议编写服务器端代码(端口任意) 编写客户机的代码访问该端口 客户机按行输入 服务器将收到的字符流和接收到的时间输出在服务器consol ...
- 安装ubuntu时将boot目录单独挂载的意义
只有一个意义那就是当你的情况是:单个硬盘里面安装多个系统. 如果不是这样,就别动它.
- 微软职位内部推荐-Senior Development Lead
微软近期Open的职位: MSIT Dynamics CRM Sr. Dev Lead (Sr. Dev Lead, Microsoft China, Beijing) Are you interes ...
- 避免写出IE Bug
https://github.com/KitWong/KitWong.github.io/tree/master/_posts
- Spring集成hibernate错误
八月 25, 2016 7:55:31 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule ...
- Hibernate使用原生sql语句
异常类型1:could not extract resulted --->表名字和类名不一致 异常类型2:could not execute query---->可能是sql语句错: 异常 ...
- iOS UIApplicatin和它的delegate
每一个UIApplication代表一个应运程序,而且UIApplication是个单例类: ios程序一旦启动,创建的第一个对象就是UIApplication对象: // 拿到UIApplica ...
- 仿百度搜索(AJAX)
<h1>百度搜索</h1><!--建立一个DIV,其中包括一个文本输入框和一个按钮--><div id="sousuo"> < ...
- DepthClipEnable error
刚刚呢又遇到这种鬼扯的问题,ps就return个(1,1,0,1) nisight的汇编都写对了,但结果就是画不出任何东西,按照经验,必然是某个state.... 我就找啊找啊,被我找到一个 Rast ...
- Yarn的服务库和事件库
对于生命周期较长的对象,YARN采用了基于服务对象管理模型对其进行管理. 该模型有一下特点: 每个被服务化的对象都分为4个状态 任何服务状态变化都可以触发另外一些动作 可以通过组合方式对任意服务进行组 ...