java-j2ee-eclipse +struts + hibernate + tomcat 问题集锦(一)

本文仅供参考,如有差错,欢迎拍砖,我不怕疼~~~~

java eclipse3.2 +struts1.1 + hibernate3.0 + tomcat5.5 问题集锦:

1------当点击一个 有action的连接后,在确保action执行没有错误的情况下,浏览器页面
显示的是“无法显示当前页”错误,那么很可能是 此action最后没有 return mapping.findforward("动作标志")这个语句造成的


2------console控制台返回 id to load .... requeris id loading

是由于 调用的方法中参数是 id,而这个参数没有传递进去造成的。


3------bean name must not empty,but not ...

       标签指定错误,注意name 和 property


4------一个modify action 的解释

public ActionForward modifylist(ActionMapping mapping,ActionForm form,
   HttpServletRequest request,HttpServletResponse response){
  Integer GID=Integer.valueOf(request.getParameter("groupid"));
  try{
   TGroupDAO userGroupDao =TGroupDAO.instance();
     TGroup GroupModel =userGroupDao.findById(GID);
       
   //response.getWriter().println("testtest ok ok :id  value --->"+GID);
   //response.getWriter().println("/n"+" group info GroupName:"+ GroupModel.getAName());
   //response.getWriter().println("/n"+"group info GroupSystem:"+ GroupModel.getASystem());
   request.setAttribute("group",GroupModel);//只要静态网页中含有bean name=group 的标签,那么
                                            //系统自动寻找所有名称为group的bean标签,并将GroupModel
                                            //的多个属性值填入bean property后面的相应位置
                                            //bean property后面的值在html页面中通常是属性名称
  }
  catch  (java.lang.Exception ee){
       ee.printStackTrace();
  }
  return   mapping.findForward("modifylist");  //对于返回html页面/或者指向了动作结果,此句必须有
 }


5.注意 java里的 integer 和 short ,long类型是严格区分的,


6.关于nNo getter method for property XXX of bean xxxx的错误
 
 在bean标签xxx中的xxx属性没有读取方法。
  原因:
 我这样写了hql
SELECT UID, UUserName, UName
FROM TUser as Model1
WHERE (Model1.UID IN
          (SELECT UId
         FROM T_GroupUser as Model2
         WHERE Model2.GId = "2"))

导致提示没有UId,UUserName等的标签读取方法错误。

后来我将 SELECT UUserName , UName  去掉,只保留了 "from "后面的语句就正常了。

7.实际提交时候却没有了method后面的东西?
subForm.action="/admin/"+"groupManage"+"."+"do"+"?"+"method"+"="+"delselectedGroup";
  alert(subForm.action);
  subform.action //实际提交时候却没有了method后面的东西?


原因是 html的form后面没有写 method="post" 参数 !!!


8.控制台种错误 如下 For input string: "14
               "xxxxxxxxxxxxxxxxx

原因是html/jsp中有bean write写入的参数中双引号换行导致 传入url参数错误引起的
  解决办法,打开html/jsp页面将换行的引号退回紧凑即可。

9.a different object with the same identifier value was already associated with the session: [com.EduStar.Bean.User.TGroupUser#com.EduStar.Bean.User.TGroupUserId@626e]

解决办法:
 HibernateSessionService HibernateSession = HibernateSessionService.instance();
 HibernateSession.SessionClean();  //加上这句

10.加了分页后,以前能执行的查询不能执行了,提示could not execute query
  解决办法:修改查询获取的页数,有可能是制定了负数的页数导致的错误。
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

安优小青和他的程序生活

我的文档对您有很大的帮助吗?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值