Announcement Announcement Module
Collapse
No announcement yet.
Use Placeholder value in JSP page? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use Placeholder value in JSP page?

    Hi!

    Using Spring 3.0.x for a web application, is it possible to get/read a placeholder value from a JSP page?

    I found two solutions, but they are not elegant:
    - store the value in a bean and read it with spring:eval tag / SpEL (see post #9 here)
    - use a bean to inject the value into the servlet context (see here)

    Is there a better simpler way? What I aim at is:

    Code:
    <context-param>
    	<param-name>foo</param-name>
    	<param-value>${placeholder.value}</param-value>
    </context-param>
    Thanks,
    David

    PS: Hmm, if PropertyPlaceholderConfigurer would implement the FactoryBean<Properties> interface it would be much simpler for me...
    Last edited by xerces8; Feb 7th, 2013, 11:49 AM.

  • #2
    How about writing a custom jsp tag that would fetch the value for you?

    Comment

    Working...
    X