Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JSF

 
imran mansuri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to JSF. I am trying to execute the program given in Roseindia site. However, the browser does not seems to recognize #{.....} and displays as it is written in JSP.

Please help.

 
Manu dv
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give a link to the page where I can see the program you are trying out ?


 
imran mansuri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not on live url. It is in internal url.

The problem is when i write following code :

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>


<html>
<head>
<title>enter your name page</title>
</head>
<body>
<f:view>
<h1>
<hutputText value="JSF 1.2 Tutorial"/>
</h1>
<h:form id="UserEntryForm">
<hutputText value="Enter Your Name:"/>
<h:inputText value="#{UserBean.userName}"></h:inputText>
<h:commandButton action="welcome" value="OK" />
</h:form>
</f:view>
</body>
</html>

It prints following:

JSF 1.2 Tutorial
Enter Your Name:#{UserBean.userName} OK

in browser.

where blue colored text is in text bxo and orange colored text is button.
 
Manu dv
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may be it's a dumb reply, but is it the (a) preview pane you are talking about or (b) the actual app deployed on the web server and viewed through browser.
If it (a) then don't worry about it it will be ok when you actually deploy it.

if it's (b) then you must have felt like after reading the above two line.
In that case I don't have any concrete suggestions coz this never happened to me before. However you could check if your project path includes the jsf implementation jars and that the 'UserBean' has proper entry in <managed-bean> section.
 
Pardha Reddy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you just run the first example of RoseIndia.

Make sure you write a java file with name UserBean and a property with getter /setter methods named userName in that. Define this java file in faces-config with <managed-bean> and <managed-property> attributes.

If you go through further in the same site, they might have provided all these bean and config info.

Thanks
Pardha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic