資源簡介
第1章 jsp的環境配置與開發工具 1.1 tomcat服務器 1.2 配置resin服務器 1.3 weblogic服務器 1.4 開發jsp程序 第2章 表單及表單元素的應用 2.1 獲取提交的表單元素的值 2.2 下拉列表 2.3 動態添加表單元素 2.4 文本框組件的應用 2.5 單選按鈕組 2.6 表單應用第3章 窗口與導航條設計 3.1 彈出窗口控制 3.2 彈出網頁對話框 3.3 無邊框窗口 3.4 水平導航條應用 3.5 下拉菜單式導航條

代碼片段和文件信息
package?org.apache.jsp;
import?javax.servlet.*;
import?javax.servlet.http.*;
import?javax.servlet.jsp.*;
import?java.util.Date;
import?java.sql.*;
public?final?class?business_jsp?extends?org.apache.jasper.runtime.HttpJspbase
????implements?org.apache.jasper.runtime.JspSourceDependent?{
??private?static?java.util.Vector?_jspx_dependants;
??public?java.util.List?getDependants()?{
????return?_jspx_dependants;
??}
??public?void?_jspService(HttpServletRequest?request?HttpServletResponse?response)
????????throws?java.io.IOException?ServletException?{
????JspFactory?_jspxFactory?=?null;
????PageContext?pageContext?=?null;
????HttpSession?session?=?null;
????ServletContext?application?=?null;
????ServletConfig?config?=?null;
????JspWriter?out?=?null;
????object?page?=?this;
????JspWriter?_jspx_out?=?null;
????PageContext?_jspx_page_context?=?null;
????try?{
??????_jspxFactory?=?JspFactory.getDefaultFactory();
??????response.setContentType(“text/html;?charset=GBK“);
??????pageContext?=?_jspxFactory.getPageContext(this?request?response
?????? null?true?8192?true);
??????_jspx_page_context?=?pageContext;
??????application?=?pageContext.getServletContext();
??????config?=?pageContext.getServletConfig();
??????session?=?pageContext.getSession();
??????out?=?pageContext.getOut();
??????_jspx_out?=?out;
??????out.write(“\r\n\r\n\r\n\r\n\r\ntle>\r\nbusiness\r\n tle>\r\n\r\n\r\n“);
//建立數據庫連接
Connection?conn=null;
Statement?stat=null;
try{
??String?driver=“com.microsoft.jdbc.sqlserver.SQLServerDriver“;
??String?url=“jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=db_database01“;
??String?username=“sa“;
??String?password=““;
??Class.forName(driver);
??conn=DriverManager.getConnection(urlusernamepassword);
??stat=conn.createStatement();
}catch(Exception?e){
??e.printStackTrace();
}
//執行業務邏輯
if(request.getParameter(“topicId“)==null){?????//添加主題
??String?topic?=?request.getParameter(“topic“);
??String?content?=request.getParameter(“content“);
??//通過轉碼解決中文亂碼
??topic=new?String(topic.trim().getBytes(“ISO8859_1“)“GB2312“);
??content=new?String(content.trim().getBytes(“ISO8859_1“)“GB2312“);
??Date?date=new?Date();
??int?year=date.getYear()+1900;
??int?month=date.getMonth()+1;
??int?day=date.getDate();
??String?dates=year+“-“+month+“-“+day;
??String?sql=“insert?into?tb_topicGF(ownertopiccontentdates)?values(‘高飛‘‘“+topic+“‘‘“+content+“‘‘“+dates+“‘)“;
??try{
????stat.executeUpdate(sql);
??}catch(Exception?e){
????e.printStackTrace();
??}
}else{?????//刪除主題
??try{
????String?topicId=request.getParameter(“topicId“);
????stat.executeUpdate(“delete?from?tb_topicGF?where?id=“+topicId);
??}catch(Exception?e){
????e.printStackTrace();
??}
}
//關閉數據庫連接
try{
??stat.close();
??conn.close();
}catch(Exception?e){
??e.printStackTrace();
}
//轉入成功頁
response.sendRedirect(“success.jsp“);
??????out.write(“\r\n
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????1048576??2006-12-26?14:02??01\Databa
?????文件????1048576??2006-12-26?14:02??01\Databa
?????目錄??????????0??2007-06-23?06:04??01\Databa
?????文件????????106??2006-12-26?14:02??01\018\程序使用說明.txt
?????文件???????3019??2006-12-26?14:02??01\018\firstjspnetbeans\build.xm
?????文件???????2071??2006-12-26?14:02??01\018\firstjspnetbeans\web\index.jsp
?????文件???????1153??2006-12-26?14:02??01\018\firstjspnetbeans\web\listuser.jsp
?????文件????????515??2006-12-26?14:02??01\018\firstjspnetbeans\web\WEB-INF\web.xm
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\web\WEB-INF
?????文件?????????67??2006-12-26?14:02??01\018\firstjspnetbeans\web\me
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\web\me
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\web
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\test
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\src\java
?????文件?????????23??2006-12-26?14:02??01\018\firstjspnetbeans\src\conf\MANIFEST.MF
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\src\conf
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\src
?????文件??????32990??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\build-impl.xm
?????文件????????632??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\genfiles.properties
?????文件???????2215??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\project.properties
?????文件????????880??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\project.xm
?????文件???????1357??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\private\private.properties
?????文件????????211??2006-12-26?14:02??01\018\firstjspnetbeans\nbproject\private\private.xm
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\nbproject\private
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\nbproject
?????文件?????418490??2006-12-26?14:02??01\018\firstjspnetbeans\dist\firstjsp.war
?????目錄??????????0??2007-06-23?06:04??01\018\firstjspnetbeans\dist
?????文件???????2072??2006-12-26?14:02??01\018\firstjspnetbeans\build\web\index.jsp
?????文件???????1153??2006-12-26?14:02??01\018\firstjspnetbeans\build\web\listuser.jsp
?????文件????????515??2006-12-26?14:02??01\018\firstjspnetbeans\build\web\WEB-INF\web.xm
............此處省略204個文件信息
評論
共有 條評論