wood burning stoves 2.0*
The moose likes JSF and the fly likes ServeletException, PropertyNnotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "ServeletException, PropertyNnotFoundException" Watch "ServeletException, PropertyNnotFoundException" New topic
Author

ServeletException, PropertyNnotFoundException

t kk
Greenhorn

Joined: May 19, 2005
Posts: 5
hi all
when I try to run my jsf application I get following error,
javax.servlet.ServletException error testing property 'msg' in bean of type null.

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

<f:loadBundle basename="bundle.Messages" var="Message"/>

<html>
<head> <title>Welcome Page</title> </head>

<body>
<f:view>
<h:form>
<h utputText value="Input Your Message" />
<h:inputText value="#{hiberBean.msg}" id="myMsg1"/>
<h:commandButton value="Save" action="#{hiberBean.saveMsg}" />
</h:form>

</f:view>
</body>

</HTML>
package messagebean;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
public class HiberBean
{
private String msg;

public void setMsg(String msg)
{
this.msg = msg;
}

public String getMsg()
{
return this.msg;
}

public String saveMsg()
{
setMsg(msg);
System.out.println(getMsg());

return "finish";

}
}

here are my jsf and beans , bean entry is made in faces-config.xml
Please advise
Marius Cloete
Greenhorn

Joined: Apr 14, 2005
Posts: 10
hi hope this works

In your bean initialize var "msg" to private String msg = "";


If the compiler ain't happy then no body is....<br /> <br />SCJP 1.4
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
See my reply here.


- Varun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServeletException, PropertyNnotFoundException