Meaningless Drivel is fun!*
The moose likes Struts and the fly likes making all fields empty when i make new transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "making all fields empty when i make new transaction" Watch "making all fields empty when i make new transaction" New topic
Author

making all fields empty when i make new transaction

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

hi all,

I have created an application which has 3 .jsps

after colick first.jsp's create button -second.jsp (form)has to that contains some fileds and buttons
to enter


and third one is for confirming the entered values in the second .jsp

problems is

Senario1: I
used MVC (struts)


1-first step: clicked on create button from first.jsp

2-enterd intp second.jsp, filed all the text boxes --- clicked next button

3-entered into third.jsp
, clicked on back button to modify


4-second.jsp is holding all values entered before { this is good} since SCOPE = REQUEST


but the problem lies here:

from the above mentioned 4th step's second.jsp if i go back to first.jsp
again come to second.jsp.. I do not want see the old data entred in second.jsp because this

time i am creating a freash transaction.


can you please tell me solution to this problem.

my idea was:

making second.jsp fileds null .

due to type casting problem i can not writee code along with findForward in firstAction.java

is there any other way to solve this problem easyly?


regards,
Rahul
Abhilash George
Greenhorn

Joined: Apr 28, 2006
Posts: 13
Well it seems that the scope of the form you are talking of ie the one associated with second page is session and thats why it is retaining across action calls.
The default scope of formbeans is session and not request .
let me know if this helps. If you want to look it in a different way , at the submit of first button you create an object of the formbean , (optional put values inside it) and then put that formbean object in the request.
regards


george
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making all fields empty when i make new transaction
 
Similar Threads
JSTL Weblogic
EJB to JSP communication
multiple forms in JSP
getting the URL for the calling jsp page?
Passing values to JSp with href