|
From: Vikrant K. <vik...@vi...> - 2004-09-30 15:26:03
|
Hi,
I am using Spring and struts in combination. Spring as an individual
application is working absolutely fine, applicationContext.xml is having all
the inter-related beans as normal Spring would have. The problem I am facing
is to share the information generated between spring class and session (from
struts). Once the information generated in the spring class is stored in the
session I can access it through JSP page.
Just to get an idea about it I am pasting the part of applicationContext.xml
code below.
......
<bean id="commandRunner"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBe
an">
<property name="transactionManager"><ref
bean="transactionManager"/></property>
<property name="target"><ref
bean="commandRunnerTarget"/></property>
<property name="transactionAttributes">
<props>
<prop
key="execute*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
<bean id="commandRunnerTarget"
class="com.mtm.loader.CommandRunner">
<property name="commands">
<list>
<ref
local="clearCommand"></ref>
<ref
local="loadCommand"></ref>
<ref
local="validateCommand"></ref>
<ref
local="makeLiveCommand"></ref>
<ref
local="copyFromLiveCommand"></ref>
</list>
</property>
</bean>
<bean id="clearCommand" class="com.mtm.loader.commands.Clear">
<property
name="name"><value>clear</value></property>
<property name="description"><value>Creates a new
empty holding pen</value></property>
<property name="productionFlagDAO"><ref
local="productionFlagDAO"/></property>
</bean>
.....
Now I want to add the struts over the Spring so that it can have Web User
Interface. I am using tomcat 4.1.30 I have added respective lines in the
struts-config.xml and one more bean in applicationContext.xml as follows
<bean name="/testing" class="com.mtm.loader.TestVk">
<constructor-arg index="0"><value>67</value></constructor-arg>
<property name="validate"><ref bean</property>
<!--<property name="validate"><ref
bean="validateCommand"/></property>-->
</bean>
When I hit testing.do via browser it works absolutely fine, class
com.mtm.loader.TestVk is getting invoked.
The problem I am facing is to share the information generated in the
"com.mtm.loader.commands.Clear" class and the session (from struts).
Basically I need to share the information between Spring and Struts'
session. Once the information is in the session I can access it from JSP
page.
Can someone please guide me in this matter? Thanks in advance.
Regards,
Vikrant.
|