Time of Update: 2015-04-16
標籤:簡單的以代碼的形式紀念一下,因為現在還沒有解決SQL2008驅動的問題,並且有好多東西要學,所以日後會有更新~所安裝的軟體有:SQL2008,eclipse,tomcat,JDK,涉及環境配置、等等,安裝資料庫感受最深,雖然網上有教程,但是實際操作起來,真心感覺這才是真正的安裝軟體。設計關鍵: 關鍵在於驗證頁面,在該頁面中必須:資料庫的串連操作,資料庫記錄的查詢操作 提交介面代碼<%@ page language="java"
Time of Update: 2015-04-11
標籤:web應用開發 jsp 資料庫 mysql jsp串連mysql資料庫步驟:1、建立mysql資料庫指令碼:use uestc;create table emp(empno INT(4) PRIMARY KEY,ename VARCHAR(10),job VARCHAR(9), hiredate DATE,sal FLOAT(7,2)
Time of Update: 2015-04-03
標籤:本地串連MySQL資料庫時,之前一直使用的方法是在項目lib中直接匯入JDBC的jar包,這樣只需要以下代碼就可以得到一個Connection。 String user="xxx"; String password="123"; String url="jdbc:mysql://localhost:3306/xxx"; Connection con=null; try {
Time of Update: 2015-01-25
標籤: 使用jsp串連資料庫真的不那麼容易,之前使用純java串連sql Server 2008,都是很正常的,但是在使用jsp調用的時候,總是報錯ClassNotFoundException.很鬱悶 jar驅動包明明就是那樣.(x)csdn部落格有位網友說將驅動和url修改為4.0的jar驅動,還是不行,我甚至修改為4.1的jar驅動.也總是報錯.(x)網上有網友說將 sqljdbc_auth.dll
Time of Update: 2014-12-22
標籤:兩部曲:1:在你的web.xml中的Struts2的核心過濾器的映射中增加<filter-mapping> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <filter-name>struts2&l
Time of Update: 2015-04-17
標籤: 我們在JSP中往往會把一些表格裡的東西需要匯出到本地,一般都是導成word、excel格式的檔案。這隻需要在JSP頁面頭設定及在<head></head>標籤中添加下面的代碼: 匯出為excel:<% response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.setHeader("Content-Dis
Time of Update: 2015-04-15
標籤:java jsp javabean 看似簡單,就是一個類的使用,但是使用的時候問題一大堆。1、bean包的使用在定義bean的java檔案開頭有package
Time of Update: 2015-04-10
標籤:String realPath = request.getRealPath("WEB-INF/classes/com/properties/devicetype.properties");以上為擷取路徑的最正確做法,因此,properties可以放在com包下,或者src目錄下。 Properties props = new Properties(); ArrayList al = new ArrayList(); try {
Time of Update: 2018-12-08
1,common.jsp 複製代碼 代碼如下:<%@ taglib uri="/WEB-INF/resource/struts-logic.tld" prefix="logic"%> <%@ taglib uri="/WEB-INF/resource/struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/resource/struts-html.tld" prefix="html"%> <%@
Time of Update: 2018-12-08
調用方法:在jsp頁面用映像標籤便可以直接調用如下是標籤代碼<img border=0 src="image.jsp">,只需要把該代碼發在驗證碼要顯示的地區就可以了) <%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*" %> <%! public static String
Time of Update: 2018-12-08
在ASP裡我曾告訴過朋友如何讓ASP程式不從緩衝裡讀取資料,同樣在JSP裡也能實現,請看下面:1, 使用java提供的方法,在jsp或者servlet中都可以 <% response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); %> 2, 使用HTML標記,如下面: <HEAD> &
Time of Update: 2018-12-08
<%@ page contentType="text/html;charset=8859_1" %><%//變數聲明java.sql.Connection sqlCon; //資料庫連接對象java.sql.Statement sqlStmt; //SQL語句對象java.sql.ResultSet sqlRst; //結果集對象java.lang.String strCon; //資料庫連接字串java.lang.String strSQL; //SQL語句int
Time of Update: 2018-12-08
一、概述
Time of Update: 2018-12-08
1.可以使用: response.sendRedirect("http://www.foo.com/path/error.html"); 2.可以手工修改HTTP header的Location屬性,如下:<% response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); String newLocn = "/newpath/index.html";
Time of Update: 2018-12-08
資訊發布介面 提供發布資訊的互動介面,調用 recordMessage.jsp程式。 sayMessage.jsp <HTML> <HEAD> <TITLE> 資訊發布</TITLE> <META content = "text/html; charset=GB2312" http-equiv = Content-Type> <LINK href ="css_01.css" rel = stylesheet> <
Time of Update: 2018-12-08
jsp:plugin Action 使您能插入所需的特定的瀏覽器的OBJECT或EMBED元素來指定瀏覽器運行一個JAVA Applet所需的外掛程式。文法:<jsp:plugintype="bean|applet"code="classFileName"codebase="classFileDirectoryName"[ name="instanceName" ][ archive="URIToArchive, ..." ][ align="bottom|top|middle|left|
Time of Update: 2018-12-08
作 者: precom (皮蛋) 2000.12.10guestbook.jsp =========================== <html><head> <META content="text/html; charset=gb2312 " http-equiv=Content-Type> <title>張家界電話黃頁(網上114)</title></head> <style
Time of Update: 2018-12-08
<HTML><HEAD><TITLE>JSP Bean Example</TITLE></HEAD><BODY><!-- Set the scripting language to java --><%@ page language="java" %><!-- Instantiate the Counter bean with an id of "counter"
Time of Update: 2018-12-08
一、 什麼是JSP JSP(JavaServer Pages)是由Sun
Time of Update: 2018-12-08
在WEB.XML檔案中設定參數: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>