OCPSoft Rewrite together with Tapestry 5

Splash Forums Rewrite Users OCPSoft Rewrite together with Tapestry 5

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18326

    balteo
    Participant

    Hello,

    I am planning on developing a Tapestry 5 website and I need a reliable url-rewriting library.

    I am just wondering what could be the pros and cons of using Ocpsoft Rewrite library against using T5 built-in rewrite api?

    see: http://blog.tapestry5.de/index.php/2010/09/06/new-url-rewriting-api/

    Any idea whether T5 built-in api might get in the way of OCPSoft Rewrite? Especially considering there might be as many as three servlet filter eventually.

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

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

    3. Ocpsoft rewrite servlet filter.

    Which order should I choose for my servlet filters if it matters at all?

    Regards,

    Julien.

    P.S. I was initially planning on using Vaadin or GWT but I decided against it due to GWT’s poor SEO capabilities.

    #22472

    While I haven’t tried Rewrite with tapestry before, I would suggest placing the RewriteFilter first in the chain (in other words, make Rewrite the outer-most filter.)

    And yeah – GWT takes extra work to do SEO. I’m hoping that our rewrite extension can help make this simpler via using crawler agent detection.

    #22473

    balteo
    Participant

    Hello Lincoln!

    How do I make Rewrite the outer-most filter bearing in mind the rewrite filter is configured in a web-fragment and it is not mentioned in my app’s web.xml.

    Any idea?

    Regards,

    Julien.

    #22474

    Hey Julien,

    Sorry for the late reply. You can simply override the order by re-defining the filter mapping in your application’s web.xml, but it should already be outer-most:

    This is the web-fragment.xml from Rewrite:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-fragment xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"
    version="3.0">

    <name id="rewrite">com_ocpsoft_rewrite</name>
    <distributable />

    <ordering>
    <before>
    <others />
    </before>
    </ordering>

    <listener>
    <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
    </listener>

    <listener>
    <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
    </listener>

    <filter>
    <filter-name>OCPsoft Rewrite Filter</filter-name>
    <filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
    <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
    <filter-name>OCPsoft Rewrite Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ASYNC</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    </web-fragment>

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

You must be logged in to reply to this topic.

Comments are closed.