Çó½Ìjsp useBean beanµÄÎÊÌâ - Java / Web ¿ª·¢
±ÈÈç˵DB.classÊÇÔÚ°ücom/zhl/jdbcϵÄ
ÄÇôDB.class·ÅÔÚʲôµØ·½ Èç¹ûÓÃ<jsp:useBean id="d" class=""/>À´ÒýÈëbean ÄÇôclassÊôÐÔÓ¦¸ÃÔõôд
Ðè²»ÐèÒªÏñservletÄÇÑù»¹ÒªÅäÖÃweb.xmlµÄ<servlet-mapping>
<%@page import="java.io.*,java.sql.*"%>
<%@page contentType="text/html; charset=GBK"%>
<jsp:useBean id="DB" class="com.zhl.jdbc.ExecuteDB"/>
<%
String sql = "select id,title from zhuye order by id desc";
int i=0;
Connection conn = DB.getConnection();
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
%>
<table valign="top" Cellspacing="5">
<%
while(rs.next()){
int id = rs.getInt("id");
String s = rs.getString("title");
%>
<tr>
<td valign="top"><h5><%=id+" "%></h5></td>
<td valign="top"><h5>><a href=left_dianHouWen.jsp?id=<%=id%> ><%=s %></a></h5></td>
</tr>
<%
i++;
if(i>10) break;
}
DB.free(rs,ps,conn);
%>
</table>
ÏñÉÏÃæÄÇÑùдµÄ»° ÔËÐеÄʱºò³ö´í
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/zh
Ïà¹ØÎÊ´ð£º
Ò»¸öJSPÒ³Ãæ½ÓÊÕÆäËûÒ³ÃæÌá½»¹ýÀ´µÄFORM±íµ¥£¬µ«ÊÇÒªÇóÖ»½ÓÊÕµ±Ç°Õ¾µã¼°Æä×ÓÕ¾µãÌá½»¹ýÀ´µÄFORM±íµ¥£¬ÆäËûÕ¾µãÌá½»¹ýÀ´µÄ±íµ¥²»½ÓÊÕ£¬Õâ¸öÔõôÉèÖã¿
ÓùýÂËÆ÷
filter
½«µ±Ç°Õ¾µã¼°Æä×ÓÕ¾µã·ÅÒ»¸öĿ¼
È» ......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
......
tableÔõô°ó¶¨Êý¾Ý¿â£¬²¢ÇÒÓÃJavaScriptʵÏÖ·Ò³¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£JavaScriptÄÜÏòJSPÒ³Ãæ´«µÝ²ÎÊýÂð
Äã˵µÄÎÊÌâÓеãÄǸö¡£¡££¬²»ºÃ»Ø´ð¡£¡£¡£¡£
jspÖÐtableÊÇÐèÒªhtml´úÂëÓëÒ³Ãæ¶Ë»ñÈ¡Êý¾Ý¿â²éѯºóµÄÐÅÏ¢½øÐÐ ......
ÇëÎʸ÷λ¸ç¸ç½ã½ã£¬ÈçºÎÔËÓÃÏֳɵÄÄ£°åÀ´ÖÆ×÷ƯÁÁµÄJSPÍøҳѽ,»ØÕßÓзÖ!
×Ô¼º¶¥Ï£¬×ÜÓиßÊÖ°É,ÆÚ´ýÖÐ......
Èç¹ûÖ±½ÓÒýÓýøÈ¥
¿ÉÒÔÖ±½ÓÓÃjspµÄÖ¸ÁҲ¿ÉÒÔÓÃfreemarkÒýÓ㬼ǵøø·Ö
лл¸÷λÁË£¬¿´À´Î ......