1 Reply Latest reply on Aug 21, 2014 11:19 AM by marcial.atienzar

    Login form with access to other path distinct to root of context path

    marcial.atienzar

      Hi,

       

        If i've a webapp, with a private area with login form like this:

       

      <security-constraint>
              <display-name>Acceso a WebPrivada</display-name>
              <web-resource-collection>
                  <web-resource-name>web-privada</web-resource-name>
                  <description />
                  <url-pattern>/opc/*</url-pattern>
                  <url-pattern>/WebPrivada.html</url-pattern>
                  <http-method>GET</http-method>
                  <http-method>POST</http-method>
              </web-resource-collection>
              <auth-constraint>
                  <description>Todos los usuarios</description>
                  <role-name>ADMIN</role-name>           
              </auth-constraint>
          </security-constraint>
          <login-config>
              <auth-method>FORM</auth-method>
              <realm-name>kyrianAuthRealm</realm-name>
              <form-login-config>
                  <form-login-page>/login.html</form-login-page>
                  <form-error-page>/login_error.html</form-error-page>
              </form-login-config>
          </login-config>
      

       

      When I access to WebPrivada.html (http://localhost:8080/web/WebPrivada.html) it returns login.html and display correctly relatives images like this: style="background-image: url(logo.png);

       

      But when I access directly to this url: http://localhost:8080/web/opc/test (rest url), I see that the image resource that I takes is this: /opc/test/logo.png, and form target changes to /opc/test/j_security_check.

       

      I'm doing something wrong?

       

      Lot of thanks,

       

        Marcial