• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling data carry between different pages - Design handliing.

 
Bharat Chowdary
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having 3 jsp pages which are having similar fields (like text field 'My name' is present on all the 3 pages) & different fields too(I'm having text field 'company name' present on page 2 only). I'm trying to use single actionForm but the problem is i dont want data filled for 'My Name' field on page 1 to be displayed directly in the text field of page 2.

How to handle this ?

I'm using single actionForm so that the getter & setter methods will not be redundant.

Design is like this:

ActionForm same for all the 3 pages.
1 Action class(controller), 1 bean class(model), 1 DAO class for db queries for each Jsp page(view).

Idea, of any better handling of actionForm is very much welcome.
 
Bharat Chowdary
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bluzeee blu wrote:I'm having 3 jsp pages which are having similar fields (like text field 'My name' is present on all the 3 pages) & different fields too(I'm having text field 'company name' present on page 2 only). I'm trying to use single actionForm but the problem is i dont want data filled for 'My Name' field on page 1 to be displayed directly in the text field of page 2.

How to handle this ?

I'm using single actionForm so that the getter & setter methods will not be redundant.

Design is like this:

ActionForm same for all the 3 pages.
1 Action class(controller), 1 bean class(model), 1 DAO class for db queries for each Jsp page(view).

Idea, of any better handling of actionForm is very much welcome.

No one has replied yet...any reason ?? Please let me know if you didn't understand what i asked here. I have to complete the design. So please some help needed.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you want to clean out all the fields and assuming you have code to do this in the reset() method in your bean then you can call the reset method before you run your .jsp. If the list of fields you want to clean out depends on what .jsp you are going to then you can make methods to clean out those specific fields depending on what .jsp you are going to.
 
Bharat Chowdary
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Rispoli wrote:Assuming you want to clean out all the fields and assuming you have code to do this in the reset() method in your bean then you can call the reset method before you run your .jsp. If the list of fields you want to clean out depends on what .jsp you are going to then you can make methods to clean out those specific fields depending on what .jsp you are going to.


Thanks for replying....

The problem is ...wen moving form a page to next , forward is written in this way..

<forward name="success" path="/ThankYou.jsp" /> it directly points to jsp ...Is that fine design ? So the flow doesn't go to action class/bean class, so thre is no way to reset the values.

I also tried...

<forward name="success" path="/ThankYou.jsp" redirect=”true” /> But in this case..i'm loosing all the data...i need the data filled on page 1 but shouldn't get displayed directly on the page 2.

Hmmmm.....Lot to Learn...!!

n Thanks for the help.

 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your first forward looks fine. You just need to do the resetting in your action before you return the forward that sends the user to the thankyou.jsp.
 
Bharat Chowdary
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Rispoli wrote:Your first forward looks fine. You just need to do the resetting in your action before you return the forward that sends the user to the thankyou.jsp.


Okayy..So here is wat i understood....

So let me say,

Request comes to AActionClass.java[supportive ABeanClass.java]-->AView.jsp--Onuser action 1-->AActionClass.java[ABeanClass.java][Reset form values here; Forward=nextView.jsp on success]->nextView.jsp--onUser action 2-->BAction.java[BBeanClass.java]---------->>>>>

Thanks for your help Tom Rispoli]!!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic