thanx a lot...
temporarity..my problem is solved...but wht if i dont want the
parameter value to be displayed in the url..
in this case .. i cannot use xyz.jsp?param=''
is thr any other way ??so tht my parameter values can be hidden??
> thanx a lot...
> temporarity..my problem is solved...but wht if i dont want the
> parameter value to be displayed in the url..
> in this case .. i cannot use xyz.jsp?param=''
>
> is thr any other way ??so tht my parameter values can be hidden??
Set up the choice as one of several different HTML controls, e.g., submit
buttons. Use a <form> tag, naturally, with method set to "post".
<form name="x" method="post" action="/home">
...
<input type="submit" name="destiny" value="Go to A" />
<input type="submit" name="destiny" value="Go to B" />
</form>
and map the "/home" target to a controller servlet that decides where to forward:
public class Control extends HttpServlet
{
protected void doPost(
HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
{
String target;
String destiny = request.getParameter( "destiny" );
if ( destiny.equalsIgnoreCase( "go to a" ))
{
target = "A.jsp";
}
...
RequestDispatcher rd = request.getRequestDispatcher( target );
rd.forward( request, response );
}
}
Exceptions and package imports omitted for brevity.
- Lew
Lew - 10 Jan 2007 00:04 GMT
Raj_genius wrote:
>> is thr any other way ??so tht my parameter values can be hidden??
> Set up the choice as one of several different HTML controls, e.g.,
> submit buttons. Use a <form> tag, naturally, with method set to "post".
>
> <form name="x" method="post" action="/home">
> ...
The action target should be "home", without the leading slash.
- Lew
Raj_genius - 12 Jan 2007 18:34 GMT
Thak you lew...thts an interesting and gr8 solution, thanks...
but here also i hav to use another new servlet/page do decide whc page
to forward..
but anyways..i guess i hav to pay sum price to get my work done..lol..
thanks evry1 for replying
- Raj
> Raj_genius wrote:
> >> is thr any other way ??so tht my parameter values can be hidden??
[quoted text clipped - 8 lines]
>
> - Lew
Lew - 13 Jan 2007 17:54 GMT
> Thak you lew...
Please post your replies in line with the quoted text, not on top of the
message. The latter is called "top-posting" and makes messages harder to follow.
- Lew