Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to use Message Resources in a login page? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to use Message Resources in a login page?

    Hi,
    When I try to access a protected URL in my webapp and get redirected to my form-based login page, the spring:message custom tags (and the fmt:message ones too) throw an exception because the message resource cannot be found. I guess it's got something to do with the request not going via the Spring DispatcherServlet. Is it possible to use message resources in the login page?

    Cheers

  • #2
    Hi,

    certainly, this should work as well. What does your redirect, respectively your new handling controller, exactly look like?

    Regards,
    Simon

    Comment


    • #3
      Hi Simon,
      I guess you are referring to a handler controller for the login page. I don't have one. I'm using container-based security, so the app server is intercepting requests for protected URLs before they reach the Spring Dispatcher Servlet.

      I'm not sure how to do it any other way. It would be nice to have a little more control over the login process. For example, if login fails, i'd like to reload the same login page but when it loads, how does it know if its because of a failed login attempt or a normal request for protected URLs?

      Comment


      • #4
        You can still use <fmt:message> tag, but have to configure your resource bundle in web.xml file or use <fmt:setBundle...>

        <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContex t</param-name>
        <param-value>BundleFileName</param-value>
        </context-param>

        Comment

        Working...
        X