跳转界面404

来源:3-7 request对象(上)

慕盖茨4474050

2018-08-06 16:49

</head>

  

  <body>

    <h1>用户注册</h1>

    <hr>

   <form name="regForm" action="request.jsp" method="get">

   <table>

   <tr>

   <td>用户名</td>

   <td><input type="text"name="username"/></td>

   </tr>

   <tr>

   <td>爱好:</td>

 <td>

 <input type="checkbox" name="favorite"value="read">读书

 <input type="checkbox" name="favorite"value="music">音乐

 <input type="checkbox" name="favorite"value="movie">电影

 <input type="checkbox" name="favorite"value="game">游戏

 </td>

 <tr>

 <td colspan="2"><input type="submit" name="提交"/></td>

   </tr>

   </table>

   </form>


  </body>

</html>

</head>

  跳转的request界面

  <body>

  <h1>request内置对象</h1>

  <%

  request.setCharacterEncoding("utf-8") ;

   %>

    用户名:<%=request.getParameter("username") %><br>

    爱好:<%

    String[] favorites=request.getParameterValues("favorite");

    for(int i=0;i<favorites.length;i++){

    out.println(favorites[i]+"&nbsp;&nbsp;") ;

    }

    %>

  </body>

</html>


写回答 关注

2回答

  • cdc66
    2018-09-10 21:30:47

    一样的错误啊,修改tomcat路径也不行


  • 柴犬的凝视
    2018-08-08 16:13:21

    我和你一样的错误


    慕盖茨447...

    我忘了是 好像 tomcat还是jdk重新配置一下就好了 内容无错

    2018-08-08 16:18:31

    共 1 条回复 >

JAVA遇见HTML——JSP篇

Java Web入门级教程JSP,带你轻松的学习JSP基础知识

248279 学习 · 3071 问题

查看课程

相似问题