New in Rewrite

Splash Forums PrettyFaces Users New in Rewrite

This topic contains 2 replies, has 2 voices, and was last updated by  Anonymous 4 years, 4 months ago.

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

    Anonymous

    hi

    i am new in pretty faces i cant not understand REWRITE what is that? is this another framework or a TAG providing in prettyfaces ? can you guide me please..

    i have read the doc chapter 6 and 7 but not fully understand, anyone has tutorial aur book? please send me

    i am using servlet 3.0 and pretty faces 3.3.2 with annotations

    i want to use <rewrite……/>

    when ever i start tom cat server, it loads index.xhtml file like this http://localhost/myApp/index.xhml but i want it in http://localhost/myApp/home

    to implement rewrite is there any servlet ? to write in web.xml ?

    and doc is not fully clear, is there any example of rewrite URL please?

    please Do tell me

    thanks.

    #23388

    “Rewrite” is both. A configuration element in PrettyFaces and a separate project. :)

    Let me explain:

    There is PrettyFaces, which is a URL rewriting framework for JSF. PrettyFaces is very stable and I use it in many projects. In PrettyFaces you can use pretty-config.xml to define either URL-mappings or simple rewrite rules. These rewrite rule are built using the XML element <rewrite>. It allows to define simple rewriting rules similar to mod_rewrite.

    To get PrettyFaces up and running, have a look at:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/GettingStarted.html

    For your usecase you should also have a look at:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.mapping

    In your case you should use a configuration like this:

    <url-mapping id="home">
    <pattern value="/home" />
    <view-id value="/index.xhml" />
    </url-mapping>

    Or if you want to use annotations:

    @URLMapping(id = "home", pattern = "/home", viewId = "/index.xhtml")
    public class HomeBean {
    /* your code */
    }

    There is also a separate project called “Rewrite”. This project is the successor of PrettyFaces. It’s a complete new project and fixes many of the weaknesses of PrettyFaces. If you want to learn more about Rewrite have a look at the Rewrite site:

    Rewrite

    I hope this clears up the situation a bit. :)

    #23389

    Anonymous

    thanks Christian Kaltepoth you have solved my confusions :) (Y)

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

You must be logged in to reply to this topic.

Comments are closed.