jsp的一些问题,救我,大虾们 - Java / Web 开发
Java code:
package friend;
import java.sql.*;
import java.util.*;
public class FriendUtil {
private Connection con;
public FriendUtil()
{
this.con=DataBaseConnection.getConnection();
}
public Collection getAllFriend() throws Exception{
Statement stmt=con.createStatement();
ResultSet rst=stmt.executeQuery("SELECT * from mywork");
Collection ret=new ArrayList();
while(rst.next()){
Friend temFr=new Friend();
temFr.setName(rst.getString("name"));
temFr.setAddress(rst.getString("address"));
temFr.setPhone(rst.getString("phone"));
temFr.setEmail(rst.getString("email"));
temFr.setQq(rst.getString("qq"));
ret.add(temFr);
}
stmt.close();
con.close();
return ret;
}
老提示这些问题:
Collection is a raw type. References to generic type Collection<E> should be parameterized ch8/WebRoot deleteFriend.jsp line 18 1274156616281 200
ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized ch8/src/friend FriendUtil.java line 18 1274153813500 177
是不是jsp里取得结果用了范型?
你没有用泛型,就会有提示。
但不是错误吧
Collection ret=new ArrayList(); 应该
相关问答:
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
java swing 程序如何打包成jar,然后可以通过批处理文件bat直接运行,有没有什么工具直接可以完成这两个工作?
用jar打包,把运行需要的jar拷贝到一个目录,批处理用 start javaw -cp .;其他包路径 运行
用zip ......
怎么样将id传过去啊???是简单的传。。。在地址栏中写id号
LZ 好幽默!不知道你的意思?
是想把ID 传到ACTION ? 通过URl id=?
不够详细 别人不知道怎样帮你
../XXXXX.do?id=XXXX&id2=XXXXX
......