Beginner needs help with Tapestry 5 and Ocpsoft Rewrite

Splash Forums Rewrite Users Beginner needs help with Tapestry 5 and Ocpsoft Rewrite

This topic contains 9 replies, has 3 voices, and was last updated by  balteo 5 years, 5 months ago.

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

    balteo
    Participant

    Hello,

    I have the following configuration in a Tapestry 5/Ocpsoft rewrite:

    @Override

    public Configuration getConfiguration(final ServletContext context)

    {

    return ConfigurationBuilder.begin()

    .addRule(Join.path(“/PrettyURL”).to(“/moduleA/ThePage”));

    }

    However, I still always get the following error message: “the requested resource does not exist: /ume-web/moduleA/ThePage” from Tomcat whereras I can access the page directly from the browser.

    Can anyone please help?

    Regards,

    Julien

    #22475

    Hi,

    Could you be a little more specific in your description of the behavior?

    Perhaps attach a sample application that we can use to reproduce your problem?

    Thanks!

    ~Lincoln

    #22476

    Did I understand you correctly that Tomcat is complaining that /ume-web/moduleA/ThePage does not exist but you can enter exactly this URL into the browser bar and it works?

    #22477

    balteo
    Participant

    @Christian: yes it behaves exactly as you described…

    #22478

    Could you please post the content of your web.xml?

    My guess is the Tapestry is using a servlet filter that doesn’t work because it has to be configured to also process forwarded requests. Please have a look at question 2 here:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/FAQ.html

    #22479

    Sorry, I should have mentioned that although it is the PrettyFaces FAQ, this entry also applies to Rewrite. :)

    #22480

    balteo
    Participant

    My web.xml:

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <web-app xmlns=”http://java.sun.com/xml/ns/javaee&#8221;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee

    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd

    version=”3.0″ metadata-complete=”false”>

    <display-name>bignibou web application</display-name>

    <context-param>

    <param-name>tapestry.app-package</param-name>

    <param-value>com.ume.web</param-value>

    </context-param>

    <context-param>

    <param-name>contextConfigLocation</param-name>

    <param-value>

    classpath:bignibou-configuration-context.xml

    </param-value>

    </context-param>

    <filter>

    <filter-name>app</filter-name>

    <filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>

    </filter>

    <filter>

    <filter-name>oemInViewFilter</filter-name>

    <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>

    <init-param>

    <param-name>entityManagerFactoryBeanName</param-name>

    <param-value>emf</param-value>

    </init-param>

    </filter>

    <filter-mapping>

    <filter-name>app</filter-name>

    <url-pattern>/*</url-pattern>

    </filter-mapping>

    <filter-mapping>

    <filter-name>oemInViewFilter</filter-name>

    <url-pattern>/*</url-pattern>

    </filter-mapping>

    </web-app>

    #22481

    balteo
    Participant

    I have added the following to the filter mappings and it now works. Thanks to both of you!

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    #22482

    Nice to hear that it’s working for you now. :)

    BTW: I’m not sure if you really have to add the dispatcher settings also to the OpenEntityManagerInViewFilter. This way it may be called twice which MAY cause weird effects. :)

    #22483

    balteo
    Participant

    Thanks Christian!

    I removed the dispatcher settings from the oem filter…

    Regards,

    Julien.

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

You must be logged in to reply to this topic.

Comments are closed.