Announcement Announcement Module
Collapse
No announcement yet.
Web Module, Specifying the DispatcherServlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 [email protected]; Oct 6th, 2008, 08:08 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.

    Comment

    Working...
    X