Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help bean!

 
Sandmax Fu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
SudhaPrakash Madanambedu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your bean in TOMCAT\webapps\ROOT\web-inf\classes\cou dir.
This will solve your problem.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic