当前位置: 代码迷 >> Java Web开发 >> 我是新手想请各位高手给点帮助
  详细解决方案

我是新手想请各位高手给点帮助

热度:322   发布时间:2005-05-05 20:10:00.0
我是新手想请各位高手给点帮助
我是新手自己编写个小程序但有错误,请大家帮忙看看
%@ page contentType="text/html;charset=GBK" %>
<%@include file="a"%>
<html>
<head>
<title>表单和JSP结合</title>
</head>
<body>
<center>
<h1>玩具店</h1>

<form action="wan.jsp"method="get">
<p><input type="checkbox" name="wan1"value="绒毛熊">绒毛熊
  <input type="checkbox" name="wan1"value="米老鼠">米老鼠
<p><input type="checkbox" name="wan1"value="小狗">小狗
 <input type="checkbox" name="wan1"value="唐老鸭">唐老鸭
<p><input type="submit"value="购买"></p>
</form>

<p>现在购买的商品有:
<p><% 
 String aa[]=request.getParameterValues("wan1");
if(session.getAttribute("wan2") == null) {
	session.setAttribute("wan2","ok");

}
session.setAttribute("wan2",session.getAttribute("wan2") +aa);

out.println(session.getAttribute("wan2") + "<br>");
%>
<a href="main.jsp">退出</a>
</html>

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] E:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\jsp作业\wan_jsp.java:99: operator + cannot be applied to java.lang.Object,java.lang.String[]
    [javac] session.setAttribute("wan2",session.getAttribute("wan2") +aa);
    [javac]                                                          ^
    [javac] 1 error



搜索更多相关主题的帖子: html  米老鼠  include  唐老鸭  action  

----------------解决方案--------------------------------------------------------
已答
希望以后还是不要弄成这样的字体了
看的我好辛苦哟
----------------解决方案--------------------------------------------------------
  相关解决方案