| Author |
jsp:useBean ClassCastException
|
Reginald Law
Greenhorn
Joined: Jan 21, 2004
Posts: 19
|
|
I have a jsp where I use jsp:useBean. I only get the exception in the JSP after I try to update the bean in the session data (in a struts action class). Should beans only be read only, set up once never to be changed ? I am getting this error on Jrun4. If I initialize the bean with some initial values things work fine. It is only after I do an update to the session data that I get the error. Now I see why sun came up with the ejb session beans. You know they work and they are reliable. Are their undocumented scope restrictions on the jsp:useBean tag ? What application servers does this work best with.
|
SCJP 1.4
|
 |
Nathaniel Stoddard
Ranch Hand
Joined: May 29, 2003
Posts: 1258
|
|
|
You're going to need to give some more info on this. Where exactly are you getting the casting exception, etc. Maybe post the code in question.
|
Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56221
|
|
|
There are no weird restrictions. You are probably just casting the bean incorrectly somehwere. As pointed out, more info would be needed for further diagnosis.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Reginald Law
Greenhorn
Joined: Jan 21, 2004
Posts: 19
|
|
|
I found the problem. I was using the wrong class indeed. The session.setAttribute does work.
|
 |
 |
|
|
subject: jsp:useBean ClassCastException
|
|
|