日期:2014-05-17  浏览次数:20657 次

JavaWeb 打开时候不现实
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
  </head>
  
  <body>
       <c:forEach items="${requestScope.ls}" var="bean" varStatus="beanStatus">
                <tr>
                    
                    <td>${bean.Id}</td>
                    <td>${bean.Nmae}</td>
                    <td>${bean.Pwd}</td>
                    <td>${bean.Age}</td> 
                </tr>
 </c:forEach>
  </body>
</html>

package servelt;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

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

import shiti.st;

import dao.daostudent;

public class servlet extends HttpServlet {

/**
 * Constructor of the object.
 */
public servlet() {
super();
}

/**
 * Destruction of the servlet. <br>
 */
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}

/**
 * The doGet method of&nbs