On 29/08/2009 14:23, Thilani wrote:

Hi All,

I am developing a web application which is require login for users. I want
to use HTTPS for login only. Application server is tomcat 6.x and following
is the url for login.

https://localhost:8443/GIShome/index.shtm

After successfully login I want to direct users to http connection
(https://localhost:8080/GIShome/home.html
). So I used following in my web xml

<servlet-mapping>
         <servlet-name>dispatcher</servlet-name>
         <url-pattern>*.html</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
         <servlet-name>dispatcher</servlet-name>
         <url-pattern>*.shtm</url-pattern>
     </servlet-mapping>

<security-constraint>
         <web-resource-collection>
             <web-resource-name>Protected Context</web-resource-name>
             <url-pattern>*.shtm</url-pattern>
         </web-resource-collection>
       <!-- auth-constraint goes here if you requre authentication -->
         <user-data-constraint>
             <transport-guarantee>CONFIDENTIAL</transport-guarantee>
         </user-data-constraint>
     </security-constraint>

     <security-constraint>
         <web-resource-collection>
             <web-resource-name>Non Protected Context</web-resource-name>
             <url-pattern>*.html</url-pattern>
         </web-resource-collection>
       <!-- auth-constraint goes here if you requre authentication -->
         <user-data-constraint>
             <transport-guarantee>NONE</transport-guarantee>
         </user-data-constraint>
     </security-constraint>


This is from the dispatcher.xml

<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
         <property name="mappings">
             <props>
                 <prop key="index.shtm">indexController</prop>
                 <prop key="login.shtm">loginController</prop>
                 <prop key="createNew.shtm">createNewController</prop>
                 <prop key="saveUser.html">saveUserController</prop>
                 <prop key="GIShome.html">gisHomeController</prop>
                 <prop key="capability.html">capabilityController</prop>
             </props>
         </property>
     </bean>

Also I did appropriate configuration from the Tomcat side as well.
When I executes the first url it is going to the
https://localhost:8443/GIShome/index.shtm
And never come to normal http connection again.  So how can I redirect this
to http from https again?

Tomcat doesn't have a mechanism to downgrade a connection from HTTPS to HTTP, so the configuration above is not going to do what you want it to.

If you want to downgrade to HTTP you'll have to write or configure a Filter which modifies the URL and executes a redirect. I'm assuming you know a) what a servlet Filter is, and b) how to perform a redirect.


p



Please explain.

Regards.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to