S2 使用JSP/Servlet技术开发新闻发布系统 第二章JSP交互(一)所有上机

因为是之前做的我没有标记那个是哪个上机,然后我就分不清了,所以就你们自己看是哪个上机吧

<%@ page language="java" import="java.util.*,java.text.*" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  
    
    
    My JSP 'email.jsp' starting page
    
	
	
	    
	
	
	

  
  
  
    
用户名: 只能输入字母或数字,4-16个字符
密码: 密码长度6-12位
<%@ page language="java" import="java.util.*,java.text.*" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  
    
    
    My JSP 'emailInfo.jsp' starting page
    
	
	
	    
	
	
	

  
  
  
    <%
      request.setCharacterEncoding("UTF-8");
      String name=request.getParameter("txtUser");
      String pwd=request.getParameter("txtPass");
      if("lucky".equals(name) && "123456".equals(pwd)){
          request.getRequestDispatcher("welcome.jsp?txtUser="+name).forward(request, response);
      }else{
         response.sendRedirect("email.jsp");
      }
      
     %>
  


<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  
    
    
    My JSP 'index.jsp' starting page
	
	
	    
	
	
	
  
  
  
    This is my JSP page. 
<%@ page language="java" import="java.util.*,java.text.*" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
  request.setCharacterEncoding("UTF-8");
  String name=request.getParameter("txtUser");
  String pwd=request.getParameter("txtPass");
  String repwd=request.getParameter("txtRPass");
  String email=request.getParameter("txtEmail");
   String year=request.getParameter("year");
  String[] sex=request.getParameterValues("gen");
  String[] month=request.getParameterValues("month");
  String[] day=request.getParameterValues("day");
 %>


  
    
    
    My JSP 'reginfo.jsp' starting page
    
	
	
	    
	
	
	

  
  
  
    
您输入的注册信息
用户名: <%=name %>
密码: <%=pwd %>
确认密码: <%=repwd %>
邮箱: <%=email %>
性别: <% if(sex!=null){ for(String sexs:sex){ out.print(sexs+" "); } } %>
出生日期: <%=year %> <% if(month!=null){ for(String channel:month){ out.print(channel+" "); } } %> <% if(month!=null){ for(String channel:day){ out.print(channel+" "); } } %>
<%@ page language="java" import="java.util.*,java.text.*" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  
    
    
    用户注册
    
	
	
	    
	
	
	
  


用户名: 只能输入字母或数字,4-16个字符
密码: 密码长度6-12位
确认密码:
性别: 男 
电子邮件地址: 输入正确的Email地址
出生日期:  年    月    日
<%@ page language="java" import="java.util.*,java.text.*" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  
    
    
    My JSP 'welcome.jsp' starting page
    
	
	
	    
	
	
	

  
  
  
  
    欢迎<%=request.getParameter("txtUser") %>进入本页面!
  


你可能感兴趣的:(计算机)