This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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: 61316
    
  66

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getRequestDispatcher problem