struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sundararaman, Anand" <>
Subject RE: Struts2-Spring Integration Issue
Date Sat, 14 Feb 2009 16:24:01 GMT
 Here are the files. I have just pasted only the contents to highlight the problem. The CreateUserAction
has two methods, execute() and doActivateUser(). The execute is called for "saveUser" action.
The doActivateUser() is called for "activateUser" action. If I specify the scope=prototype,
the doActivateUser() fails. If I remove the scope=prototype, the doActivateUser() works but
I loose thread safety. I want thread safety as well as able to use the do*() methods called
from actions.

<?xml version="1.0" encoding="UTF-8" ?>
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
" ">
   <constant name="struts.ui.theme" value="main" />
   <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"
   <constant name="struts.devMode" value="true" />
   <constant name="struts.objectFactory.spring.autoWire" value="name" />

   <include file="struts-default.xml"/>
      <package name="default" namespace = "/" extends="struts-default">
      <action name="newUser">
      <action name="saveUser" class="createUser">
         <result name="success">/jsp/user/saveuser.jsp</result>   
         <result name="error">/jsp/user/userregistration.jsp</result>        
      <action name="activateUser" class="createUser" method="activateUser">
         <result  name="success">/jsp/user/useractivated.jsp</result>        
         <result  name="error">/jsp/user/login.jsp</result>

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
        <bean id="createUser" class="CreateUserAction" scope="prototype">
        <property name="userService">
            <ref bean="userServiceTarget"/>
     <bean id="userServiceTarget" class="UserService">
      <property name="UserDAO">
            <ref bean="UserDAOTarget"/>
     <bean id="UserDAOTarget"
        class="UserDAO" >
         <property name="sessionFactory">
            <ref bean="sessionFactory" />

From: Lukasz Lenart []
Sent: Saturday, February 14, 2009 10:01 AM
To: Struts Users Mailing List
Subject: Re: Struts2-Spring Integration Issue

Could you copy-paste your struts.xml and Spring config regarding actions?


To unsubscribe, e-mail:
For additional commands, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message