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 7 years, 7 months ago.

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


    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.


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



    Thank you christian, I will try this.



    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(
    at com.ocpsoft.pretty.PrettyFilter.init(
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(
    … 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(
    at com.ocpsoft.pretty.faces.config.annotation.PrettyAnnotationHandler.processClass(
    at com.ocpsoft.pretty.faces.config.annotation.AbstractClassFinder.processClass(
    at com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.processJarFile(
    at com.ocpsoft.pretty.faces.config.annotation.WebLibFinder.findClasses(
    at com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(
    … 44 more

    Could you pls help further.



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


    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:

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

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

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.