0

i used prettyfaces in my project and its working well but when i tryed to use similar pattern for two url-mapping it always keep the first in mind and neglagte the second url-mapping that have the same pattern.

i want to ask you if there is a way to have same pattern for different page with pretty faces thats my code :

<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.0
                                        http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd">

    <url-mapping id="accueillogin"> 
      <pattern value="/login" />   
       <view-id value="/faces/login.xhtml" />             
    </url-mapping>  
    <url-mapping id="afficherarticlehome"> 
    <pattern value="/article" />   
       <view-id value="/faces/admin/gestiondesarticles/afficherarticlehome.xhtml" />             
    </url-mapping>
        <url-mapping id="afficherarticleges"> 
    <pattern value="/article" />     
       <view-id value="/faces/admin/gestiondesarticles/afficherarticleges.xhtml" />             
    </url-mapping> 

</pretty-config>

any idea ?

marouanoviche
  • 253
  • 4
  • 11
  • 28
  • It seems to be not possible using Prettyfaces. So now for your original problem, please see my edited answer here: http://stackoverflow.com/questions/17232638/how-to-hide-jsf-url-after-the-application-name – Laabidi Raissi Jun 21 '13 at 16:45

1 Answers1

2

Of course it is not possible. It wouldn't be possible to differ between the two different urls when the pattern is typed. However, it is possible to pass a parameter to determine what you want to show (having both of them the same view-id):

<url-mapping id="afficherarticle"> 
    <pattern value="/article" />   
    <view-id value="/faces/admin/gestiondesarticles/afficherarticle.xhtml" />             
</url-mapping>

/article?section=home

/article?section=ges

Aritz
  • 30,971
  • 16
  • 136
  • 217