"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."