facebook

JSF won’t redirect

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #236411 Reply

    Rick Geneva
    Member

    I am trying to get a really simple operation to work on JSF and it won’t do what I want it to.

    The JSF config:

    
    <navigation-rule>
            <from-view-id>userLogin.jsp</from-view-id>
            <navigation-case>
                <from-outcome>success</from-outcome>
                <to-view-id>home.jsp</to-view-id>
                <redirect/>
            </navigation-case>
            <navigation-case>
                <from-outcome>failure</from-outcome>
                <to-view-id>userLogin.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    
        <managed-bean>
            <description>Bean used to handle all User-based operations.</description>
            <managed-bean-name>UserBean</managed-bean-name>
            <managed-bean-class>gprsm.web.jsf.bean.UserBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    

    The bean is in fact returning “success” but I always get the loginUser.jsp view in the browser. What am I doing wrong?

    #236435 Reply

    Riyad Kalla
    Member

    Did you mean loginUser.jsp (what you typed below) or userLogin.jsp (what si in the snippet above)?

    You can try and remove the <from-view-id> tag to make the navigation rules global to make sure that isn’t the problem, you can also try prefixing a / before the paths, like /home.jsp and so forth.

    #239944 Reply

    groepaz1
    Member

    I had the same problem,

    I downloaded the jsf-jars from sun and replaced the myeclipse jars
    -> works!!

    To MyEclipse – Team:

    Keep working on the quality!!! Before the useres loose confidence!!

    #239956 Reply

    We bundle Sun RI 1.1. Did you use 1.1_01? Are you sure your problem was with the Jars not with the code?

    #240421 Reply

    groepaz1
    Member

    Yes I am sure the problem was not related to the code!

    I did not change anything at the code level, just the jars ->works.

    #256579 Reply

    fsteveb
    Member

    I am having the same problem.
    I have two jsp pages. The first is a jsf page with a button. The next page is another jsf page with some controls on it. Both pages display if I put the .faces address on the address bar.
    Here is what the button looks like:

    <h:commandButton id="submit" action="success" value="Submit"/>
    

    I added navigation to the faces-config like this:

        <navigation-rule>
            <from-view-id>/sample.jsp</from-view-id>
        </navigation-rule>
        <navigation-rule>
            <from-view-id>/first.jsp</from-view-id>
            <navigation-case>
                <from-action>success</from-action>
                <to-view-id>/sample.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>

    I tried removing some of the nav rule stuff like you suggested.
    @support-rkalla wrote:

    You can try and remove the <from-view-id> tag to make the navigation rules global to make sure that isn’t the problem, you can also try prefixing a / before the paths, like /home.jsp and so forth.

        <navigation-rule>
            <navigation-case>
                <from-action>success</from-action>
                <to-view-id>/sample.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>

    No change.

    When I click the button, nothing happens. From what I read, this is all I need to do.

    #256607 Reply

    Riyad Kalla
    Member

    Your button must be in a form.

    #295660 Reply

    amir55
    Participant

    hi all

    I just want to use jsf redirect rather than next jstl one

    <c:redirect url=”/page.faces”>
    <c:param name=”left” value=”${leftBody.left}” />
    </c:redirect>

    when I use

    <jsf:redirect url=”/page.faces” > // here Iget error jsf:redirect unknown
    <f:param name=”left” value=”${leftBody.left}” />
    </jsf:edirect>

    so many thanks

    Amir

    #295706 Reply

    amir55
    Participant

    hi again

    I could not find any way how to use in jsf framework libraries any :

    1 – how to do import a jsp file
    2 – include
    3 – forward
    4 – redirect
    5 – also how to pass paramters as f:param and not c:param for jstl.

    I do not want to use jstl or jsp components as I lose some features of the view.

    I donot want link like comaand or button but jusrt forward with a paramter with it.

    As Simple As That

    please reply ASAP if you may

    Amir

    a

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: JSF won’t redirect

You must be logged in to post in the forum log in