title: How to develop https site with Spring 3.x?
body: <p>I am a newbie in Spring based web development.</p>
  
  <p>Our site is Spring based and is currently http based (so quite insecure).
  Since, the site is not live yet, we are sending login/password also through a normal JSON request to server and have focussed mostly on JSP, UI design, SQL queries etc.</p>
  
  <p>Now, we want to shift to focus on security and shift to https as a first step.</p>
  
  <p>I have read a no. of web-pages and some spring books but none seems to provide a clear answer on how Spring can be used to provide https security.
  Can some one please help me in achieving the above?</p>
  
  <p>Please let me know if my question is not clear. I will try to add more details ASAP.</p>
  
  <p>Our web.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="
    http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd    
  "
  id="WebApp_ID" version="2.5"&gt;
  
  &lt;display-name&gt;Spring3MVC&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.springframework.web.servlet.DispatcherServlet
      &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;!--&gt; Mapping for serving static web-content &lt;--&gt;
  &lt;!--&gt; The resources folder must be in parallel to WEB-INF &lt;--&gt;
  &lt;!--&gt; The mvc:resources gives "not bound" exception unless bound to a namespace as above for xmlns:mvc &lt;--&gt;
  &lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
  &lt;mvc:resources mapping="/scripts/**" location="/scripts/" /&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>There is only one controller right now for which, spring-servlet.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;context:component-scan
      base-package="console.controllerpkg" /&gt;
  
  &lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
      &lt;property name="viewClass"
          value="org.springframework.web.servlet.view.JstlView" /&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Thanks a lot in advance!</p>
  
  <p>P.S. If you can recommend me a good example based site/book on spring, it would be much appreciated. Most of the sites/books I have seen lay much emphasis on theory but very little examples. That has left me a little confused.</p>