aspose file tools
The moose likes JSF and the fly likes JSF property file's value is not executing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Meteor in Action this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF property file Watch "JSF property file New topic

JSF property file's value is not executing

Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 127

My application has a jsp named “inputnamed.jsp”
<%@ page isELIgnored="false" %>
<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="f" %>
<f:loadBundle basename="messages" var="message"/>

<head><title>enter your name page</title></head>

<h1><hutputText value="#{message.inputname_header}"/></h1>
<hutputText value="#{message.prompt}"/>
<h:inputText value="#{StoreNameBean.personName}" />
<h:commandButton action="result" value="#{message.button_text}" />

When I run this application then I am getting this output ----


please tell me what is the mistake.
Thanks in advanced.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16588

Technically, a JSF "jsp" is NOT a JSP. JSPs are written in HTML and JSP tag extensions to HTML. They are compiled to produce servlets, which are then executed when the appropriate URL request is made by a client.

JSF "jsp's" are actually templates written in JSF View Definition Language, which is an XML format. They do NOT create servlets. Instead, the FacesServlet compiles the template into a UIComponent tree and acts as a Controller to interact with that tree.

In fact, use of the ".jsp" extension isn't even the recommended practice any more. As of JSF2, the spec includes Facelets, and the recommended extension for a Facelets resource is not ".jsp", it's ".xhtml".

However, the real reason that your EL property references fail to expand is almost certainly because you aren't routing the incoming URL through the FacesServlet. So the appserver is attempting to execute the jsp file as a JSP rather than as JSF.

Customer surveys are for companies who didn't pay proper attention to begin with.
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 127
So would you please tell me how to do that , I provide the structure I have made --

Application Name : Testjsf [ contains pages and WEB-INF folder and index.jsp(contains <jsp:forward page="/pages/inputname.jsf" />) ]
with in pages 2 jsp file present inputname.jsp and result.jsp
with in WEB-INF classes and lib folder is present and web.xml and faces-config.xml is present






<!-- Faces Servlet -->
<servlet-name>Faces Servlet</servlet-name>
<load-on-startup> 1 </load-on-startup>

<!-- Faces Servlet Mapping -->
<servlet-name>Faces Servlet</servlet-name>



in classes folder PersonBean.class and is present

Thanks >
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16588

Well, for one thing, a view ID is a relative URL, not a resource (file) path. Therefore, you don't code

you code

I'm also skeptical about your JSP forward definition, since it would only work if you deployed your webapp under the root context, but a lot of people do, so I won't say that that's a problem.
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 127
I change the code as you said , I wrote ---


but it still show same output .
please provide any suggestion , I am new in jsf and I tiik that code from roseindia site

Thanks again.
chandu ravalpu

Joined: Jan 11, 2012
Posts: 7

once check you used correct managed bean name to insert that value

and also the managed bean class is in any package then write complete name of that package in <managed-bean-class>tag

and in navigation rule put .jsp as extention
Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 127
Hi my bean class is ---

public class PersonBean {

String personName;

public String getPersonName() {
return personName;

public void setPersonName(String name) {
personName = name;

I did not put it in any package , I directly put it in myapp\WEB-INF\classes folder
And i change .jsf ext. in .jsp but it givving same output

I put .jars[commons-beanutils.jar,commons-collections.jar,commons-digester.jar,commons-logging.jar,jsf-impl.jar,jsf-api.jar] in myapp\WEB-INF\lib

I am using tomcat 6 and java 1.5

please help me to find out my mistake .
Thanks again
I agree. Here's the link:
subject: JSF property file's value is not executing