• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JSF does NOT error!?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Wondering if somebody can shed some light on the following behaviour:

In my xhtml page, if the value attribute of a component attempts to reference a bean name that has not been declared as a managed bean in faces-config, JSF does not error when rendering the page.

For example, if I have the following component: <h:inputText id="id" value="#{BeanThatDoesntExist.someMethod}" />

JSF happily carries on without telling me that i've done something stupid. This can be very frustrating when trying to track down bugs.

On the other hand, if the bean HAS been declared as a managed bean in faces-config but I attempt to call a method that doesn't exist on that bean, JSF will rightly tell me that i'm being stupid.

So my qusetion is this: why does JSF let you attempt to reference a bean that doesn't exist but not a method?
 
Saloon Keeper
Posts: 28807
212
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I think that you do get an error message in the server log. But JSF operates in terms of postback operations, so whenever no explicit navigation instructions are given, JSF simply redisplays the page.
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic