📄 requestutils.java
字号:
public static String getActionMappingURL(
String action,
PageContext pageContext) {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getActionMappingURL(action, pageContext);
}
/**
* <p>Locate and return the specified bean, from an optionally specified
* scope, in the specified page context. If no such bean is found,
* return <code>null</code> instead. If an exception is thrown, it will
* have already been saved via a call to <code>saveException</code>.</p>
*
* @param pageContext Page context to be searched
* @param name Name of the bean to be retrieved
* @param scopeName Scope to be searched (page, request, session, application)
* or <code>null</code> to use <code>findAttribute()</code> instead
*
* @return JavaBean in the specified page context
* @exception JspException if an invalid scope name
* is requested
* @deprecated This will be removed after Struts 1.2.
* Use {@link org.apache.struts.taglib.TagUtils#lookup(PageContext,String,String)} instead.
*/
public static Object lookup(PageContext pageContext, String name, String scopeName)
throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().lookup(pageContext, name, scopeName);
}
/**
* <p>Converts the scope name into its corresponding PageContext constant value.</p>
*
* @param scopeName Can be "page", "request", "session", or "application" in any
* case
*
* @return The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
* @throws JspException if the scopeName is not a valid name.
* @since Struts 1.1
* @deprecated This will be removed after Struts 1.2.
* Use {@link org.apache.struts.taglib.TagUtils#getScope(String)} instead.
*/
public static int getScope(String scopeName) throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getScope(scopeName);
}
/**
* <p>Locate and return the specified property of the specified bean, from
* an optionally specified scope, in the specified page context. If an
* exception is thrown, it will have already been saved via a call to
* <code>saveException</code>.</p>
*
* @param pageContext Page context to be searched
* @param name Name of the bean to be retrieved
* @param property Name of the property to be retrieved, or
* <code>null</code> to retrieve the bean itself
* @param scope Scope to be searched (page, request, session, application)
* or <code>null</code> to use <code>findAttribute()</code> instead
*
* @return property of specified JavaBean
* @exception JspException if an invalid scope name
* is requested
* @exception JspException if the specified bean is not found
* @exception JspException if accessing this property causes an
* IllegalAccessException, IllegalArgumentException,
* InvocationTargetException, or NoSuchMethodException
* @deprecated This will be removed after Struts 1.2.
* Use {@link org.apache.struts.taglib.TagUtils#lookup(PageContext,String,String,String)} instead.
*/
public static Object lookup(
PageContext pageContext,
String name,
String property,
String scope)
throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().lookup(pageContext, name, property, scope);
}
/**
* <p>Look up and return current user locale, based on the specified parameters.</p>
*
* @param pageContext The PageContext associated with this request
* @param locale Name of the session attribute for our user's Locale. If this is
* <code>null</code>, the default locale key is used for the lookup.
*
* @return current user locale
* @deprecated This will be removed after Struts 1.2.
* Use {@link org.apache.struts.taglib.TagUtils#getUserLocale(PageContext,String)} instead.
*/
public static Locale retrieveUserLocale(PageContext pageContext, String locale) {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getUserLocale(pageContext, locale);
}
/**
* <p>Look up and return a message string, based on the specified parameters.</p>
*
* @param pageContext The PageContext associated with this request
* @param bundle Name of the servlet context attribute for our
* message resources bundle
* @param locale Name of the session attribute for our user's Locale
* @param key Message key to be looked up and returned
*
* @return message string
* @exception JspException if a lookup error occurs (will have been
* saved in the request already)
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#message(PageContext,String,String,String)} instead.
* This will be removed after Struts 1.2.
*/
public static String message(
PageContext pageContext,
String bundle,
String locale,
String key)
throws JspException {
// :TODO: Remove afer Struts 1.2
return TagUtils.getInstance().message(pageContext, bundle, locale, key);
}
/**
* Look up and return a message string, based on the specified parameters.
*
* @param pageContext The PageContext associated with this request
* @param bundle Name of the servlet context attribute for our
* message resources bundle
* @param locale Name of the session attribute for our user's Locale
* @param key Message key to be looked up and returned
* @param args Replacement parameters for this message
* @return message string
* @exception JspException if a lookup error occurs (will have been
* saved in the request already)
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#message(PageContext,String,String,String,Object[])} instead.
* This will be removed after Struts 1.2.
*/
public static String message(
PageContext pageContext,
String bundle,
String locale,
String key,
Object args[])
throws JspException {
// :TODO: Remove afer Struts 1.2
return TagUtils.getInstance().message(
pageContext,
bundle,
locale,
key,
args);
}
/**
* <p>Return true if a message string for the specified message key
* is present for the specified Locale.</p>
*
* @param pageContext The PageContext associated with this request
* @param bundle Name of the servlet context attribute for our
* message resources bundle
* @param locale Name of the session attribute for our user's Locale
* @param key Message key to be looked up and returned
*
* @return true if a message string for message key exists
* @exception JspException if a lookup error occurs (will have been
* saved in the request already)
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#present(PageContext ,String,String,String)} instead.
* This will be removed after Struts 1.2.
*/
public static boolean present(
PageContext pageContext,
String bundle,
String locale,
String key)
throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().present(pageContext, bundle, locale, key);
}
/**
* <p>Return the context-relative URL that corresponds to the specified
* <code>page</code> attribute value, calculated based on the
* <code>pagePattern</code> property of the current module's
* {@link ModuleConfig}.</p>
*
* @param request The servlet request we are processing
* @param page The module-relative URL to be substituted in
* to the <code>pagePattern</code> pattern for the current module
* (<strong>MUST</strong> start with a slash)
* @return context-relative URL
* @since Struts 1.1
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#pageURL(HttpServletRequest request, String page, ModuleConfig moduleConfig)} instead.
* This will be removed after Struts 1.2.
*/
public static String pageURL(HttpServletRequest request, String page) {
//load the current moduleConfig
ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request);
return TagUtils.getInstance().pageURL(request, page, moduleConfig);
//:TODO: Remove after Struts 1.2
}
/**
* <p>Save the specified exception as a request attribute for later use.</p>
*
* @param pageContext The PageContext for the current page
* @param exception The exception to be saved
*
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#saveException(PageContext,Throwable)} instead.
* This will be removed after Struts 1.2.
*/
public static void saveException(PageContext pageContext, Throwable exception) {
TagUtils.getInstance().saveException(pageContext, exception);
// :TODO: Remove after Struts 1.2
}
/**
* <p>Return the <code>ModuleConfig</code> object if it exists, null if otherwise.</p>
*
* @param pageContext The page context.
*
* @return the ModuleConfig object
* @since Struts 1.1
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#getModuleConfig(PageContext)} instead.
* This will be removed after Struts 1.2.
*/
public static ModuleConfig getModuleConfig(PageContext pageContext) {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getModuleConfig(pageContext);
}
/**
* <p>Retrieves the value from request scope and if it isn't already an
* <code>ActionMessages</code> some classes are converted to one.</p>
*
* @param pageContext The PageContext for the current page
* @param paramName Key for parameter value
*
* @return ActionErros in page context.
* @throws JspException
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#getActionMessages(PageContext,String)} instead.
* This will be removed after Struts 1.2.
*/
public static ActionMessages getActionMessages(PageContext pageContext, String paramName)
throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getActionMessages(pageContext, paramName);
}
/**
* <p>Retrieves the value from request scope and if it isn't already an
* <code>ErrorMessages</code> some classes are converted to one.</p>
*
* @param pageContext The PageContext for the current page
* @param paramName Key for parameter value
*
*
* @return ActionErrors from request scope
* @exception JspException
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#getActionErrors(PageContext,String)} instead.
* This will be removed after Struts 1.2.
*/
public static ActionErrors getActionErrors(PageContext pageContext, String paramName)
throws JspException {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().getActionErrors(pageContext, paramName);
}
/**
* <p>Use the new <code>URLEncoder.encode</code> method from Java 1.4 if available, else
* use the old deprecated version. This method uses reflection to find the appropriate
* method; if the reflection operations throw exceptions, this will return the url
* encoded with the old <code>URLEncoder.encode</code> method.
* @return String - the encoded url.
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#encodeURL(String)} instead.
* This will be removed after Struts 1.2.
*/
public static String encodeURL(String url) {
// :TODO: Remove after Struts 1.2
return TagUtils.getInstance().encodeURL(url);
}
/**
* <p>Returns true if the custom tags are in XHTML mode.</p>
*
* @since Struts 1.1
* @deprecated Use {@link org.apache.struts.taglib.TagUtils#isXhtml(PageContext)} instead.
* This will be removed after Struts 1.2.
*/
public static boolean isXhtml(PageContext pageContext) {
// :TODO: Remove after Struts 1.2
String xhtml =
(String) pageContext.getAttribute(
Glo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -