로컬호스트로 start.jsp 실행시키면...
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 7 in the generated java file
Only a type can be imported. com.db.DBCon resolves to a package
An error occurred at line: 8 in the generated java file
Only a type can be imported. com.util.Utility resolves to a package
An error occurred at line: 7 in the jsp file: /start.jsp
DBCon cannot be resolved to a type
4: ,com.util.Utility"
5: %>
6: <%
7: DBCon db = new DBCon();
8: Utility ut = new Utility();
9:
10: Connection con = null;
An error occurred at line: 7 in the jsp file: /start.jsp
DBCon cannot be resolved to a type
4: ,com.util.Utility"
5: %>
6: <%
7: DBCon db = new DBCon();
8: Utility ut = new Utility();
9:
10: Connection con = null;
An error occurred at line: 8 in the jsp file: /start.jsp
Utility cannot be resolved to a type
5: %>
6: <%
7: DBCon db = new DBCon();
8: Utility ut = new Utility();
9:
10: Connection con = null;
11: String s0 = null;
An error occurred at line: 8 in the jsp file: /start.jsp
Utility cannot be resolved to a type
5: %>
6: <%
7: DBCon db = new DBCon();
8: Utility ut = new Utility();
9:
10: Connection con = null;
11: String s0 = null;
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
웹페이지에 이렇게 에러나거든요...
에디트 플러스 소스는..
<%@ page contentType="text/html; charset=euc-kr"
import="java.sql.*
,com.db.DBCon
,com.util.Utility"
%>
<%
DBCon db = new DBCon();
Utility ut = new Utility();
Connection con = null;
String s0 = null;
String s1 = null;
String s2 = null;
String setURL = "jdbc:mysql://localhost/root";
String setID = "evelove";
String setPW = "0000";
//Class.forName("org.gjt.mm.mysql.Driver");
Class.forName("com.mysql.jdbc.Driver");
int colcnt = 4;
String path="최신상품";
//인기상품
s0 = " select a.goods_id "
+ " , a.gcode_id "
+ " , a.name "
+ " , a.contents "
+ " , a.price "
+ " , a.num "
+ " , a.photo "
+ " , a.reg_date "
+ " , round(a.price*a.point_rate) "
+ " , a.d_price "
+ " from goods a "
+ " where best = '1' "
+ " order by a.goods_id desc "
+ " limit 0,8 ";
//추천상품
s1 = " select a.goods_id "
+ " , a.gcode_id "
+ " , a.name "
+ " , a.contents "
+ " , a.price "
+ " , a.num "
+ " , a.photo "
+ " , a.reg_date "
+ " , round(a.price*a.point_rate) "
+ " , a.d_price "
+ " from goods a "
+ " where a.recommended = '1' "
+ " order by a.goods_id desc "
+ " limit 0,8 ";
//최신상품
s2 = " select goods_id "
+ " , a.gcode_id "
+ " , a.name "
+ " , a.contents "
+ " , a.price "
+ " , a.num "
+ " , a.photo "
+ " , a.reg_date "
+ " , round(a.price*a.point_rate) "
+ " , a.d_price "
+ " from goods a "
+ " order by goods_id desc limit 0,12 ";
//공지사항 첫번째 명칭 가져오기
String name1 = " select code1, code2, name, image2 from bcode where gubun = '1' ";
String name2 = " select code1, code2, name, image2 from bcode where gubun = '2' ";
String m1 = " select b_gubun,idx, title from board where b_gubun = ? order by idx desc limit 0,5 ";
String gongji1_name = null;
String gongji2_name = null;
String gongji1_code = null;
String gongji2_code = null;
String gongji1_go = null;
String gongji2_go = null;
String gongji1_image = null;
String gongji2_image = null;
String gongji1_content = null;
String gongji2_content = null;
String board_gubun1 = null;
String board_gubun2 = null;
try{
con = db.getCon();
PreparedStatement stmt0 = null;
stmt0 = con.prepareStatement(s0);
ResultSet rs0 = stmt0.executeQuery();
PreparedStatement stmt = con.prepareStatement(s1);
ResultSet rs = stmt.executeQuery();
PreparedStatement stmt2 = con.prepareStatement(s2);
ResultSet rs2 = stmt2.executeQuery();
//공지사항1 명칭
PreparedStatement stmt3 = con.prepareStatement(name1);
ResultSet rs3 = stmt3.executeQuery();
while(rs3.next()){
gongji1_name = rs3.getString(3);
gongji1_code = ut.replaceNull(rs3.getString(1))+ut.replaceNull(rs3.getString(2));
gongji1_image = rs3.getString(4);
}
rs3.close();
stmt3.close();
if(gongji1_code != null){
if(gongji1_code.substring(0,2).equals("01")){
gongji1_go = "/board/list.jsp?gubun="+gongji1_code;
board_gubun1="board";
}else if(gongji1_code.substring(0,2).equals("02")){
gongji1_go = "/data/list.jsp?gubun="+gongji1_code;
board_gubun1="data";
}else{
gongji1_go = "/gallery/list.jsp?gubun="+gongji1_code;
board_gubun1 = "gallery";
}
}
if(gongji1_image == null || gongji1_image.equals("")){
gongji1_content = gongji1_name;
}else{
gongji1_content = "<img src=/images/"+gongji1_image+" border=0>";
}
//공지사항2 명칭
PreparedStatement stmt4 = con.prepareStatement(name2);
ResultSet rs4 = stmt4.executeQuery();
while(rs4.next()){
gongji2_name = rs4.getString(3);
gongji2_code = ut.replaceNull(rs4.getString(1))+ut.replaceNull(rs4.getString(2));
gongji2_image= rs4.getString(4);
}
rs4.close();
stmt4.close();
if(gongji2_code != null){
if(gongji2_code.substring(0,2).equals("01")){
gongji2_go = "/board/list.jsp?gubun="+gongji2_code;
board_gubun2="board";
}else if(gongji2_code.substring(0,2).equals("02")){
gongji2_go = "/data/list.jsp?gubun="+gongji2_code;
board_gubun2="board";
}else{
gongji2_go = "/gallery/list.jsp?gubun="+gongji2_code;
board_gubun2="board";
}
}
if(gongji2_image == null || gongji2_image.equals("")){
gongji2_content = gongji2_name;
}else{
gongji2_content = "<img src=/images/"+gongji2_image+" border=0>";
}
PreparedStatement stmt5 = con.prepareStatement(m1);
stmt5.setString(1,gongji1_code);
ResultSet rs5 = stmt5.executeQuery();
PreparedStatement stmt6 = con.prepareStatement(m1);
stmt6.setString(1,gongji2_code);
ResultSet rs6 = stmt6.executeQuery();
%>
<html>
<head>
<title>D&Y 야구용품 쇼핑몰</title>
<script language="javascript">
<!--
function goContent(x,y){
document.myform.goods_id.value = x;
document.myform.gcode.value = y;
document.myform.submit();
}
function on_list_go(obj){
window.open("/board/list.jsp?gubun=0101",'_self')
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr"></head>
<body topmargin=0 leftmargin=0 onLoad="upfix();" background="/images/bg.gif">
<!-- 인클루드 top //-->
<%@include file="/top_inc.jsp"%>
<table width="824" border="0">
<tr><td colspan="2" height="5"></td></tr>
<tr>
<td width="180" valign="top">
<!--인클루드 메뉴 //-->
<%@include file="/left.jsp"%>
<!--인클루드 메뉴 끝//-->
</td>
<td width="5"> </td>
<td width="644" valign="top">
<table border="0" width="644">
<tr>
<td valign="top">
<!-- 공지사항1 //-->
<table width="300" >
<tr>
<td><img src="/images/rrr.gif"></td>
</tr>
</table>
</td>
<td valign="top">
<!-- 공지사항2 //-->
<table width="300" border="0">
<tr bgcolor="" onClick="javascript:on_list_go('<%=gongji2_go%>')">
<!--<td class="td_path" width="70%"> -->
<td><img src="/images/r1.jpg"></td>
<%if(gongji2_name == null){
out.println("");
}else{
out.println(gongji2_name);
}
%></td>
<td align="right"><a href="<%=gongji2_go%>"></td>
</tr>
<tr>
<td class="td_line1" ba></td>
</tr>
<%while(rs6.next()){%>
<tr>
<td ><a href="/<%=board_gubun2%>/content.jsp?idx=<%=rs6.getString(2)%>&gb=<%=gongji2_content%>" style=" color:#996600">
<%if(rs6.getString(3).length() > 25){
out.println(rs6.getString(3).substring(0,25)+"...");
}else{
out.println(rs6.getString(3));
}
%>
</td>
</tr>
<%}
rs6.close();
stmt6.close();
%>
<tr>
</table>
</td>
</tr>
</table>
<br>
<!-- 상품 리스트 시작 //-->
<form name="myform" method="post" action="/sale/goodsDetail.jsp">
<input type="hidden" name="goods_id" value="">
<input type="hidden" name="gcode" value="">
<table class="table_basic">
<tr>
<td height=45 width="100">
<td><img src="/images/bestbar.gif"></td>
</td>
</tr>
<tr>
<td height=1 colspan="2" background="/images/dot_line.gif"></td>
</tr>
</table>
<table class="table_basic">
<tr>
<%
int tr=0;
int k=0;
while(rs0.next()){
k++;
tr++;
%>
<td valign="top">
<table class="table_goods">
<tr>
<td align="center"><a href="javascript:goContent('<%=rs0.getString("goods_id")%>','<%=rs0.getString("gcode_id")%>');">
<img src="/images/goods/<%=rs0.getString(7)%>" width=130 border=0>
</td>
</tr>
<tr>
<td class="td_content"><%=rs0.getString(3)%></td>
</tr>
<tr>
<td class="td_content">
가격 : <strike><%=ut.getComma(rs0.getString(10))%>원</strike><br>
<font class="txt_price">
할인 : <%=ut.getComma(rs0.getString(5))%>원</font><br>
<!--적립 : <%=ut.getComma(rs0.getString(9))%>원//-->
</td>
</tr>
</table>
</td>
<%if(tr%colcnt == 0){%>
</tr>
<tr>
<td height=5 colspan=<%=colcnt%>></td>
</tr>
<tr>
<td height=1 colspan=<%=colcnt%> background="/images/dot_line.gif"></td>
</tr>
<tr>
<td height=5 colspan=<%=colcnt%>></td>
</tr>
<tr>
<%}%>
<%}
rs0.close();
stmt0.close();
%>
<table class="table_basic">
<tr>
<td height=45 width="100">
<td><img src="/images/11111111111111.gif"></td>
</td>
</tr>
<tr>
<td height=1 colspan="2" background="/images/dot_line.gif"></td>
</tr>
</table>
<table class="table_basic">
<tr>
<%
tr=0;
k=0;
while(rs.next()){
k++;
tr++;
%>
<td valign="top">
<table class="table_goods">
<tr>
<td align="center"><a href="javascript:goContent('<%=rs.getString("goods_id")%>','<%=rs.getString("gcode_id")%>');">
<img src="/images/goods/<%=rs.getString(7)%>" width=130 border=0>
</td>
</tr>
<tr>
<td class="td_content"><%=rs.getString(3)%></td>
</tr>
<tr>
<td class="td_content">
가격 : <strike><%=ut.getComma(rs.getString(10))%>원</strike><br>
<font class="txt_price">
할인 : <%=ut.getComma(rs.getString(5))%>원</font><br>
<!--적립 : <%=ut.getComma(rs.getString(9))%>원//-->
</td>
</tr>
</table>
</td>
<%if(tr%colcnt == 0){%>
</tr>
<tr>
<td height=5 colspan=<%=colcnt%>></td>
</tr>
<tr>
<td height=1 colspan=<%=colcnt%> background="/images/dot_line.gif"></td>
</tr>
<tr>
<td height=5 colspan=<%=colcnt%>></td>
</tr>
<tr>
<%}%>
<%}
rs.close();
stmt.close();
%>
<table class="table_basic">
</tr>
<tr>
<td height=45 width="100">
<td><img src="/images/newbar.gif"></td>
</td>
</tr>
<tr>
<td height=1 colspan="2" background="/images/dot_line.gif"></td>
</tr>
</table>
<table class="table_basic">
<tr>
<%
tr=0;
k=0;
while(rs2.next()){
k++;
tr++;
%>
<td valign="top">
<table class="table_goods">
<tr>
<td align="center"><a href="javascript:goContent('<%=rs2.getString("goods_id")%>','<%=rs2.getString("gcode_id")%>');">
<img src="/images/goods/<%=rs2.getString(7)%>" width=130 border=0>
</td>
</tr>
<tr>
<td class="td_content"><%=rs2.getString(3)%></td>
</tr>
<tr>
<td class="td_content">
가격 : <strike><%=ut.getComma(rs2.getString(10))%>원</strike><br>
<font class="txt_price">
할인 : <%=ut.getComma(rs2.getString(5))%>원</font><br>
<!--적립 : <%=ut.getComma(rs2.getString(9))%>원//-->
</td>
</tr>
</table>
</td>
<%if(tr%colcnt == 0){%>
</tr>
<tr>
<td height=5 colspan=<%=colcnt%>></td>
</tr>
<tr>
<td height=1 colspan=<%=colcnt%> background="/images/dot_line.gif"></td>
</tr>
<tr>
<%}%>
<%}
rs2.close();
stmt2.close();
%>
</tr>
</table>
<%
}catch(Exception e){
out.println(e);
}
db.closeCon(con);
%>
</form>
<!-- 상품 리스트 끝 //-->
</td>
<!-- 오른쪽 화면 //-->
<td width=200>
<%@include file="/adv.jsp"%>
</td>
</tr>
</table>
<!-- 마지막 꼬리말 부분 //-->
<%@include file="/foot_inc.jsp"%>
<!-- 꼬리말 끝 //-->
</body>
</html>
이거에요..
봐주세요...제발 자세히좀 부탁드림..초보라