Example usage for javax.servlet ServletConfig getServletContext

List of usage examples for javax.servlet ServletConfig getServletContext

Introduction

In this page you can find the example usage for javax.servlet ServletConfig getServletContext.

Prototype

public ServletContext getServletContext();

Source Link

Document

Returns a reference to the ServletContext in which the caller is executing.

Usage

From source file:org.blanco.gae.blog.BlogServlet.java

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    ctx = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
}

From source file:com.netcracker.financeapp.controller.agent.AgentServlet.java

@Override
public void init(ServletConfig config) {
    try {//from  w  ww. ja  va  2  s . co m
        super.init(config);
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
    } catch (ServletException ex) {
        Logger.getLogger(AgentServlet.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:eu.cloud4soa.frontend.commons.server.services.ApplicationComponentsTreeServiceImpl.java

@Override
public void init(ServletConfig config) throws ServletException {
    super.init(config);
    SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}

From source file:com.netcracker.financeapp.controller.bank_card.BankCardAddServlet.java

@Override
public void init(ServletConfig config) {
    try {//from   w w w. j  a  va2s.  co  m
        super.init(config);
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
    } catch (ServletException ex) {
        Logger.getLogger(BankCardAddServlet.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.netcracker.financeapp.controller.type.typeAddServlet.java

@Override
public void init(ServletConfig config) {
    try {/*  w  w  w  .j  a  v a 2 s. co  m*/
        super.init(config);
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
    } catch (ServletException ex) {
        Logger.getLogger(typeAddServlet.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.netcracker.financeapp.controller.bank_card.BankCardServlet.java

@Override
public void init(ServletConfig config) {
    try {/*from  w  ww  .j a va 2  s .c  om*/
        super.init(config);
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
    } catch (ServletException ex) {
        Logger.getLogger(BankCardServlet.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:org.wso2.carbon.priority.executors.ui.PriorityAdminClient.java

public PriorityAdminClient(ServletConfig config, HttpSession session) throws AxisFault {

    String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
    ConfigurationContext configContext = (ConfigurationContext) config.getServletContext()
            .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
    String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
    String serviceURL = backendServerURL + "PriorityMediationAdmin";
    stub = new PriorityMediationAdminStub(configContext, serviceURL);
    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);/*  w  w w.  j a  v  a 2  s  . co  m*/
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
}

From source file:adminpackage.adminview.ProductAddition.java

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods.//ww  w . ja  v  a 2s .c om
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
public void init(ServletConfig config) throws ServletException {
    context = config.getServletContext();
    super.init(config); //To change body of generated methods, choose Tools | Templates.
    adminFacadeHandler = new AdminFacadeHandler();
}

From source file:de.qucosa.dissemination.epicur.servlet.EpicurDisseminationServlet.java

private boolean isParameterSet(ServletConfig config, String name) {
    String p = config.getServletContext().getInitParameter(name);
    return p != null && !p.isEmpty() || (System.getProperty(name) != null);
}

From source file:org.codehaus.cargo.sample.testdata.jdbc.TestServlet.java

public void init(ServletConfig config) throws ServletException {
    super.init(config);
    ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
    dao = (DerbyDao) ctx.getBean("personDao");
    txManager = (PlatformTransactionManager) ctx.getBean("transactionManager");
    dao.createTable();/*from  w  w  w  .  j a  v a 2s. c  o m*/
}