Common param value using annotations

Splash Forums Rewrite Users Common param value using annotations

This topic contains 5 replies, has 2 voices, and was last updated by  Christian Kaltepoth 2 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26226

    jvr
    Participant

    Hi All,
    I have common parameter which is using for no of urls like
    1) con?juits=yyyy
    2) jutyy?juits=kjuy
    3) hjytr?juits=lkiu
    Here “juits” is the common param which is used in different url mappings.
    And all the action methods & URLmapping are available in the corresponding classes.
    And I would like to maintain all the common param values in the different class is this possible?
    Could any one of you please help me.

    #26228

    You can simply move the common query parameter to a super class. PrettyFaces will also process super classes when looking for annotations.

    #26230

    jvr
    Participant

    Thank you christian, I will try this.

    #26231

    jvr
    Participant

    It is not working with super class I got the following exception.
    Caused by: 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.getFilter(ApplicationFilterConfig.java:264)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
    … 41 more
    Caused by: java.lang.IllegalArgumentException: Unable to find a suitable mapping for the query-parameter definied on field ‘lang’ in class ‘com.web.issue.BaseParameters’. Either place a @URLMapping annotation on the class or reference a foreign mapping using the ‘mappingId’ attribute.
    at com.ocpsoft.pretty.faces.config.annotation.PrettyAnnotationHandler.processFieldAnnotations(PrettyAnnotationHandler.java:342)
    at com.ocpsoft.pretty.faces.config.annotation.PrettyAnnotationHandler.processClass(PrettyAnnotationHandler.java:123)
    at com.ocpsoft.pretty.faces.config.annotation.AbstractClassFinder.processClass(AbstractClassFinder.java:219)
    at com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.processJarFile(WebLibFinder.java:141)
    at com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.findClasses(WebLibFinder.java:85)
    at com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:82)
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)
    … 44 more

    Could you pls help further.

    #26232

    jvr
    Participant

    Super class and sub class are in same package.
    that has been include in the web.xml file.

    #26239

    Hmmmm. I just checked the PrettyFaces code. Looks like processing super classes isn’t supported. I thought it was. Sorry.

    But I think Rewrite supports this. You should think about migrating to Rewrite, which is something like the successor of PrettyFaces. There is a detailed migration guide here:

    http://ocpsoft.org/rewrite/docs/migration/prettyfaces3

    But please not you will have to use “Strategy #2”!!!

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

You must be logged in to reply to this topic.

Comments are closed.