This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Setting Value Explicitly
 
Similar Threads
Cannot Load Servlet from JSP
Implementing HttpSession in the Spring MVC
Action class being called only once in ajax
retreaving the value in servlet which is set in session in a jsp page
Unable to parse setupCmdLine: null\bin\setupCmdLine.bat