Announcement Announcement Module
Collapse
No announcement yet.
specifying relative context to component-scan Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • specifying relative context to component-scan

    I have been referring to Greenhouse to build a simple application. I am using Eclipse Helios (J2EE edition) for development and debugging.

    Here is the hierarchy:

    Code:
    simpleapp/
    simpleapp/WEB-INF/*
    When I start it on the tomcat server, I should be able to access it at:

    http://localhost:8080/simpleapp

    But, when I try to access the above URL, I am getting the following message:

    org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/simpleapp/] in DispatcherServlet with name 'app-Servlet'

    I have a HomeController which is same as GreenHouse's HomeController with the request mapping.

    Code:
    @RequestMapping("/")
    I used <context:component-scan> to detect this request mapping. I think it directly maps all the url-patterns after "http://localhost:8080/" to the ones specified in the controllers. Sometimes, we might want to map all the url-patterns after "http://localhost:8080/<someapp>" to the controller specified request mappings. This happens when we are debugging or deploying multiple applications on the same server.

    I think I need to do some config change which will map the request "http://localhost:8080/simpleapp" to "/" instead of "/simpleapp". If anybody knows how to set it up, please help me.

    I would really appreciate the help.

    Thanks,
    Praveen
Working...
X