Search code examples
apachejakarta-eejsf-2jbossmod-proxy

Apache in front of JSF


In Jboss AS 7:

Putting Apache in front of Jboss with this works fine:

ProxyPass / http://localhost:8080
ProxyPassReverse / http://localhost:8080

So app is accessed by domain.com/app.

Problem appears when aiming for a clearer URL(Just domain.com):

ProxyPass / http://localhost:8080/app
ProxyPassReverse / http://localhost:8080/app

All javax.faces.resource are not delivered in the second case, because they don't use the war context URL.

Any idea how to get the faces resources in the second case? Maybe just move to mod_jk?

This answer about ResourceHandler, helps pretty much.


Solution

  • The JSF ResourceHandler emits URLs with the <contextPath>/javax.faces.resource/ route, albeit indirectly through the ScriptRenderer, StyleSheetRenderer etc.

    Since you're omitting the app name (context Path) in the ProxyPass directive, you'll need to use a URL rewriter to omit the URLs before they're served to the browser. Refer the answers in the related question on how to achieve this.