• 大小: 7.39MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-22
  • 语言: Java
  • 标签: JSP  

资源简介

第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\ntle>\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\Database\db_database01_Data.MDF

     文件    1048576  2006-12-26 14:02  01\Database\db_database01_Log.LDF

     目录          0  2007-06-23 06:04  01\Database

     文件        106  2006-12-26 14:02  01\018\程序使用说明.txt

     文件       3019  2006-12-26 14:02  01\018\firstjspnetbeans\build.xml

     文件       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.xml

     目录          0  2007-06-23 06:04  01\018\firstjspnetbeans\web\WEB-INF

     文件         67  2006-12-26 14:02  01\018\firstjspnetbeans\web\meta-INF\context.xml

     目录          0  2007-06-23 06:04  01\018\firstjspnetbeans\web\meta-INF

     目录          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.xml

     文件        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.xml

     文件       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.xml

     目录          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.xml

............此处省略204个文件信息

评论

共有 条评论