Examples of ServletException


Examples of javax.servlet.ServletException

      String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
      getReportList(request, dataSource, "StandardReport", ValueListConstants.STANDARD_REPORT_LIST_TYPE, ValueListConstants.standardReportViewMap, moduleId, new ArrayList());
      session.removeAttribute("standardreportform");
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    // based on the module ID pick the forward name this name is used to set the selections on the left nav.
    String forwardName = "";
    switch (moduleId) {
      case 14: forwardName = ".view.reports.contacts.standard"; break;
View Full Code Here

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
TOP
Copyright © 2018 www.massapi.com. 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.