Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JSP·ÖÒ³Ö®¼Ù·ÖÒ³¼°MVCʵÏÖ

 MVCÊÇÓÉÄ£ÐͲ㣬ÊÓͼ²ã£¬¿ØÖƲã×é³É£¬MVCÌá¸ßÁË¿ª·¢Ð§ÂÊ£¬±ãÓÚά»¤
·ÖÒ³ÊÇWeb¿ª·¢ÖеÄÒ»¸öÖØÒªµÄ¹¦ÄÜ£¬ÄÇÔõÑùʵÏÖ·ÖÒ³ÄØ£¿£¿£¿
¼Ù·ÖÒ³ÊÇÖ¸²éѯ³öËùÓеÄÊý¾Ý£¬Ö»ÏÔʾÐèÒªµÄÊý¾Ý£¬ËüÍêÈ«ÓɳÌÐòʵÏÖ£¬¿ª·¢Ð§Âʲ»¸ß£¬µ«ÈÝÒ×ʵÏÖ
´úÂëÈçÏÂ:
Ò».Ä£ÐͲã
UserInfo(JavaBeanµÄʵÏÖ£¬´«µÝÊý¾Ý£©
package com.feng.test;
import java.io.Serializable;
public class UserInfo implements Serializable {
private int userid;
private String username;
private String password;
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

¶þ.Êý¾Ý²ã
 DataBae(Êý¾Ý¿âµÄÁ¬½Ó)
package com.feng.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public final class DataBase {
private final static String DRIVER = "oracle.jdbc.driver.OracleDriver";
private final static String URL = "jdbc:oracle:thin:@localhost:1521:Oracle9i";
private final static String USER = "scott";
private final static String PWD = "tiger";
private DataBase() {
}
public static Connection getConnection() {
Connection conn = null;
try {
Class.forName(DRIVER);
conn = DriverManager.getConnection(URL, USER, PWD);
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
public static void closeConnection(Connection conn) {
try {
if (conn != null) {
if (!conn.isClosed()) {
conn.close();
}
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public static PreparedStatement getPreparedStatement(Connection conn,
String sql) {
PreparedStatement pstmt = null;
try {
pstmt = conn.prepareStatement("sql");


Ïà¹ØÎĵµ£º

JSP»ñÈ¡ÕæʵIPµØÖ·




 
ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr£¨£©£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁË
Apache£¬SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæʵIPµØÖ·ÁË¡£Èç¹ûʹÓÃÁË·´Ïò´úÀíÈí¼þ£¬ÓÃ
request.getRemoteAddr£¨£©·½·¨»ñÈ¡µÄIPµØÖ·ÊÇ£º127.0.0.1»ò
192.168.1.110£¬¶ø²¢²»ÊÇ¿ ......

FCKeditor 2.5 jsp struts2

Ò».ÏÂÔØfckeditor-java-demo-2.5.war
           ÏÂÔصØÖ·£ºhttp://java.fckeditor.net/demo.html£¬²¿Êðµ½tomcatÏ£¬Æô¶¯ºó¾Í¿ÉÒÔ·ÃÎÊ´Ëdemo.
¶þ.jsp¼¯³É
           1. copy "fckeditor"Îļþ¼Ðµ½ÍøվĿ¼&n ......

checkbox ÔÚjspÖеÄʹÓÃ

 ±¾ÎÄ×÷ÕߣºØýÃû
ËùÊô·ÖÀࣺÍøÂç±à³Ì
¼ÓÈëʱ¼ä£º2006-1-19
µã»÷´ÎÊý£º396
<%@ page language="java" contentType="text/html" %>
<%@ page import="com.ora.jsp.util.*" %>
<html>
<body bgcolor="white">
<form action="checkbox.jsp">
<input type="checkbox" name="fr ......

¹ØÓÚJSPÖÐrequest.getRealPath()

ÔÚΪ·þÎñÆ÷¶Ë×é¼þ±à³Ìʱ£¬ÄãºÜ¿ÉÄÜÒª´ÓÏà¶ÔÓÚweb¸ùµÄ·¾¶À´È¡µÃij¸öÎļþµÄÕæʵ·¾¶£¬µ«´ËÎļþʵ¼ÊÉÏÔÚÕ¾µãµÄÒ»¸öÐéÄâ·¾¶ÉÏ¡£
ʲôÊÇÐéÄâ·¾¶£¿
ÔÚÒ»¸öweb·þÎñÆ÷ÉÏ£¬ÐéÄâ·¾¶½«ÎïÀíÉÏ·ÖÀëµÄ¸÷Îļþ×éºÏÔÚÒ»Æ𣬷ÅÔÚͬһ¸öÕ¾µã·¾¶ÉÏ£¬ÔÚÓ¦Ó÷þÎñÆ÷ÉÏ£¬Ã¿¸öÓ¦Óö¨Î»ÓÚÆä×Ô¼ºµÄÐéÄâ·¾¶ÉÏ£¬Êµ¼ÊÉÏÏ໥֮¼äÓÐ×ÅÍêÃÀµØ·ÖÀë¡£ ......

JSPÁ¬½ÓACCESSÊý¾Ý¿âµÄ¼òµ¥´úÂë

Á¬½ÓACCESSÊý¾Ý¿âµÄ¼òµ¥JSP´úÂ룺
  <%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Drive ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ