Package javax.servlet

Examples of javax.servlet.ServletContext


         // we need to do this because the classloader is initialize by the web container and
         // the injection container needs the classloader so that it can build up Injectors and ENC populators
         injectionContainer.setClassLoader(getClassLoader());
         injectionContainer.processMetadata();
      }
      ServletContext servletContext = ((Context) webContainer).getServletContext();
      if (servletContext == null)
         return;
   }
View Full Code Here


      if (sharedJBossWebMetaData != null)
      {
         processWebMetaData(sharedJBossWebMetaData);
      }

      ServletContext servletContext = context.getServletContext();
      Kernel kernel = kernelLocal.get();
      DeploymentUnit unit = deploymentUnitLocal.get();
      log.debug("Setting MC attributes, kernel: " + kernel + ", unit: " + unit);
      servletContext.setAttribute(KernelConstants.KERNEL_NAME, kernel);
      servletContext.setAttribute(DeploymentUnit.class.getName(), unit);
   }
View Full Code Here

  public void service(
    HttpServletRequest request,
    HttpServletResponse response
    ) throws IOException, ServletException
  {
    ServletContext context = this.getServletConfig().getServletContext();

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    try
    {
      String reportFileName = context.getRealPath("/reports/WebappReport.jasper");
      File reportFile = new File(reportFileName);
      if (!reportFile.exists())
        throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");

      Map parameters = new HashMap();
View Full Code Here

  public void service(
    HttpServletRequest request,
    HttpServletResponse response
    ) throws IOException, ServletException
  {
    ServletContext context = this.getServletConfig().getServletContext();

    File reportFile = new File(context.getRealPath("/reports/WebappReport.jasper"));
    if (!reportFile.exists())
      throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");

    Map parameters = new HashMap();
    parameters.put("ReportTitle", "Address Report");
View Full Code Here

  public void service(
    HttpServletRequest request,
    HttpServletResponse response
    ) throws IOException, ServletException
  {
    ServletContext context = this.getServletConfig().getServletContext();

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    try
    {
      File reportFile = new File(context.getRealPath("/reports/WebappReport.jasper"));
      if (!reportFile.exists())
        throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");

      JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());
   
View Full Code Here

  public void service(
    HttpServletRequest request,
    HttpServletResponse response
    ) throws IOException, ServletException
  {
    ServletContext context = this.getServletConfig().getServletContext();

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    try
    {
      File reportFile = new File(context.getRealPath("/reports/WebappReport.jasper"));
      if (!reportFile.exists())
        throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");

      JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());
   
View Full Code Here

  public void service(
    HttpServletRequest request,
    HttpServletResponse response
    ) throws IOException, ServletException
  {
    ServletContext context = this.getServletConfig().getServletContext();

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    try
    {
      JasperCompileManager.compileReportToFile(context.getRealPath("/reports/WebappReport.jrxml"));
    }
    catch (JRException e)
    {
      out.println("<html>");
      out.println("<head>");
View Full Code Here

  /**
   * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
   */
  public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);
    ServletContext servletContext = getServletContext();
   
    // initialize log system. do not make any calls to Logger "log" before log system has been initialized.
    String prefix =  servletContext.getRealPath("/");
    String file = "WEB-INF/log4j.properties";
    PropertyConfigurator.configure(prefix+file);

    // ----- startup OLAT -----
    String moduleID = null;
View Full Code Here

  /**
   * Loookup module container instance
   */
  public static final StrutsModuleGroup getInstance(ActionServlet servlet) {
    ServletContext context = servlet.getServletContext();
    StrutsModuleGroup result = (StrutsModuleGroup)context.getAttribute(MODULE_CONTAINER_KEY);
    if (result == null) {
      result = new StrutsModuleGroup(ModuleSupport.getInstance(context));
      context.setAttribute(MODULE_CONTAINER_KEY, result);
    }
    return result;
  }
View Full Code Here

    /**
     * Removes the ConnectionMap from the Session (actually, the ServletContext).
     */
    void removeConnectionMap()
    {
        ServletContext context = session.getServletContext();
        context.removeAttribute( session.getId() + SSH_CONNECTIONS );
    }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletContext

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.