Announcement Announcement Module
Collapse
No announcement yet.
Tiles localization dependencies? (TilesJstlView) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 views.properties file are as follows:

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

    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
    index.url=.index

    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(DispatcherServlet.java:757)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:658)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:392)
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:347)
    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):

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

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

    Comment


    • #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

      Comment

      Working...
      X