Reply To: rewrite appends previously visited link's path to other h:link

Splash Forums Rewrite Users rewrite appends previously visited link's path to other h:link Reply To: rewrite appends previously visited link's path to other h:link

#27230

rewriteme
Participant
@Override
  public Configuration getConfiguration(ServletContext context) {
    ConfigurationBuilder cb = ConfigurationBuilder.begin();

    cb.addRule().perform(Log.message(Level.DEBUG, "Rewrite is active."));

    cb.addRule(Join.path("/home").to("/index.xhtml"));
    // cb.addRule(Join.path("/signin").to("/signin.xhtml"));
    // cb.addRule(Join.path("/login").to("/signin.xhtml"));

    // cb.addRule(Join.path("/signup").to("/signup.xhtml"));

    cb.addRule(Join.path("/aboutus").to("/aboutus.xhtml"));
    cb.addRule(Join.path("/contactus").to("/contactus.xhtml"));

    cb.addRule(Join.path("/accountrecovery").to("/accountrecovery.xhtml"));

    cb.addRule(Join.path("/user/{username}").to("/user.xhtml"));

    cb.addRule(Join.path("/sharestory").to("/app/storyadd.xhtml"));

    cb.addRule(Join.path("/useraccount").to("/app/useraccountedit.xhtml"));
    cb.addRule(Join.path("/editstory").to("/app/storyedit.xhtml"));

    cb.addRule(Join.path("/story/{storyid}/{story}").to("/shared.xhtml"));

    cb.addRule(Join.path("/tag/{tag}").to("/shared.xhtml"));

    return cb;

  }

@Join(path="/signup", to="/signup.xhtml")
@ManagedBean(name = "signUpUserAccountMBean")
@RequestScoped
public class SignUpUserAccountMBean

After clicking on this link, the other links home, contactus do not work, i.e, the story/2/ get appended to be /story/2/home


<h:link outcome="shared" includeViewParams="true"
  value="#{storyVar.storyName.i18N} - #{storyVar.title}">
  <f:param name="#{requestParamsMBean.REQ_PARAM_STORY}"
    value="#{storyVar.storyName.i18N} - #{storyVar.title}" />
  <f:param name="#{requestParamsMBean.REQ_PARAM_STORY_ID}"
    value="#{storyVar.id}" />
</h:link>

<td width="50%"><c:choose>
  <c:when test="#{signInMBean.userSignedIn}">
    <table border="0" width="100%">
      <tr align="right">
        <td><h:form>
            <h:outputLink value="home">#{i18nApp.header_home}</h:outputLink>
            | <h:outputLink value="sharestory"
              rendered="#{signInMBean.userAppUser}">#{i18nApp.share_shareHeaderLink}</h:outputLink>  | 
            <h:outputLink value="user">#{userid}</h:outputLink>  | 
            <h:commandLink value="#{i18nApp.header_signout}"
              action="#{signInMBean.doSignOut}" />
          </h:form></td>
      </tr>
    </table>

  </c:when>
  <c:otherwise>
    <table border="0" width="100%">
      <tr align="right">
        <td><h:outputLink value="home">#{i18nApp.header_home}</h:outputLink>
          | <h:outputLink value="signup">#{i18nApp.header_signup}</h:outputLink>
          | <h:outputLink value="signin">#{i18nApp.header_signin}</h:outputLink></td>
      </tr>
    </table>
  </c:otherwise>
</c:choose></td>
<tr align="center">
  <td><h:outputLink value="aboutus">#{i18nApp.footer_aboutUS}</h:outputLink>
    | <h:outputLink value="contactus">#{i18nApp.footer_contactUS}</h:outputLink></td>

</tr>

Thank you.

  • This reply was modified 6 years, 6 months ago by  rewriteme.