File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getRequestDispatcher problem 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 "getRequestDispatcher problem" Watch "getRequestDispatcher problem" New topic
Author

getRequestDispatcher problem

Rocky Khan
Greenhorn

Joined: Oct 18, 2011
Posts: 11

I am new to jsp-servlet and Ranch too.
When i submit jsp page it sends info to servlet and servlet process that data and send response as home page..
but at the home page address URL it shows the parameters passed to servlet and their values..
like this

Is there is any way to conver this URL in the following form..


Here is some part of servlet code



There is some terms like URL rewriting, will it help me?..

Please Help..
Thanks in advance..
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I hope I understand you correctly - You do not want your request parameters to show int he URL. If so, then implement doPost instead of doGet.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Rocky Khan
Greenhorn

Joined: Oct 18, 2011
Posts: 11

Thank you for reply Bosun..

Will try it....
abani patra
Ranch Hand

Joined: Oct 11, 2011
Posts: 70
Hi,
I think you should use response object's send Redirect method to do that so that url will be show what it is in actual.
Rocky Khan
Greenhorn

Joined: Oct 18, 2011
Posts: 11

Hey abani,

I want to retain my session and as per my information using sendRedirect in response ends the session..

Thank you for reply..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60783
    
  65

A redirect most certainly does not end a session.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

With a redirect you will not be able to access the data from the first request, the session still fine.

Try something like


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Rocky Khan
Greenhorn

Joined: Oct 18, 2011
Posts: 11

Thank you all for giving me your precious time...
 
 
subject: getRequestDispatcher problem
 
Similar Threads
Calling servlet on page load
Handle Session Expire in JSP
My jsp file is not displayed - tomcat does not pick up the class file
JSP Not able to Identify the JS, CSS file path
Response Filtering Suggestions