0

I have product which is build on Struts1 framework, instead of moving the full framework to latest Struts2, I want to start with new feature with Struts2 framework.

On looking on multiple sites, I learned that we can have both Struts1 and Struts2 framework running together. So while trying to do that, I have added the entry for filter class of Struts2 in web.xml

<filter>
  <filter-name>struts2</filter-name>
  <filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
  </filter-class>
</filter>

And also the filter mapping to /*.action.

Now when comes to adding action, in Struts1 the struts-config tag is used, whereas in Struts2 it is just struts.

How should I handle both version in common struts.xml file.

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
Ayush
  • 161
  • 1
  • 13

1 Answers1

0

While you can have both struts1 and 2 in one application, you can't mix and match the configuration.

You will need to keep configuring your struts1 actions (.do) like you have done before and start configuring the struts2 actions (.action) in the struts2 way.

They actually live side by side.

tom
  • 2,735
  • 21
  • 35