2

I got a similar question as: Shorten path of REST service in JBoss Seam application But couldn't comment on the shipmaster answer because of my initial rep. His comment Jul 19 at 18:10 misunderstood the situation:

Faces servlet is mapped by url-pattern *.xhtml and Seam Resource Servlet is mapped to /*. The /* now gets all the url patterns, even those of *.html, because it has more priority on url-pattern matching.

What can I change on components.xml in the code (default behavior): <resteasy:application resource-path-prefix="/rest"/> and on web.xml in the code below:

<servlet-mapping> 
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>

In a way that my RestEasy resource could be accessed by a path like /rest/<resource> instead of /seam/resource/rest/<resource> without invalidating my *.xhtml faces servlets (using his hint of change Seam Resource Servlet url-pattern to /* )?

(It is basically the unsolved question of kongo09 better detailed).

Community
  • 1
  • 1

1 Answers1

0

You're looking for a url-rewriting solution. Seam/RestEasy still gets the full URL, but the client will get a pretty short URL.

If you're using AJP and Apache as a front-end, you could go with httpd's standard mod_rewrite http://httpd.apache.org/docs/2.0/misc/rewriteguide.html.

If you can afford JSF2, a simpler solution is PrettyFaces http://ocpsoft.com/prettyfaces/