提交报错

wanglong 发布于 2009/11/19 15:54
阅读 858
收藏 0
JSF

package jcy.video.model.view.bean;

import javax.el.ValueExpression;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;

 
import com.jsfabc.jsh.model.bo.Department;
import com.jsfabc.jsh.model.exception.DaoException;
import com.jsfabc.jsh.model.exception.UserException;
import com.jsfabc.jsh.model.exception.UserNotExistException;
import com.jsfabc.jsh.model.exception.DbException;
import com.jsfabc.jsh.model.service.UserService;

import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.dao.DataAccessException;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import jcy.video.model.bo.Meeting; 
import jcy.video.model.bo.Meetinginfo;
import jcy.video.model.bo.Meetingsysdoing;
import jcy.video.model.bo.Videoinfo;
import jcy.video.model.bo.Videosysdoing;
import jcy.video.model.dao.MeetinginfoDao; 
import jcy.video.model.dao.MeetingDao;
import jcy.video.model.dao.MeetingsysdoingDao;
import jcy.video.model.service.videoservice;

import com.jsfabc.jsh.model.bo.Department;
import com.jsfabc.jsh.model.bo.Person;
import com.jdbc.model.dao.jdbcDao;
import com.systm.base.base;


public class MeetinginfoBean {
 private Long id; 
 private Long meetingid;
 private String info;
 private Date dates;
 private String tourl; 
 private String types;
 private String doing;
 
    private Map meetingMap;
    private base comm=new base();
 private MeetinginfoDao meetinginfoDao;
 private MeetingDao meetingDao;
 private MeetingsysdoingDao meetingsysdoingDao;
 private jdbcDao jdbcdao; 
 public  MeetinginfoBean(){
  FacesContext facesContext= FacesContext.getCurrentInstance();     
     Application app=facesContext.getApplication();
     javax.el.ExpressionFactory factory= app.getExpressionFactory();
     ValueExpression service=factory.createValueExpression(facesContext.getELContext()
    ,"#{videoservice}",videoservice.class);
     videoservice servicbean=(videoservice)service.getValue(facesContext.getELContext()); 
     this.types=comm.getPageParameter(facesContext,"types");
     System.out.println("types:"+types);
     if(this.types.equals("0")||this.types.equals("2")){
      //省级会议||召集会议
      meetingMap=servicbean.getMeetingMap(types,30);
     }else if(this.types.equals("1")){
      //市级会议
      String uid=comm.getSessionAttribute(FacesContext.getCurrentInstance(),"userId");
      if(uid==null||uid.length()<=0||uid.equals(""))uid="admin";
      meetingMap=servicbean.getMeetingMap(types,10,uid,"340000");
     }      
 }
 
 
 public Long getId() {
  return id;
 }

 


 public void setId(Long id) {
  this.id = id;
 }

 


 public Long getMeetingid() {
  return meetingid;
 }

 

 public void setMeetingid(Long meetingid) {
  this.meetingid = meetingid;
 }
 public String getTypes() {
  return types;
 }


 public void setTypes(String types) {
  this.types = types;
 }
 public String getInfo() {
  return info;
 }
 public void setInfo(String info) {
  this.info = info;
 } 

 public Date getDates() {
  return dates;
 }

 


 public void setDates(Date dates) {
  this.dates = dates;
 }

 


 public String getDoing() {
  return doing;
 }

 


 public Map getMeetingMap() {  
  return meetingMap;
 }


 public void setMeetingMap(Map meetingMap) {
  this.meetingMap = meetingMap;
 }

 public String getTourl() {
  return tourl;
 }
 public void setMeetinginfoDao(MeetinginfoDao meetinginfoDao) {
  this.meetinginfoDao = meetinginfoDao;
 }
 
 public void setMeetingDao(MeetingDao meetingDao) {
  this.meetingDao = meetingDao;
 }

 public void setJdbcdao(jdbcDao jdbcdao) {
  this.jdbcdao = jdbcdao;
 }


 public void setMeetingsysdoingDao(MeetingsysdoingDao meetingsysdoingDao) {
  this.meetingsysdoingDao = meetingsysdoingDao;
 }

 public String creatEntity(){  
  return null;
 } 
 public void sava_ActionEvent(ActionEvent event) throws UserException{
  System.out.println("0");
  String uid=comm.getSessionAttribute(FacesContext.getCurrentInstance(),"userId");
        if(uid==null&&uid.equals(""))uid="admin";
        Person person=this.meetinginfoDao.findPerson(uid);
        System.out.println("1");
  Meeting meeting=this.meetingDao.find(this.meetingid);
  System.out.println("2");
  Meetinginfo  entity=new Meetinginfo();
  entity.setDates(new Date());
  entity.setInfo(this.info);
  entity.setPerson(person);
  entity.setDepartment(person.getDepartment());
  System.out.println("3");
  entity.setMeeting(meeting);
  entity.setTypes(meeting.getTypes());
  System.out.println("4");
     this.meetinginfoDao.create(entity);
     doing="新增记录成功!";
     this.info="";
     this.meetingid=null;
  }
}

 

 

2009-11-19 15:19:31 com.sun.faces.lifecycle.LifecycleImpl phase
警告: executePhase(PROCESS_VALIDATIONS 3,com.sun.faces.context.FacesContextImpl@edd9de) threw exception
javax.faces.FacesException
 at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:108)
 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at com.jsfabc.jsh.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException
 at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
 at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
 at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:164)
 at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
 at javax.faces.component.UIInput.validate(UIInput.java:867)
 at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
 at javax.faces.component.UIInput.processValidators(UIInput.java:666)
 at javax.faces.component.UIForm.processValidators(UIForm.java:229)
 at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
 at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$201(AjaxViewRoot.java:53)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:302)
 at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:54)
 at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot.processValidators(AjaxViewRoot.java:315)
 at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
 ... 25 more
2009-11-19 15:19:31 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalArgumentException
 at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
 at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
 at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:164)
 at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
 at javax.faces.component.UIInput.validate(UIInput.java:867)
 at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
 at javax.faces.component.UIInput.processValidators(UIInput.java:666)
 at javax.faces.component.UIForm.processValidators(UIForm.java:229)
 at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1030)
 at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$201(AjaxViewRoot.java:53)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:302)
 at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:54)
 at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
 at org.ajax4jsf.framework.ajax.AjaxViewRoot.processValidators(AjaxViewRoot.java:315)
 at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at com.jsfabc.jsh.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Unknown Source)

 

网页代码

<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%>
<!-- 过滤非法登录 -->
<html>
<head>
<title>会议效果信息</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../fckeditor/fckeditor.js"></script>
<script type="text/javascript" defer="defer" src="../My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
.title2{ color:#0661b3; background:url(../images/bg_title2.jpg) repeat-x top; line-height:29px; height:29px; padding:0px 17px; margin:0px; font-size:12px; }
.title2 img{ padding-right:10px;}
</style>
<script type="text/javascript">
    function isEmpty() {
  var mid = document.getElementById("formLogin:mid").value;   
      if(mid == "") {
        alert("会议不能为空!");
        document.getElementById("formLogin:mid").focus();
        return false;
      }
      var info = document.getElementById("formLogin:info").value;   
      if(info == "") {
        alert("会议效果不能为空!");
        document.getElementById("formLogin:info").focus();
        return false;
      }
     
    }
 
 function doPopup(source) {
        popup = window.open("popupMeeting.faces", "popup",
                        "height=500,width=400,toolbar=no,menubar=no,"
                        + "scrollbars=yes");             
                     popup.openerFormId = source.form.id;
                     popup.focus();           
            }    
    </script>
</head>
<body> 
<f:view>
  <h:form  id="formLogin">
    <h2 class="title2"><img src="../images/icon_1.gif" align="absmiddle" />会议效果信息</h2>
    <table border="0" align="center" cellpadding="5" cellspacing="0">      
      <tr>
        <td align="right" style="font-size:12px;" >会议:</td>
        <td>
    <h:selectOneMenu  id="mid"  value="#{MeetinginfoBean.meetingid}"  style="text-align:left;width=500px;">     
          <f:selectItems value="#{MeetinginfoBean.meetingMap}" /> 
          </h:selectOneMenu>   
   </td>
      </tr>     
   <tr>
      <td align="right" style="font-size:12px;">会议效果:</td>
      <td>     
        <h:inputTextarea  id="info" cols="30" rows="10" value="#{MeetinginfoBean.info}" ></h:inputTextarea>  
  <h:commandButton value="标准效果"   onclick="doPopup(this); return false;"/>
   </td>
      </tr>   
      <tr>
        <td>&nbsp;</td>
        <td align="center"><h:commandButton value="保存"  actionListener="#{MeetinginfoBean.sava_ActionEvent}"  action="#{MeetinginfoBean.creatEntity}"
   onclick="return isEmpty();"/> </td>
      </tr>
    </table>
  </h:form>
</f:view>
</body>
</html>

加载中
返回顶部
顶部