gpt4 book ai didi

com.sun.faces.config.WebConfiguration类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 07:23:05 27 4
gpt4 key购买 nike

本文整理了Java中com.sun.faces.config.WebConfiguration类的一些代码示例,展示了WebConfiguration类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebConfiguration类的具体详情如下:
包路径:com.sun.faces.config.WebConfiguration
类名称:WebConfiguration

WebConfiguration介绍

[英]Class Documentation
[中]类文档

代码示例

代码示例来源:origin: org.glassfish/javax.faces

private String fetchProjectStageFromConfig() {
  WebConfiguration webConfig = WebConfiguration.getInstance(FacesContext.getCurrentInstance().getExternalContext());
  String value = webConfig.getEnvironmentEntry(WebConfiguration.WebEnvironmentEntry.ProjectStage);
  if (value != null) {
    if (LOGGER.isLoggable(FINE)) {
      LOGGER.log(FINE, "ProjectStage configured via JNDI: {0}", value);
    }
  } else {
    value = webConfig.getOptionValue(JavaxFacesProjectStage);
    if (value != null && LOGGER.isLoggable(FINE)) {
      LOGGER.log(FINE, "ProjectStage configured via servlet context init parameter: {0}", value);
    }
  }
  return value;
}

代码示例来源:origin: org.glassfish/jakarta.faces

private void processViewHandlers(ServletContext servletContext, FacesContext facesContext, Application application, LinkedHashMap<String, Node> viewHandlers) {
  
  // Take special action on the ViewHandlers that have been configured for the application. 
  // If any of the ViewHandlers is the FaceletViewHandler, don't install the 2.0 FaceletViewHandler. 
  // Make the application behave as 1.2 unless they use our ViewHandler
  
  WebConfiguration webConfig = WebConfiguration.getInstance();
  if (!webConfig.isOptionEnabled(DisableFaceletJSFViewHandler) && !webConfig.isOptionEnabled(DisableFaceletJSFViewHandlerDeprecated)) {
    if (viewHandlers.containsKey("com.sun.facelets.FaceletViewHandler")) {
      LOGGER.log(WARNING, "jsf.application.legacy_facelet_viewhandler_detected", "com.sun.facelets.FaceletViewHandler");
      webConfig.overrideContextInitParameter(DisableFaceletJSFViewHandler, true);
    }
  }
  
  for (Node viewHandlerNode : viewHandlers.values()) {
    setViewHandler(servletContext, facesContext, application, viewHandlerNode);
  }
}

代码示例来源:origin: org.glassfish/javax.faces

public MultiViewHandler() {
  WebConfiguration config = WebConfiguration.getInstance();
     
  configuredExtensions = config.getConfiguredExtensions();
  extensionsSet = config.isSet(WebConfiguration.WebContextInitParameter.DefaultSuffix);
  vdlFactory = (ViewDeclarationLanguageFactory) FactoryFinder.getFactory(VIEW_DECLARATION_LANGUAGE_FACTORY);
  protectedViews = new CopyOnWriteArraySet<>();
}

代码示例来源:origin: com.sun.faces/jsf-impl

private void init() {
  WebConfiguration webconfig = WebConfiguration.getInstance();
  enableMissingResourceLibraryDetection =
      webconfig.isOptionEnabled(EnableMissingResourceLibraryDetection);
}

代码示例来源:origin: org.glassfish/javax.faces

public WebappResourceHelper() {
  WebConfiguration webconfig = WebConfiguration.getInstance();
  cacheTimestamp = webconfig.isOptionEnabled(CacheResourceModificationTimestamp);
  BASE_RESOURCE_PATH = webconfig.getOptionValue(WebConfiguration.WebContextInitParameter.WebAppResourcesDirectory);
  BASE_CONTRACTS_PATH = webconfig.getOptionValue(WebConfiguration.WebContextInitParameter.WebAppContractsDirectory);
}

代码示例来源:origin: org.glassfish/javax.faces

public FaceletWebappResourceHelper() {
  WebConfiguration webConfig = WebConfiguration.getInstance();
  webAppContractsDirectory = webConfig.getOptionValue(WebAppContractsDirectory);
  configuredExtensions = webConfig.getOptionValue(FaceletsSuffix, " ");
}

代码示例来源:origin: javax.faces/jsf-impl

private WebConfiguration(ServletContext servletContext) {
  this.servletContext = servletContext;
  String contextName = getServletContextName();
  initSetList(servletContext);
  processBooleanParameters(servletContext, contextName);
  processInitParameters(servletContext, contextName);
  if (canProcessJndiEntries()) {
    processJndiEntries(contextName);
  }
}

代码示例来源:origin: eclipse-ee4j/mojarra

webConfig = WebConfiguration.getInstance(context);
if (mappingsAdded == null) {
  if (!webXmlProcessor.isFacesServletPresent()) {
    if (!webConfig.isOptionEnabled(ForceLoadFacesConfigFiles)) {
      LOGGER.log(FINE, "No FacesServlet found in deployment descriptor - bypassing configuration");
      WebConfiguration.clear(context);
      configManager.destroy(context, initContext);
      ConfigManager.removeInstance(context);
  webConfig.setOptionEnabled(WebConfiguration.BooleanWebContextInitParameter.EnableDistributable, true);
  context.setAttribute(WebConfiguration.BooleanWebContextInitParameter.EnableDistributable.getQualifiedName(), TRUE);
  if (webConfig.isOptionEnabled(VerifyFacesConfigObjects)) {
    LOGGER.warning("jsf.config.verifyobjects.development_only");
    webConfig.overrideContextInitParameter(EnableLazyBeanValidation, false);
    Verifier.setCurrentInstance(new Verifier());
  if (webConfig.isOptionEnabled(EnableWebsocketEndpoint)) {
    ServerContainer serverContainer = (ServerContainer) context.getAttribute(ServerContainer.class.getName());
  webConfig.doPostBringupActions();
  configManager.publishPostConfigEvent();

代码示例来源:origin: org.glassfish/jakarta.faces

if (webConfig.canProcessJndiEntries() &&
    !webConfig.isSet(BooleanWebContextInitParameter.DisableClientStateEncryption)) {
  guard = new ByteArrayGuard();
} else {
stateTimeoutEnabled = webConfig.isSet(ClientStateTimeout);
if (stateTimeoutEnabled) {
  String timeout = webConfig.getOptionValue(ClientStateTimeout);
  try {
    stateTimeout = Long.parseLong(timeout);
String size = webConfig.getOptionValue(
   ClientStateWriteBufferSize);
String defaultSize =
debugSerializedState = webConfig.isOptionEnabled(BooleanWebContextInitParameter.EnableClientStateDebugging);

代码示例来源:origin: asual/summer

public FacesRenderKitImpl() {
  webConfig = WebConfiguration.getInstance();
  String value = webConfig.getEnvironmentEntry(WebConfiguration.WebEnvironmentEntry.ProjectStage);
  if (value == null) {
    value = webConfig.getOptionValue(WebContextInitParameter.JavaxFacesProjectStage);
  }
  try {
    if (value != null) {
      if (ProjectStage.valueOf(value).equals(ProjectStage.Development)) {
        webConfig.overrideContextInitParameter(WebContextInitParameter.FaceletsDefaultRefreshPeriod, 
            WebContextInitParameter.FaceletsDefaultRefreshPeriod.getDefaultValue());
      }
    }
  } catch (IllegalArgumentException e) {
  }
}

代码示例来源:origin: javax.faces/jsf-impl

webConfig = WebConfiguration.getInstance(context);
ConfigManager configManager = ConfigManager.getInstance();
if (!webConfig.isOptionEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles)) {
  WebXmlProcessor processor = new WebXmlProcessor(context);
  if (!processor.isFacesServletPresent()) {
            "No FacesServlet found in deployment descriptor - bypassing configuration");
    WebConfiguration.clear(context);
    return;
  } else {
     webConfig.isOptionEnabled(BooleanWebContextInitParameter.EnableHtmlTagLibraryValidator));
  if (webConfig.isOptionEnabled(BooleanWebContextInitParameter.VerifyFacesConfigObjects)) {
    if (LOGGER.isLoggable(Level.WARNING)) {
      LOGGER.warning("jsf.config.verifyobjects.development_only");
    webConfig.overrideContextInitParameter(BooleanWebContextInitParameter.EnableLazyBeanValidation, false);
    Verifier.setCurrentInstance(new Verifier());
  if (webConfig.isOptionEnabled(EnableThreading)) {
    initScripting();

代码示例来源:origin: org.glassfish.main.web/jsf-connector

WebConfiguration config = WebConfiguration.getInstance(ctx);
if (!config.isSet(WebConfiguration.BooleanWebContextInitParameter.EnableAgressiveSessionDirtying)) {
  Object isDistributableObj = ctx.getAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE);
  Object enableHAObj = ctx.getAttribute(Constants.ENABLE_HA_ATTRIBUTE);
        LOGGER.fine("setting the EnableAgressiveSessionDirtying to true");
      config.overrideContextInitParameter(WebConfiguration.BooleanWebContextInitParameter.EnableAgressiveSessionDirtying,
          Boolean.TRUE);

代码示例来源:origin: com.sun.faces/jsf-impl

public static FaceletsConfiguration getInstance(FacesContext context) {
  FaceletsConfiguration result = null;
  Map<Object, Object> attrs = context.getAttributes();
  result = (FaceletsConfiguration) attrs.get(FaceletsConfiguration.FACELETS_CONFIGURATION_ATTRIBUTE_NAME);
  if (null == result) {
    WebConfiguration config = WebConfiguration.getInstance(context.getExternalContext());
    result = config.getFaceletsConfiguration();
    attrs.put(FaceletsConfiguration.FACELETS_CONFIGURATION_ATTRIBUTE_NAME, result);
  }
  return result;
}

代码示例来源:origin: org.glassfish/jakarta.faces

webconfig.isOptionEnabled(DisableFaceletJSFViewHandler) ||
webconfig.isOptionEnabled(DisableFaceletJSFViewHandlerDeprecated);
webconfig.overrideContextInitParameter(DisableFaceletJSFViewHandler, isFaceletsDisabled);

代码示例来源:origin: org.glassfish/jakarta.faces

private boolean shouldInitConfigMonitoring() {
  boolean development = isDevModeEnabled();
  boolean threadingOptionSpecified = webConfig.isSet(EnableThreading);
  
  if (development && !threadingOptionSpecified) {
    return true;
  }
  
  return development && threadingOptionSpecified && webConfig.isOptionEnabled(EnableThreading);
}

代码示例来源:origin: org.glassfish/jakarta.faces

/**
 * @param param the init parameter of interest
 * @return <code>true</code> if the parameter was explicitly set,
 *  otherwise, <code>false</code>
 */
public boolean isSet(WebContextInitParameter param) {
  return isSet(param.getQualifiedName());
}

代码示例来源:origin: com.sun.faces/jsf-impl

/**
 * Constructs a new ResourceCache.
 */
public ResourceCache() {
  this(WebConfiguration.getInstance());
}

代码示例来源:origin: org.glassfish/jakarta.faces

if (configManager == null && WebConfiguration.getInstanceWithoutCreating(context) != null) {
  if (LOGGER.isLoggable(SEVERE)) {
    LOGGER.log(SEVERE, "Unexpected state during contextDestroyed: no ConfigManager instance in current ServletContext but one is expected to exist.");
  FactoryFinder.releaseFactories();
  ReflectionUtils.clearCache(Thread.currentThread().getContextClassLoader());
  WebConfiguration.clear(context);
  InitFacesContext.cleanupInitMaps(context);

代码示例来源:origin: org.glassfish/javax.faces

private boolean isMatchedWithFaceletsSuffix(String viewId) {
  String[] defaultsuffixes = webConfig.getOptionValue(WebConfiguration.WebContextInitParameter.FaceletsSuffix, " ");
  for (String suffix : defaultsuffixes) {
    if (viewId.endsWith(suffix)) {
      return true;
    }
  }
  
  return false;
}

代码示例来源:origin: org.glassfish/jakarta.faces

@Override
public void comment(char[] ch, int start, int length)
    throws SAXException {
  if (this.inDocument) {
    if (!unit.getWebConfiguration().getFaceletsConfiguration().isConsumeComments(alias)) {
      this.unit.writeComment(new String(ch, start, length));
    }
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com