tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Hanik" <Filip.Ha...@evant.com>
Subject RE: request parameter question ...
Date Wed, 26 Mar 2003 21:35:31 GMT
then I would suggest to make your servlet into a jsp page, and that way you can use the jsp:forward
to pass parameters

Filip

> -----Original Message-----
> From: Mufaddal Khumri [mailto:mufaddal@wmotion.com]
> Sent: Wednesday, March 26, 2003 1:02 AM
> To: Tomcat Users List
> Subject: Re: request parameter question ...
> 
> 
> I guess if i use setAttribute ... i have to use getAttribute 
> ... thats 
> the reason i get the blank string .. coz i was using getParameter
> 
> my problem is that the jsp uses getParameter ... it would have been 
> good if i could have used the same method regardless as how the 
> parameter was set.
> 
> On Thursday, March 27, 2003, at 02:37  AM, Filip Hanik wrote:
> 
> > that is what request.setAttribute is there for.
> >
> > you can also look at JSP forward, that allows you to set 
> parameters, 
> > not sure how this translates to a servlet
> >
> > http://java.sun.com/products/jsp/syntax/1.1/syntaxref1110.html
> >
> >
> > filip
> >
> >> -----Original Message-----
> >> From: Mufaddal Khumri [mailto:mufaddal@wmotion.com]
> >> Sent: Wednesday, March 26, 2003 12:33 AM
> >> To: Tomcat List
> >> Subject: request parameter question ...
> >>
> >>
> >> Hi ,
> >>
> >> In my servlet I have the following code:
> >>
> >> String str = request.getParameter("name");
> >>
> >> if(str.equals("xyz") == true)
> >> {
> >> 	str = "ChangedName";
> >> 	request.setParameter("name", str);   //
> >> <------------------------- how
> >> do i do this ??? There is no method as request.setParameter()
> >> }
> >>
> >> try
> >> {
> >> 	String path = "/SomeJSP.jsp"
> >> 	
> >> getServletConfig().getServletContext().getRequestDispatcher(pa
> >> th).forwar
> >> d(request, response);
> >> }
> >> catch(Exception ex)
> >> {
> >> 	ex.printStackTrace();
> >> }
> >>
> >> one way to do it would be to append the parameter and its
> >> changed value
> >> to the path:
> >> String path = "/SomeJSP.jsp?name=str";
> >>
> >> But is there some method like setParameter to do what I 
> want to do ?
> >>
> >> Thanks.
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> >>
> >>
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message