struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isharatbabu <>
Subject Struts 2 Unit test for Session.
Date Mon, 17 Sep 2007 09:31:14 GMT

Hello all,

I have created a java bean called person. i am accessing that java bean from
applicationcontext.xml where bean scope is set as session.


<beans xmlns=""

<bean id="person1" class="org.apache.struts2.showcase.person.Person1" />
	<!--  a simple session-scoped bean -->
	<bean id="person" class="org.apache.struts2.showcase.person.Person"
		<property name="person1" ref="person1" />


i am able to acess the "person" bean, set the bean values in session and
remove them successfully.
i got the object of the Person in  my Action class as simply writing :

Person person; 

i want to do the same in Junit test cases, without creating the new instance
of the person.which i was able to do in actions.

I want to know how to access the applicationcontext.xml attributes in Junit
test cases with out application server running.

Please respond soon.
I have deadline for the project. thanks in anticipation.

View this message in context:
Sent from the Struts - User mailing list archive at

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

View raw message