⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 requestutils.java

📁 jakarta-struts-1.2.4-src
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * add corresponding request attributes to this request.</p>
     *
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     *
     * @deprecated Use {@link org.apache.struts.util.ModuleUtils#selectModule(HttpServletRequest,ServletContext)} instead.
     * This will be removed after Struts 1.2.
     */
    public static void selectModule(HttpServletRequest request, ServletContext context) {
        // :TODO: Remove after Struts 1.2

        ModuleUtils.getInstance().selectModule(request, context);

    }


    /**
     * Get the module name to which the specified request belong.
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     * @return The module prefix or ""
     * @deprecated Use Use {@link org.apache.struts.util.ModuleUtils#getModuleName(HttpServletRequest,ServletContext)} instead.
     * This will be removed after Struts 1.2.
     */
    public static String getModuleName(HttpServletRequest request, ServletContext context) {
        // :TODO: Remove after Struts 1.2

        return ModuleUtils.getInstance().getModuleName(request, context);

    }


    /**
     * <p>Get the module name to which the specified uri belong.</p>
     *
     * @param matchPath The uri from which we want the module name.
     * @param context The ServletContext for this web application
     *
     * @return The module prefix or ""
     * @deprecated Use {@link org.apache.struts.util.ModuleUtils#getModuleName(String,ServletContext)} instead.
     * This will be removed after Struts 1.2.
     */
    public static String getModuleName(String matchPath, ServletContext context) {
        // :TODO: Remove after Struts 1.2

        return ModuleUtils.getInstance().getModuleName(matchPath, context);

    }


    /**
     * <p>Return the current <code>ModuleConfig</code> object stored in request,
     * if it exists, null otherwise.
     * This method can be used by a {@link org.apache.struts.action.PlugIn} to
     * retrieve the current module config object. If no moduleConfig is found,
     * this means that the request hasn't hit the server through the Struts servlet.
     * The appropriate module config can be set and found with
     * <code>{@link RequestUtils#selectModule(HttpServletRequest, ServletContext)} </code>.
     *
     * @param request The servlet request we are processing
     *
     * @return the ModuleConfig object from request, or null if none is set in
     * the request.
     * @since Struts 1.1
     * @deprecated Use {@link org.apache.struts.util.ModuleUtils#getModuleConfig(HttpServletRequest)} instead.
     * This will be removed after Struts 1.2.
     */
    public static ModuleConfig getRequestModuleConfig(HttpServletRequest request) {
        // :TODO: Remove after Struts 1.2

        return ModuleUtils.getInstance().getModuleConfig(request);

    }


    /**
     * <p>Return the ModuleConfig object is it exists, null otherwise.</p>
     *
     * @param request The servlet request we are processing
     * @param context The ServletContext for this web application
     *
     * @return the ModuleConfig object
     * @since Struts 1.1
     * @deprecated Use {@link org.apache.struts.util.ModuleUtils#getModuleConfig(HttpServletRequest,ServletContext)} instead.
     * This will be removed after Struts 1.2.
     */
    public static ModuleConfig getModuleConfig(
            HttpServletRequest request,
            ServletContext context) {
        // :TODO: Remove after Struts 1.2

        return ModuleUtils.getInstance().getModuleConfig(request, context);

    }


    /**
     * <p>Return the list of module prefixes that are defined for
     * this web application. <strong>NOTE</strong> -
     * the "" prefix for the default module is not included in this list.</p>
     *
     * @param context The ServletContext for this web application.
     *
     * @return An array of module prefixes.
     * @since Struts 1.1
     * @deprecated Use {@link org.apache.struts.util.ModuleUtils#getModulePrefixes(ServletContext)} instead.
     * This will be removed after Struts 1.2.
     */
    public static String[] getModulePrefixes(ServletContext context) {
        // :TODO: Remove after Struts 1.2

        return ModuleUtils.getInstance().getModulePrefixes(context);

    }


    // ---------------------------------------- Deprecated in favor of TagUtils


    /**
     * <p>Compute a set of query parameters that will be dynamically added to
     * a generated URL. The returned Map is keyed by parameter name, and the
     * values are either null (no value specified), a String (single value
     * specified), or a String[] array (multiple values specified). Parameter
     * names correspond to the corresponding attributes of the
     * <code>&lt;html:link&gt;</code> tag.  If no query parameters are
     * identified, return <code>null</code>.</p>
     *
     * @param pageContext PageContext we are operating in

     * @param paramId Single-value request parameter name (if any)
     * @param paramName Bean containing single-value parameter value
     * @param paramProperty Property (of bean named by <code>paramName</code>
     *  containing single-value parameter value
     * @param paramScope Scope containing bean named by
     *  <code>paramName</code>
     *
     * @param name Bean containing multi-value parameters Map (if any)
     * @param property Property (of bean named by <code>name</code>
     *  containing multi-value parameters Map
     * @param scope Scope containing bean named by
     *  <code>name</code>
     *
     * @param transaction Should we add our transaction control token?
     * @return Map of query parameters
     * @exception JspException if we cannot look up the required beans
     * @exception JspException if a class cast exception occurs on a
     *  looked-up bean or property
     * @deprecated This will be removed after Struts 1.2.
     * Use {@link org.apache.struts.taglib.TagUtils#computeParameters(PageContext,String,String,String,String,String,String,String,boolean)} instead.
     */
    public static Map computeParameters(
            PageContext pageContext,
            String paramId,
            String paramName,
            String paramProperty,
            String paramScope,
            String name,
            String property,
            String scope,
            boolean transaction)
            throws JspException {
        // :TODO: Remove after Struts 1.2

        return TagUtils.getInstance().computeParameters(pageContext, paramId, paramName, paramProperty, paramScope,
                                                        name, property, scope, transaction);

    }


    /**
     * <p>Compute a hyperlink URL based on the <code>forward</code>,
     * <code>href</code> or <code>page</code> parameter
     * that is not null.</p>
     *
     * @param pageContext PageContext for the tag making this call
     * @param forward Logical forward name for which to look up
     *  the context-relative URI (if specified)
     * @param href URL to be utilized unmodified (if specified)
     * @param page Module-relative page for which a URL should
     *  be created (if specified)
     * @param params Map of parameters to be dynamically included (if any)
     * @param anchor Anchor to be dynamically included (if any)
     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?

     * @return URL with session identifier
     * @exception MalformedURLException if a URL cannot be created
     *  for the specified parameters
     * @deprecated This will be removed after Struts 1.2
     * Use {@link RequestUtils#computeURL(PageContext, String, String, String, String, Map, String, boolean)} instead.
     */
    public static String computeURL(
            PageContext pageContext,
            String forward,
            String href,
            String page,
            Map params,
            String anchor,
            boolean redirect)
            throws MalformedURLException {
        // :TODO: Remove after Struts 1.2

        return (TagUtils.getInstance().computeURLWithCharEncoding(
                pageContext, forward, href, page, null, null, params, anchor, redirect, false));
    }


    /**
     * <p>Compute a hyperlink URL based on the <code>forward</code>,
     * <code>href</code>, <code>action</code> or <code>page</code> parameter
     * that is not null.
     * The returned URL will have already been passed to
     * <code>response.encodeURL()</code> for adding a session identifier.</p>
     *
     * @param pageContext PageContext for the tag making this call
     * @param forward Logical forward name for which to look up
     *  the context-relative URI (if specified)
     * @param href URL to be utilized unmodified (if specified)
     * @param page Module-relative page for which a URL should
     *  be created (if specified)
     * @param action Logical action name for which to look up
     *  the context-relative URI (if specified)
     * @param params Map of parameters to be dynamically included (if any)
     * @param anchor Anchor to be dynamically included (if any)
     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?

     * @return URL with session identifier
     * @exception MalformedURLException if a URL cannot be created
     *  for the specified parameters
     * @deprecated This will be removed after Struts 1.2.
     * Use {@link org.apache.struts.taglib.TagUtils#computeURL(PageContext,String,String,String,String,String,Map,String,	boolean)} instead.
     */
    public static String computeURL(
            PageContext pageContext,
            String forward,
            String href,
            String page,
            String action,
            Map params,
            String anchor,
            boolean redirect)
            throws MalformedURLException {
        // :TODO: Remove after Struts 1.2

        return TagUtils.getInstance().computeURL(
                pageContext,
                forward,
                href,
                page,
                action,
                null,
                params,
                anchor,
                redirect);
    }


    /**
     * <p>Compute a hyperlink URL based on the <code>forward</code>,
     * <code>href</code>, <code>action</code> or <code>page</code> parameter
     * that is not null.
     * The returned URL will have already been passed to
     * <code>response.encodeURL()</code> for adding a session identifier.
     * </p>
     *
     * @param pageContext PageContext for the tag making this call
     * @param forward Logical forward name for which to look up
     *  the context-relative URI (if specified)
     * @param href URL to be utilized unmodified (if specified)
     * @param page Module-relative page for which a URL should
     *  be created (if specified)
     * @param action Logical action name for which to look up
     *  the context-relative URI (if specified)
     * @param params Map of parameters to be dynamically included (if any)
     * @param anchor Anchor to be dynamically included (if any)
     * @param redirect Is this URL for a <code>response.sendRedirect()</code>?
     * @param encodeSeparator This is only checked if redirect is set to false (never
     * encoded for a redirect).  If true, query string parameter separators are encoded
     * as &gt;amp;, else &amp; is used.

     * @return URL with session identifier
     * @exception MalformedURLException if a URL cannot be created
     *  for the specified parameters
     * @deprecated This will be removed after Struts 1.2.
     * Use {@link org.apache.struts.taglib.TagUtils#computeURL(PageContext,String,String,String,String,String,Map,String,boolean,boolean)} instead.
     */
    public static String computeURL(
            PageContext pageContext,
            String forward,
            String href,
            String page,
            String action,
            Map params,
            String anchor,
            boolean redirect,
            boolean encodeSeparator)
            throws MalformedURLException {
        // :TODO: Remove after Struts 1.2

        return (TagUtils.getInstance().computeURL(
                pageContext,
                forward,
                href,
                page,
                action,
                null,
                params,
                anchor,
                redirect,
                encodeSeparator));
    }


    /**
     * <p>Return the form action converted into an action mapping path.  The
     * value of the <code>action</code> property is manipulated as follows in
     * computing the name of the requested mapping:</p>
     * <ul>
     * <li>Any filename extension is removed (on the theory that extension
     *     mapping is being used to select the controller servlet).</li>
     * <li>If the resulting value does not start with a slash, then a
     *     slash is prepended.</li>
     * </ul>
     * @deprecated  This will be removed after Struts 1.2.
     * Use {@link org.apache.struts.taglib.TagUtils#getActionMappingName(String)} instead.
     */
    public static String getActionMappingName(String action) {
        // :TODO: Remove after Struts 1.2

        return TagUtils.getInstance().getActionMappingName(action);

    }


    /**
     * <p>Return the form action converted into a server-relative URL.</p>
     * @deprecated This will be removed after Struts 1.2.
     * Use {@link org.apache.struts.taglib.TagUtils#getActionMappingURL(String,PageContext)} instead.
     */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -