当前位置:网站主页>网站技术资料>java>文章内容

java常见错误以及可能原因集锦


<a href = "/Bookshop/admin/bookManagement.do?action=edit&id=<%=((Book)item).getId()%>">编辑</a>
<a href = "/Bookshop/admin/bookManagement.do?action=delete&id=<%=((Book)item).getId()%>">删除</a>
</display:column>
要在displaytag中使用链接,必须具备paramId,否则不显示为链接
<display:column property = "product.name" href = "viewDetailV2.0.jsp" title = "书名" paramId="item" paramProperty="product.id"/>
可以这样使用display
<display:column property = "product.id" title = "ID"/>
其中product为对象

63.<bean:write name = "xxxx" property = "xxx"/> 可以直接取到session.getAttribute()取到的东西。

64.实验struts-upload例子时要注意的地方:
1.If you would rather write this file to another file, please check here:
这一行要打钩
2.If you checked the box to write to a file, please specify the file path here:
在这里要重命名如:c:\b.jpg
上传成功的话,会出现提示 The file has been written to "c:\b.jpg"

65.Hibernate的like可以这么用:
Query query = session.createQuery("from src.persistent.Book as book where upper(book.name) like :name ");
query.setString("name", "%");
result = query.list();

66.Hibernate出现 duplicate import : className
异常也可能是因为忘了为持久类在configuration中addClass了

67.<logic:iterate id = "author" name = "authors">
name所引用的是session里的attribute。

68.如果发现要出现询问下载的情况,有可能是因为要跳转的页面出现了问题。试试在要跳转到的页删掉
<%@ page contentType="text/html; charset=gb2312"%>

69.如果JSP页面跳转时出现下边的错误信息:
The request sent by the client was syntactically incorrect (Invalid path /web/shoppingCart was requested).
原因是struts-config的action = "x" 写成了 action = "x.do"

  • 快速服务服务:网站策划 | 网站建设 | 北京网站建设 | 网站推广 | 网罗SEO
  • 联系网罗: 咨询电话:010-89630319 Mail:admin#wonlu.com Msn:刘先生 QQ:26402294
  •   2006-2008 Wonlu.com 北京网罗无限-京ICP备06036090号 网罗SEO