0 Replies Latest reply on Mar 23, 2009 7:22 PM by gregoryc

    Handling Converter in outputLinks

    gregoryc

      I am fairly new to Seam and JSF and trying to figure out the best way to accomplish the following:


      I am wishing to maintain well formatted URLs for the sake of Google and our users without complicating the code with handling String input parameters to the bean which would then have to handle conversions instead of using a Converter.


      I am able to use


      <page view-id="/state-standards/view.xhtml">
          <param name="state" value="#{ stateStandards.state }"/>
          <param name="subject" value="#{ stateStandards.subject }" converter="#{ stateStandardSubjectConverter }"/>
          <param name="grade" value="#{ stateStandards.grade }" converter="#{ gradeLevelConverter }"/>
      </page>
      



      along with urlrewrite to create the URL format I desire. Everything works fine except when I would like to create a link to the resource. I would like to be able to use something like the following, which I realize isn't valid


      <h:outputLink value="#{ request.contextPath }/state-standards/view.xhtml">
          <f:param name="state" value="#{ stateStandards.state }"/>
          <f:param name="subject" value="#{ subject }" converter="#{ stateStandardSubjectConverter }"/>
          <f:param name="grade" value="#{ grade }" converter="#{ gradeLevelConverter }"/>
          <h:outputText value="#{ grade }"/>
      </h:outputLink>
      



      to use the same converters to encode the URL as which decodes the URL. Ideally the parameters would be aware of the Conversion occurring in pages.xml and handle the output conversion implicitly. I have not found any examples trying to accomplish similar, although I am sure it is a fairly common issue. I would like to pass through the converters in both directions and also use something that allows urlrewrite to perform its transformations.


      Thanks in advance for your help.