Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Setting Value Explicitly

 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
probably it wont lose . whether you implement reset method in your ActionForm ?
 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody guide in this matter??
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the definition of the second action?
 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class SecondClass extends Action
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...

Not the signature, the definition in struts.xml.
 
subhasish nag
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic