• Post Reply Bookmark Topic Watch Topic
  • New Topic

Requesting a JSP page on our url and not browser url

 
arthi iyer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created a Employee form wherein details entered by the user would be sent to a jsp where all the fields are validated and sent to the 3rd jsp to display the user entered details.
My 1st jsp is GetEmpDetails.jsp : form gets displayed.
2nd jsp is ShowEmpDetails.jsp : where validations take place
3rd jsp is EmpDetails : details of the form are displayed.

All these JSPs are in Assignment7 project.

So my question is my GetEmpDetails.jsp page should get displayed using this url
http://localhost:8082/employeevalidation/enter_details.ev

and my EmpDetails.jsp page should be accessible using this url.
http://localhost:8082/employeevalidation/emp_details.ev

Can anyone please guide me iam clueless..iam new to jsp
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems a strange design - the validation wouldn't normally happen on a separate JSP, it would happen in Java code that's part of a backing bean or a servlet. If the data was unacceptably wrong, then you'd go back to the first JSP to have the user correct it. And only if it was valid you'd go to some other JSP.
 
arthi iyer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:This seems a strange design - the validation wouldn't normally happen on a separate JSP, it would happen in Java code that's part of a backing bean or a servlet. If the data was unacceptably wrong, then you'd go back to the first JSP to have the user correct it. And only if it was valid you'd go to some other JSP.


Ya that i know..I have even designed the same way you are saying but those things apart, for now help me in my question
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can either rename your JSPs to enter_details and emp_details, and then configure your web app to map *.ev to JSPs, *or* add a couple of servlet that are mapped to those URLs and which then forward to the respective URLs. I advise to use the latter, as you will need to have Java code for validation, and possibly some logic of which JSPs to go to, anyway. Come to think of it, a single servlet would be sufficient - it can check which of the two URLs was accessed, and then forward or redirect accordingly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!