Results 1 to 5 of 5

Thread: Configuring a root context for Tomcat

  1. #1
    Join Date
    Dec 2007
    Posts
    15

    Default Configuring a root context for Tomcat

    Can someone give me an example of how to assign a webapp to the root context for Tomcat? I created a fragment bundle containing a conf/server.xml file, but I am not sure what to set appBase in the Host element and the docBase in the Context element. (I know how to do it if I were running tomcat in standalone mode.)

    I have Tomcat running in equinox with spring osgi web extender.

    Thanks.

  2. #2
    Join Date
    Dec 2007
    Posts
    15

    Default

    Nevermind I found it. Set Web-ContextPath in the bundle manifest.

  3. #3

    Default More info...

    Our load balancer pings our OSGi/Tomcat/Spring-DM based servlet with context path /. Tomcat is returning an error because in the embedded tomcat there is not default webapp. I need to somehow configure Tomcat to respond to this request. This seem very similar to what you were trying to do.

    Can you give me a little more detail? What are the steps you took to get Tomcat to respond to /.

    Thanks,
    Michael-

  4. #4
    Join Date
    Dec 2007
    Posts
    15

    Default

    If you put, the following in the manifest file of your war:

    Web-ContextPath: /

    then when spring-osgi deploys your war file to tomcat, it will set the base context to this value. You can look in the spring-osgi documentation, section 8.4 table 8-1 in the default behavior column for the contextPathStrategy bean for a description of what spring-osgi does if Web-ContextPath is not present.

  5. #5
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    In case you haven't found it already, the link is here.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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