Announcement Announcement Module
Collapse
No announcement yet.
Newbie: Cannot set form-login page to a mvc:view-controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie: Cannot set form-login page to a mvc:view-controller

    Please Igone :- Error was that my web.xml was configured to only forward *.form to diuspatcherServlet, hence I could
    not seem to get other urls to work. duh !



    I am new to spring security 3.1, and am running into an issue trying to set the login-page in http/form-login to reference a jsp view that is set in my servlet-context.

    My security tags and http tags are in the application-context.xml, and mvc tags are in servlet-conext

    I seem to come across posts that indicate that I cannot simly put everything in servlet-context.xml, which
    seems to confuse things even more.

    Is there a way around this ?

    I have tried the following

    <mvc:view-controller path="/login" view-name="login" /> with a corrosponding jsp in the views directory


    <s:http security="none" pattern="/login"/>
    <s:http>

    <s:intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
    <s:intercept-url pattern="/secure/**" access="IS_AUTHENTICATED_REMEMBERED" />
    <s:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />

    <s:form-login login-page="/login"/>
    <s:anonymous />
    <s:logout />
    <s:access-denied-handler error-page="/err.form"/>
    </s:http>



    The strage this i that err.form is also defined in the servlet-context as

    <mvc:view-controller path="/err.form" view-name="welcome" />

    I cant understand why this would work, but the login page does not !



    UPDATE :- If I set the path for login-page to be rather log like "doAuth.form", it works fine !!!! But shotter names dont seem to work.


    Thanks
    Last edited by shahed100; Dec 18th, 2011, 12:12 PM.
Working...
X