0 Replies Latest reply on Dec 27, 2011 3:17 AM by piklos

    Seamfaces-prettyfaces integration problem.

    piklos

      Hello,
      I am using seam-faces 3.0.2


      @ViewConfig

      annotation. I configure my pretty faces with it.
      However it seems that there are some limitations with it.


      Example:


      Lincoln has this example in his doc:




      <url-mapping id="archives">
        <pattern value="/#{ /\\d{4}/ year }/#{ /\\d{2}/ month }/" />
        <view-id value="/faces/blog/archives.jsf" /> 
      </url-mapping>



      For urls such as '/blog/2010/12/'


      And


      <url-mapping id="viewAuthorPost">
        <pattern value="/#{ /[a-z]+/ blogger }/#{ /\\d+/ postId }/" />
        <view-id value="/faces/blog/viewPost.jsf"/> 
      </url-mapping>



      For urls such as



      For urls such as '/blog/lincoln/23/'


      In order for this to work we need to have two mappings with the same view-id.


      That doesn't seem to be possible with seam-faces.


      Here is why:


      ViewConfigExtension has a map:


      Map<String, Set<Annotation>> data= ...
       public <T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> event) {
         ...
          for (Class clazz : tp.getJavaClass().getClasses()) {
             for (Field enumm : clazz.getFields()) {
                ...
                Set<Annotation> viewPattern = new HashSet<Annotation>();
                data.put(viewConfig.value(), viewPattern);
             }
          }
       }



      So If you have two mappings in the


      @ViewPattern

      with the same value it seems that the field that is scanned last will overwrite all previous entries :( and thus effectively limit what prettfaces can do.