Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » newbie,
newbie, [message #671445] Tue, 17 May 2011 19:17 Go to next message
Kamal  is currently offline Kamal
Messages: 2
Registered: September 2010
Junior Member
Hi,
I am new here please bear with me if I am asking this kind of question.

I created a project in eclipse, I went to :
Java resources, right click, created a package demo, then right-click and created a java class :

package demo;
public class user {
private String name="";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

But when I went to faces-config.xml and added :

<managed-bean-class>demo.user</managed-bean-class> ERROR

it does not see the class user from this file.

can you please help me .
thanks
Kamal

Re: newbie, [message #671463 is a reply to message #671445] Tue, 17 May 2011 21:47 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3146
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 2011.05.17 17:17, Kamal wrote:
> Hi,
> I am new here please bear with me if I am asking this kind
> of question.
>
> I created a project in eclipse, I went to :
> Java resources, right click, created a package demo, then
> right-click and created a java class :
>
> package demo;
> public class user {
> private String name="";
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> }
>
> But when I went to faces-config.xml and added :
>
> <managed-bean-class>demo.user</managed-bean-class> ERROR
>
> it does not see the class user from this file.
>
> can you please help me .
> thanks
> Kamal

It's a Java standard to name classes in upper case. I'm not certain this
is causing your problem, however, if you're going to work with anyone in
the Java community, you should strongly consider adopting the practices
of the community anyway (whether or not this is your problem). There
might be something in the JSF wiring in WTP that expects this; I don't
know for sure.

Your faces-config.xml should appear thus:

<managed-bean>
<managed-bean-name> User </managed-bean-name>
<managed-bean-class> demo.User</managed-bean-class>
<managed-bean-scope> session </managed-bean-scope>
</managed-bean>


If you'd like a nice, guided tour through a JSF example in Eclipse, I
suggest http://www.javahotchocolate.com/tutorials/wtp-jsf.html.
Previous Topic:Conflicting dependencies with Liferay IDE
Next Topic:Accessing Bean Functions and Names from xhtml page
Goto Forum:
  


Current Time: Wed Aug 20 20:27:45 EDT 2014

Powered by FUDForum. Page generated in 0.01929 seconds