Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Wed, 22 February 2012 01:22 Go to next message
Jochen Szostek is currently offline Jochen SzostekFriend
Messages: 24
Registered: January 2011
Location: Maasmechelen
Junior Member

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: Wed, 22 February 2012 01:28]

Report message to a 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 10:37 Go to previous messageGo to next message
Chris Frost is currently offline Chris FrostFriend
Messages: 230
Registered: January 2010
Location: Southampton, England
Senior Member

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.


------------------------------------------------
Chris Frost, Twitter @cgfrost
Springsource, a divison of VMware.
Re: Snaps issues with dispatchservlet mapped to (snap) root and separate resources folder [message #808682 is a reply to message #808055] Tue, 28 February 2012 02:25 Go to previous message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
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: Thu Apr 25 04:43:49 GMT 2024

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

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

Back to the top