File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF" Watch "JSF" New topic


kamiya sei

Joined: Dec 12, 2012
Posts: 25
I have a project called MyJSF, when deploy user will fill their information but appear an error , I don't know how to slove this problem, help me repair them

/User.xhtml @20,81 value="#{userBean.getUser}": Property 'getUser' not found on type ManagedBean.UserBean

here are code of JSF Managed Bean

package ManagedBean;

public class UserBean {

User curUser = new User();

public String getUser() {
if ("") ||"") || == 0 || curUser.age == 0) {

return "/Error.xhtml";
} else {
return "/success.xhtml";

and class include getter and setter

package ManagedBean;

public class User {

String name;
String city;
int phone;
int age;

public User() {

public User(String name, String city, int phone, int age) { = name; = city; = phone;
this.age = age;

public int getAge() {
return age;

public void setAge(int age) {
this.age = age;

public String getCity() {
return city;

public void setCity(String city) { = city;

public String getName() {
return name;

public void setName(String name) { = name;

public int getPhone() {
return phone;

public void setPhone(int phone) { = phone;
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Try #{userBean.user}

[] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957

Hebert Coelho wrote:Try #{userBean.user}

The "get" part is not merely redundant/incorrect, it's potentially harmful. When you make an EL reference to a bean property on an input control, the "get" method brings the value out for display, but it's the set method that takes the user's input and posts it into the backing bean.

In fact, that's what distinguishes the "$" notation from the "#" notation. The older "$" expressions were read-only.

Customer surveys are for companies who didn't pay proper attention to begin with.
kamiya sei

Joined: Dec 12, 2012
Posts: 25
thanks all .

I agree. Here's the link:
subject: JSF
Similar Threads
Use of @Before and @After annotation with example..
cannot find symbol
select in hibernate
Unable to Access mysql database through JNDI.
detached entity passed to persist