JSPÖеÄjavaÉùÃ÷ºÍjavaƬ¶Ï - Java / Web ¿ª·¢
Ïò´ó¼ÒÇë½ÌÒ»¸öÎÊÌ⣺
JspÖÐ <%! %>Óë <% %>²î±ðÔÚÄĶù£¿
ÊéÉÏ˵<%! %>Àï·ÅµÄÊÇÉùÃ÷£¬<% %>Àï·ÅµÄÊÇjavaƬ¶Ï£¬ÄÇÎÒÏëÎÊÎÊ£¬<%! %>ÖÐÉùÃ÷µÄ£¬ÔÚ£¬<% %>ÖÐÄÜÓÃÂð£¿
ÎÒдÁËÈçÏ´úÂ룺
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*,java.io.*,java.util.*" %>
<html>
<head><title></title></head>
<body>
<%
String user = request.getParameter("n");
%><h2>Welcome!<%=user%><h2>
<center><h2>Óû§ÐÅÏ¢±í<h2></center>
<hr><br>
<%
Connection c = null;
PreparedStatement pst = null;
ResultSet rs = null;
int pageNow = 1;
int pageCount = 0;
int pageSize = 3;
int rowCount = 0;
String pagenow = request.getParameter("pagenow");
if(pagenow != null)
{
pageNow = Integer.parseInt(pagenow);
}
Class.forName("oracle.jdbc.driver.OracleDriver");
c = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:MYDB","xiaoming","a123");
pst = c.prepareStatement("select count(*) from test");
rs = pst.executeQuery();
if(rs.next())
{
rowCount = rs.getInt(1);
}
pageCount = (rowCount%pageSize==0)?(rowCount/pageSize
Ïà¹ØÎÊ´ð£º
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÎÒÔÚ javaºËÐļ¼ÊõÉÏ ¿´ÁËÒ»¸ö ÀûÓà Java socket emailµÄÀý×Ó ¿ÉÊÇÔõôҲ ²»³É¹¦ Ϊʲô£¿
Ô´Âë
Java code:
package cn.com.test.email;
import java.awt.GridBagLayout;
import java.awt.event.Action ......
ÎÒÊǸöÐÂÊÖ£¬Íû¸ßÊÖ½â´ð
ÎÒÏÖÔÚÒѾ°²×°ÁËmysql£¬Ò²ÓÐmysqlµÄjdbc¡£µ«ÎÒÔõôÅäÖú󣬲ÅÄÜÔÚMyEclipseÀï²Ù×÷mysqlÄØ£¿Çë¸ßÊÖ˵Ïêϸµã
´ò¿ªMyeclipse----window---open perspective---MyEclipse database explorer-- ......
ÔõôÑù½«id´«¹ýÈ¥°¡£¿£¿£¿ÊǼòµ¥µÄ´«¡£¡£¡£ÔÚµØÖ·À¸ÖÐдidºÅ
LZ ºÃÓÄĬ£¡²»ÖªµÀÄãµÄÒâ˼£¿
ÊÇÏë°ÑID ´«µ½ACTION ? ͨ¹ýURl id=?
²»¹»Ïêϸ ±ðÈ˲»ÖªµÀÔõÑù°ïÄã
../XXXXX.do?id=XXXX&id2=XXXXX
......
ÏÖÔÚ²»ÏëÓÃ<a> </a> ±êÇ© £¬ÒòΪµã»÷ºó»á³öÏÖÒ³ÃæÖض¨Î»£¬¸øÎÄ×Ö¼ÓÉÏcssÑùʽ¾Í¿ÉÒÔ¿´ÆðÀ´ ÊÇhrefÔõôʵÏÖÕâÑùµÄcss
text-decoration:underline; cursor:hand;
ÒýÓÃ
text-decoration:underline; cur ......