|
Re: newbie, [message #671463 is a reply to message #671445] |
Wed, 18 May 2011 01:47 |
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03684 seconds