日期:2014-05-17  浏览次数:20721 次

菜菜泪奔求解答
做了一个关于图书的管理系统,在做图书信息修改的时候,我的做法是:
  在图书列表页面中点击某一本书的“修改”按钮,此时将bookID通过<a href=a.jsp?bookID="+bookID+">"+"修改"+"</a>传递到一个用于修改的页面a.jsp 。
  在a.jsp页面中通过String bookID = request.getParameter("bookID");的方式接到这个bookID,之后通过
int tID = Integer.parseInt(bookID);将bookID转换为int类型(因为操作图书修改的方法写成的是传入一个int类型的ID值,通过ID修改图书信息,所以转换成int类型。)
  但最后在运行的时候Tomcat报错,错误信息是:

org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 56 in the jsp file
56: <html:hidden property="bookID" value="<%=tID%>" />
The method setValue(String) in the type BaseInputTag is not applicable for the arguments (int)


之前的一些修改都是这么写的,没有问题,这次却报出了这个错误,是什么原因?
小弟找不到原因了,恳请大侠帮助~~~~~~~

------解决方案--------------------
<html:hidden property="bookID" value="<%= String.valueOf(tID)%>" />
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html