首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
struts2 convention插件
2024-08-30
Struts2 Convention插件的使用
转自:http://chenjumin.iteye.com/blog/668389 1.常量说明 struts.convention.result.path="/WEB-INF/content/": 结果页面存放的根路径,必须以 "/" 开头. struts.convention.action.suffix="Action": action名字的获取 struts.convention.action.name.lowercase="tr
Struts2 Convention插件的使用(4)使用@Action注解返回json数据
package com.hyy.action; import java.util.HashMap; import java.util.Map; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; imp
Struts2 Convention插件的使用(1)
刚刚查阅官方文档(convention-plugin.html)并学习了Struts2的Convention插件,文章这里只作为一个笔记,建议大家去看官方文档比较清晰和全面. 需要在项目添加这些包 convention先找package,其中如果package包含action这个单词,就会将这个包作为根路径,即namespace="/" 然后找类,如果一个类的类名称是Action结尾,或者继承了ActionSupport类,那么会将该类作为action类,对应的url为 例如: com
struts2 Convention插件零配置,使用注解开发
从struts21开始,struts2不再推荐使用codebehind作为零配置插件,而是改用Convention插件来支持零配置.与以前相比较,Convention插件更彻底. 使用Convention插件,需要将struts2-convention-plugin-2.3.1.2.jar文件复制到lib目录中即可 这个插件是自动搜索action的功能: 规则如下:它会自动搜索位于action,actions,struts.struts2包下的java类. Convention插件会把如下两
struts2 Convention插件好处及使用
现在JAVA开发都流行SSH.而很大部分公司也使用了struts2进行开发..因为struts2提供了很多插件和标签方便使用..在之前开发过程中总发现使用了struts2会出现很多相应的配合文件.如果对配置文件的管理感觉比较麻烦..可以考虑使用COnvention插件可以进行零配置而且插件进行很多规范的约定也可以对开发合作当中按着它相应的规律开发..感觉也挺方便管理的.下面简单介绍它的使用. 首先我们需要使用到的jar包: struts2-convention-plugin-2.1.8.jar
struts2 convention插件
1.struts2自2.1以后推荐使用Convention Plugin支持struts零配置支持(引入jar:struts2-convention-plugin-2.x.x.jar)①convention默认扫描所有实现com.opensymphony.xwork2.Action的类和指定包路径下以Action结尾的类名②struts.convention.package.locators指定默认的根packages,struts.convention.action.packages指定搜索的
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
Struts2 convention插件试用+ Spring+Hibernate SSH整合
第一步,引入struts2-convention-plugin-2.2.1.jar 然后,改动配置文件. 我是在struts.properties文件里改动的: struts.objectFactory = spring struts.devMode = true struts.i18n.encoding = UTF-8 struts.convention.result.path =/WEB-INF/jsp/ struts.convention.package.locators = action
Struts2 Convention插件的使用(2)return视图以及jsp的关系
package com.hyy.action; import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extends ActionSupport{ private String message; public String execute() { message = "hyy"; return INPUT; } public String getMessage() { return message;
struts2基于Convention插件的约定映射使用
一.首先说明一点:所谓的基于Convention插件的约定优于配置的使用,并不是严格意义上的零配置,struts.xml文件并不能完全舍弃. 获得Convention插件功能,所必需的jar包有:|asm-x.x.jar|asm-commons-x.x.jar|struts2-convention-plugin-x.x.jar| 如果将struts2-config-browser-plugin-x.x.jar放入项目中,则可以通过http://{ip}:{port}/{Application}/
热门专题
nginx 代理静态字段.json
freemarker 过滤
php的工作方式有哪些
mac上配置gitignore
STM32l151 串口 (HAL库)
sql引起oom案例
Netperf收发包大小一致吗
判断一个map是否包含另一个map的所有key
unity如何保存excel 文件 安卓
用sorted函数倒序排列一串数字
matplotlib画线段
ubuntu 查看wget日志
linux查看安装的服务
sql无法登录 错误号0,严重性11
javascript操作excel
devexpress 预览office
mac cmd 三清
tensorflow 文件队列
gzip压缩大json效果如何
bootstrap网格系统案例