Announcement Announcement Module
No announcement yet.
Tiles localization dependencies? (TilesJstlView) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tiles localization dependencies? (TilesJstlView)

    I have setup a basic Spring and Tiles webapp configuration using a ResourceBundleViewResolver with the views defined in a resource bundle using the default basename 'views'. The content of this file are as follows:

    index.(class)=org.springframework.web.servlet.view .tiles.TilesView

    This works okay however I have run into a frustrating problem which I change the class name of the View implementation to use TilesJstlView to expose the locale and resource bundle for JSTL formatting, i.e. this doesn't work...

    index.(class)=org.springframework.web.servlet.view .tiles.TilesJstlView

    The error reported when navigating to http://localhost/index.html is as follows:

    SEVERE: Could not complete request
    javax.servlet.ServletException: Error occured during request processing: javax/servlet/jsp/jstl/fmt/LocalizationContext
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(
    at org.springframework.web.servlet.DispatcherServlet. doService(
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    at org.springframework.web.servlet.FrameworkServlet.d oGet(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

    As a sanity check I have successfully implemented the TilesView using a InternalResourceViewResolver, however continue to run into the same problem using TilesJstlView and InternalResourceViewResolver.

    I have scoured several Spring books and online resources and all seem to gloss over Tiles integration (especially using TilesJstlView) so would appreciate help from anyone who can shed light on why an exception is throw while processing the LocalizationContext class i.e are there localization dependencies that need to be configured in the application/webapplication context's which I have overlooked??

    My configuration - Windows XP, Tomcat 5.5, Spring v 1.2.6, Struts (tiles) v 1.2.8

  • #2
    Not sure if you have tried this already, but do you have a javax.servlet.jsp.jstl.fmt.LocalizationContext context parameter set to the short name of your resource bundle? It would look like this (in web.xml):

    <param-name>javax.servlet.jsp.jstl.fmt.LocalizationContex t</param-name>

    It's needed by the <fmt/> tags in JSTL, unless you set <fmt:useBundle/> on every page.


    • #3
      codagtr, all along I thought it may be a Spring configuration issue but thanks to your response I narrowed down the problem to my maven build - the standard-xxx.jar was not being included in my build and hence was not in the webapp classpath. Embarassing but at least it is now sorted, thanks