[Opensource] Question for any of you Servlet API Spec Gurus

Peter wang pwang33 at yahoo.com
Thu Oct 3 10:45:47 PDT 2002


Try to encode the whole URL , not just partial like
you did.

Peter
--- Michael Rimov <rimovm at centercomp.com> wrote:
> Hey All,
> 
> I came across a very strange issue with exImageTag()
> tag that has to do 
> with the servlet spec.  I'm using Tomcat 4.0.4 in
> development.  The code in 
> question is:
> 
>          tmp = src();
> 
>          if (tmp != null) {
>              results.append(" src=\"");
>             
> results.append(response.encodeURL(tmp));
> 			   ^^^^^^^^^^^^^^^^^^^^^^^^^^
>              results.append("\"");
>          }
> 
> The problem was that if I went to this page from an
> HTTP POST event, 
> everything went well, but if I went there from an
> HTTP GET event, 
> encodeURL() would throw an IllegalArgumentException.
> 
> [The URL in question was something like
> "../images/myimage.gif")
> 
> Now, if I remove encodeURL() everything works
> great... but if we have a 
> dynamic src for the images, removing encodeURL will
> break that, correct?
> 
> Any suggestions as to what would be best for this
> situation would be 
> greatly appreciated.
> 
> 						-Mike
> 
> 
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
>
http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives:
http://mail.jcorporate.com/pipermail/opensource/


=====
ITWANG DOT COM -helping to create the winning e-business solutions!

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the Opensource mailing list