Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

senRedirect how to diferntiate in the different jsp file?

 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 667
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 667
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I still didn't understand clearly, you want to display 3 JSP files at once? If Yes, its not possible.
 
Tim Moores
Bartender
Posts: 2795
38
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use for what? What are you trying to accomplish?
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 667
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this first jsp .





the redirect to another jsp file







similar to those file need to display another different jsp file
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The action attribute of the HTML form in the first JSP should point to the URL of the second JSP.
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64837
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather, it should point to the page controller of the 2nd JSP.
 
karthik ekantha
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64837
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm completely lost too, and have no idea what the OP is really trying to accomplish.
 
Saurabh Pillai
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic