my dog learned polymorphism*
The moose likes JSP and the fly likes help bean! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "help bean!" Watch "help bean!" New topic
Author

help bean!

Sandmax Fu
Greenhorn

Joined: Dec 17, 2002
Posts: 5
org.apache.jasper.JasperException: Unable to compile class for JSPE:\TOMCAT\work\localhost_8080\_0002fcounter_0002ejspcounter_jsp_0.java:61: Class cou.counter not found. cou.counter cc = null;
为什么老是找不到我的BEAN呢
Why don't I find my bean?
My bean file in:
TOMCAT\webapps\ROOT\cou
My jsp file in :
TOMCAT\webapps\ROOT


[img]http://www.windstudio.net/bbs/icons/0017.gif[/img]
SudhaPrakash Madanambedu
Greenhorn

Joined: Aug 06, 2002
Posts: 2
Put your bean in TOMCAT\webapps\ROOT\web-inf\classes\cou dir.
This will solve your problem.


Sudha
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"sandmax sandmax",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
Annina WG
Greenhorn

Joined: Dec 12, 2002
Posts: 19
same question here!
I put my Bean under TOMCAT\webapps\ROOT\web-inf\classes\MyPackage dir
and my jsp under TOMCAT\webapps\ROOT\
there is no error message , but no result either.

in my servlet I add my Bean to the ServletContext,using:
records = new Records();
...
getServletContext().setAttribute("records",records);
and in my JSP I access bean using:
<jsp:useBean id="records" class="MyPackage.Records" scope="application" />
</jsp:useBean>
<%
System.out.println("here Show the records");
Vector v = records.getRecords();
int p = 0;
while(p < v.size()){
out.println(v.elementAt(p));
System.out.println(v.elementAt(p).toString());
p++;
}
%>
Servlet is in the same package as Beans'. I made no modification with any file to configure Tomcat.
Why I get no result?Could anybody tell what is going wrong?
 
Don't get me started about those stupid light bulbs.
 
subject: help bean!
 
Similar Threads
JSP BEAN Question
where do i put the bean?
where i need to place my java bean file in the tomcat
Bean Classes
JSP can't find bean classes