首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

菜鸟的小疑点,求帮忙

2012-04-20 
初学者的小问题,求大虾帮忙!DOCTYPE htmlhtmlheadtitleform.html/title/headbodycenterh

初学者的小问题,求大虾帮忙
<!DOCTYPE html>
<html>
  <head>
  <title>form.html</title>
  </head>
  
  <body>
  <center>
  <h2>志愿者注册</h2>
  <FORM action = "dosubmit.jsp" method = "post">
  
  <table>
  <tr valign = "top">
  <td align = "right">name:</td>
  <td align = "left"><input type = "text" name = "name" maxlength = "50" size = "40"></td>
  </tr>
   
  <tr valign = "top"> 
  <td align = "right">email:</td>
  <td align = "left"><input type = "text" name = "email" maxlength = "50" size = "40"></td>
  </tr>
   
  <tr valign = "top">
  <td align = "right">sex:</td>  
  <td align = "left"><input type = "radio" name = "sex" value = "man" checked = "true"/>man
  <input type = "radio" name = "sex" value = "women">women</td>
  </tr>
  
  <tr valign = "top">
  <td align = "right">language:</td>
  <td align = "left"><input type = "checkbox" name = "language" value = "english"/>english
  <input type = "checkbox" name = "language" value = "chinaese"/>chinaese
  <input type = "checkbox" name = "language" value = "japanese"/>japanese
  </td>
  </tr>
   
  <tr valign = "top"> 
  <td align = "right">address:</td> 
  <td align = "left">
  <select name = "address">
  <option value = "beijin">beijin</option>
  <option value = "shanghai">shanghai</option>
  <option value = "hangzhou">hangzhou</option>
  </select>
  </td>
  </tr>
   
  <tr valign = "top"> 
  <td align = "right">jianli</td>
  <td align = "left"><textarea rows = "5" cols = "40" name = "jianli"></textarea></td>
  </tr>
   
  <tr valign = "top"> 
  <td align ="left"><input type = "submit" value = "submit">&nbsp;&nbsp;<input type = "reset" value = "reset"></td>
  </tr> 
   
   
  </table>
  </form>  
  </body>
</html>
这是html语言
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title>用户注册数据</title>


  </head>
  <body>
  String current = "";
  Enumeration params = request.getParameterNames();
  while(params.hasMoreElements()){
  current = (String)params.nextElement();
  out.print();
  String[] values = request.getParameterValues(current);
  for(int i=0;i < values.length;i++){
  out.print(values[i]);
  }
  out.print("<br>");
   
  }

  </body>
</html>
我用游览器打不开,请问大侠那句语句出错了啊


[解决办法]
不管你的编码,逻辑java代码有楼主这么写的吗?java代码在jsp页面中必须<% java代码 %>
java代码也就是你写的这些:
String current = "";
Enumeration params = request.getParameterNames();
while(params.hasMoreElements()){
current = (String)params.nextElement();
out.print();
String[] values = request.getParameterValues(current);
for(int i=0;i < values.length;i++){
out.print(values[i]);
}
out.print("<br>");
 
}

热点排行