aspose file tools*
The moose likes JSP and the fly likes How to index the JSP page for different pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to index the JSP page for different pages" Watch "How to index the JSP page for different pages" New topic
Author

How to index the JSP page for different pages

Shanmugam Muthukumarasamy
Ranch Hand

Joined: Jan 11, 2003
Posts: 83
Hi All,

I am using Struts 1.1 and I have the following requirement. The scenario is, for example I have a customer page. In my application, based on the user selection, I have to allow the user to enter maximum of 10 customers. When the user finish with the page one and click on "continue", then I have to show the same page to ask for the next customer information. I don't want to create
Customer1.jsp
Customer2.jsp
.
.
.
Customer10.jsp.

In that case, I would like to index the pages by using one Customer.jsp file, to identify the different customer information.

Any Idea would be appreciated !!!

Thanks in advance !!!

Shan


SJCP 1.4<br />SCWCD 1.4<br />SCEA
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30352
    
150

Shan,
If each customer page has the same format, you have no problem. Just keep track of the current page number in the session.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61043
    
  66

Shanmugam,

Could you please do our eyes a favor and modify your display name to use mixed case rather than all uppercase? It's rather jarring.

thanks!
bear
Forum bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shanmugam Muthukumarasamy
Ranch Hand

Joined: Jan 11, 2003
Posts: 83
Hi Jeanne,

Thank you for your reply, I want to use only one Customer.jsp for all the pages. How do I keep the different numbers in the session.

Thanks,
Shan
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Well obviously you have your action process the pages one at a time as they are submitted.
By this I mean, you gather the information from the Action form, and save it into a variable somewhere. List of customer objects? Maybe in session scope?
When the page gets submitted again, you just add the records onto the end of your existing list.

Do you have to go back and edit the customers already entered?
Shanmugam Muthukumarasamy
Ranch Hand

Joined: Jan 11, 2003
Posts: 83
Hi Stefans,

Thanks for your reply. Yes I have to go back and edit the customer details some times. For example, assume I have completed 7 customer pages, but I want to edit the the 3rd customer page. I would click on the "Customer 3" tab and directly go there and edit and save the information.

In that case, how do I tell the session, that I am editing the 3 customer ?

Thanks,
Shan
[ September 08, 2005: Message edited by: Shanmugam Muthukumarasamy ]
Shanmugam Muthukumarasamy
Ranch Hand

Joined: Jan 11, 2003
Posts: 83
Is Anbody having any idea ?

Thanks in Advance
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
You can have the LoadAction take the customer number as parameter. On your jsp page, pass the customer number to your SaveAction. On success, the SaveAction should increment the customer number, and forward to the Load Action. The tabs on the top can call LoadAction and pass the correct customer number
 
 
subject: How to index the JSP page for different pages