<action name="*" class="com.ecc.struts2.web.action.ExampleSupport">
<result>/{1}.jsp</result>
</action>
这种配置类似struts1.2中的ForwordAction
如果我想直接访问一个jsp文件并且又想通过*。do的方式访问。那么就可以如上这样配置
例如我想访问a.jsp,可以这样写http://localhost:8080/app/a.do,struts2找不到a这个action就会映射到a.jsp。
<action name="login_*" method="{1}" class="com.ecc.struts2.web.action.LoginAction">
<result name="success">/view.jsp</result>
<result name="login">/login.jsp</result>
</action>
这种配置方式类似于struts1.2中的DispatchAction
name="login_*" : 星号匹配方法名字
例如 <s:form action="login_XXX"> 会匹配到LoginAction的doXXX方法
这样你的action类可以不实现任何接口 具有更好的移植行。
分享到:
相关推荐
struts-config.xml struts标准配置文件 struts-config
·Struts2配置文件介绍 struts.xml action package ·Struts2配置文件介绍 struts.xml action package
Struts框架中struts-config.xml文件配置小结
struts.xml配置文件详解struts.xml配置文件详解struts.xml配置文件详解
struts.xml文件配置解释,对action配置进行说明
spring在web.xml中和在struts中的不同配置..pdf
struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置...
SSH(Struts,Spring,Hibernate)struts.xml文件配置
Struts 2.0 的配置文件是 struts.xml,需要在 src 目录下创建该文件,并添加相应的配置信息。 struts.xml 文件的内容包括 Struts 2.0 的配置信息,如 packages、actions、results 等。 本文提供了 Struts 2.0 的...
struts-config.xml配置文件 struts-config.xml配置文件 struts-config.xml配置文件
Struts应用采用两个基于XML配置文件来配置,分别是web.xml和struts-cofig.xml文件.web.xml文件 是配置所有web应用而struts-config.xml文件是struts专用配置文件,事实上也是可以根据需要给这个配置文件 起其他名称.
struts.configuration.xml.reload Whether to reload the XML configuration or not 是否加载xml配置(true,false) struts.continuations.package The package containing actions that use Rife continuations ...
4. struts.configuration.xml.reload:这是一个布尔值,用于确定是否加载XML配置文件。如果设置为true,Struts2将加载XML配置文件;否则,不加载。 5. struts.continuations.package:这是一个包名,包含使用Rife ...
struts配置文件,用于创建springmvc与struts工程的配置文件,集合加数组获得后台的空间空间空间 空间 空间空了
绝对的好东西 struts2.0中struts.xml配置文件详解
Struts-config.xml 配置文件详解 Struts-config.xml 是 Struts 框架的主要配置文件,用于配置 Struts 应用程序的各种设置。在该文件中,可以配置数据源、Form Bean、Action 和插件等信息。下面是 Struts-config.xml...
struts-config.xml配置文件对学struts的人必备的查找资料。
在开始实例开发之前,需要了解 Struts2 框架的配置文件,包括 web.xml 和 struts.xml 两个文件。web.xml 文件主要是配置 Struts 的过滤器,使整个 Web 的流程转入到 Struts 框架中,而 struts.xml 是 Struts 框架的...
struts2开发的struts.xml配置文件配置以及web.xml配置说明
以前和struts2一起使用的配置文件,struts2的核心控制器