Where to place ConfigurationProvider

Splash Forums Rewrite Users Where to place ConfigurationProvider

This topic contains 5 replies, has 2 voices, and was last updated by  Lincoln Baxter III 2 years, 11 months ago.

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

    djmj
    Participant

    I want to use Rewrite but i am having trouble getting it to work using glassfish 3.1.2, mojarra 2.1.23 and eclipse.

    I have no folder such as “src/main/resources/META-INF/services” so I dont know where to put my ConfigurationProvider.

    With pretty-faces xml configuration it worked fine.

    My folder structure is like following:

    – project
    — Java Resources
    — src
    —- packages
    —– UrlRewrite.java (extends HttpConfigurationProvider)
    — WebContent
    — META-INF
    — resources
    — sites
    — WEB-INF
    —- lib
    —– rewrite-servlet-2.0.5.Final.jar

    • This topic was modified 3 years ago by  djmj.
    • This topic was modified 3 years ago by  djmj.
    #24524

    Put it in the src/META-INF/services folder 🙂 I will update the installation guide to note this difference for non-Maven projects.

    #24585

    djmj
    Participant

    Thanks for your answer, i will try it out. Still evaluating if basic pretty-faces will be sufficient.

    #24596

    You’re welcome. Because of this issue, I’ve also added a new configuration mechanism based on Annotations, eliminating the need for the service configuration file in 90% of cases. This will be available when we release Rewrite 2.1.0 🙂

    This is what it looks like:
    https://github.com/ocpsoft/rewrite/blob/761277af3d85ab23e15a0b0a3b86a652c2e570da/config-annotations/src/test/java/org/ocpsoft/rewrite/annotation/config/AnnotationEnabledConfig.java#L12

    #24635

    djmj
    Participant

    This looks promising and much easier :), or what about defining it within web.xml instead of a hardcoded file?

    #24643

    Hmm. Not sure web.xml is the right place, since the entire platform is moving away from using xml files by default. In that case, you might as well just use the service registry files which are more technically powerful 🙂 I’ll think about that though.

    I’ll put it this way. If you wanted to submit a patch/pull request that implemented that, with accompanying test cases. I’d consider it a lot more favorably 🙂

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

You must be logged in to reply to this topic.

Comments are closed.