Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Problems using xdoclet with Spring

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am trying to use xdoclet tags within my Spring Controllers to hande the Url Mapping.

My controller class is tagged as follows

/**
* @@org.springframework.web.servlet.handler.metadata.PathMap("/foo.htm")
*/

public class FooController implements Controller {
...
}

I then have the following within my ant build script

<taskdef resource="org/apache/commons/attributes/anttasks.properties" classpathref="classpath" />

<target name="compile-attributes">
<attribute-compiler destdir="${src.dir}">
<fileset dir = "${src.dir}" includes="**/*.java"/>
</attribute-compiler>
</target>

And my foo-servlet.xml contains

<bean id="urlMapping"
class="org.springframework.web.servlet.handler.metadata.CommonsPathMapHandlerMapping" />


When I try to visit the site /domain/foo.htm I get a 404 error. However when I use SimpleURLMapping in foo-servlet.xml

<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/foo.htm">fooController</prop>

I'm able too see the page without any issues. Has anyone else had any similar issues and does anyone know what I'm doing wrong?


Thanks,


Simon
 
rubbery bacon. rubbery tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!