Rewrite JSF 2.0 & primefaces resources

Splash Forums PrettyFaces Users Rewrite JSF 2.0 & primefaces resources

This topic contains 2 replies, has 2 voices, and was last updated by  m1m 5 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18031

    m1m
    Participant

    Is it possible to rewrite standard JSF2 and primefaces resources?

    Now it looks like this:

    <link href="/myapp/javax.faces.resource/style.css.html?ln=css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/myapp/javax.faces.resource/jquery/jquery.js.html?ln=primefaces&v=3.0.M3"></script>
    <link type="text/css" rel="stylesheet" href="/myapp/javax.faces.resource/themes/sam/theme.css.html?ln=primefaces&v=3.0.M3" />
    <link type="text/css" rel="stylesheet" href="/myapp/javax.faces.resource/jquery/ui/jquery-ui.css.html?ln=primefaces&v=3.0.M3" />
    <script type="text/javascript" src="/myapp/javax.faces.resource/jquery/ui/jquery-ui.js.html?ln=primefaces&v=3.0.M3"></script>
    <script type="text/javascript" src="/myapp/javax.faces.resource/core/core.js.html?ln=primefaces&v=3.0.M3"></script>

    I want this to look like:

    /myapp/resources/css/style.css

    /myapp/resources/primefaces/3.0.M3/jquery/jquery.js

    `

    #21424

    domdorn
    Participant

    you’d have to implement a ResourceHandler (http://java.sun.com/javaee/6/docs/api/javax/faces/application/ResourceHandler.html)

    I did this once for the JSF Resource Relocator ( https://github.com/domdorn/JSF-Resource-Relocator )

    anyway.. if you are going to keep the resources on your local server, its not worth the effort to rewrite the jsf resource urls… pretty urls are primary made for humans ;)

    #21425

    m1m
    Participant

    I’m trying to use JSF Resource Relocator. Does it support regexp in jsf-resource-relocator.xml?

    I want to create rule for files in img/* and replace it with http://some.host.com/img/*

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.