PrettyFaces not working with jsf

Splash Forums PrettyFaces Users PrettyFaces not working with jsf

This topic contains 9 replies, has 3 voices, and was last updated by  Christian Kaltepoth 3 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #24200

    jainabhi
    Participant

    Hi All,
    My preetyfaces is not working with jsf.Please help me.
    Web.xml entry

    
    <filter>
       <filter-name>Pretty Filter</filter-name>
       <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
    </filter>
    <filter-mapping> 
       <filter-name>Pretty Filter</filter-name> 
       <url-pattern>/*</url-pattern> 
       <dispatcher>FORWARD</dispatcher> 
       <dispatcher>REQUEST</dispatcher> 
       <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    

    also preety-config entry

    
    <url-mapping id="home">
    	<pattern value="/Login" />
    	<view-id value="/Login.xhtml" />
    </url-mapping>	
    

    Also Jar file used

    commons-beanutils-1.8.3
    commons-collections-3.2.1
    commons-digester-1.8
    commons-logging-1.1.3
    xml-apis-2.0.2

    I am getting Error

    
    com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:90)
    	at com.ocpsoft.pretty.PrettyFilter.init(PrettyFilter.java:337)
    	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    	at com.ocpsoft.shade.org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
    	at com.ocpsoft.shade.org.apache.commons.digester.Digester.parse(Digester.java:1887)
    	at com.ocpsoft.pretty.faces.el.resolver.FacesConfigBeanNameResolver.processFacesConfig(FacesConfigBeanNameResolver.java:275)
    	at com.ocpsoft.pretty.faces.el.resolver.FacesConfigBeanNameResolver.init(FacesConfigBeanNameResolver.java:98)
    	at com.ocpsoft.pretty.faces.el.LazyBeanNameFinder.<init>(LazyBeanNameFinder.java:90)
    	at com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:59)
    	at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)
    	... 15 more
    
    #24257

    Hey Jainabhi,

    Have you tried installing the latest version of PrettyFaces? (See instructions here at http://ocpsoft.org/prettyfaces/)

    Otherwise, I’m not exactly sure why you would be having this problem. What server are you deploying this to? The only thing that makes me suspicious is the xml-apis.jar that you have included. Is that required?

    ~Lincoln

    #24263

    jainabhi
    Participant

    Hi Lincoln,

    1.I need to provide url dynamically also i will change url randomly.
    2.Is it working with jsf menu bar .

    Thanks for your reply.My problem solved after removing xml-apis.jar.Also can i complete my these two task with your api? Please reply me.

    Thanks,
    Abhishek Jain

    #24268

    Hey,

    I’m not really sure what you mean bu those two things, could you elaborate and give some examples?

    Thanks,
    Lincoln

    #24289

    jainabhi
    Participant

    Hi Lincoln,

    1.I need to provide url http://localhost:8080/RIICO/module/admin@123#456=789 in place of http://localhost:8080/RIICO/module/admin.jsf also my url change second time http://localhost:8080/RIICO/module/admin@67890=jklfgh.Every time change url.

    2. when i click on command button and menu bar of jsf application then changed url not displayed.
    <url-mapping id=”showcase”>
    <pattern value=”/showcase@123456″ />
    <view-id value=”/Admin/showcase.jsf” />
    </url-mapping>

    Please take a look.

    #24290

    Hey,

    regarding (1): You could use path parameters for this. But to be honest, I don’t fully understand this requirement. Why do you want to change the URL every time?

    What do you mean with “then changed url not displayed” for (2)? And what do you mean with “jsf menu bar”? There is no menu bar component in standard JSF. I think you are referring to some kind of 3rd party component?

    Christian

    #24292

    jainabhi
    Participant

    Hi Christian,

    1) How to set path parameter.Please give me any example.
    2)I am using JSF
    1.<ice:commandButton value=”Login” action=”#{userLogin.validateLogin}” id=”login”></ice:commandButton>
    2.MenuItem of icefaces.
    In both Preetyfaces is not working after click.
    Please resolve my issue.

    #24293

    For some information about path parameter, have a look at this chapter of the documentation:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.pathparams

    Basically you have to use EL-like expressions in your pattern. Something like this:

    
    <url-mapping id="home">
        <pattern value="/module/admin@#{myBean.myProperty}" />
        <view-id value="/admin.xhtml" />
    </url-mapping>	
    

    Could you explain “In both Preetyfaces is not working after click” a little bit more. What exactly doesn’t work?

    #24294

    jainabhi
    Participant

    Hi Christian,

    <url-mapping id=”showcase”>
    <pattern value=”/showcase@123456″ />
    <view-id value=”/Admin/showcase.jsf” />
    </url-mapping>
    rule is not working after click on ice:commandButton .but after showcase.jsf page display then click on ice menuitem in this page url displayed http://localhost:8080/TMSERPHN/Modules/showcase@123456 in place of http://localhost:8080/TMSERPHN/Modules/showcase-menu.jsf.Also page not found error come.
    Please take a look.

    #24295

    It’s very difficult to help you with this without having access to the code. Could you please provide a minimal sample application to reproduce this? Please also include which steps are necessary to reproduce the error, and what the expected output is.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Comments are closed.