views:

209

answers:

1

hi All,

I was using Tuckey url for url re-writing. This is how it looks:

rule from / from
to /pf/welcome to
(changed format to enter into this forum, regular xml tags are used)
rule

and this is how I have my entitymanager set up in web.xml:

OpenEntityManagerInViewFilter /*--> /pf/* FORWARD

I would like to take advantage of Spring 3 validations. In my presentation-context file I added this:

As soon as I do that I get 404 errors. The mapping is off.

12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.web.servlet.Di spatcherServlet.getLastModified(DispatcherServlet.java:842)) - DispatcherServlet with name 'dispatcher' determining Last-Modified value for [/PublicFountainWAR- 0.0.1-SNAPSHOT/pf/welcome] 12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.web.servlet.Di spatcherServlet.getLastModified(DispatcherServlet.java:850)) - No handler found in getLastModified 12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.web.servlet.Di spatc**herServlet.doService(DispatcherServlet.java:690)) - DispatcherServlet with name 'dispatcher' processing GET request for [/PublicFountainWAR-0.0.1-SNAPSHOT/ pf/welcome] 12/Sep/10 21:57:46 WARN [http-8080-1] WARN (org.springframework.web.servlet.Dis patcherServlet.noHandlerFound(DispatcherServlet.java:962)) - **No mapping found fo r HTTP request with URI [/PublicFountainWAR-0.0.1-SNAPSHOT/pf/welcome] in Dispat cherServlet with name 'dispatcher' 12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.web.servlet.Fr ameworkServlet.processRequest(FrameworkServlet.java:677)) - Successfully complet ed request 12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.orm.jpa.suppor t.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.j ava:120)) - Closing JPA EntityManager in OpenEntityManagerInViewFilter 12/Sep/10 21:57:46 DEBUG [http-8080-1] DEBUG (org.springframework.orm.jpa.Entity ManagerFactoryUtils.closeEntityManager(EntityManagerFactoryUtils.java:328)) - Cl osing JPA EntityManager

my controllers are mapped to key words without the "pf". e.g. /welcome NOT /pf/welcome

the "pf" was just there to forward it to a sort of virtual path only known to the dispatchservlet for processing...the url's are all independant.

IS there a way to use Tuckey and ???

Summary:

guys any clues would help...just wanna add mvc:annotation-driven

to my pre-existing spring mvc 3.0 web app using Tuckey URL filter......

any help would be greatly appreciated!

A: 

I assume you're using Tuckey because you have your Spring controller methods mapped to /pf/*, and you want to get rid of that part of the URL for the user. You can do this without Tuckey.

Add <mvc:default-servlet-handler /> (see Spring Reference) to your Spring configuration and make sure your DispatcherServlet is mapped to / rather than /pf/* in web.xml.

The <mvc:default-servlet-handler /> was added in Spring 3.0.4, but it was not added to the schema spring-mvc-3.0.xsd, so it will show up as an error in Eclipse. It does work despite the apparent error, and the problem is being addressed by SPR-7545.

James Earl Douglas
hi thanks for the reply, yes I did not want /pf in my urls rather, I just wanted my controllers to be unaware of any underlying implementation and just care about mappings like "/welcome" OR "/register" etc. Another reason I went with Tuckey was I wanted to use restful URL's like /welcome/user/id/{userID} OR /welcome/hello/register/now/heyyyyy so I was ending up mapping every single restful URL in web.xml and it was getting to be huge and ugly..hence tuckey...so are you suggesting that it works the same way as I have it now just without Tuckey? I will give it a go as well...thanks!!!!
logixplayer
hi after trying this new technique, I am getting a problem with the mapping. NO mapping found for HTTP request with URI [/myProjectWebApp/welcome] I only require /welcome ....any ideas?
logixplayer