Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Property Bean Not displaying on JSP Page

Posted on 2013-11-15
2
Medium Priority
?
1,392 Views
Last Modified: 2013-11-21
Hi,

I've created a Bean in my servlet-context.xml file.  It references a properties file and I would like to call and display those properties on my JSP page.  I'm using Spring 3.1 MVC.

Here's my bean from Spring's servlet-context.xml:

    <beans:bean id="propertyConfigurer"   
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            <beans:property name="location" value="/WEB-INF/app.properties" />
    </beans:bean> 

Open in new window


Here are the contents of my app.properties file in WEB-INF:

app.env=development
app.VersionNo=v9.0
app.VersionBuild=.1

Open in new window


Here are the attempts to access the values in the jsp:

<title>${VersionNo} ${app.VersionNo}</title>

Open in new window


Any help would be greatly appreciated.

blue
0
Comment
Question by:blue44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 1500 total points
ID: 39654121
If you are using spring tags then try the following.

1. load spring tags in jsp
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

2. use spring taf to render the property
<title>${VersionNo} <spring:message code="app.VersionNo" /></title>
0
 

Author Closing Comment

by:blue44
ID: 39668199
It helped but I wish there was a way to do this without using the Spring tags.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question