/** * A convenience method to return the WebApplication. Same as {@link WebApplication#get()}. * * @return the current WebApplication */ public final WebApplication getWebApplication() { return WebApplication.get(); } }
public Class<? extends Page> getBoxPageClass() { Class<? extends Page> homePage = WebApplication.get().getHomePage(); if (homePage != null) { return homePage; } return boxPageClass; }
@Override public String getContentType() { return WebApplication.get().getServletContext().getMimeType(url); }
@Override public Object getObject() { parameters.put("id", componentMarkupId); parameters.put("filterName", WebApplication.get().getWicketFilter().getFilterConfig().getFilterName()); return parameters; } }
protected BufferedWebResponse getAndRemoveBufferedResponse(Url url) { String sessionId = getSessionId(); BufferedWebResponse response = null; if (Strings.isEmpty(sessionId) == false) { response = WebApplication.get().getAndRemoveBufferedResponse(sessionId, url); } return response; }
@Override public String getContentType() { return WebApplication.get().getServletContext().getMimeType(url); }
/** * A convenience method to return the WebApplication. Same as {@link WebApplication#get()}. * * @return the current WebApplication */ public final WebApplication getWebApplication() { return WebApplication.get(); } }
/** * Redirect it to (home)page */ protected void redirectPage() { if (WebApplication.exists()) { throw new RestartResponseException(WebApplication.get().getHomePage()); } }
protected BufferedWebResponse getAndRemoveBufferedResponse(Url url) { String sessionId = getSessionId(); BufferedWebResponse response = null; if (Strings.isEmpty(sessionId) == false) { response = WebApplication.get().getAndRemoveBufferedResponse(sessionId, url); } return response; }
protected boolean isMetaInfResourcesSupported() { if (META_INF_RESOURCES_SUPPORTED == null) { int majorVersion = WebApplication.get().getServletContext().getMajorVersion(); META_INF_RESOURCES_SUPPORTED = majorVersion >= 3; } return META_INF_RESOURCES_SUPPORTED; }
/** * A convenience method to return the WebApplication. Same as {@link WebApplication#get()}. * * @return the current WebApplication */ public final WebApplication getWebApplication() { return WebApplication.get(); } }
protected boolean isMetaInfResourcesSupported() { if (META_INF_RESOURCES_SUPPORTED == null) { int majorVersion = WebApplication.get().getServletContext().getMajorVersion(); META_INF_RESOURCES_SUPPORTED = majorVersion >= 3; } return META_INF_RESOURCES_SUPPORTED; }
/** * A convenience method to return the WebApplication. Same as {@link WebApplication#get()}. * * @return the current WebApplication */ public final WebApplication getWebApplication() { return WebApplication.get(); } }
private Manifest getWebAppManifest() throws IOException { final ServletContext servletContext = WebApplication.get().getServletContext(); final InputStream manifestInputStream = servletContext.getResourceAsStream("/META-INF/MANIFEST.MF"); if (manifestInputStream != null) { return new Manifest(manifestInputStream); } final File manifestFile = new File(servletContext.getRealPath("/"), "META-INF/MANIFEST.MF"); if (manifestFile.exists()) { return new Manifest(new FileInputStream(manifestFile)); } return null; }
/** * The rules if and when to insert an xml decl in the response are a bit tricky. Allow the user * to replace the default per page and per application. */ protected void renderXmlDecl() { WebApplication.get().renderXmlDecl(this, false); }
@Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); String path = WebApplication.get().getServletContext().getContextPath(); if (StringUtils.isBlank(path)) { path = "/"; } tag.put("href", path); } });
/** * The rules if and when to insert an xml decl in the response are a bit tricky. Allow the user * to replace the default per page and per application. */ protected void renderXmlDecl() { WebApplication.get().renderXmlDecl(this, false); }
private IClassResolver getClassResolver() { Application application = WebApplication.get(); ApplicationSettings appSettings = application.getApplicationSettings(); return appSettings.getClassResolver(); } }
protected boolean hasBufferedResponse(Url url) { String sessionId = getSessionId(); boolean hasResponse = false; if (Strings.isEmpty(sessionId) == false) { hasResponse = WebApplication.get().hasBufferedResponse(sessionId, url); } return hasResponse; }
protected boolean hasBufferedResponse(Url url) { String sessionId = getSessionId(); boolean hasResponse = false; if (Strings.isEmpty(sessionId) == false) { hasResponse = WebApplication.get().hasBufferedResponse(sessionId, url); } return hasResponse; }