开发者

Struts2: custom action mapper defined in Spring

I have following situation:

  • I use Struts2 as MVC cobtroller
  • I use Spring as object factory
  • I im开发者_JAVA百科plemented custom action mapper, I have configured this as a bean in my spring configuration.

How can I tell Struts to use this bean as an action mapper?

I tried top set:

struts.mapper.class=beanName

in struts.properties but this doesn't work.


Do you have have following the struts.xml file ? This is required to tell Struts2 that objects will be created by Spring

<struts>
 <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
    ... 
</struts>

OR

Add the following property in the struts.properties

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜