本文整理匯總了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;
}