Moved permanently servlet 1.1

It is a Java servlet lets you perform HTTP redirection with code 301 (permanently moved). E.g. you are moving your site (application) to the new location and need to redirect old requests. Using response.sendRedirect produces only HTTP status code 302 which is temporarily moved where this tool lets you indicate a permanently moved resource.

How to use it:

a) copy movepermPackage.jar into your WEB-INF/lib directory.

b) define MovePermanentlyServlet in your web.xml file. You must set an initial parameter for this servlet describes a new location. Parameter name is location.
 


    <servlet>
     <servlet-name>MovePermanently</servlet-name>
     <servlet-class>com.jsos.redirect.MovePermanentlyServlet</servlet-class>
    <init-param>
    <param-name>location</param-name>
    <param-value>http://your_new_domain</param-value>
    </init-param>
    </servlet>

c) define a mapping:
 


    <servlet-mapping>
     <servlet-name>MovePermanently</servlet-name>
     <url-pattern>/*</url-pattern>
    </servlet-mapping>

in this case servlet will service all the requests.

Optionally, you can a parameter uri with possible values true or false. If this value is true servlet will use the same URI during the redirection. E.g. the request to http://old_domain/some_dir will be redirected to the http://new_domain/some_dir etc. Default value is false.

    For downloading:   movepermPackage.jar

 © Coldbeans Software     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: