本文整理汇总了Java中javax.faces.context.ExternalContext.getRequestPathInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ExternalContext.getRequestPathInfo方法的具体用法?Java ExternalContext.getRequestPathInfo怎么用?Java ExternalContext.getRequestPathInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.context.ExternalContext
的用法示例。
在下文中一共展示了ExternalContext.getRequestPathInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _getInternalView
import javax.faces.context.ExternalContext; //导入方法依赖的package包/类
private InternalView _getInternalView(
FacesContext context,
String viewId)
{
Object cached = _internalViewCache.get(viewId);
if (cached != null)
{
return ((cached == _NOT_FOUND) ? null : (InternalView)cached);
}
InternalView internal = _internalViews.get(viewId);
if (internal == null)
{
// If we're using suffix-mapping, then any internal viewId will
// get affixed with ".jsp" or ".jspx"; try trimming that off
// if present
ExternalContext external = context.getExternalContext();
// Only bother when using suffix-mapping (path info will always
// be non-null for prefix-mapping)
if (external.getRequestPathInfo() == null)
{
String suffix = external.getInitParameter("javax.faces.DEFAULT_SUFFIX");
if (suffix == null)
suffix = ".jspx";
if (viewId.endsWith(suffix))
{
String viewIdWithoutSuffix = viewId.substring(
0, viewId.length() - suffix.length());
internal = _internalViews.get(viewIdWithoutSuffix);
}
}
}
_internalViewCache.put(viewId, (internal == null) ? _NOT_FOUND : internal);
return internal;
}