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

📄 imgtag.java

📁 jakarta-struts-1.2.4-src
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v 1.41 2004/08/24 22:53:35 husted Exp $
 * $Revision: 1.41 $
 * $Date: 2004/08/24 22:53:35 $
 *
 * Copyright 1999-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.taglib.html;

import java.util.Iterator;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;

import org.apache.struts.Globals;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.taglib.TagUtils;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.ModuleUtils;

/**
 * Generate an IMG tag to the specified image URI.
 * <p>
 * TODO:
 * <ul>
 *   <li>Make the <strong>alt</strong>, <strong>src</strong>, and
 *       <strong>lowsrc</strong> settable from properties (for i18n)</li>
 * </ul>
 *
 * @version $Revision: 1.41 $
 */

public class ImgTag extends BaseHandlerTag {

    // ------------------------------------------------------------- Properties

     /**
     * The property to specify where to align the image.
     */
    protected String align = null;

    public String getAlign() {
        return (this.align);
    }

    public void setAlign(String align) {
        this.align = align;
    }

    /**
     * The border size around the image.
     */
    protected String border = null;

    public String getBorder() {
        return (this.border);
    }

    public void setBorder(String border) {
        this.border = border;
    }

    /**
      * The property to specify how to root the image.
      * If 'true' or if there is no current module the image is
      * rooted to the application context path
      * If 'false' or absent the image is rooted to the current
      * module's context path.
      * @deprecated Use module property instead; will be removed in a release after 1.2.0.
      */
     protected String contextRelative = null;

     /** @deprecated Use module property instead; will be removed in a release after 1.2.0.
      */
     public String getContextRelative() {
         return (this.contextRelative);
     }

    /** @deprecated Use module property instead; will be removed in a release after 1.2.0.
     */
     public void setContextRelative(String contextRelative) {
         this.contextRelative = contextRelative;
     }


    /**
     * Convenience method to return true if contextRelative set to "true".
     * @return True if contextRelative set to "true"
     * @deprecated Use module property instead; will be removed in a release after 1.2.0.
     */
    public boolean isContextRelativeSet() {
        return Boolean.valueOf(this.contextRelative).booleanValue();
    }

    /**
     * The image height.
     */
    protected String height = null;

    public String getHeight() {
        return (this.height);
    }

    public void setHeight(String height) {
        this.height = height;
    }

    /**
     * The horizontal spacing around the image.
     */
    protected String hspace = null;

    public String getHspace() {
        return (this.hspace);
    }

    public void setHspace(String hspace) {
        this.hspace = hspace;
    }

    /**
     * The image name for named images.
     */
    protected String imageName = null;

    public String getImageName() {
        return (this.imageName);
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    /**
     * Server-side image map declaration.
     */
    protected String ismap = null;

    public String getIsmap() {
        return (this.ismap);
    }

    public void setIsmap(String ismap) {
        this.ismap = ismap;
    }

    /**
     * The low resolution image source URI.
     * @deprecated This is not defined in the HTML 4.01 spec and will be removed in a
     * future version of Struts.
     */
    protected String lowsrc = null;

    /**
     * @deprecated This is not defined in the HTML 4.01 spec and will be removed in a
     * future version of Struts.
     */
    public String getLowsrc() {
        return (this.lowsrc);
    }

    public void setLowsrc(String lowsrc) {
        this.lowsrc = lowsrc;
    }

    /**
     * The message resources for this package.
     */
    protected static MessageResources messages =
        MessageResources.getMessageResources(Constants.Package + ".LocalStrings");

    /**
     * The JSP bean name for query parameters.
     */
    protected String name = null;

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * The module-relative path, starting with a slash character, of the
     * image to be displayed by this rendered tag.
     */
    protected String page = null;

    public String getPage() {
        return (this.page);
    }

    public void setPage(String page) {
        this.page = page;
    }

    /**
     * The message resources key under which we should look up the
     * <code>page</code> attribute for this generated tag, if any.
     */
    protected String pageKey = null;

    public String getPageKey() {
        return (this.pageKey);
    }

    public void setPageKey(String pageKey) {
        this.pageKey = pageKey;
    }

    /**
     * The module-relative action (beginning with a slash) which will be
     * used as the source for this image.
     */
    protected String action = null;

    public String getAction() {
        return (this.action);
    }

    public void setAction(String action) {
        this.action = action;
    }

	/**
	 * The module prefix (beginning with a slash) which will be
	 * used to find the action for this link.
	 */
	protected String module = null;

	public String getModule() {
		return (this.module);
	}

	public void setModule(String module) {
		this.module = module;
	}

    /**
     * In situations where an image is dynamically generated (such as to create
     * a chart graph), this specifies the single-parameter request parameter
     * name to generate.
     */
    protected String paramId = null;

    public String getParamId() {
        return (this.paramId);
    }

    public void setParamId(String paramId) {
        this.paramId = paramId;
    }

    /**
     * The single-parameter JSP bean name.
     */
    protected String paramName = null;

    public String getParamName() {
        return (this.paramName);
    }

    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    /**
     * The single-parameter JSP bean property.
     */
    protected String paramProperty = null;

    public String getParamProperty() {
        return (this.paramProperty);
    }

    public void setParamProperty(String paramProperty) {
        this.paramProperty = paramProperty;
    }

    /**
     * The single-parameter JSP bean scope.
     */
    protected String paramScope = null;

    public String getParamScope() {
        return (this.paramScope);
    }

    public void setParamScope(String paramScope) {
        this.paramScope = paramScope;
    }

    /**
     * The JSP bean property name for query parameters.
     */
    protected String property = null;

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    /**
     * The scope of the bean specified by the name property, if any.
     */
    protected String scope = null;

    public String getScope() {
        return (this.scope);
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    /**
     * The image source URI.
     */
    protected String src = null;

    public String getSrc() {
        return (this.src);
    }

    public void setSrc(String src) {
        this.src = src;
    }

    /**
     * The message resources key under which we should look up the
     * <code>src</code> attribute for this generated tag, if any.
     */
    protected String srcKey = null;

    public String getSrcKey() {
        return (this.srcKey);
    }

    public void setSrcKey(String srcKey) {
        this.srcKey = srcKey;
    }

    /**
     * Client-side image map declaration.
     */
    protected String usemap = null;

    public String getUsemap() {
        return (this.usemap);
    }

    public void setUsemap(String usemap) {
        this.usemap = usemap;
    }

    /**

⌨️ 快捷键说明

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