Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » newbie,
newbie, [message #671445] Tue, 17 May 2011 23:17 Go to next message
Kamal  is currently offline Kamal Friend
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] Wed, 18 May 2011 01:47 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
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:"Finish"-Button not responding
Goto Forum:
  


Current Time: Fri Apr 19 21:41:55 GMT 2024

Powered by FUDForum. Page generated in 0.03181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top