java.lang.InstantiationException("bean newTeam not found within scope")
What causes this error? I have looked in the java code generated by my jsp page and found this
com.football.Team newTeam = null;
synchronized (request) {
newTeam = (com.football.Team) _jspx_page_context.getAttribute("newTeam", PageContext.REQUEST_SCOPE);
if (newTeam == null){
throw new java.lang.InstantiationException("bean newTeam not found within scope");
The value of my bean is null,how do i solve this?
Any ideas? I am new to JSP
[486 byte] By [
Styx218a] at [2007-11-27 1:40:36]

# 1
Most probably caused by your jsp:useBean tag.
I am guessing you have
<jsp:useBean id="newTeam" type="com.football.Team" scope="request"/>
Try:
<jsp:useBean id="newTeam" class="com.football.Team" scope="request"/>
There is a difference between "type" and "class"
Class will create the bean if it is not already present. Type will throw an exception.
Is the newTeam bean attribute meant to be already present?
# 3
Ok, its a different error message at least.
Check the following on your bean com.football.Team
1 - It has a public constructor that takes no parameters
2 - The class implements java.io.Serializable
3 - The class is compiled properly, and is in the correct place (presumably the file /WEB-INF/classes/com/football/Team.class)
Try restarting your server to see if that makes a difference.