Package javax.servlet

Examples of javax.servlet.ServletException


    try
    {
      chartRemote = chartHome.create();
    }catch(CreateException e){
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    chartRemote.setDataSource(dataSource);
    Collection chartRawData = (Collection)chartRemote.getTicketBarData(individualId, listParameters);

    // Add the raw data to a JFree dataset
    DefaultCategoryDataset chartData = new DefaultCategoryDataset();
    Iterator iter = chartRawData.iterator();
    while (iter.hasNext())
    {
      HashMap row = (HashMap)iter.next();
      Number openTickets = (Number)row.get("count");
      String userName = (String)row.get("name");
      if(userName == null){
      userName = "UnAssigned";
    }
      Number ageValue = (Number)row.get("age");
      chartData.setValue(openTickets, userName, this.getAgeName(ageValue));
    }

    // create the chart
    JFreeChart barChart = ChartFactory.createStackedBarChart("Open Tickets by Age", "Age", "# Open Tickets",
                                                             chartData, org.jfree.chart.plot.PlotOrientation.VERTICAL,
                                                             true, true, false);

    // set the visual options
    CategoryPlot plot = barChart.getCategoryPlot();

    // set the X axis labels to be slanted
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 3.0));

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // set the max width of each bar
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setMaxBarWidth(0.10);

    // print the chart image directly the the HTTP stream
    OutputStream out = response.getOutputStream();
    response.setContentType("image/jpeg");

    try
    {
      ChartUtilities.writeChartAsJPEG(out, 1.0f, barChart, 400, 300);
    }catch(IOException e){
      logger.error("[getOpportunityPieData] Exception thrown.", e);
      throw new ServletException(e);
    }finally{
      out.close();
    }

    // return null (don't forward anywhere, we've done the output already)
View Full Code Here


      adHocReportForm.set("moduleId", new Integer(moduleId));
      request.setAttribute("reportId", String.valueOf(reportId));
      request.setAttribute("reportType", String.valueOf(ReportConstants.ADHOC_REPORT_CODE));
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    String forwardName = "";
    switch (moduleId) {
      case 14: forwardName = ".view.reports.entities.adhoc"; break;
      case 15: forwardName = ".view.reports.individuals.adhoc"; break;
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    ArrayList buttonList = new ArrayList();
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    ArrayList buttonList = new ArrayList();
View Full Code Here

    int typeId = 0;
    int rowId = 0;

    String op = request.getParameter("op");
    if ((op == null) || (op == "")) {
      throw new ServletException("No operation selected");
    }

    String type = request.getParameter("typeId");
    if ((type == null) || (type == "")) {
      String row = request.getParameter("rowId");
      if (CVUtility.notEmpty(row)) {
        rowId = Integer.parseInt(row);
      } else {
        throw new ServletException("No activity selected");
      }

      ActivityFacadeHome activityFacadeHome = (ActivityFacadeHome)CVUtility.getHomeObject(
          "com.centraview.activity.activityfacade.ActivityFacadeHome", "ActivityFacade");
      try {
        ActivityFacade remote = activityFacadeHome.create();
        remote.setDataSource(dataSource);
        typeId = remote.getActivityType(rowId);
      } catch (CreateException ce) {
        logger.error("[execute] Exception thrown.", ce);
        throw new ServletException(ce);
      }
    } else {
      typeId = Integer.parseInt(type);
    }

    ActionForward forward = null;
    if (op.equals("dup")) {
      switch (typeId) {
        case ActivityVO.AT_FORCASTED_SALES:
          forward = new ActionForward(
              "/sales/view_opportunity.do?Duplicate=true&TYPEOFOPERATION=ADD&OPPORTUNITYID="
                  + rowId);
          break;
        case ActivityVO.AT_LITRATURE_REQUEST:
          forward = new ActionForward(
              "/marketing/view_literaturefulfillment.do?TYPEOFOPERATION=ADD&activityid=" + rowId);
          break;
        case ActivityVO.AT_TASK:
          forward = new ActionForward("/projects/duplicate_task.do?rowId=" + rowId);
          break;
        default:
          forward = new ActionForward("/activities/duplicate_activity.do?rowId=" + rowId);
          break;
      }
    } else if (op.equals("del")) {
      switch (typeId) {
        case ActivityVO.AT_FORCASTED_SALES:
          forward = new ActionForward("/sales/delete_opportunitylist.do");
          break;
        case ActivityVO.AT_LITRATURE_REQUEST:
          forward = new ActionForward("/marketing/delete_literaturefulfillmentlist.do");
          break;
        case ActivityVO.AT_TASK:
          forward = new ActionForward("/projects/delete_tasklist.do");
          break;
        default:
          forward = new ActionForward("/activities/delete_activitylist.do");
          break;
      }
    } else {
      throw new ServletException("Invalid operation");
    }
    return forward;
  }
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
   
    ArrayList buttonList = new ArrayList()
View Full Code Here

      session.setAttribute("moduleId", String.valueOf(moduleId));
      // unless ViewAdHocReport.do needs the following whack it.
      request.setAttribute("reportType", String.valueOf(ReportConstants.ADHOC_REPORT_CODE));
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    String forwardName = "";
    switch (moduleId) {
      case 14: forwardName = ".view.reports.entities.adhoc"; break;
      case 15: forwardName = ".view.reports.individuals.adhoc"; break;
View Full Code Here

        AdvancedSearchHome advancedSearchHome = (AdvancedSearchHome)CVUtility.getHomeObject("com.centraview.advancedsearch.AdvancedSearchHome", "AdvancedSearch");
        remoteAdvancedSearch = advancedSearchHome.create();
        remoteAdvancedSearch.setDataSource(dataSource);
      }catch(Exception e){
        System.out.println("[Exception][SearchForm.execute] Exception Thrown getting EJB connection: " + e);
        throw new ServletException(e);
      }

      final int emailTableID = 33;
      final int emailModuleID = 79;
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = (ValueList)CVUtility.setupEJB("ValueList", "com.centraview.valuelist.ValueListHome", dataSource);
    } catch (Exception e) {
      logger.error("[relatedInfoSetup] Exception thrown.", e);
      throw new ServletException(e);
    }
    // List!
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    // Display Junk
    ValueListDisplay displayParameters = new ValueListDisplay(buttonList, true, false, true, true, true, true);
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
   
    ArrayList buttonList = new ArrayList()
View Full Code Here

TOP

Related Classes of javax.servlet.ServletException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.