初步使用MyEclipse

来源:互联网 发布:草根吧整站源码 编辑:程序博客网 时间:2024/05/10 06:51

1.创建Web project

2.在WebRoot创建jsp文件

《1》

 <body>
    表单提交演示 <br>

<form name="form1" method="post" action="doreg.jsp">
    <p>用户名:
      <label for="textfield"></label>
    <input type="text" name="user" id="textfield">
    </p>
    <p>密 码:          
      <input type="text" name="pwd" id="textfield2">
    </p>
    <p>风 格:
      <label>
        <input type="radio" name="RadioGroup1" value="单选" id="RadioGroup1_0">
        豪华版</label>
      <input type="radio" name="RadioGroup2" value="单选" id="RadioGroup1_1">
    简洁版</p>
    <p> 登陆类型:
      <label>
        <input type="checkbox" name="rtype" value="复选框" id="CheckboxGroup1_0">
      安全登录</label>
      <label>
        <input type="checkbox" name="rtype" value="复选框" id="CheckboxGroup1_1">
        自由登陆</label>
      <label>
        <input type="checkbox" name="rtype" value="复选框" id="CheckboxGroup1_2">
        疯狂登陆</label>
      <br>
      <br>
      登陆地点:
      <label for="select"></label>
      <select name="addr1" id="select">
        <option value="中国">中国</option>
      </select>
      <select name="addr2" id="select2">
        <option value="江西">江西</option>
        <option value="北京">北京</option>
      </select>
    </p>
    <p>
      <input type="submit" name="button" id="button" value="提交">
      <input type="reset" name="button2" id="button2" value="重置">
      <br>
    </p>
  </form>

 </body>

《2》doreg.jsp文件部分(显示登录信息)

  <body>
  登录信息:
    <% request.setCharacterEncoding("utf-8");%><br>//
        登录名:<% out.print(request.getParameter("user")) ;%><br>
     密码:<% out.print(request.getParameter("pwd")) ;%><br>
  </body>

0 0