用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月 忘记密码?

发表随想


还能输入:200字
云代码 - jsp代码库

添加信息显示

2018-04-11 作者:云代码会员 举报

[jsp]代码库

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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 'cj1.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>
    <center>
    <% 
      request.setCharacterEncoding("utf-8");
      String name=request.getParameter("name");
      String password=request.getParameter("password"); 
      String sexinfor=request.getParameter("sex");
      String[] d=request.getParameterValues("dx");
      String fx=request.getParameter("fx");
      out.println("<br>");
      if(name=="") out.println("您没有输入姓名!<br>");
      else
      {
      out.println("您的姓名:");
      out.println(name);
      out.println("<br>");
      } 
      if(password=="") out.println("您没有输入密码!<br>");
      else
      {
      out.println("您的密码:");
      out.println(password);
      out.println("<br>");
      } 
      if(sexinfor=="") out.println("您没有选择性别!<br>");
      else
      {
      out.println("您的性别:");
      out.println(sexinfor);
      out.println("<br>");
      } 
      if(d==null) out.println("您没有选择爱好!<br>");
      else
      {
      out.println("您的爱好:");
      for(int i=0;i<d.length;i++)
      {
      out.println(d[i]+" ");
      }
      out.println("<br>");
      } 
      if(fx=="") out.println("您没有选择行业!<br>");
      else
      {
      out.println("您的行业:");
      out.println(fx);
      out.println("<br>");
      } 
      %>
    </center>
  </body>
</html>



<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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>
    <center>
    <h1>用户注册信息</h1>
    <form name=form  action="cj1.jsp">
    <p>您的姓名:<input type="text" name="name" /></p>
    <p>您的密码:<input type="password" name="password" /></p>
    <p>您的性别:<input type="radio" name="sex" value="男">男&nbsp;<input type="radio" name="sex" value="女">女</p>
    <p>您的爱好:<input type="checkbox" name="dx" value="音乐">音乐
    				   <input type="checkbox" name="dx" value="电影">电影
    				   <input type="checkbox" name="dx" value="阅读">阅读
    				   <input type="checkbox" name="dx" value="旅游">旅游
    				   <input type="checkbox" name="dx" value="运动">运动</p>
    <p>您的行业:<select name="fx" size=1>
    				   <option value="">------</option>
    				   <option value="教育">教育</option>
    				   <option value="私企">私企</option>
    				   <option value="行政">行政</option>
    				   <option value="IT">IT</option>
    				   </select></p>
    <p><input type="submit" value="填好了!">&nbsp;<input type="reset" value="重置"></p>
    </form>
    </center>
  </body>
</html>


分享到:
更多

网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。