private boolean processParameter(HttpServletRequest request){
  HttpSession session=request.getSession(true);
  session.removeAttribute(WebSessionCtx.HDR_MESSAGE);
  Properties ctx=JSPEnv.getCtx(request);
  String mode=WebUtil.getParameter(request,"mode");
  if (mode == null)   return false;
  boolean subscribe=!mode.startsWith("un");
  int R_InterestArea_ID=WebUtil.getParameterAsInt(request,"area");
  MInterestArea ia=MInterestArea.get(ctx,R_InterestArea_ID);
  int AD_User_ID=WebUtil.getParameterAsInt(request,"contact");
  log.fine("Subscribe=" + subscribe + ",R_InterestArea_ID="+ R_InterestArea_ID+ ",AD_User_ID="+ AD_User_ID);
  if (R_InterestArea_ID == 0 || AD_User_ID == 0)   return false;
  MContactInterest ci=MContactInterest.get(ctx,R_InterestArea_ID,AD_User_ID,false,null);
  ci.subscribe(subscribe);
  boolean ok=ci.save();
  if (ok)   log.fine("success");
 else   log.log(Level.SEVERE,"subscribe failed");
  WebUser wu=(WebUser)session.getAttribute(WebUser.NAME);
  if (wu == null) {
    wu=WebUser.get(ctx,AD_User_ID);
    session.setAttribute(WebUser.NAME,wu);
  }
  sendEMail(request,wu,ia.getName(),subscribe);
  return ok;
}

private boolean processParameter ( HttpServletRequest request ) { HttpSession session = request . getSession ( true ) ; session . removeAttribute ( WebSessionCtx . HDR_MESSAGE ) ; Properties ctx = JSPEnv . getCtx ( request ) ; String mode = WebUtil . getParameter ( request , "mode" ) ; if ( mode == null ) return false ; boolean subscribe = ! mode . startsWith ( "un" ) ; int R_InterestArea_ID = WebUtil . getParameterAsInt ( request , "area" ) ; MInterestArea ia = MInterestArea . get ( ctx , R_InterestArea_ID ) ; int AD_User_ID = WebUtil . getParameterAsInt ( request , "contact" ) ; log . fine ( "Subscribe=" + subscribe + ",R_InterestArea_ID=" + R_InterestArea_ID + ",AD_User_ID=" + AD_User_ID ) ; if ( R_InterestArea_ID == 0 || AD_User_ID == 0 ) return false ; MContactInterest ci = MContactInterest . get ( ctx , R_InterestArea_ID , AD_User_ID , false , null ) ; ci . subscribe ( subscribe ) ; boolean ok = ci . save ( ) ; if ( ok ) log . fine ( "success" ) ; else log . log ( Level . SEVERE , "subscribe failed" ) ; WebUser wu = ( WebUser ) session . getAttribute ( WebUser . NAME ) ; if ( wu == null ) { wu = WebUser . get ( ctx , AD_User_ID ) ; session . setAttribute ( WebUser . NAME , wu ) ; } sendEMail ( request , wu , ia . getName ( ) , subscribe ) ; return ok ; }
process parameter and check them
