Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struts1 and Struts2 interoperability

Status
Not open for further replies.

ism1234

Programmer
Aug 31, 2007
1
US
Any one worked with the Struts 1 plugin for Struts 2 ?
Its stated features are:
- Can use Struts 1 Actions and ActionForms with no code changes
- Supports Commons Validator-enabled ActionForms

I've got it to work partially where I am able to call the struts1 Action configured thru a strut2 wrapper action. However, only the execute(..) method of the struts1 Action is getting called. I can't figure out how to call different methods as we can do with Struts1 and Struts2. Following is my struts2 configuration (struts.xml):

<package name="integration" extends="struts1-default">
<interceptors>
<interceptor name="loginForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
<param name="className">com.newco.servicelive.struts1.form.LoginForm</param>
<param name="name">loginForm</param>
<param name="scope">session</param>
</interceptor>
</interceptors>

<action name="loginAction" class="org.apache.struts2.s1.Struts1Action">
<param name="className">com.newco.servicelive.struts1.action.LoginAction</param>
<interceptor-ref name="staticParams"/>
<interceptor-ref name="loginForm"/>
<result name="success">test.jsp</result>
</action>
</package>

Any help/comments/suggestions would be greatly appreciated.
Thanks !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top