Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Managed bean

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello folks

I have this JavaBean :


and this jsp page:



and this is my faces-config.xml




I have this exception while trying to access my Javabean with that JSP :




Can you helop please?
 
Saloon Keeper
Posts: 22480
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You capitalized the package name ("Controller") in your faces-config file. Java is case-sensitive and package names should never contain upper-case letters.

Incidentally, a backing bean is not a Controller. Although it can contain some controller functions, it's primarily a Model. Most of the Controller logic in JSF is in the FacesServlet and the Tag implementations. Action Processors aren't controllers in the strict sense of the word. They're more of a business logic function with ties to the dispatcher.
 
Malika Ben Aziz
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:You capitalized the package name ("Controller") in your faces-config file. Java is case-sensitive and package names should never contain upper-case letters.

Incidentally, a backing bean is not a Controller. Although it can contain some controller functions, it's primarily a Model. Most of the Controller logic in JSF is in the FacesServlet and the Tag implementations. Action Processors aren't controllers in the strict sense of the word. They're more of a business logic function with ties to the dispatcher.



Thank you Tim, it was the the package!
Yes I agree, i shouldn't have put my beans in a package named controller.
 
Tim Holloway
Saloon Keeper
Posts: 22480
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Malika Ben Aziz wrote:
Yes I agree, i shouldn't have put my beans in a package named controller.



The reason I mentioned it is that you're not the only one I've seen doing that. I just wanted to get the word out before a lot of people get themselves all confused.

Or more confused, anyway...
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic