在管理员对 用户提交的信息进行审核后,要求返回boolean值,可是用struts1返回的是actionForm对象,怎样变为boolean型?或者直接用struts2怎么实现?最好是struts1!在线求解。

解决方案 »

  1.   

    你可以在自己业务Form中设置属性来判断
      

  2.   

    struts1 太久没用了 不过你可以在actionForm加个 boolean 的flag标示位
    来代表操作的结果
      

  3.   

    你可以在action里面对actionform进行判断啊,如果审核通过给一个true这样也可以啊
    不需要一定要返回类型就跟你需要的一致啊~
      

  4.   

    在form 里面给一个标识 !
      

  5.   

    哦。我看没回复,就又试着用Struts2 还有spring的getHibernateTemplate()等东东来试,很奇怪连通过ID获得对象测试都通不过了?知道咋回事吗?呵呵。。
    public NxtUser getNxtUserByID(String id) { // this.getHibernateTemplate().get(NxtUser.class, ndataId); return (NxtUser) this.getHibernateTemplate()
    .get(NxtUser.class,Integer.parseInt(id));
    }main方法肯定没问题!(NxtUser) this.getHibernateTemplate()
    .get(NxtUser.class,Integer.parseInt(id));
    有问题吗?提示是:log4j:ERROR Could not find value for key log4j.appender.R
    log4j:ERROR Could not instantiate appender named "R".
    Exception in thread "main" java.lang.NullPointerException
    at com.module.wap.action.AuditAndDelH.getNxtUserByID(AuditAndDelH.java:37)
    at com.module.wap.action.AuditAndDelH.main(AuditAndDelH.java:46)
    日志可以不管的!到底哪的问题呢?。
      

  6.   

    是这啊:ActionForward  对象啊!public ActionForward checkingInfo(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse reponse)
    throws UnsupportedEncodingException {}怎么让她返回Boolean?