• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP Throwing Exception in the jsp:useBean Tag

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I am trying to auto populate a bean and retrieve the values from it using the jsp:useBean tags ect..

My code looks like this..



The error my Apache Tomcat is throwing

org.apache.jasper.JasperException: An exception occurred processing JSP page /sign_on_server_pages/confirm_info.jsp at line 91

88:
89:
90: %>
91: <jsp:useBean id="acct" type="beans.Creating_Account" scope="application"></jsp:useBean>
92: <!-- -->
93: <h5 class="param_names"> <%=param_names[0] %></h5><h5 style=" color: ${ color_border_links[0] } ;" class=""> ${ request.getParameter("firstName") }</h5>
94:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

root cause

javax.servlet.ServletException: java.lang.InstantiationException: bean acct not found within scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
org.apache.jsp.sign_005fon_005fserver_005fpages.confirm_005finfo_jsp._jspService(confirm_005finfo_jsp.java:217)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


Any ideas on what I may be doing wrong... I have tried sever different values for the scope attribute and all of them say the same thing about 'not found in scope'
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, have you created a scoped attributed named acct in the desired scope? If not, then that's exactly what the the exception is telling you.

The form of useBean you are using requires that the scoped variable already exist.

(And, of course, the usually question: why are you using 12-year-old obsolete technology? scriptlets are long dead.)
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic