Announcement Announcement Module
No announcement yet.
Accessing URI template variables in view Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing URI template variables in view

    Hi, guys!

    There is a Spring 3.2, a view-controller configured in spring context XML:

    <beans xmlns:mvc="" ...>
    <mvc:view-controller path="/i18n/{className}.js" view-name="common-i18n"/>
    (it simply renders a JSP)

    and a corresponding common-i18n.jsp, where the ${className} URI template var is used:

    <%@ page language="java" ...%>
    Template var: ${requestScope['org.springframework.web.servlet.HandlerMapping.ur iTemplateVariables']['className']}
    This way, with long constant value, it works fine - i see the 'QWE123' on the page accessing the localhost:8080/myContext/i18n/QWE123.js

    But is there any simpler way, without deep internal constant values? The SPR-6486 is done in Spring 3.1, promising that just saying ${className} inside JSP will do the job. But actually ${className} in my JSP renders nothing...