File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JAVA BEANS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JAVA BEANS" Watch "JAVA BEANS" New topic


Sanjay Deshpande
Ranch Hand

Joined: May 22, 2001
Posts: 111

Joined: Jan 04, 2002
Posts: 5
Store it in Classes directroy
Pranit Saha
Ranch Hand

Joined: Sep 09, 2001
Posts: 130
Place beans in TOMCAT-HOME\webapps\examples\WEEB-INF\classes
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
As a testament to the search capabilities of the forums, I was having severe problems trying to figure out why my jsp page kept coming up with errors when I introduced beans (first time doing a jsp/bean tutorial). Found this, and works like a charm.
Thanks for the question and the answer, previous problem solvers
Ash sav
Ranch Hand

Joined: Apr 14, 2001
Posts: 55
Hi all,
I created a bean compile it on c:\java directory and then I placed my java file and class file in
TOMCAT-HOME\webapps\examples\WEB-INF\classes When I tried to acces my form and hit the submit button I got Internal server error as follows.
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /SaveName.jsp

Joined: Feb 28, 2002
Posts: 9
I wrote a java bean and tried to call it from a jsp page.i placed the class and file in
when i submit the jsp page, it displays an internal server error.
org.apache.jasper.jasperException:unable to compile the class for JSP
waiting for response.....

Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
More than likely you are defining your useBean JSP tag incorrectly. Try defining it like this...
<!-- declares bean. retrieves from session and is referenced by "bryce" -->
<jsp:useBean id="referenceName" scope="session" class="class.where.bean.located" />
<%= reference.getXXX() %>
Hope this helps,

Java: The power, elegance, and simplicity of a hand grenade
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
beans has to be packaged, if u don't container might treat it as a part of its own package and u get errors; so have package declarations in your beans classes: ie
package com.etc;
then compile it to /WEB-INF/classes/com/etc
hope this would solve the problem.
[ February 28, 2002: Message edited by: ersin eser ]
Tualha Khan
Ranch Hand

Joined: Nov 22, 2000
Posts: 287
Dear Ersin,
Is this applicable to other commercial containers as well or not. I am also not able to provide my jsp page with the java bean.
Thanks & Bye,
Tualha Khan

SCJP2, BEA WLS 6.0, DB2 UDB 7.1
I agree. Here's the link:
subject: JAVA BEANS
It's not a secret anymore!