This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes senRedirect how to diferntiate in the different jsp file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "senRedirect how to diferntiate in the different jsp file?" Watch "senRedirect how to diferntiate in the different jsp file?" New topic
Author

senRedirect how to diferntiate in the different jsp file?

karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
the three different jsp files can submit the values in one servet and i want display of values is the differen three diiferent jsp file .i want senRedirect how to diferntiate in the different jsp file ???

1)the servlet is getting value from the three different jsp.

2)this servlet file.how to differentiate to display another the three jsp display file in the senRedirect



Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

I didn't understand the problem clearly, however, from what i understood here is the answer.
From each of the JSP, you can pass a request parameter, based on this parameter, in the servlet, you can redirect to the appropriate JSP.


Regards, Prasad
SCJP 5 (93%)
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
this is servlet file




first the parameter some common in the three differentiate jsp files.getting values the three differentiated jsp files.and i want display three different jsp files

1)how to differentiate in the three different jsp page ??
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

Sorry, I still didn't understand clearly, you want to display 3 JSP files at once? If Yes, its not possible.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Correct, you can only redirect to a single target.

Also, never keep an empty exception handler. At the least, write a message to where you will see it so that you'll know if there's a problem.
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Tim Moores wrote:Correct, you can only redirect to a single target.

Also, never keep an empty exception handler. At the least, write a message to where you will see it so that you'll know if there's a problem.





which method i can use for the jsp file??please do it need ful..
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Use for what? What are you trying to accomplish?
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Tim Moores wrote:Use for what? What are you trying to accomplish?



how to redirect to the three different jsp files


Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

You can't redirect to 3 three different jsp files at once and the same has been said before. Can you please clearly explain, what you are trying to accomplish?
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

You cannot do that. You cannot redirect to more than 1 page at a time. How should the browser even handle displaying 3 pages in one window?
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
this first jsp .





the redirect to another jsp file







similar to those file need to display another different jsp file
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Koen Aerts wrote:You cannot do that. You cannot redirect to more than 1 page at a time. How should the browser even handle displaying 3 pages in one window?


ok .give suggestion of different methods..
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Is the 2nd page supposed to be displayed underneath the first one, or is it displayed after you proceed (submit) from the first page?
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Koen Aerts wrote:Is the 2nd page supposed to be displayed underneath the first one, or is it displayed after you proceed (submit) from the first page?


first jsp page give values and display second jsp page
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

karthik ekantha wrote:
Koen Aerts wrote:Is the 2nd page supposed to be displayed underneath the first one, or is it displayed after you proceed (submit) from the first page?


first jsp page give values and display second jsp page

Sorry, I can't make sense from that sentence. Are you saying:
1) the output from page 1 and the output from page 2 appear on the screen at the same time
or
2) the output from page 2 will appear on the screen AFTER I submit the form on page 1

I'm just trying to visualize what your screen(s) should look like and how they should flow together.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The action attribute of the HTML form in the first JSP should point to the URL of the second JSP.
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Koen Aerts wrote:
karthik ekantha wrote:
Koen Aerts wrote:Is the 2nd page supposed to be displayed underneath the first one, or is it displayed after you proceed (submit) from the first page?


first jsp page give values and display second jsp page

Sorry, I can't make sense from that sentence. Are you saying:
1) the output from page 1 and the output from page 2 appear on the screen at the same time
or
2) the output from page 2 will appear on the screen AFTER I submit the form on page 1

I'm just trying to visualize what your screen(s) should look like and how they should flow together.



you told first one
1) the output from page 1 and the output from page 2 appear on the screen at the same time
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Rather, it should point to the page controller of the 2nd JSP.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
Tim Moores wrote:The action attribute of the HTML form in the first JSP should point to the URL of the second JSP.



totally different 6 jsp files .first three file interact with html and another three files interact with servlet .so i need differentiate in the jsp file
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

karthik ekantha wrote:
you told first one
1) the output from page 1 and the output from page 2 appear on the screen at the same time

Why can't you put them into the same .jsp source file? Also, perhaps you need to look into how to include JSP files with the jsp:include tags.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
karthik ekantha wrote:totally different 6 jsp files .first three file interact with html and another three files interact with servlet .so i need differentiate in the jsp file

OK, now you've completely lost me. Briefly I thought I understood at least parts of what you intended to do, but now - I'm clueless
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

I'm completely lost too, and have no idea what the OP is really trying to accomplish.
Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 506
It is clearly a language barrier. This is what I can conclude so far,

- On first JSP, you accept user input.
- On second one, you display the same information. May be for user confirmation.

Karthik, can you please show us the third JSP? We might be able to conclude something.

Another option is, please explain in simple words (without including ANY technical information) what do you want to do?

Also, have WordWeb installed on your computer. It is really helpful to me.
 
Consider Paul's rocket mass heater.
 
subject: senRedirect how to diferntiate in the different jsp file?
 
Similar Threads
jsp:getProperty problem
Servlet reading a JSP file
File parser application
Display Error Page in JSP
sendRedirect() in Tomcat?