- 浏览: 4734 次
-
最新评论
文章列表
9、Annotation
Action相关:
· 与Action相关的两个Annotation是@Action 和@Actions
· @Action中可指定一个value属性。类似于指定<action name=””/>属性值
· @Action中还可以指定一个params属性,该属性是一个字符串数组,用于该Acion指定的参数名和参数值。params属性应遵守如下格式:{“name1”,”value1”,”name2”,”value2”}
· @Actions 也用于修饰Action类里的方法,用于将该方法映射到多个URL.@Actions用于组织多个@Actio ...
Struts2 实现零配置(1)
- 博客分类:
- 精通strust2
1、安装Convention插件(struts2-convention-plugin.jar)
2、可设置常量:
· struts.convention.exclude.packages:指定不扫描的包
· struts.convention.package.locators:指定的包作为搜索Action的根包
· struts.convention.action.packages:外加需要扫描的包
· ...
struts.xml配置详解
- 博客分类:
- 精通strust2
<struts>
<include file="user.xml"/>
<include file="goods.xml"/>
<include file="order.xml"/>
</struts>
include标签,可以将一个struts.xml配置文件分割成多个配置文件
<struts>
<!--设置开发模式-->
<constant name="s ...
<struts>
<bean class="com.opensymphony.xwork2.ObjectFactory" name="xwork" />
<bean type="com.opensymphony.xwork2.ObjectFactory" name="struts" class="org.apache.struts2.impl.StrutsObjectFactory" />
<bean type=&quo ...
Struts2 基本配置
- 博客分类:
- 精通strust2
<!-- Struts2配置 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<!-- 配置Struts2常量,不建议使用 -->
<init-param>
...
### Specifies the Configuration used to configure Struts
### one could extend org.apache.struts2.config.Configuration
### to build one's customize way of getting the configurations parameters into Struts
### 指定加载Struts2配置文件的配置管理器
# struts.configuration=org.apache.struts2.config.DefaultConfi ...