The moose likes Struts and the fly likes Action Switching problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action Switching problem " Watch "Action Switching problem " New topic

Action Switching problem

Raj Chukka

Joined: Apr 09, 2007
Posts: 22

I got two action classes (say A1 and A2) and two form beans (F1 and F2).
Iam populating F2 in A1 and transferring the control to A2 (which has mapping to F2). But iam getting all "null" values.

How should i retain the values in form F2 when switching the class???

struts-config.xml is listed below.

<action path="/" name="F1" scope="session" type="A1">
<forward name="OK" path="/" redirect="true"/>

<action path="/" name="F2" scope="session" type="A2">
<forward name="Success" path="/success.jsp/>

Thanks in advance.

Raj Chukka
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
You are not populating the F2 instance in A1 beacause it does not exist yet. This is why you are getting null values.
I agree. Here's the link:
subject: Action Switching problem
It's not a secret anymore!