亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? formrenderer.java

?? struts的源代碼
?? JAVA
字號(hào):
/*
 * Copyright 2002-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.struts.faces.renderer;


import java.io.IOException;
import java.util.Map;

import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.config.ActionConfig;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.faces.component.FormComponent;


/**
 * <p><code>Renderer</code> implementation for the <code>form</code> tag
 * from the <em>Struts-Faces Integration Library</em>.</p>
 *
 * @version $Rev: 55303 $ $Date: 2004-10-22 03:56:53 +0100 (Fri, 22 Oct 2004) $
 */

public class FormRenderer extends AbstractRenderer {


    // -------------------------------------------------------- Static Variables


    /**
     * <p>The <code>Log</code> instance for this class.</p>
     */
    private static Log log = LogFactory.getLog(FormRenderer.class);


    // ---------------------------------------------------------- Public Methods


    /**
     * <p>Perform setup processing that will be required for decoding the
     * incoming request.</p>
     *
     * @param context FacesContext for the request we are processing
     * @param component UIComponent to be processed
     *
     * @exception NullPointerException if <code>context</code>
     *  or <code>component</code> is null
     */
    public void decode(FacesContext context, UIComponent component) {

        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }
        String clientId = component.getClientId(context);
	Map map = context.getExternalContext().getRequestParameterMap();
        if (log.isDebugEnabled()) {
            log.debug("decode(" + clientId + ") --> " +
                      map.containsKey(clientId));
        }
        component.getAttributes().put
            ("submitted",
             map.containsKey(clientId) ? Boolean.TRUE : Boolean.FALSE);

    }


    private static String passThrough[] =
    { "enctype", "method", "onreset", "onsubmit", "style", "target", };


    /**
     * <p>Render the beginning of an HTML <code>&lt;form&gt;</code>
     * control.</p>
     *
     * @param context FacesContext for the request we are processing
     * @param component UIComponent to be rendered
     *
     * @exception IOException if an input/output error occurs while rendering
     * @exception NullPointerException if <code>context</code>
     *  or <code>component</code> is null
     */
    public void encodeBegin(FacesContext context, UIComponent component)
        throws IOException {

        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        // Calculate and cache the form name
        FormComponent form = (FormComponent) component;
        String action = form.getAction();
        ModuleConfig moduleConfig = form.lookupModuleConfig(context);
        ActionConfig actionConfig = moduleConfig.findActionConfig(action);
        String beanName = actionConfig.getAttribute();
        if (beanName != null) {
            form.getAttributes().put("beanName", beanName);
        }

        // Look up attribute values we need
        String clientId = component.getClientId(context);
        if (log.isDebugEnabled()) {
            log.debug("encodeBegin(" + clientId + ")");
        }
        String styleClass =
            (String) component.getAttributes().get("styleClass");

        // Render the beginning of this form
        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("form", form);
        writer.writeAttribute("id", clientId, "clientId");
        if (beanName != null) {
            writer.writeAttribute("name", beanName, null);
        }
        writer.writeAttribute("action", action(context, component), "action");
        if (styleClass != null) {
            writer.writeAttribute("class", styleClass, "styleClass");
        }
        if (component.getAttributes().get("method") == null) {
            writer.writeAttribute("method", "post", null);
        }
        renderPassThrough(context, component, writer, passThrough);
        writer.writeText("\n", null);

        // Add a marker used by our decode() method to note this form is submitted
        writer.startElement("input", form);
        writer.writeAttribute("type", "hidden", null);
        writer.writeAttribute("name", clientId, null);
        writer.writeAttribute("value", clientId, null);
        writer.endElement("input");
        writer.writeText("\n", null);

        // Add a transaction token if necessary
        HttpSession session = (HttpSession)
            context.getExternalContext().getSession(false);
        if (session != null) {
            String token = (String)
                session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
            if (token != null) {
                writer.startElement("input", form);
                writer.writeAttribute("type", "hidden", null);
                writer.writeAttribute
                    ("name", "org.apache.struts.taglib.html.TOKEN", null);
                writer.writeAttribute("value", token, null);
                writer.endElement("input");
                writer.writeText("\n", null);
            }
        }

        // Create an instance of the form bean if necessary
        if (component instanceof FormComponent) {
            ((FormComponent) component).createActionForm(context);
        }

    }


    /**
     * <p>Render the ending of an HTML <code>&lt;form&gt;</code>
     * control.</p>
     *
     * @param context FacesContext for the request we are processing
     * @param component UIComponent to be rendered
     *
     * @exception IOException if an input/output error occurs while rendering
     * @exception NullPointerException if <code>context</code>
     *  or <code>component</code> is null
     */
    public void encodeEnd(FacesContext context, UIComponent component)
        throws IOException {

        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }
        String clientId = component.getClientId(context);
        if (log.isDebugEnabled()) {
            log.debug("encodeEnd(" + clientId + ")");
        }
        ResponseWriter writer = context.getResponseWriter();

        // Render the hidden variable our decode() method uses to detect submits
	writer.startElement("input", component);
	writer.writeAttribute("type", "hidden", null);
	writer.writeAttribute("name", component.getClientId(context), null);
	writer.writeAttribute("value", component.getClientId(context), null);
	writer.endElement("input");
	writer.write("\n");

        // Write our state information (if necessary)
        context.getApplication().getViewHandler().writeState(context);

        // Render the ending of this form
        writer.endElement("form");
        writer.writeText("\n", null);

        // Render focus JavaScript if requested
        if (!(component instanceof FormComponent)) {
            return;
        }
        String focus = (String) component.getAttributes().get("focus");
        if (focus == null) {
            return;
        }
        String focusIndex =
            (String) component.getAttributes().get("focusIndex");
        writer.writeText("\n", null);
        FormComponent form = (FormComponent) component;
        writer.startElement("script", form);
        writer.writeAttribute("type", "text/javascript", null);
        if (!isXhtml(component)) {
            writer.writeAttribute("language", "JavaScript", null);
        }
        writer.writeText("\n", null);
        if (!isXhtml(component)) {
            writer.write("<!--\n");
        }

        StringBuffer sb = new StringBuffer("document.forms[\"");
        sb.append(clientId);
        sb.append("\"].elements[\"");
        sb.append(component.getClientId(context));
        sb.append(NamingContainer.SEPARATOR_CHAR);
        sb.append(focus);
        sb.append("\"]");
        String focusControl = sb.toString();

        writer.write("  var focusControl = ");
        writer.write(focusControl);
        writer.write(";\n");
        writer.write("  if (focusControl.type != \"hidden\") {\n");
        writer.write("    ");
        writer.write(focusControl);
        if (focusIndex != null) {
            writer.write("[");
            writer.write(focusIndex);
            writer.write("]");
        }
        writer.write(".focus();\n");
        writer.write("  }\n");

        if (!isXhtml(component)) {
            writer.write("// -->\n");
        }
        writer.endElement("script");
        writer.writeText("\n", null);

    }


    // ------------------------------------------------------- Protected Methods


    /**
     * <p>Calculate and return the value to be specifed for the
     * <code>action</action> attribute on the <code>&lt;form&gt;</code>
     * element to be rendered.</p>
     *
     * @param context FacesContext for the current request
     * @param component Component being processed
     */
    protected String action(FacesContext context, UIComponent component) {

        String actionURL =
            context.getApplication().getViewHandler().
            getActionURL(context, context.getViewRoot().getViewId());
        if (log.isTraceEnabled()) {
            log.trace("getActionURL(" + context.getViewRoot().getViewId() +
                      ") --> " + actionURL);
        }
        return (context.getExternalContext().encodeActionURL(actionURL));

    }


    /**
     * <p>Return <code>true</code> if we should render as XHTML.</p>
     *
     * @param component The component we are rendering
     */
    protected boolean isXhtml(UIComponent component) {

        return (false); // FIXME -- check up the hierarchy

    }


}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久精品app | 99精品视频在线观看| 91精品国产欧美日韩| 亚洲一区二区免费视频| 91天堂素人约啪| 国产精品久久久爽爽爽麻豆色哟哟 | 一区二区三区欧美在线观看| 国产精品夜夜爽| 亚洲国产精品99久久久久久久久| 成人免费视频网站在线观看| 国产欧美日本一区二区三区| 成人性色生活片| 亚洲色大成网站www久久九九| 91在线高清观看| 亚洲自拍偷拍欧美| 7777精品久久久大香线蕉| 亚洲成在人线免费| 日韩免费观看高清完整版| 国产一区二区三区免费| 日本一区二区三区在线观看| 成人黄色av电影| 依依成人综合视频| 7777精品久久久大香线蕉| 激情偷乱视频一区二区三区| 久久久久久日产精品| 91日韩精品一区| 七七婷婷婷婷精品国产| 欧美国产成人在线| 欧美欧美午夜aⅴ在线观看| 韩国理伦片一区二区三区在线播放 | 91精品国产91久久久久久一区二区| 麻豆精品视频在线| 国产精品国产三级国产有无不卡 | 波多野结衣一区二区三区 | 国产一区二区不卡老阿姨| 欧美激情一区在线观看| 在线观看不卡一区| 韩国一区二区三区| 亚洲亚洲人成综合网络| 2023国产精品自拍| 欧洲中文字幕精品| 国产成人午夜99999| 亚洲线精品一区二区三区八戒| 精品卡一卡二卡三卡四在线| 91视视频在线观看入口直接观看www | 视频在线在亚洲| 中国色在线观看另类| 欧美久久一二区| 91网站黄www| 国产a视频精品免费观看| 毛片一区二区三区| 一区二区三区四区国产精品| 久久精品网站免费观看| 欧美一区二区视频在线观看| 91黄视频在线观看| av一区二区三区黑人| 国产高清不卡二三区| 久久精品国产亚洲一区二区三区 | 国产精品精品国产色婷婷| 久久久久久免费网| 久久综合九色综合97婷婷| 欧美一区二区美女| 亚洲欧美日韩在线播放| 国产午夜精品在线观看| 欧美电影免费观看高清完整版在线| 5858s免费视频成人| 欧美浪妇xxxx高跟鞋交| 欧美精品高清视频| 在线播放91灌醉迷j高跟美女| 精品视频1区2区| 51久久夜色精品国产麻豆| 精品视频全国免费看| 欧美一区二区视频免费观看| 日韩免费看的电影| 日本一区免费视频| 亚洲三级视频在线观看| 午夜电影网一区| 精品在线你懂的| 成人国产精品视频| 欧美色爱综合网| 欧美大片拔萝卜| 成人欧美一区二区三区在线播放| 亚洲午夜久久久久久久久电影院| 偷拍自拍另类欧美| 国产精品综合久久| 91在线观看地址| 日韩欧美一级在线播放| 国产精品久久久久婷婷| 亚洲电影一区二区| 国产精品一区二区黑丝| 色猫猫国产区一区二在线视频| 欧美疯狂性受xxxxx喷水图片| 26uuu久久天堂性欧美| 一区二区三区四区不卡在线 | 国产精品国产三级国产普通话99 | 老色鬼精品视频在线观看播放| 成人综合婷婷国产精品久久蜜臀| 欧洲精品中文字幕| 成人自拍视频在线| 肉色丝袜一区二区| 亚洲国产日韩a在线播放| 日韩欧美123| 欧美日韩国产中文| 99re免费视频精品全部| 蜜桃av一区二区三区| 亚洲国产综合91精品麻豆| 国产欧美一二三区| 26uuuu精品一区二区| 91精品免费在线| 欧美日韩免费观看一区二区三区| 国产·精品毛片| 国产一区二区福利视频| 国产一区二区剧情av在线| 美国欧美日韩国产在线播放| 亚洲网友自拍偷拍| 亚洲激情五月婷婷| 亚洲欧美日韩中文播放| 国产精品久久久久久久久动漫| 中文字幕免费不卡| 国产精品每日更新在线播放网址| 久久久久久久久久电影| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲自拍都市欧美小说| 亚洲三级电影网站| 亚洲第四色夜色| 日韩精品五月天| 国产在线播放一区三区四| 国产一区二区在线看| 成熟亚洲日本毛茸茸凸凹| 91在线观看地址| 7777精品伊人久久久大香线蕉的 | 在线亚洲一区二区| 欧美日韩一卡二卡| 久久久久久久久免费| 亚洲精品日韩一| 毛片不卡一区二区| jlzzjlzz亚洲日本少妇| 欧美日韩精品免费| 国产亚洲精品超碰| 亚洲电影一级黄| 成人精品小蝌蚪| 91精品国产欧美一区二区成人| 久久久亚洲综合| 亚洲成在人线免费| 成人国产电影网| 91精品国产综合久久久久久久| 久久久高清一区二区三区| 亚洲国产综合色| a亚洲天堂av| ww亚洲ww在线观看国产| 午夜成人免费电影| 色乱码一区二区三区88| 国产精品免费视频一区| 麻豆国产精品一区二区三区| 91国产福利在线| 国产精品国产自产拍高清av| 六月丁香婷婷久久| 欧美人与性动xxxx| 亚洲福利一区二区| 久久久精品中文字幕麻豆发布| 奇米精品一区二区三区在线观看| 成人av第一页| 国产精品国产三级国产普通话99| 久久国产精品第一页| 日韩免费电影一区| 午夜久久电影网| 欧美人妇做爰xxxⅹ性高电影 | 国产风韵犹存在线视精品| 欧美videos大乳护士334| 首页亚洲欧美制服丝腿| 欧美精品日韩一区| 日韩中文字幕不卡| 日韩一区二区三区电影在线观看 | 国产精品福利影院| 成人黄色在线视频| 国产精品午夜久久| 97精品久久久午夜一区二区三区| 亚洲精品成a人| 在线欧美一区二区| 日韩精品一二三四| 国产亚洲欧美一区在线观看| 波多野结衣的一区二区三区| 亚洲美女屁股眼交3| 欧美一区二区三区在线视频| 久久av中文字幕片| 综合久久久久综合| 日韩一区二区三区三四区视频在线观看 | 国产毛片精品视频| 亚洲视频免费在线观看| 欧美性极品少妇| 麻豆精品在线看| 亚洲精品久久久久久国产精华液| 制服丝袜一区二区三区| 国产91高潮流白浆在线麻豆 | 国产成人啪免费观看软件| 一片黄亚洲嫩模| 欧美精品一区二区不卡| 欧美性生活一区| 99国产精品久久久久久久久久| 日本不卡高清视频|