Dashboard > Jetty > ... > Jetty Documentation > MovedContextHandler
MovedContextHandler Log In | Sign Up   View a printable version of the current page.

Added by Greg Wilkins , last edited by Greg Wilkins on Mar 06, 2008  (view change)
Labels: 
(None)

Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery

How to move or relocate a Context.

The MovedContextHandler may be used to relocate or redirect a context
that has changed context path and/or virtual hosts.

The sample context configuration below redirects the /jetty context to / with a permanent redirection, while preserving pathinfo and query strings:

move-jetty.xml
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<Configure class="org.mortbay.jetty.handler.MovedContextHandler">
  <Set name="contextPath">/jetty</Set>
  <Set name="newContextURL">/</Set>
  <Set name="permanent">false</Set>
  <Set name="discardPathInfo">false</Set>
  <Set name="discardQuery">false</Set>

  <Set name="virtualHosts">
    <Array type="String">
          <Item>209.235.245.73</Item>
          <Item>127.0.0.73</Item>
          <Item>mortbay.org</Item>
          <Item>www.mortbay.org</Item>
          <Item>jetty.mortbay.org</Item>
          <Item>jetty.mortbay.com</Item>
    </Array>
  </Set>

</Configure>

[!Jetty:FAQ^info_sm.gif!]
[Back to FAQ]


Site running on a free Atlassian Confluence Open Source Project License granted to The Codehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.2 Build:#919 Nov 26, 2007) - Bug/feature request - Contact Administrators