*
The moose likes Struts and the fly likes Problem in Setting Value Explicitly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in Setting Value Explicitly" Watch "Problem in Setting Value Explicitly" New topic
Author

Problem in Setting Value Explicitly

subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
Hi Ranchers,
I am facing problem with a field (<html:select property="ooCode" name="OoForm" >) .
I am setting the value of ooCode explicitly( by calling SetOoCode()) in OoAction1.And
OoAction1 forwards to OoAction2.But in OoAction2 the value of ooCode set in OoAction1
is lost.It is showing the value of ooCode from jsp.Kindly guide me ,so that 2nd Action can
get the value set in 1st action without doing any modification in second action.


Thanks,<br />Subhasish
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

probably it wont lose . whether you implement reset method in your ActionForm ?
subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
yes Reset method is there.But it is not applied for that perticular field. And the field value is taking in 2nd action is from the jsp .
Is the problem is with struts-config?
Is the name of scope has any relation with that?
for ref:
<action path="/OoAction1"
type="claim.OoAction1"
name="GenClaimForm"
scope="session" validate="false">
subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
Can somebody guide in this matter??
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's the definition of the second action?
subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
public class SecondClass extends Action
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

...

Not the signature, the definition in struts.xml.
subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
Hi David,
the defination in struts-config is given below

<action path="/SecondClass"
type="claim.SecondClass"
name="GenClaimForm"
scope="session" validate="false">
<forward name="success" path="/resources/jsp/roclaim/claim/policy.jsp" contextRelative="true" />
Pl let me know if anything more you need to know.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I think we'll need to see the entire workflow: how the form is first accessed, the processing the action does to it, and how the second action is accessed.
 
Don't get me started about those stupid light bulbs.
 
subject: Problem in Setting Value Explicitly