在spring配置文件里给stirng注入一个字符串,如下:
<bean id="fileTypeMemo" class="java.lang.String">
<constructor-arg index="0" value="文件类型必须是TXT LOG"/>
</bean>
然后jsp中添加一条记录,提交,struts2的配置文件是使用chain来跳转,如下:
<action name="addMarketType" class="etTypeAction" method="addMarketType">
<result name="success" type="chain">queryMarketType</result>
<result name="input">MarketTypeList.jsp</result>
</action>
提交后,数据可以插入,可是会返回错误,如下:
There is no Action mapped for namespace [文件类型必须是TXT LOG] and action name [queryMarketType] associated with context path [/eimp].
红色的字是我刚刚注入的字符串,没有这个命名空间,如果去掉这中注入方式就可以正常了,各位大神有没有遇到过这样的问题?Spring
<bean id="fileTypeMemo" class="java.lang.String">
<constructor-arg index="0" value="文件类型必须是TXT LOG"/>
</bean>
然后jsp中添加一条记录,提交,struts2的配置文件是使用chain来跳转,如下:
<action name="addMarketType" class="etTypeAction" method="addMarketType">
<result name="success" type="chain">queryMarketType</result>
<result name="input">MarketTypeList.jsp</result>
</action>
提交后,数据可以插入,可是会返回错误,如下:
There is no Action mapped for namespace [文件类型必须是TXT LOG] and action name [queryMarketType] associated with context path [/eimp].
红色的字是我刚刚注入的字符串,没有这个命名空间,如果去掉这中注入方式就可以正常了,各位大神有没有遇到过这样的问题?Spring
<result name="input">/MarketTypeList.jsp</result>
<action name="queryMarketType" class="etTypeAction" method="queryMarketType">
<result name="success">MarketTypeList.jsp</result>
<result name="input">MarketTypeList.jsp</result>
</action>
呵,在这,代码没有贴全。
<bean id="fileSize" class="java.lang.Long">
<constructor-arg index="0" value="5242880"/>
</bean>
这个就没有问题,会不会跟版本或包有啥关系的
这些问题都排除了,因为chain是可以用的,只是加入了这个注入就挂了,郁闷,能想到的基本上都试过了。。
<action name="addMarketType" class="etTypeAction" method="addMarketType">
<result name="success" type="chain">
<param name="namespace">/et/etType</param>
<param name="actionName">queryMarketType</param>
<param name="method">queryMarketType</param>
</result>
<result name="input">MarketTypeList.jsp</result>
</action>
注意红色的配置,有人知道这为什么吗?