TestPortlet3_23.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:portletbox 作者:
@SuppressWarnings("incomplete-switch")
@ProcessEvent(name=EVENT_NAME)
public void EventAble(EventRequest eventRequest, EventResponse eventResponse) 
      throws PortletException, IOException {
   // Get test to be performed

   String eventName = eventRequest.getEvent().getName();
   String eventTest = (String)eventRequest.getEvent().getValue();
   ThrowType tt = ThrowType.NONE;

   if (eventTest != null) {

      try {
         tt = ThrowType.valueOf(eventTest);
      }
      catch (Exception e) {
      }
   }

   eventRequest.getPortletSession().setAttribute(RENDER_PARM_NAME, "EventName=" + eventName
   // eventResponse.setRenderParameter( RENDER_PARM_NAME, "EventName=" + eventName 
         + ". Exception " + tt.toString() + " will be thrown." );

   switch(tt) {
      case PORTLET: 
         throw new PortletException("PortletException thrown from event method");
      case IO: 
         throw new IOException("IOException thrown from event method");
      case RUNTIME: 
         throw new RuntimeException("RuntimeException thrown from event method");
   }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号