标题:我是新手想请各位高手给点帮助
只看楼主
liuyangsv
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-5-5
 问题点数:0 回复次数:1 
我是新手想请各位高手给点帮助
我是新手自己编写个小程序但有错误,请大家帮忙看看
%@ page contentType="text/html;charset=GBK" %>
<%@include file="a.html"%>
<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 
2005-05-05 20:10
疯子java
Rank: 4
等 级:贵宾
威 望:13
帖 子:328
专家分:0
注 册:2004-9-19
得分:0 
已答
希望以后还是不要弄成这样的字体了
看的我好辛苦哟

疯言疯语 疯部可及 ---世界法第1章第1节第1条规定 此人由于说话太过于疯!!!其余人等切不可与其交谈! 此人由于说话太过于疯!!!此人的话100%的不能相信
2005-05-05 20:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-17398-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.050034 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved