Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF newbie question  RSS feed

 
Padma Priya
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to Jsf and just started with a helloworld application

i am using tomcat.

I have a bean UserBean


package com.corejsf;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
// or import javax.inject.Named;
import javax.faces.bean.SessionScoped;
// or import javax.enterprise.context.SessionScoped;

@ManagedBean(name="user") // or @Named("user")
@SessionScoped
public class UserBean implements Serializable {
private String name;
private String password;

public String getName() { return name; }
public void setName(String newValue) { name = newValue; }

public String getPassword() { return password; }
public void setPassword(String newValue) { password = newValue; }
}


When i compile this class i get the following error

cannot find the package javax.faces.bean.

I have downloaded the latest version(2.0.3 binary bundle) of Jsf implementation from Mojjaro project (https://javaserverfaces.dev.java.net/download.html) and included jsf-api.jar and jsf-impl.jar in tomcat/lib.

Could anyone tell me what mistake i am doing

Thanks
With Regards
Deepthi
 
Jagadeeswara Yaramala
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The package javax.faces.bean and its classes are in jsf-api.jar.

You can try putting these jar files (jsf-api.jar and jsf-impl.jar) in your project classpath (\WEB-INF\lib) and then deploy the project on the web server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!