[solved] How to work with response.sendRedirect() and jsp:forward ?

Splash Forums PrettyFaces Users [solved] How to work with response.sendRedirect() and jsp:forward ?

This topic contains 5 replies, has 2 voices, and was last updated by  mohamida 7 years, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17738

    mohamida
    Participant

    Hi everybody.

    I’m very new to Prettyfaces.

    I’m actually developing a J2EE application (jsf 1.2, richfaces 3.3.3,…)

    How to work with esponse.sendRedirect() or jsp:forward, and have a prettyURL ?

    #19893

    mohamida
    Participant

    Anyone to help me ??

    #19894

    Could you explain your scenario in a little more detail? I’m not sure what you are asking.

    What problem are you trying to solve?

    Thanks,

    Lincoln

    #19895

    mohamida
    Participant

    Sorry for my stupid question.

    I didn’t know how to work with the response.sendRedirect() command in my page.

    In fact, i got a page like this:

    <html>

    <head>

    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>

    <title>redirection</title>

    </head>

    <body>

    <%

    response.sendRedirect(“faces/index.jsp”);

    %>

    </body>

    </html>

    What i wanted is to redirect to that page with a pretty Link (for example faces/prettyLink).

    The solution is to simply put that pretty link in that command.

    <html>

    <head>

    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>

    <title>redirection</title>

    </head>

    <body>

    <%

    response.sendRedirect(“faces/prettyLink”);

    %>

    </body>

    </html>

    Sorry again ! :D

    #19896

    No problem, thanks for explaining :)

    You know, you can avoid the whole index file problem if you use a PrettyFaces mapping to ‘/’:

    <url-mapping>
    <pattern value="/" />
    <view-id> faces/index.jsp </view-id>
    </url-mapping>

    #19897

    mohamida
    Participant

    thanks lincoln

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

You must be logged in to reply to this topic.

Comments are closed.