I am new to Jsf and just creating a helloworld example
But I am getting null values in my backing bean can you guys help me out
Here is my backing bean
package practice.backingbeans;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class Helloworld implements Serializable {
private String firstname;
private String lastname;
public Helloworld()
{
}
public String getFirstname() {
System.out.println(firstname+"****************************");
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
}
And Here is my xhtml
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Hello world</title>
</h:head>
<h:body>
<h:form>
FirstName:<h:inputText id="fname" value="#{helloworld.firstname}" /><br></br><br></br>
LastName:<h:inputText id="lname" value="#{helloworld.lastname}" /><br></br><br></br>
<h:commandButton value="Submit" action="success" />
</h:form>
</h:body>
</html>
previously when i am getting viewrestored exception I have added these few lines in my web.xml and my exception got resolved but i am facing error:mac did not verify in my console
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
can you guys help me out????