I've tried to fix this issue by myselft over a week but still don't know where i was wrong. I also read all the posts that have similar issue but can't find the solution for my case.

Web xml 

```
<?xml version="1.0" encoding="UTF-8"?>
<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" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

<!-- Servlet config begin -->
  <servlet>
    <servlet-name>vietjob</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>vietjob</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
<!-- end-->
  <listener>
    <listener-class>
          org.springframework.web.context.ContextLoaderListener
    </listener-class>
  </listener>
   <filter>  
    <filter-name>encodingFilter</filter-name>  
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>  
    <init-param>  
       <param-name>encoding</param-name>  
       <param-value>UTF-8</param-value>  
    </init-param>  
    <init-param>  
       <param-name>forceEncoding</param-name>  
       <param-value>true</param-value>  
    </init-param>  
  </filter>
  <filter-mapping>  
    <filter-name>encodingFilter</filter-name> 
    <url-pattern>/*</url-pattern>  
  </filter-mapping> 
   <!-- Begin load Spring Filter Chain config from servlet vietjob -->
   <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/vietjob_security.xml
        </param-value>
    </context-param>
    <!-- end load -->
    <!-- Begin Spring security config-->
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- End Spring security config -->
</web-app>

```

Security xml

```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
    xmlns:sec="http://www.springframework.org/schema/security"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security.xsd">

    <import resource="vietjob-data.xml" />

    <!-- Begin Spring security config -->
    <sec:http auto-config="true" use-expressions="true">
        <sec:intercept-url pattern="/secure/admin/**"
            access="hasRole('ROLE_YLLAPITAJA')" />
        <sec:intercept-url pattern="/secure/employee/*" access="hasRole('ROLE_EHDOKAS')" />
        <sec:intercept-url pattern="/secure/hakemus/*" access="hasRole('ROLE_EHDOKAS')" />
        <sec:intercept-url pattern="/secure/partner/*"
            access="hasRole('ROLE_PARTNERI')" />
        <sec:intercept-url pattern="/secure" access="isAuthenticated()" />
        <sec:intercept-url pattern="/lomake.do" access="isAuthenticated()" />
        <sec:intercept-url pattern="/*" access="permitAll" />

        <sec:form-login login-page="/login.do"
            default-target-url="/secure" 
            authentication-failure-url="/loginfail.do" />

        <sec:logout logout-success-url="/logout.do" />
        <sec:csrf disabled="true"/>
    </sec:http>

    <bean id="encoder"
        class="org.springframework.security.crypto.password.StandardPasswordEncoder" />

    <sec:authentication-manager>
        <sec:authentication-provider>
            <sec:password-encoder ref="encoder" />
            <sec:jdbc-user-service data-source-ref="dataSource"
                users-by-username-query="select kayttaja_tunnus, kayttaja_salasana_encrypted, kayttaja_enabled from kayttaja where kayttaja_tunnus=? and enabled = 1"
                authorities-by-username-query="select k.kayttaja_tunnus, r.rooli from kayttaja k JOIN kayttaja_rooli kr ON (r.fk_kayttaja_id = kr_kayttaja_id) JOIN rooli r ON (r.rooli_id = kr.fk_rooli_id) WHERE k.kayttaja_tunnus = ?" />
        </sec:authentication-provider>
    </sec:authentication-manager>

    <sec:global-method-security
        pre-post-annotations="enabled" />

    <!-- End Spring security config -->

</beans>

```

login form

```
<h3><spring:message code="login.kirjaudu.kayttaja" /></h3>
<hr>
<c:if test="${not empty loginerror}">
        <p>Sisäänkirjautuminen epäonnistui. Käyttäjätunnus tai salasana on syötetty väärin.</p>
    </c:if>

    <c:if test="${not empty loggedout}">
        <p>Uloskirjautuminen onnistui</p>
    </c:if>
    <spring:url value='j_spring_security_check' var="springcheck"></spring:url>
<form action='${springcheck }' class="form-horizontal" role="form"  method="post">
  <div class="form-group">
    <label class="control-label col-sm-2"><spring:message code="login.tunnus.kayttaja"></spring:message>:</label>
    <div class="col-sm-4">
      <input type="text" class="form-control" name="j_username" placeholder="Enter username" />
    </div>
  </div>
  <div class="form-group">
    <label class="control-label col-sm-2" ><spring:message code="login.salasana.kayttaja"></spring:message>:</label>
    <div class="col-sm-4"> 
      <input type="password" class="form-control" name="j_password" placeholder="Enter password" />
    </div>
  </div>
  <div class="form-group"> 
    <div class="col-sm-offset-2 col-sm-4">
      <div class="checkbox">
        <label><input type="checkbox"> <spring:message code="login.remember.kayttaja"></spring:message></label>
      </div>
    </div>
  </div>

  <div class="form-group"> 
    <div class="col-sm-offset-2 col-sm-4">
      <button type="submit" class="btn btn-default"><spring:message code="login.kirjaudu.kayttaja"/></button>
    </div>
  </div>
</form>

```

Anyone can help me? i've ready to give up :(.