• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:useBean can't find class `common.sendMail'

 
bat ken
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends...

I cant call my class file.pls help.

500 Servlet Exception
/mrs/authorise/mr_newreq.jsp:76: jsp:useBean can't find class `common.sendMail'

JSP
----
<%@ page import = "java.sql.*,java.util.*,java.text.SimpleDateFormat,java.lang.String,java.text.*,
java.io.*,
javax.mail.*,
javax.mail.internet.*,
javax.activation.*
"%>
<% //@ page errorPage = "../error_page/timeout.jsp"
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<% String fromPageP = "authorise"; %>
<%! ResultSet rset3 = null;
String exceed = "", remarksExceed = "", suppliername, lano, remarksFromDfdflw = "",cmp_no, cmp_name, dept_cde, dept_name, shp_desc, reqname, seq_num, requestedby, rec_status,
auth_empid, authempid, s_no, tracknum, umdesc, shipto_desc, trackNumberForCurrent1 = "", trackNumberForCurrent = "", mr1_cde1_desc="", mrh_req_typ="", totalRej="";
int seq = 0, new_seq,z = 0, rCnt=0; String accumulated = "";
double finalbudget = 0,tempIps =0,dbAccum = 0,budget = 0;
String project="";// Additional condtion ... added on 7/06/05
%>
<%
//check whether the password still keep in session object
HttpSession ses = request.getSession(true);

//if password removed
if (ses.getValue("password") == null) {
//go back to mr_emplogin.jsp
response.sendRedirect ("../mr_emplogin.jsp");
}
//if password is kept, execute the page
else {
%>

<META HTTP-EQUIV="refresh">

<% String[] arrayTrackEmp;
String[] arrayDAEI;
String usr = (String)session.getAttribute("name");
String passwd = (String)session.getAttribute("password");
String serv = (String)session.getAttribute("server");
String oline = (String)session.getAttribute("online");
String employeeId = (String)session.getAttribute("empId");
String docType = request.getParameter("cdeType");
%>

<jsp:useBean id = "db" class="bgoc.dbConn.Conn" scope="request" />
<% Connection conn = db.getConnection(); %>

<jsp:useBean id = "passend" class="common.sendMail" scope="request"/>

.....................and so on

****************************************************************************

**I did put my sendMail.class to C:\resin-2.1.6\doc\WEB-INF\classes\common
AND C:\resin-2.1.6\doc\classes\common

**I did set "package common;" in my sendMail.class

I cant find any mistake in my JSP, please help...
Thank You.

regards,
tan
[ February 21, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, you said you put the class file in two places. This tells me that you don't really have a good handle on how your app is structured. Are you sure that the WEB-INF/classes folder hierarchy in which you are placing your class file is the one for your application?

Also, with regard to



I am sure that this is not what you want to do. Do you really want rset3 to be shared across all simultaneous instances of the JSP?

Your best bet is to factor all that Java code out of the JSP and into servlets or beans.
[ February 21, 2006: Message edited by: Bear Bibeault ]
 
bat ken
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Bear Bibeault,

thanks for your reply.

Actually I am not so sure about the <%!ResultSet rset3=null; because it is done by my colleague and I am doing enhancement by adding the mail application.

but friend...it is nothing to do with using my bean file right...the problem is the JSP can find the sendMail class...sigh...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sendMail.class


You did name your class with a lowercase letter ?
I just want to make sure you don't actually have SendMail.class.

And as Bear said, you should not have the class file in two locations.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bat ken:
Actually I am not so sure about the <%!ResultSet rset3=null; because it is done by my colleague


Tell your colleague that the JSP is not thread-safe! It's heading for big trouble.
 
bat ken
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Satou kurinosuke,

I already remove 1 one of the class and rename all my class with capital letter. but still having the same problem.

regards,
tan
 
bat ken
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Bear Bibeault,

my colleague is changing his code.thanks man...

regards,
tan
 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry ah you code will totally terminate whole program
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!