File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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

is there any other way to solve this problem easyly?

Abhilash George

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.

I agree. Here's the link:
subject: making all fields empty when i make new transaction
It's not a secret anymore!