• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ServeletException, PropertyNnotFoundException

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi hope this works

In your bean initialize var "msg" to private String msg = "";
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See my reply here.
 
The only thing that kept the leeches off of me was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic