报错的原因是因为下面这局代码的问题。楼住可以加判断判断一下再对这个值进行转型。String number = (String)application.getAttribute("counter");应该是这句 String number = (String)application.getAttribute("counter")导致的错误,你可以查看下其它地方给“counter”赋过值的地方,根据异常来看原始赋值...
if(session.getAttribute("i")==null){ session.setAttribute("i",1); } int i=Integer.parseInt(""+session.getAttribute("i")); int j=8; for(int m=0;m<j;m++){ %> <%=LoginMaker.bookSelect(i*j-(j-1)+m).getInt(1) %> <%=LoginMaker.bookSelect(i*j-(j-1)+m).getString(2...
第二个,使用response.addCookie(); 的时候,传入的cookie的值必须合法,不能有空格什么的,刚才使用这个方法一直报错,最后发现是java的Date()方法创建的时间转换为字符串之后,中间会有一个空格,就导致了报错,所以用replace(" ",""); 将字符串合法化就可以了...
><%=errtitle%><String errinfo = (String)request.getAttribute("ExceptionInfo");><%=errinfo%><!---><input name="imageField" type="image" src="/EbsWeb/images/<%=displayStyle%>/admin/button_back.gif" align="middle" width="90" ...
运行JSP文件时,页面提交后使用request的getAttribute方法无法获得表单数据,知道使用request的getParameter方法。 19 使用Struts框架,运行程序时,报错: The requested resource (Servlet action) is not available. 知道检查web.xml文件中是否配置ActionServlet。 20 ...
一般地在jsp页面中可以直接使用session内置对象,不会报错的。比如:<%! String username=session.getAttribute("username"); %> form action="editinfo" method="post"> Username: <input type="text" value="<%= session.getAttribute("username") %>"/> 如果有报错,那是因为session取值...
(String)request.getAttribute("errorinfo");%>校园博客登录页面账号:${requestScope.errorinfo}
然后我用request.getAttribute("heros")得出的是null 送TA礼物 1楼2017-05-26 21:47回复 浮夸听梦 淼淼淼淼 12 难受的一批,如果直接在servlet中写这么一段resp.setContentType("text/html;charset=UTF-8");List<Hero> heros = new HeroDao().list(0,Short.MAX_VALUE);StringBuffer sb = new String...
第8行:if(Car==null);后面没有执行语句,而直接跳到下一个判断了,这样子本身Car如果没有被赋上新的shopCar 类型,就会报错,也就相当于你没有进行ShopCar car=new ShopCar();而直接对car进行赋值……其中