By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,106 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Java Help - Servlets

P: n/a
Hi

I am using the response.sendRedirect(url) method. url is path to
another servlet. Example:

response.sendRedirect(response.encodeRedirectURL
("/EcBugManager/servlet/bugmanager.bugmanager.gui.BugsheetPage?
type="+bugsheetType+"&page="+page);

I am using the response.encodeRedirectURL to encode the url as i dont
want the parameters to be seen in the explorer - address bar.

?? But nothing happens, it just returns the same string with all the
paramteers without being encoded.

Am i using the correct way to encode the url, or is there another way
to do it.

Please, help me on this
Thanks for your time

Rose.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Rose Girl" <ro*********@hotmail.com> wrote in message
news:f5**************************@posting.google.c om...
| Hi
|
| I am using the response.sendRedirect(url) method. url is path to
| another servlet. Example:
|
| response.sendRedirect(response.encodeRedirectURL
| ("/EcBugManager/servlet/bugmanager.bugmanager.gui.BugsheetPage?
| type="+bugsheetType+"&page="+page);
|
| I am using the response.encodeRedirectURL to encode the url as i dont
| want the parameters to be seen in the explorer - address bar.
|
| ?? But nothing happens, it just returns the same string with all the
| paramteers without being encoded.
|
| Am i using the correct way to encode the url, or is there another way
| to do it.
|
| Please, help me on this
| Thanks for your time
|
| Rose.

Hi Rose, URLEncoding just changes certain characters in the url string a
space for example becomes %20, see here for a list of codes
http://www.w3schools.com/html/html_ref_urlencode.asp
If you don't want the query string to be seen you need to post the data
(typically from a browser). If you are wanting to pass the data from one
Servlet to another Servlet check out the RequestDispatcher in the api & (set
attributes in the HttpSession, ServletRequest or ServletContext). A
RequestDispatcher can be obtained from the ServletContext or from the
ServletRequest & HttpServletRequest. The RequestDispatcher obtained from the
ServletRequest can take a relative path. See
ServletRequest.getNamedDispatcher() also.
http://java.sun.com/j2ee/sdk_1.3/tec...ispatcher.html

HTH :-)
--
-P
"Much as some folks hate to lose their way, me, I pray to God that I will."
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.