• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

JSF newbie question

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic