Change how primefaces theme resources are handled?

UI Components for JSF
Post Reply
bag06a
Posts: 1
Joined: 01 Sep 2014, 04:42

01 Sep 2014, 04:52

I've posted this question in a couple other places and this form seems like a good forum to ask as well. As well, week or so ago I asked a question on stackoverflow regarding running 2 different app/web servers on a VPS, but using one main incoming URL/port (using only site.com and not needing site.com:8080).

I received an answer and have for the most part made the solution work. I needed to use URL Rewriting in IIS, and in doing so make both inbound and outbound rules for the rewrite.

This works perfect EXCEPT when I have a CSS property with a value URL being relative in the themes.css and other places. For example:

Code: Select all

    .rule{
        background-image: url(/images/picture.jpg);
    }
If anyone knows IIS, these are my current inbound and outbound

Code: Select all

    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="java/(.*)" />
                <action type="Rewrite" url="http://s17857763.onlinehome-server.com:8080/{R:1}" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="RewriteRelative" preCondition="IsHtml" enabled="false" stopProcessing="true">
                <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="/(.*)" />
                <action type="Rewrite" value="/java/{R:1}" />
            </rule>
            <rule name="RewriteAbsolute" preCondition="IsHtml" enabled="false">
                <match filterByTags="A, Area, Base, Form, Head, IFrame, Img, Input, Link, Script" pattern="http(s)?://s17857763\.com/(.*)" />
                <action type="Rewrite" value="/java/{R:2}" />
            </rule>
            <preConditions>
                <preCondition name="IsHtml">
                    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    <add input="{URL}" pattern=".*/java/.*" />
                </preCondition>
            </preConditions>
        </outboundRules>
    </rewrite>
If you would like to see the issue i'm having, with your dev console open, go to http://s17857763.onlinehome-server.com/java/FirstMaven/

Because of the outbound rules it loads the normal CSS and JS links fine because they come from HTML tags (\<link\> and \<script\>....but i dont know if it's possible to fix the CSS url( ) path

i also posted this question on stackoverflow in case you want to answer there also so that reddit isn't the only community that sees the answer

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 31 guests