当前位置: 代码迷 >> Java Web开发 >> 哪位高手能给小弟我指点一下session对象的setAttribute()和getAttribute()方法如何使用啊
  详细解决方案

哪位高手能给小弟我指点一下session对象的setAttribute()和getAttribute()方法如何使用啊

热度:40   发布时间:2016-04-17 15:40:40.0
谁能给我指点一下session对象的setAttribute()和getAttribute()方法怎么使用啊?
这是我写的一个程序,过程是在choice.jsp文件中选择要买的物品,提交以后在session.jsp文件中将要买的物品显示出来。

choice.jsp文件如下:
<html>
<head>
<title>
Doing   Some   Shoppings
</title>
</head>
<body>
<form   action= "show.jsp "   method= "post ">
    What   do   you   want   to   buy: <input   type= "radio "   name= "choice "   value= "basketball "   checked> basketball
                                                <input   type= "radio "   name= "choice "   value= "football "> football
                                                <input   type= "radio "   name= "choice "   value= "baseball "> baseball
                                                <br> <br>
                                                <input   type= "submit "   name= "go ">
                                                <input   type= "reset "   name= "reset ">
                                               
</form>
  <%  
  session.setArribute( "choice ",value)
    %>
</body>
</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:   17   in   the   jsp   file:   /111/choice1.jsp
Generated   servlet   error:
C:\Program   Files\Apache   Software   Foundation\Tomcat   5.0\work\Catalina\localhost\web\org\apache\jsp\_111\choice1_jsp.java:61:   '; '   expected
   
^
1   error


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
  相关解决方案