Results 1 to 2 of 2

Thread: standard way to map Spring 3 MVC servlet to Root context?

  1. #1
    Join Date
    Aug 2010
    Location
    Goteborg, Sweden
    Posts
    434

    Default standard way to map Spring 3 MVC servlet to Root context?

    What is the standard way to map a Spring 3 MVC servlet to the server root context when using Tiles as in a Spring Roo project? The first index page under the server root which will be running on Tomcat 6.0.3x standalone is not going to be a static page, but will be a servlet. I've set my url-pattern to "/**" for my controller class for this view, added a Context.xml file to META-INF:
    Code:
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="siteName" docBase="" path="" workDir="work/Catalina/siteName/_">
    </Context>
    . I'm returning the proper view that I want. But still I get "The requested resource (/) is not available."

    If I use the context "/[projectName]" I get the view I want. But I really need the root context.

    My Tomcat 6 test server have only one base webapp.

    Any ideas? I'm not sure if it is the nature of the Spring project I need to change or if it is my deployment method.

  2. #2
    Join Date
    Jul 2008
    Location
    Mumbai, India
    Posts
    26

    Default

    Try keeping a file named on your webapp under conf/Catalina/locahost. example serverRoot/conf/Catalina/localhost/myapp.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/" >
    </Context>
    I am not completely sure but given this; and an exploded war under webapps with dir name /ROOT should work.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •