Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JAVA BEANS

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHERE TO STORE JAVA BEANS IN TOMCAT 4 .0
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store it in Classes directroy
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Place beans in TOMCAT-HOME\webapps\examples\WEEB-INF\classes
Pranit..
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /SaveName.jsp
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wrote a java bean and tried to call it from a jsp page.i placed the class and file in
tomcat\webapps\examples\WEB_INF\classes\
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.....
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
Ryan
 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic