码迷,mamicode.com
首页 > 其他好文 > 详细

邮件系统1

时间:2020-04-29 11:13:35      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:html   str   exception   table   nec   login   ons   sea   tco   

技术图片技术图片

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
  </head>
  
  <body>
   <form method="post" action="dologin.jsp">
     用户名:<input  type="text" name="name"/>  <br><br><br>
     密   码:<input type="text" name="password"/><br>
     <hr>
     <input type="submit" value="登录">
     </form>
  </body>
</html>

  

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="scc.Userdao" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>


  </head>
  
  <body>
           <%
             String name=request.getParameter("name");
             String password=request.getParameter("password");
              
              
              Userdao dao=new Userdao();
              if(dao.select(name, password)){
              request.getRequestDispatcher("main.jsp").forward(request, response);
              }else{
               response.sendRedirect("login.jsp");
              }
           
            %>

  </body>
</html>

  

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page  import="java.sql.*" %>
<%@page  import="scc.JDBCUtils" %>
<%@page  import="scc.Msg" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>


  </head>
  
  <body>
        <% String nn=request.getParameter("name");
        
         %>
          
        <%
         
         Connection con=null;
		 PreparedStatement st=null;
		 ResultSet rst=null;
            try{
            con=JDBCUtils.getCon();
			 
			 
			 
			 String sql="select*from msg where sender=?";
			 
			 
			st=con.prepareStatement(sql);
			 
			 
			 st.setString(1, nn);
          
            rst=st.executeQuery();
            Msg m=new Msg();
            %>
     
       
     
       
     
           <table border="1" >
               <tr>
            <td> 标题</td>
            <td> 内容</td>
            <td> 发件人</td>
             <td>收件人</td>
             <td> 日期</td>
            <td> 状态</td>
             </tr>
             
             
             
             
            <%  while(rst.next()){ %>
              
 
               
           <tr>
            <td> <%=rst.getString("title") %></td>
            <td> <%=rst.getString("content") %></td>
            <td> <%=rst.getString("sender") %></td>
             <td><%=rst.getString("recive") %></td>
             <td> <%=rst.getString("date") %></td>
            <td> <%=rst.getString("state") %></td>
             </tr>
                
             
           
         
          <%} %>
            
             </table> 
          <%
            }catch(Exception e){
            throw new RuntimeException(e);
            }
            finally{
            JDBCUtils.closeAll(rst, st, con);
            }
	
         %>
             <br>  <br>  <br>  <br>  <br>  <br>
             
             
             
             <div  >
             <form action="domain.jsp" method="post">
                        请输入你的标题
             <input type="text" name="tt">
             <input type="submit" value="搜索标题"> 
             
             </form>
             </div>
  </body>
</html>

  

邮件系统1

标签:html   str   exception   table   nec   login   ons   sea   tco   

原文地址:https://www.cnblogs.com/gsfwxj1820/p/12800242.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!