Could I use action mappings in struts.xml and Spring’s RequestMapping annotation in the same time?
(my environment is Struts 2.3.1 and Spring 3.1.1)
in my struts.xml something like this:
<package name="proj" namespace="/proj" extends="proj-default">
<action name="home" class="proj">
<result name="success" type="tiles">proj.home</result>
</action>
</package>
and one of my class is annotated like this:
@Controller
@RequestMapping("/dialog")
public class MyDialogController {
...
@RequestMapping(value="/info", method=RequestMethod.GET)
public String info(NativeWebRequest request) {
...
}
}
I’ve found the answer is YES.
I just need to configure the spring configuration additionally.
First, I add Spring’s
DispatcherServletinweb.xmlThen add below codes additionally in
applicationContext.xmlFinally, I create a
profile-servlet.xmlwhich contains the request mapping settingAnd it works fine now.