Skip to main content



      Home
Home » Eclipse Projects » Virgo » Snaps issues with dispatchservlet mapped to (snap) root and separate resources folder((this makes it hard to get clean url's with Snaps))
Snaps issues with dispatchservlet mapped to (snap) root and separate resources folder [message #803923] Tue, 21 February 2012 20:22 Go to next message
Eclipse UserFriend
By default the Snaps example has the dispatcher servlet mapped to something like "/web/*" and the static resources in the root.

To have cleaner url's I tried altering this behavior by mapping the dispatcher servlet to the snap root and use:
<mvc:resources location="/jsp/**" mapping="/jsp/"/>


This didn't seem to work and the dispatcher servlet kept handling my jsp requests:
2012-02-22 01:55:41.669] INFO  http-bio-8080-exec-1         org.eclipse.virgo.snaps.core.internal.webapp.url.PathUrlPattern   Path '/register/jsp/index.jsp' matches pattern '/register' 
[2012-02-22 01:55:41.670] INFO  http-bio-8080-exec-1         o.eclipse.virgo.snaps.core.internal.webapp.url.UrlPatternMatcher  Matched path '/register/jsp/index.jsp' with mapping 'register' 
[2012-02-22 01:55:41.670] INFO  http-bio-8080-exec-1         org.eclipse.virgo.snaps.core.internal.webapp.url.PathUrlPattern   Translated path '/register/jsp/index.jsp' to '/jsp/index.jsp' 
[2012-02-22 01:55:41.688] WARN  http-bio-8080-exec-1         org.springframework.web.servlet.PageNotFound                      No matching handler method found for servlet request: path '/jsp/index.jsp', method 'GET', parameters map[[empty]] 

I also tried using prettyfaces or tucky url rewrite but these libs aren't OSGi'ified yet, so they aren't that easy to implement either.

So I was wondering if there might be a good/easy workaround for this perhaps?
Would seem like an nice feature to have.

This problem might be related with the dispatcher servlet mapping ending with "*" somehow, but I thought I might check here first before diving into the snaps source code.
Would be nice if there was a little bit more technical info on how exactly the url handling/translations happen behind the scenes perhaps.

Thanks in advance,

Jochen

PS. I did managed to create a pretty neat dynamic JQuery mobile front-end so far on top of Snaps though.

[Updated on: Tue, 21 February 2012 20:28] by Moderator

Re: Snaps issues with dispatchservlet mapped to (snap) root and separate resources folder [message #808055 is a reply to message #803923] Mon, 27 February 2012 05:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Can you confirm the entry for the dispatcher servlet comes after the jsp definition. Snaps dosn't change the way that the web.xml is processed in any way. I will be the usual ordering just like any other web app and snaps is only present as a filter. We have had tucky url rewriting working in the past but I can't think of an example of the top of my head.

Chris.
Re: Snaps issues with dispatchservlet mapped to (snap) root and separate resources folder [message #808682 is a reply to message #808055] Mon, 27 February 2012 21:25 Go to previous message
Eclipse UserFriend
Jochen,

What are you trying to serve with mvc:resources? Static content or jsp files?
What is your view resolvers? Can you post the rest of your dispatcher-servlet config and web.xml?

You might be running into issue described here: http://stackoverflow.com/questions/4057529/using-mvcresources-in-spring-3-causes-all-other-views-to-stop-working
Previous Topic:Grails on VTS Constraint Issues
Next Topic:SpringDM - Exporting Spring Bean as Service - Problem with scope
Goto Forum:
  


Current Time: Sat May 24 23:14:46 EDT 2025

Powered by FUDForum. Page generated in 0.03917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top