Hey,
On Tue, May 8, 2012 at 12:29 PM, Martin Keiblinger <
mar...@moosify.com> wrote:
> But the outbound-rule doesn't keep it's promise to prevent the end
> user from seeing the rewrite-status in the URL field in the browser.
> <outbound-rule>
> <note>
> The outbound-rule specifies that when response.encodeURL
> is called (if you are using JSTL c:url)
> the url /rewrite-status will be rewritten to /test/
> status/.
>
> The above rule and this outbound-rule means that end users
> should never see the
> url /rewrite-status only /test/status/ both in thier
> location bar and in hyperlinks
> in your pages.
> </note>
> <from>rewrite-status</from>
> <to>/test/status/</to>
> </outbound-rule>
>
> After calling
http://127.0.0.1:8080/test/status I see
>
http://127.0.0.1:8080/rewrite-status in the browser. Why? And how can
> I fix that?
You misunderstand what it does. It changes any URL on the page that
would normally point to /rewrite-status to point to /test/status. If a
user clicks that URL you will be 302 redirecting them to
/rewrite-status though, which is what a type="redirect" does. A 302
redirect is simply telling the user "don't go here, go here". Of
course then he sees the URL you give him there, being /rewrite-status.
If you wish to not redirect the user, you can use a forward (the
default), which _internally_ redirects the message to a different
handler, i.e. in your application server itself. For that to work, the
filter or servlet responsible for replying to the request *must* be
listening for FORWARD as well as for REQUEST. See the docs for a
configuration example.
regards,
Wim