第一呢,在做页面时,有时css会显示不出效果,或者向server发送的请求得不到响应,当然struts是配置正确的。
解决方法:当然是我自己经常不注意的,(规范很重要,尽量写全点。。为了防止页面跳转。规范写地址时要写绝对路径)
规范真的很重要!!! 例子:xmlHttpRequest.open("post","/onlineVideoSys_35_G4/~my/album/query.do",false);
第二呢,在使用hibernate时,完成对数据库的操作:
-------------------------------------------------------------------------------
String hql="select ph.phototitle,ph.photourl,ph.releasetiem from Photoinfo ph where ph.userinfo.username=? and ph.phototype=?";(这个是搜索部分的。只是个体的,要用到数组,不能封装到Pojo对象中,所以for-each行不通的,解决方法如下:)
Object[] values={user,title};
List list=super.getHibernateTemplate().find(hql,values);
Object[] temp = null;
for(int i = 0; i < list.size(); i++){
temp = (Object[]) list.get(i);
System.out.println(temp[0]);
System.out.println(temp[1]);
System.out.println(temp[2]);
}
--------------------------------------------------------------------------------
String hql="from Photoinfo ph where ph.userinfo.username=? and ph.phototype=?";
(这个搜索全部,可以封装到pojo对象中。利用for-each打印出来,他与pojo是一致的)
Object[] values={user,title};
List<Photoinfo> list=super.getHibernateTemplate().find(hql,values);
for(Photoinfo k:list){
System.out.println(k.getPhotourl());//得到数据库的URL 地址!
}
-------------------------------------------------------------------------------今天我发现,别人在悄悄中已经走得好远了