tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Klop <ronald-mailingl...@base.nl>
Subject RE: Multiple arguments in a GET URL
Date Mon, 04 Oct 2004 10:11:45 GMT
You better escape the value than replacing one character. This doesn't solve your issue on
the long run.

See java.net.URLEncoder.

String args = "mainFrame=" + URLEncoder(url, "UTF-8");

Ronald.

On Mon Oct 04 04:34:05 CEST 2004 "khanaz@HQ.Verizonwireless.com" <khanaz@HQ.Verizonwireless.com>
wrote:
> Eric:
> Thanks for your help. Now that I think about it, it appears that is what is
> happening. I will modify the code tomorrow morning to pass the second
> ampersand as an ASCII value. 
> 
> Thanks everyone for your input on this !!
> 
> 
> 
> Thanks,
> 
> Azam Khan
> Network Data Support Center
> Verizon Wireless
> 866-222-7114
> http://ndsc.eng.vzwcorp.com
> 
> -----Original Message-----
> From: erh@swapsimple.com [mailto:erh@swapsimple.com] 
> Sent: Friday, October 01, 2004 7:59 PM
> To: khanaz@HQ.Verizonwireless.com
> Cc: tomcat-user@jakarta.apache.org
> Subject: Re: Multiple arguments in a GET URL
> 
> On Fri, Oct 01, 2004 at 05:10:22PM -0400, khanaz@HQ.Verizonwireless.com
> wrote:
> >it sees "hello" as expected
> > 
> >-----Original Message-----
> >From: Caldarale, Charles R [mailto:Chuck.Caldarale@UNISYS.com] 
> >
> http://ndsc.eng.vzwcorp.com/index.jsp?mainFrame=blahblah.jsp?arg1=hello&arg2
> >=helloagain
> >> 
> >>In this scenario, I am able to perform a request.getParameter 
> >>on arg1 in blahblah.jsp but when I try to do it on arg2, I 
> >>receive a null pointer exception.
> > 
> >For curiosity's sake, what value does blahblah.jsp see for arg1?
> 
> Oh, I bet I know what you're doing. In index.jsp you're probably
> using
> the value of mainFrame directly as the url to load in the frame. But the
> value of the mainFrame arg is "blahblah.jsp?arg1=hello", not just plain
> "blahblah.jsp". That's why you can get arg1. arg2 is just another
> parameter being passed to index.jsp.
> You need to either escape those &'s so the whole thing after 
> mainFrame= is the value of mainFrame, or index.jsp needs to explicitly
> append any of _it's_ args (i.e. mainFrame and arg2) to the frame url.
> (or rather, any that you think should be passed on)
> 
> eric
> 
> ---------------------------------------------------------------------
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message