这个代码是正确的,但是如果我加上用//屏蔽的代码,读到的test内容是null,请问我如何将表格中的内容传过去,并且读出来
解决方案 »
- 求解log4j监听进出函数的问题
- 我在导出表的时候出现问题(数据库是SQLServer2005)~各位大神帮帮忙啊~~
- 求助,Struts2报404错
- 求jsp的html编辑器。
- 急,Resin中出现Server connection failure during transaction
- linux下java webservice 乱码问题
- JUnit 对 SSH 中 Service的测试
- 关于java的查询语言问题!!?
- myeclipse 读入mysql 汉字乱码
- 如何复制(读取)System.out内容?
- 求解request读取数据的原理
- 关于Struts的View部分jsp实现的一个简单问题
<html>
<head>
<title>movie</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=GB2312">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body>
<h2>select from available movies</h2>
<form action = movie method = post>
<select name = "movies" size = "5" multiple>
<option> air force </option>
<option> happy gilmore </option>
<option> so i married an axe murderer</option>
<option> austin powers </option>
<option> pure luck </option>
</select><br>
<input type = "submit" name = "add" value = "add movies">
</form>
</body>
</html>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>movie</servlet-name>
<servlet-class>test.movie</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>movie</servlet-name>
<url-pattern>/movie</url-pattern>
</servlet-mapping>
</web-app>
doGet方法中的这段
for(int x= 0; x < movies.length; x++){
out.println(movies[x] + "<br>");
}改成
for(int x= 0; x < movies.length; x++){
out.println(new String(movies[x].getBytes("iso-8859-1"), "gbk") + "<br>");
}
谢谢你的回帖。