Reverse proxy and jsf, virtual host mapping to subdirectory

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reverse proxy and jsf, virtual host mapping to subdirectory

Jan Michael Greiner
Dear all,

I have a reverse proxy, that maps https://www.somedomain.com/ to my internal Tomcat, to https://192.168.0.5:8080/somedomain/ (and https://www.someotherdomain.org/ to https://192.168.0.5:8080/someotherdomain/).

Consider the two attaced simple jsf pages.

If you call https://www.somedomain.com/test.jsf, the generated HTML looks like this:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>
    <div id="mainContainer">
    <p><a href="/somedomain/test2.jsf" id="test2" name="test2">link
        </a>
    </p>
    </div><div id="javax_faces_developmentstage_messages"></div></body>
</html>

And the link does not work, because it should be just /test2.jsf.

The most straight forward solution that comes to my mind, is to configure virtual hosts in Tomcat.

But I would like to ask:

Is there a way, to solve this easily, without configuring virtual hosts in the internal tomcat?

Is it possible, to have h:link generate relative paths, or to statically configure the subdirectory name for JSF?


Best regards and thank you

Jan Michael Greiner

test.xhtml (642 bytes) Download Attachment
test2.xhtml (698 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Reverse proxy and jsf, virtual host mapping to subdirectory

Thomas Andraschko-4
Hi,

i don't think we have a way to overwrite this behavior. I would try virtual
hosts.



2018-02-24 15:35 GMT+01:00 Jan Michael Greiner <
[hidden email]>:

> Dear all,
>
> I have a reverse proxy, that maps https://www.somedomain.com/ to my
> internal Tomcat, to https://192.168.0.5:8080/somedomain/ (and
> https://www.someotherdomain.org/ to https://192.168.0.5:8080/
> someotherdomain/).
>
> Consider the two attaced simple jsf pages.
>
> If you call https://www.somedomain.com/test.jsf, the generated HTML looks
> like this:
>
> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>
>     <div id="mainContainer">
>     <p><a href="/somedomain/test2.jsf" id="test2" name="test2">link
>         </a>
>     </p>
>     </div><div id="javax_faces_developmentstage_messages"></div></body>
> </html>
>
> And the link does not work, because it should be just /test2.jsf.
>
> The most straight forward solution that comes to my mind, is to configure
> virtual hosts in Tomcat.
>
> But I would like to ask:
>
> Is there a way, to solve this easily, without configuring virtual hosts in
> the internal tomcat?
>
> Is it possible, to have h:link generate relative paths, or to statically
> configure the subdirectory name for JSF?
>
>
> Best regards and thank you
>
> Jan Michael Greiner
>