I am using Spring 3.0 and working with the spring security for login. I have placed the login.jsp page in the webapp folder and I am trying to use messages for localization support e.g.:
<spring:message code="label.title"/>
Unfortunately, the jsp cannot find the message giving error:
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code ‘label.title’ for locale ‘en_US’
When I use the message code in a jsp that goes through a controller, it works fine.
Since the spring security redirects to the login.jsp page when user is not logged in, the page is processed without a controller (directly).
Anyone knows how to make the jsp see the resource bundle also when not going through a controller?
Thanks!
You have to force Spring to render the page login.jsp, which is actually not managed by Spring. So, create a dummy controller:
and create the view named “login” depending of your used ViewResolver (TilesViewResolver, UrlBasedViewResolver…)