Package javax.servlet

Examples of javax.servlet.ServletContext


         public void execute(ServletContext context, PortalContainer portalContainer)
         {
            onInit(config, portalContainer);
         }
      };
      ServletContext context = config.getServletContext();
      RootContainer rootContainer = RootContainer.getInstance();
      rootContainer.addInitTask(context, task);
      rootContainer.registerPortalContainer(context);
   }
View Full Code Here


              if (session.isNew()) {
                cc = new Cookie(SESSION_COOKIE_NAME,
                    sessionValue);
                if (serve.expiredIn < 0)
                  cc.setMaxAge(Math.abs(serve.expiredIn) * 60);
                ServletContext sc = ((AcmeSession) session)
                    .getServletContext();
                try {
                  String cp = (String) sc
                      .getClass()
                      .getMethod("getContextPath",
                          Utils.EMPTY_CLASSES)
                      .invoke(sc, Utils.EMPTY_OBJECTS);
                  if (cp.length() == 0)
View Full Code Here

    public String getServletFileNameForJsp(Context context, String jspName) {
        String servletName = null;

        ServletConfig servletConfig = (ServletConfig) context.findChild("jsp");
        if (servletConfig != null) {
            ServletContext sctx = context.getServletContext();
            Options opt = new EmbeddedServletOptions(servletConfig, sctx);
            JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt);
            JspCompilationContext jcctx = createJspCompilationContext(jspName, false, opt, sctx, jrctx, null);
            servletName = jcctx.getServletJavaFileName();
        } else {
View Full Code Here

    public void recompileJsps(Context context, Summary summary, List names) {
        ServletConfig servletConfig = (ServletConfig) context.findChild("jsp");
        if (servletConfig != null) {
            if (summary != null) {
                synchronized (servletConfig) {
                    ServletContext sctx = context.getServletContext();
                    Options opt = new EmbeddedServletOptions(servletConfig, sctx);

                    JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt);
                    try {
                        //
View Full Code Here

     */
    public void listContextJsps(Context context, Summary summary, boolean compile) throws Exception {
        ServletConfig servletConfig = (ServletConfig) context.findChild("jsp");
        if (servletConfig != null) {
            synchronized (servletConfig) {
                ServletContext sctx = context.getServletContext();
                Options opt = new EmbeddedServletOptions(servletConfig, sctx);

                JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt);
                try {
                    if (summary.getItems() == null) {
View Full Code Here

     * @param level
     * @param compile
     */
    protected void compileItem(String jspName, Options opt, Context ctx, JspRuntimeContext jrctx,
                               Summary summary, URLClassLoader classLoader, int level, boolean compile) {
        ServletContext sctx = ctx.getServletContext();
        Set paths = sctx.getResourcePaths(jspName);

        if (paths != null) {
            for (Iterator it = paths.iterator(); it.hasNext();) {
                String name = (String) it.next();
                boolean isJsp = false;
View Full Code Here

public class ViewServletSourceController extends ContextHandlerController {
    protected ModelAndView handleContext(String contextName, Context context,
                                         HttpServletRequest request, HttpServletResponse response) throws Exception {

        String jspName = ServletRequestUtils.getStringParameter(request, "source", null);
        ServletContext sctx = context.getServletContext();
        ServletConfig scfg = (ServletConfig) context.findChild("jsp");
        Options opt = new EmbeddedServletOptions(scfg, sctx);
        String encoding = opt.getJavaEncoding();
        String content = null;
View Full Code Here

                Resource jsp = (Resource) context.getResources().lookup(jspName);

                if (jsp != null) {

                    ServletContext sctx = context.getServletContext();
                    ServletConfig scfg = (ServletConfig) context.findChild("jsp");
                    Options opt = new EmbeddedServletOptions(scfg, sctx);
                    String descriptorPageEncoding = opt.getJspConfig().findJspProperty(jspName).getPageEncoding();

                    if (descriptorPageEncoding != null && descriptorPageEncoding.length() > 0) {
View Full Code Here

            {
               log.error("Error on contextInitialized", ex);
            }
         }
      };
      ServletContext ctx = event.getServletContext();
      try
      {
         EnvSpecific.initThreadEnv(ctx);
         RootContainer.getInstance().addInitTask(event.getServletContext(), task);
      }
View Full Code Here

        return sbean;
    }

    public static List getApplicationAttributes(Context context) {
        List attrs = new ArrayList();
        ServletContext servletCtx = context.getServletContext();
        for (Enumeration e = servletCtx.getAttributeNames(); e.hasMoreElements(); ) {
            String attrName = (String) e.nextElement();
            Object attrValue = servletCtx.getAttribute(attrName);

            Attribute attr = new Attribute();
            attr.setName(attrName);
            attr.setValue(attrValue);
            attr.setType(ClassUtils.getQualifiedName(attrValue.getClass()));
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.