• 大小: 5.31MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-27
  • 语言: Java
  • 标签: java  web开发  servlet  

资源简介

这是我实习的时候做的项目,虽然简单,但荏苒希望能够作为大家学习java的参考

资源截图

代码片段和文件信息

package ccit.servlet;

import java.awt.HeadlessException;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;

import javaBean.BasicInfoBean;
import javaBean.DBHelperBean;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.swing.JOptionPane;

public class BasicInfoQuery extends HttpServlet {
private static final String CONTENT_TYPE = “text/html“;

// 初始化全局变量
public void init() throws ServletException {
}

// 处理 HTTP Get 请求
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setContentType(CONTENT_TYPE);
request.setCharacterEncoding(“GBK“);
response.setContentType(“texthtml;charset=GBK“);
String num = request.getParameter(“sNO“);
request.getSession().setAttribute(“sNum“num);
//System.out.print(“*****************“+num);
DBHelperBean yao = new DBHelperBean();
ResultSet rs = yao
.dbQuery(“select stuff_nostuff_namestuff_sexstuff_agestuff_nation“
+ “ stuff_bornstuff_birthplacestuff_positionstuff_worktimestuff_telstuff_address“
+ “stuff_powerstuff_photostuff_remark from Stuff_Information  where stuff_no=‘“
+ num + “‘“);
if (rs != null) {
try {
BasicInfoBean bb=new BasicInfoBean();
if(rs.next()){

bb.setStuff_no(rs.getString(“stuff_no“));
bb.setStuff_name(rs.getString(“stuff_name“));
bb.setStuff_sex(rs.getString(“stuff_sex“));
bb.setStuff_age(Integer.parseInt(rs.getString(“stuff_age“)));
bb.setStuff_born(rs.getString(“stuff_born“));
bb.setStuff_birthplace(rs.getString(“stuff_birthplace“));
bb.setStuff_worktime(rs.getString(“stuff_worktime“));
bb.setStuff_position(rs.getString(“stuff_position“));
bb.setStuff_tel(rs.getString(“stuff_tel“));
bb.setStuff_address(rs.getString(“stuff_address“));
bb.setStuff_power(rs.getString(“stuff_power“));
bb.setStuff_photo(rs.getString(“stuff_photo“));
bb.setStuff_remark(rs.getString(“stuff_remark“));
bb.setStuff_nation(rs.getString(“stuff_nation“));

    request.setAttribute(“result“ bb);

request.getSession().setAttribute(“result1“ num);

request.getRequestDispatcher(“/BasicInfo.jsp“).forward(request
response);

}else {

JOptionPane.showMessageDialog(null “暂无记录!“);
response.sendRedirect(“SInfoManage.jsp“);
 
// out.println(“ript language=‘javascript‘>“);
// out.println(“alert(‘暂无记录!‘)“);
// out.println(“
ript>“);




}
} catch (SQLException e) {
e.printStackTrace();
}


}/*else {
System.out.print(“___________________“);
JOptionPane.showMessageDialog(null “暂无记录!“);
 
// out.println(“ript langu

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        552  2009-08-05 19:33  精英团队\Employee_manager1\.classpath

     文件        324  2009-08-06 09:07  精英团队\Employee_manager1\.mymetadata

     文件       1423  2009-08-05 19:28  精英团队\Employee_manager1\.project

     文件        500  2009-08-05 19:28  精英团队\Employee_manager1\.settings\.jsdtscope

     文件         49  2009-08-05 19:28  精英团队\Employee_manager1\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2009-08-05 19:28  精英团队\Employee_manager1\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       1794  2009-08-05 21:49  精英团队\Employee_manager1\CSS\Accessible_Design.css

     文件       1276  2009-08-05 21:50  精英团队\Employee_manager1\CSS\Accessible_Text.css

     文件       3367  2009-08-04 15:49  精英团队\Employee_manager1\src\ccit\servlet\BasicInfoQuery.java

     文件       1278  2009-08-05 09:18  精英团队\Employee_manager1\src\ccit\servlet\DelServlet.java

     文件       1485  2009-07-31 09:11  精英团队\Employee_manager1\src\ccit\servlet\KaoqinQueryServlet.java

     文件       3455  2009-08-06 09:18  精英团队\Employee_manager1\src\ccit\servlet\KaoqinRecordServlet.java

     文件       2411  2009-07-31 09:09  精英团队\Employee_manager1\src\ccit\servlet\KaoqinTongjiServlet.java

     文件       2608  2009-07-30 10:15  精英团队\Employee_manager1\src\ccit\servlet\ListServlet.java

     文件       2614  2009-08-02 09:48  精英团队\Employee_manager1\src\ccit\servlet\ListServlet1.java

     文件        776  2009-07-28 15:32  精英团队\Employee_manager1\src\ccit\servlet\Loginout.java

     文件        429  2009-08-15 15:37  精英团队\Employee_manager1\src\ccit\servlet\msx4\.classpath

     文件        285  2009-08-15 20:01  精英团队\Employee_manager1\src\ccit\servlet\msx4\.mymetadata

     文件       1222  2009-08-15 08:52  精英团队\Employee_manager1\src\ccit\servlet\msx4\.project

     文件       1219  2009-08-15 15:19  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\bean\DBHelper.java

     文件        375  2009-08-15 14:59  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\bean\mybean.java

     文件       1367  2009-08-15 20:12  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\MyFilter.java

     文件       3216  2009-08-15 20:25  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\myserv.java

     文件       2019  2009-08-15 12:53  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\MyServlet.java

     文件       2220  2009-08-15 13:49  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\ServletPage.java

     文件       3094  2009-08-15 11:32  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\TestServlet.java

     文件        331  2009-08-15 08:56  精英团队\Employee_manager1\src\ccit\servlet\msx4\src\com\oristand\UserInfoBean\UserInfo.java

     文件       1117  2009-08-15 13:45  精英团队\Employee_manager1\src\ccit\servlet\msx4\WebRoot\A.jsp

     文件       1099  2009-08-15 11:35  精英团队\Employee_manager1\src\ccit\servlet\msx4\WebRoot\B.jsp

     文件       1034  2009-08-15 11:45  精英团队\Employee_manager1\src\ccit\servlet\msx4\WebRoot\C.jsp

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

评论

共有 条评论