We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,459 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to keep URL unchanged when user submit a form

I am new to JSP/Servlets, so here is what I am trying to do:

suppose my url is http://mywebsite.com/ and user come on this and it shows a login form, after submitting the form I want to keep the url the same as before that is http://mywebsite.com/ means it should act the main page even after login, not something like this http://mywebsite.com/userlogin/

And also tell me a way to change the url deliberately, I mean when my Servlet1 forwards control to another servlet then url of Servlet will be visible to the user, tell me a way to change the url to servlet2 without using any client side redirect mechanism.

3
Contributors
3
Replies
1 Week
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
warlord902
Junior Poster
121 posts since Dec 2010
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0

Ive been also waiting for this kind of question. I want my visitor to only see "/index.jsp" not "/servlet" something like php does.

autorunman22
Light Poster
43 posts since May 2011
Reputation Points: 13
Solved Threads: 3
Skill Endorsements: 0

Ive been also waiting for this kind of question. I want my visitor to only see "/index.jsp" not "/servlet" something like php does.

You can do a client side redirect for that using sendRedirect() method of response object,.

warlord902
Junior Poster
121 posts since Dec 2010
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by autorunman22

If you want to keep URL unchanged means that the when the login is done then the URL is goto Home page. For this you can use the sendRedirect() function and pass the response object of the redirected URL.

bkd
Newbie Poster
Banned
2 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.1034 seconds using 2.67MB