<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"
>
<struts>
<include file="struts-default.xml"
/>
<package name="default"
extends="struts-default"
>
<action name="foo"
class="com.acme.Foo"
>
<result>
foo.ftl</result>
</action>
</package>
<package name="secure"
namespace="/secure"
extends="default"
>
<action name="bar"
class="bar"
>
<result>
bar.ftl</result>
</action>
</package>
</struts>
Where you have a Spring bean defined in your applicationContext.xml
named "bar". Note that the com.acme.Foo
Action did not need to be changed, because it can be autowired.
如何理解这句话,本文附件告诉你答案: 关于Struts2与Spring整合的一些疑惑及解释。 文中主要谈在struts.xml中配置Action的时候,在class属性上指定className与指定BeanID的区别。
分享到:
相关推荐
在该文件中,可以配置数据源、Form Bean、Action 和插件等信息。下面是 Struts-config.xml 文件的详细解释: 数据源配置 在 Struts-config.xml 文件中,数据源配置是通过 `<data-sources>` 元素实现的,该元素可以...
该属性指定整合Spring框架时,是否缓存Bean实例,该属性只允许使用true和false两个属性值,它的默认值是true.通常不建议修改该属性值. struts.objectTypeDeterminer 该属性指定Struts 2的类型检测机制, 通常支持tiger...
在这个配置类中可以设置Struts2的各种参数和设置。 3. struts.configuration.files:这是Struts2自动加载的一个配置文件列表,Struts2会自动加载这些文件中的设置和参数。 4. struts.configuration.xml.reload:这...
是否struts过滤器中提供的静态内容应该被浏览器缓存在头部属性中 struts.serve.static Whether the Struts filter should serve static content or not 是否struts过滤器应该提供静态内容 struts.tag....
2. 深入 STRUTS架构..................................................................................37 2.1. 随便谈谈......................................................................................
该属性指定是否允许在Struts 2标签中使用表达式语法,因为通常都需要在标签中使用表达式语法,故此属性应该设置为true,该属性的默认值是true。 struts.devMode 该属性设置Struts 2应用是否使用开发模式。如果...
和Spring中OpenSessionInView由于org.springframework.web.struts.ContextLoaderPlugIn中保存同一个对象的名不同导致openSessionInView失效 稍微修改后在struts-config.xml中使用MyContextLoaderPlugIn.jar包中...
2. 深入STRUTS 架构..................................................................................37 2.1. 随便谈谈.......................................................................................
@nochache:true时,在相应结果中加入特定的头参数:Pragma ,Cache-Control,Expires防止页面被存储在可数浏览器的缓存中,默认为false --> contentType="text/html;charset=UTF-8" locale="true" processorClass=...
在 Form-bean 元素中,我们可以使用 Form-property 元素来设置 FormBean 的属性。Form-property 元素有两个属性:name 和 value。Name 属性指定了需要设置的属性,value 属性指定了该属性的值。 其他元素 除了 ...
其中大部分都采用了默认设置,只是在engine容器中添加了两个Host容器。 <?xml version=1.0 encoding=UTF-8?> <Listener className=org.apache.catalina.startup.VersionLoggerListener> <
react-body-classname, 声明性嵌套状态化同构的body.className react-body-classname 提供在 React App 中指定 document.body.className的声明方式。 支持服务器端使用。内置的反应副作用。安装yarn add react-bo
对话框中Tomcat选项,选择版本,和安装路径(C:\Program Files\Apache Software Foundation\Tomcat 5.0),注意Context declaration mode 选项:Server.xml和Context files,分别代表了两中启动Tomcat的配置方式,一般...
这里对tomcat7的server.xml文件进行解释一下,方便在分析启动源码的时候理解Digester做的事情。 <?xml version='1.0' encoding='utf-8'?> <Listener className=org.apache.catalina.startup....
在pytorch的使用过程中有几种权重初始化的方法供大家参考。 注意:第一种方法不推荐。尽量使用后两种方法。 # not recommend def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') ...
1. context.xml 中的加入 <Valve className="com.orangefunction.tomcat6.redissessions.RedisSessionHandlerValve"/> <Manager className=...
在指定的目录中生成文件InvitedCarrierModel.hbm.xml,代码如下: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" ...
4、在原有tomcat\context.xml下 添加 以下代码(参考 <Manager className="org.redisson.tomcat.RedissonSessionManager" configPath="${catalina.base}/redisson.conf" readMode="REDIS" updateMode=...
本机ip为192.168.1.101 1、准备测试环境 两个Tomcat 在Eclipse中新建2个Servers,指定对应的Tomcat,端口号错开。 Tomcat1(18005、18080、18009) Tomcat2(28005、28080、28009) 一个Redis Redis下载官网...