-
Oct 6th, 2008, 08:01 AM
#1
Web Module, Specifying the DispatcherServlet
Trying to create a simple Web Module using the Spring MVC controller annotations.
Where I'm stuck is how exactly the DispatcherServlet works in this configuration.
Here is my manifest.mf:
Manifest-Version: 1.0
Bundle-Name: ABC Bundle
Web-ContextPath: abc
Bundle-ManifestVersion: 2
Module-Type: Web
Bundle-SymbolicName: ABC
Bundle-Version: 1.0.0
Web-DispatcherServletUrlPatterns: *
Import-Package: org.springframework.stereotype,
org.springframework.web.bind.annotation;version="[2.5.5.A,2.5.5.A]"
Note that since in my app I'm trying to build, I'm using Spring MVC and don't have a default extension for Web-DispatcherServletUrlPatterns.
My HomepageController.java is as follows:
(NOTE 1)Controller
public class HomepageController {
(NOTE 1)RequestMapping(value = "/" , method = RequestMethod.GET)
public String showHome() {
System.err.println("I'm here!!!!!");
return("any");
}
}
Problem is I'm getting a 404 with this message:
"Servlet ABC-DispatcherServlet is not available"
Could someone point me in the right direction? I've read (and still reading) the Programmer Guide, just need a hint how to tie the Web Module with Spring MVC.
Thanks,
Albert.
PS: NOTE 1 is the at symbol, which I can't post this thread without removing (something about no urls until 15 posts)
Last edited by albert.liptay@citrix.com; Oct 6th, 2008 at 08:08 AM.
-
Oct 6th, 2008, 10:11 AM
#2
Missed a step
Problem was I didn't have an applicationContext.xml file in META-INF/spring
A simple line fixed it:
<context:component-scan base-package="com.abc.web"/>
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules