users@glassfish.java.net

Re: Virtual Server 'redirect_1' param removing '?' from redirected links

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 28 Jul 2009 17:31:22 -0700

Hi Andrew,

On 07/27/09 11:59 PM, glassfish_at_javadesktop.org wrote:
> This is a little strange: Let's say I have a URL in the form of
>
> https://localhost:8181/boas/def?p1=z&p2=y.
>
> Now, I want that URL to redirect to https://localhost:8181/v_tester/def?p1=z&p2=y
>
> Now, I just need Glassfish to redirect everything in /boas/ to /v_tester/. Unfortunately, that doesn't work as expected. Instead of getting
>
> https://localhost:8181/v_tester/def?p1=z&p2=y
>
> I get
>
> https://localhost:8181/v_tester/defp1=z&p2=y
>

This has been fixed in the latest promoted build for GlassFish v2.1.1,
which is available from

 https://glassfish.dev.java.net/downloads/v2.1.1-b24.html


The corresponding bug id is 6798495 ("redirect_n does not work with
query parameters and cookieless feature")
in Sun's internal bug tracking system.

> Note the missing question mark after the 'def'... Does anyone know why? And if so, what can I do about it? I'm using Glassfish V2 UR2 on Ubuntu 9.04, running Sun Java build 1.5.0_18-b02
>
> The redirect param I'm using looks like:
>
> <property name="redirect_1" value="from=/boas/ url-prefix=/v_tester/"/>
>
> This has been placed in the default 'server' VS.
>
> Also, looking in the logs, I'm getting an warning llike:
>
> [#|2009-07-28T00:10:59.992+1200|WARNING|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8181-4;/v_tester/defp1=RFI&p2=FR;_RequestID=afeb0eb2-37b4-4a07-9bb0-81d0a6d723be;|WEB0144: Invalid redirect URL [/v_tester/defp1=RFI&sf=FR]: Impossible to URL encode|#]
>
> I'm not sure what that's trying to tell me, but I assume it shouldn't be appearing.
>
> Also, I've discovered that I can't do something like
>
> <property name="redirect_1" value="from=/a/ url-prefix=/b/a"/>
>
> It just seems to endlessly replace the new 'a'... I'm not sure if that's intentional or not?
>
> Anyway, let me know if I'm doing something wrong, or if I should file a bug report for this.
>

This has also been fixed in the promoted build referenced above.
Bug id is 6810361 ("AS 9.1_02 (build b06-p02) WEB0144: Invalid redirect
URL").

Would you mind installing the above build and confirming that it
addresses the issues you found?

The fixes have also been forward-ported to GlassFish v3.

Thanks!


Jan


> Oh, and for reference, I'm doing this because I'm trying to implement a site that looks and feels extremely similar to an existing one. Why? Because I need to be able to test an HTML Screen Scraper I'm writing for it, and they don't have a test site. They ONLY have a production site. Doh. Believe me, if there was a better alternative I would not be doing this. However, there is not, and I'm stuck doing things this way. Sad, but that's the real world for you.
>
> Thanks,
>
> - Andrew Thorburn
> [Message sent by forum member 'ipsi' (ipsi)]
>
> http://forums.java.net/jive/thread.jspa?messageID=357830
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>