📄 imgtag.java
字号:
/*
* $Id: ImgTag.java 471754 2006-11-06 14:55:09Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 org.apache.struts.config.ModuleConfig;
import org.apache.struts.taglib.TagUtils;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.ModuleUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import java.util.Iterator;
import java.util.Map;
/**
* <p>Generate an IMG tag to the specified image URI. </p>
*
* <p>TODO:</p>
*
* <ul>
*
* <li>Make the <strong>alt</strong> and <strong>src</strong> settable from
* properties (for i18n)</li>
*
* </ul>
*
* @version $Rev: 471754 $
*/
public class ImgTag extends BaseHandlerTag {
/**
* The message resources for this package.
*/
protected static MessageResources messages =
MessageResources.getMessageResources(Constants.Package
+ ".LocalStrings");
// ------------------------------------------------------------- Properties
/**
* The property to specify where to align the image.
*/
protected String align = null;
/**
* The border size around the image.
*/
protected String border = null;
/**
* The image height.
*/
protected String height = null;
/**
* The horizontal spacing around the image.
*/
protected String hspace = null;
/**
* The image name for named images.
*/
protected String imageName = null;
/**
* Server-side image map declaration.
*/
protected String ismap = null;
/**
* The JSP bean name for query parameters.
*/
protected String name = null;
/**
* The module-relative path, starting with a slash character, of the image
* to be displayed by this rendered tag.
*/
protected String page = null;
/**
* 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;
/**
* The module-relative action (beginning with a slash) which will be used
* as the source for this image.
*/
protected String action = null;
/**
* The module prefix (beginning with a slash) which will be used to find
* the action for this link.
*/
protected String module = null;
/**
* 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;
/**
* The single-parameter JSP bean name.
*/
protected String paramName = null;
/**
* The single-parameter JSP bean property.
*/
protected String paramProperty = null;
/**
* The single-parameter JSP bean scope.
*/
protected String paramScope = null;
/**
* The JSP bean property name for query parameters.
*/
protected String property = null;
/**
* The scope of the bean specified by the name property, if any.
*/
protected String scope = null;
/**
* The image source URI.
*/
protected String src = null;
/**
* 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;
/**
* Client-side image map declaration.
*/
protected String usemap = null;
/**
* The vertical spacing around the image.
*/
protected String vspace = null;
/**
* The image width.
*/
protected String width = null;
protected boolean useLocalEncoding = false;
// ----------------------------------------------------- Constructor
public ImgTag() {
super();
doDisabled = false;
}
public String getAlign() {
return (this.align);
}
public void setAlign(String align) {
this.align = align;
}
public String getBorder() {
return (this.border);
}
public void setBorder(String border) {
this.border = border;
}
public String getHeight() {
return (this.height);
}
public void setHeight(String height) {
this.height = height;
}
public String getHspace() {
return (this.hspace);
}
public void setHspace(String hspace) {
this.hspace = hspace;
}
public String getImageName() {
return (this.imageName);
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
public String getIsmap() {
return (this.ismap);
}
public void setIsmap(String ismap) {
this.ismap = ismap;
}
public String getName() {
return (this.name);
}
public void setName(String name) {
this.name = name;
}
public String getPage() {
return (this.page);
}
public void setPage(String page) {
this.page = page;
}
public String getPageKey() {
return (this.pageKey);
}
public void setPageKey(String pageKey) {
this.pageKey = pageKey;
}
public String getAction() {
return (this.action);
}
public void setAction(String action) {
this.action = action;
}
public String getModule() {
return (this.module);
}
public void setModule(String module) {
this.module = module;
}
public String getParamId() {
return (this.paramId);
}
public void setParamId(String paramId) {
this.paramId = paramId;
}
public String getParamName() {
return (this.paramName);
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public String getParamProperty() {
return (this.paramProperty);
}
public void setParamProperty(String paramProperty) {
this.paramProperty = paramProperty;
}
public String getParamScope() {
return (this.paramScope);
}
public void setParamScope(String paramScope) {
this.paramScope = paramScope;
}
public String getProperty() {
return (this.property);
}
public void setProperty(String property) {
this.property = property;
}
public String getScope() {
return (this.scope);
}
public void setScope(String scope) {
this.scope = scope;
}
public String getSrc() {
return (this.src);
}
public void setSrc(String src) {
this.src = src;
}
public String getSrcKey() {
return (this.srcKey);
}
public void setSrcKey(String srcKey) {
this.srcKey = srcKey;
}
public String getUsemap() {
return (this.usemap);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -