<%
String action=request.getParameter("action");
if(action==null) action="";
out.print(action);
content deal=new content();
String jdid=request.getParameter("jdid");
int i=0;
if(action.equals("add")){
i=.insertCsej(content);
if(i>0) out.println("<script>alert('新增成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('新增失败!');window.history().go(-1);</script>");
}%>
报错:HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 115 in the jsp file: /appraisal/AppraisalData.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\Tbr\org\apache\jsp\appraisal\AppraisalData_jsp.java:175: cannot resolve symbol
symbol : class Content
location: class org.apache.jsp.appraisal.AppraisalData_jsp
Content deal=new Content();
^
An error occurred at line: 115 in the jsp file: /appraisal/AppraisalData.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\Tbr\org\apache\jsp\appraisal\AppraisalData_jsp.java:175: cannot resolve symbol
symbol : class Content
location: class org.apache.jsp.appraisal.AppraisalData_jsp
Content deal=new Content();
^
2 errors org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.30
有谁能告诉我哪里写错了,谢谢!
String action=request.getParameter("action");
if(action==null) action="";
out.print(action);
content deal=new content();
String jdid=request.getParameter("jdid");
int i=0;
if(action.equals("add")){
i=.insertCsej(content);
if(i>0) out.println("<script>alert('新增成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('新增失败!');window.history().go(-1);</script>");
}%>
报错:HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 115 in the jsp file: /appraisal/AppraisalData.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\Tbr\org\apache\jsp\appraisal\AppraisalData_jsp.java:175: cannot resolve symbol
symbol : class Content
location: class org.apache.jsp.appraisal.AppraisalData_jsp
Content deal=new Content();
^
An error occurred at line: 115 in the jsp file: /appraisal/AppraisalData.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\Tbr\org\apache\jsp\appraisal\AppraisalData_jsp.java:175: cannot resolve symbol
symbol : class Content
location: class org.apache.jsp.appraisal.AppraisalData_jsp
Content deal=new Content();
^
2 errors org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.30
有谁能告诉我哪里写错了,谢谢!
Generated servlet error: C:\Tomcat 5.0\work\Catalina\localhost\Tbr\org\apache\jsp\appraisal\AppraisalData_jsp.java:175: cannot resolve symbol
symbol : class Content
这两地方错了
嗯,可是我找不到错误content deal=new content();
这个应该没写错吧!
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;import org.spring.jdbc.core.DateAccessException;
import org.spring.jdbc.core.JdbcTemplate;
import org.spring.jdbc.core.PreparedStatementSetter;
import org.spring.jdbc.core.ResultSetter;
import org.spring.jdbc.datasource.DatasourceTransactionManager;import com.web.dao.AppraisalDao;
import com.web.defince.Condition;
import com.web.defince.Csej;
import com.web.defince.content;
import com.web.pub.ConfigUtils;
import com.web.pub.PageControl;public class Contman implements AppraisalDao{
public int deleteCsej(content jdid) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} public int deleteCsej(String id) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} public int getCsejInt(Condition where) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} public List getCsejList(Condition where, PageControl pc) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public List getCsejList(Condition where) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public List getCsejResult(String userid, String jdid) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public int getDealWithInt(Condition where) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} public List getDealWithList(Condition where) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public Csej getOneCsej(String id) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public String getUserName(String userid) throws DateAccessException {
// TODO 自动生成方法存根
return null;
} public int insertCsej(Csej csej) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} public int updateCsej(Csej csej) throws DateAccessException {
// TODO 自动生成方法存根
return 0;
} private static JdbcTemplate jdbcFactory(){
return new JdbcTemplate(DatasourceTransactionManager.Create());
}
private content initialize(content content) {
// TODO 自动生成方法存根
return null;
}
public int insertcontent( content Content) throws DateAccessException {
// TODO 自动生成方法存根
final content Content1=initialize(Content);
int i=jdbcFactory().update("INSERT INTO content (jdid, ejbac1, ejnum1, ejmod1, ejkhmc, Submit5, ejkhjc, ejcype, ejptn1, ejptn2, ejptn3, ejbac2, ejnum2, ejdat2, ejmod2, ejdat3, ejbeizhu" +
" VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?)",new PreparedStatementSetter(){ public void setValues(PreparedStatement ps) throws SQLException {
// TODO 自动生成方法存根
ps.setString(1,Content1.getJdid().toUpperCase());
ps.setString(2,ConfigUtils.getByte(Content1.getEjbac1()));
ps.setString(3,ConfigUtils.getByte(Content1.getEjnum1()));
ps.setString(4,ConfigUtils.getByte(Content1.getEjmod1()));
ps.setString(5,ConfigUtils.getByte(Content1.getEjkhmc()));
ps.setString(6,ConfigUtils.getByte(Content1.getSubmit5()));
ps.setString(7,ConfigUtils.getByte(Content1.getEjkhjc()));
ps.setString(8,ConfigUtils.getByte(Content1.getEjcype()));
ps.setString(9,ConfigUtils.getByte(Content1.getEjptn1()));
ps.setString(10,ConfigUtils.getByte(Content1.getEjptn2()));
ps.setString(11,ConfigUtils.getByte(Content1.getEjptn3()));
ps.setString(12,ConfigUtils.getByte(Content1.getEjbac2()));
ps.setString(13,ConfigUtils.getByte(Content1.getEjnum2()));
ps.setString(14,ConfigUtils.getByte(Content1.getEjdat2()));
ps.setString(15,ConfigUtils.getByte(Content1.getEjmod2()));
ps.setString(15,ConfigUtils.getByte(Content1.getEjdat3()));
ps.setString(41,ConfigUtils.getBytes(Content1.getEjbeizhu())); }
});
return i;
}
public List getlist(String par1,String par2) throws DateAccessException
{
final List data=new ArrayList();
String sql="SELECT * FROM content ";
jdbcFactory().qusery("SELECT * FROM content ",new ResultSetter(){ public void processRow(ResultSet rs) throws SQLException {
// TODO 自动生成方法存根
while(rs.next()){
content list_ok=new content();
list_ok.setJdid(rs.getString("jdid"));
list_ok.setEjbac1(rs.getString("ejbac1"));
list_ok.setEjnum1(rs.getString("ejnum1"));
list_ok.setEjmod1(rs.getString("ejmod1"));
list_ok.setEjkhmc(rs.getString("ejkhmc"));
list_ok.setEjkhjc(rs.getString("ejkhjc"));
list_ok.setEjcype(rs.getString("ejcype"));
list_ok.setEjptn1(rs.getString("ejptn1"));
list_ok.setEjptn2(rs.getString("ejptn2"));
list_ok.setEjptn3(rs.getString("ejptn3"));
list_ok.setEjbac2(rs.getString("ejbac2"));
list_ok.setEjnum2(rs.getString("ejnum2"));
list_ok.setEjdat2(rs.getString("ejdat2"));
list_ok.setEjmod2(rs.getString("ejmod2"));
list_ok.setEjdat3(rs.getString("ejdat3"));
list_ok.setEjbeizhu(ConfigUtils.getByte(rs.getObject("ejbeizhu").toString()));
data.add(list_ok);
}
}
});
return data;
}
protected Object clone() throws CloneNotSupportedException {
// TODO 自动生成方法存根
return super.clone();
} public boolean equals(Object obj) {
// TODO 自动生成方法存根
return super.equals(obj);
} protected void finalize() throws Throwable {
// TODO 自动生成方法存根
super.finalize();
} public int hashCode() {
// TODO 自动生成方法存根
return super.hashCode();
} public String toString() {
// TODO 自动生成方法存根
return super.toString();
} public int insertCsej(content obj) throws DateAccessException {
// TODO 自动生成方法存根
String sql="INSERT INTO content (id,jdid, ejbac1, ejnum1, ejmod1, ejkhmc, Submit5, ejkhjc, ejcype, ejptn1, ejptn2, ejptn3, ejbac2, ejnum2, ejdat2, ejmod2, ejdat3, ejbeizhu) "+
" VALUES ('"+obj.getid()+"','"+obj.getJdid()+"','"+obj.getEjbac1()+"','"+obj.getEjnum1()+"','"+obj.getEjmod1()+"','"+obj.getEjkhmc()+"','"+obj.getSubmit5()+"','"+obj.getEjkhjc()+"','"+obj.getEjcype()+"','"+obj.getEjptn1()+"','"+obj.getEjptn2()+"','"+obj.getEjptn3()+"','"+obj.getEjbac2()+"','"+obj.getEjnum2()+"','"+obj.getEjdat2()+"','"+obj.getEjmod2()+"','"+obj.getEjdat3()+"','"+obj.getEjbeizhu()+"')";
int i=jdbcFactory().update(sql);
return i;
} public int updateCsej(content obj) throws DateAccessException {
// TODO 自动生成方法存根
String sql="UPDATE content (id,jdid, ejbac1, ejnum1, ejmod1, ejkhmc, Submit5, ejkhjc, ejcype, ejptn1, ejptn2, ejptn3, ejbac2, ejnum2, ejdat2, ejmod2, ejdat3, ejbeizhu) "+
" VALUES ('"+obj.getid()+"','"+obj.getJdid()+"','"+obj.getEjbac1()+"','"+obj.getEjnum1()+"','"+obj.getEjmod1()+"','"+obj.getEjkhmc()+"','"+obj.getSubmit5()+"','"+obj.getEjkhjc()+"','"+obj.getEjcype()+"','"+obj.getEjptn1()+"','"+obj.getEjptn2()+"','"+obj.getEjptn3()+"','"+obj.getEjbac2()+"','"+obj.getEjnum2()+"','"+obj.getEjdat2()+"','"+obj.getEjmod2()+"','"+obj.getEjdat3()+"','"+obj.getEjbeizhu()+"')";
int i=jdbcFactory().update(sql);
return i;
}
}
<%@page import="java.util.*,org.spring.dao.factory.DaoFactory"%>
<%@page import="com.web.dao.*"%>
<%@page import="com.web.deal.*"%>
<%@page import="com.web.manager.*"%>
<%@page import="com.web.defince.*,org.spring.jdbc.core.DateAccessException" %>
<jsp:useBean id="content" scope="page" class="com.web.defince.content" />
<jsp:setProperty name="content" property="*" />
<%
String action=request.getParameter("action");
if(action==null) action="";
out.print(action);
content deal=new content();
String jdid=request.getParameter("jdid");
int i=0;
if(action.equals("add")){
i=.insertCsej(content);
if(i>0) out.println("<script>alert('新增成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('新增失败!');window.history().go(-1);</script>");
}
/*
else if(action.eqdealuals("update")){
i=deal.updateCsej(content);
if(i>0) out.println("<script>alert('修改成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('修改失败!');window.history().go(-1);</script>");
}else if(action.equals("del")){
i=deal.deleteCsej(id);
if(i>0) out.println("<script>alert('删除成功!');window.location='AppraisalData.jsp';</script>");
else out.println("<script>alert('删除失败!');window.location='AppraisalData.jsp';</script>");
}/*else if(action.equals("del")){
dao_1.deleteCsej(jdid);
}*/
己经导入content包了
<%@page import="java.util.*,org.spring.dao.factory.DaoFactory"%>
<%@page import="com.web.dao.*"%>
<%@page import="com.web.deal.*"%>
<%@page import="com.web.manager.*"%>
<%@page import="com.web.defince.*,org.spring.jdbc.core.DateAccessException" %>
<jsp:useBean id="content" scope="page" class="com.web.defince.content" />
<jsp:setProperty name="content" property="*" />
<%
String action=request.getParameter("action");
if(action==null) action="";
out.print(action);
content deal=new content();
String jdid=request.getParameter("jdid");
int i=0;
if(action.equals("add")){
i=.insertCsej(content);
if(i>0) out.println("<script>alert('新增成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('新增失败!');window.history().go(-1);</script>");
}
/*
else if(action.eqdealuals("update")){
i=deal.updateCsej(content);
if(i>0) out.println("<script>alert('修改成功!');window.location='AddAppraisal.jsp';</script>");
else out.println("<script>alert('修改失败!');window.history().go(-1);</script>");
}else if(action.equals("del")){
i=deal.deleteCsej(id);
if(i>0) out.println("<script>alert('删除成功!');window.location='AppraisalData.jsp';</script>");
else out.println("<script>alert('删除失败!');window.location='AppraisalData.jsp';</script>");
}/*else if(action.equals("del")){
dao_1.deleteCsej(jdid);
}*/
己经导入content包了