Skip to main content

JSF backing bean reference

3 replies [Last post]
essingh
Offline
Joined: 2006-01-03

I currently have a jsp page that contains several jsf tags within. When the tags reference static values (value="whatever") things work fine; however, when I use el to access a backing bean ( value="#{login.loginId}" ) I get the following:

javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'login' resolved to null

My faces-config.xml is straight forward:
.
.

login
com.hm.bb.LoginBB
session

The web.xml file is correct too because jsf works with static values (I assume this means the FacesServlet config in web.xml is working as it should.)

In-order to get the desired effect I have added:
near the top of my jsp page. This solves the problem.

My question:
Shouldn't the app server init the backing bean upon request of the jsp page, which would make the jsp:useBean tag unnecessary? It has been a while since I have used JSF and things may have changed with unified el spec etc..

Anyway, comments are welcome and appreciated.
Thanks.
(oh, I'm using b32)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cayhorstmann
Offline
Joined: 2003-06-13

There has been no change in this regard.

Are you running your page through the faces servlet? (If it is a straight JSP page, the JSF resolver won't be active.)

essingh
Offline
Joined: 2006-01-03

In my web.xml file I have:

javax.faces.STATE_SAVING_METHOD client


Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
*.jsf

The URL I'm using to test is: http://localhost:8080/hm/Login.jsf

And of course the page file is Login.jsp and the context path is /hm.

When I use this URL the Login.jsf is being mapped to the FacesServlet because the Login.jsp page is loaded and the content is present; minus any backing bean values of course, which is the problem. And I know the app server can find my classes too because when I use the jsp:useBean tag to load the backing bean manually, things work fine.

Thanks again for your help.

essingh
Offline
Joined: 2006-01-03

Figured it out. I should have read the spec. Now I know that the faces-config.xml now uses schema validation instead of DTD among other things etc.

I'm really looking forward to using GlassFish.

Thanks again.

sham