本文整理汇总了Java中javax.servlet.jsp.tagext.TagData.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java TagData.getAttribute方法的具体用法?Java TagData.getAttribute怎么用?Java TagData.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.jsp.tagext.TagData
的用法示例。
在下文中一共展示了TagData.getAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
// get the type
String type = (String)data.getAttribute("type");
// make it an object if none supplied
if (type == null) {
type = "java.lang.Object";
}
// return the infor about the deined object
VariableInfo[] vinfo = new VariableInfo[1];
vinfo[0] = new VariableInfo(data.getAttributeString("id"),
type, true, VariableInfo.AT_END );
/* return the results */
return vinfo;
}
示例2: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = (String)data.getAttribute("type");
Object name = data.getAttribute("name");
Object value = data.getAttribute("value");
if (type == null) {
if ( (value!=null) || (name==null) )
type = "java.lang.String";
else
type = "java.lang.Object";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"),
type,
true,
VariableInfo.AT_END )
};
}
示例3: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String className = null;
if (data.getAttribute("multiple") == null)
className = "java.lang.String";
else
className = "java.lang.String[]";
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"),
className,
true,
VariableInfo.AT_BEGIN)
};
}
示例4: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = null;
if (data.getAttribute("input") == null)
type = "java.lang.String";
else
type = "java.io.InputStream";
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"),
type,
true,
VariableInfo.AT_BEGIN)
};
}
示例5: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String className = null;
if (data.getAttribute("multiple") == null)
className = "javax.servlet.http.Cookie";
else
className = "javax.servlet.http.Cookie[]";
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"),
className,
true,
VariableInfo.AT_BEGIN)
};
}
示例6: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = null;
if (data.getAttribute("formBean") != null)
type = "org.apache.struts.action.ActionFormBean";
else if (data.getAttribute("forward") != null)
type = "org.apache.struts.action.ActionForward";
else if (data.getAttribute("mapping") != null)
type = "org.apache.struts.action.ActionMapping";
else
type = "java.lang.Object";
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"),
type,
true,
VariableInfo.AT_BEGIN)
};
}
示例7: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Attempts to return type information so that the container can create a
* named variable for the action bean.
*/
@Override public VariableInfo[] getVariableInfo(final TagData tag) {
// We can only provide the type of 'var' if beanclass was used because
// if binding was used we need runtime information!
Object beanclass = tag.getAttribute("beanclass");
// Turns out beanclass="${...}" does NOT return TagData.REQUEST_TIME_VALUE; only beanclass="<%= ... %>".
if (beanclass != null && !beanclass.equals(TagData.REQUEST_TIME_VALUE)) {
String var = tag.getAttributeString("var");
if (var == null) var = tag.getAttributeString("id");
// Make sure we have the class name, not the class
if (beanclass instanceof Class<?>) beanclass = ((Class<?>) beanclass).getName();
// Return the variable info
if (beanclass instanceof String) {
String string = (String) beanclass;
if (!string.startsWith("${")) {
return new VariableInfo[] { new VariableInfo(var, string, true, VariableInfo.AT_BEGIN) };
}
}
}
return NO_INFO;
}
示例8: validate
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Checks to ensure that where the tag supports providing one of two attributes
* that one and only one is provided.
*/
@Override public ValidationMessage[] validate(final TagData tag) {
Collection<ValidationMessage> errors = new ArrayList<ValidationMessage>();
Object beanclass = tag.getAttribute("beanclass");
Object binding = tag.getAttribute("binding");
if (!(beanclass != null ^ binding != null)) {
errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'beanclass' or 'binding' must be supplied."));
}
String var = tag.getAttributeString("var");
String id = tag.getAttributeString("id");
if (!(var != null ^ id != null)) {
errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'var' or 'id' must be supplied."));
}
return errors.toArray(new ValidationMessage[errors.size()]);
}
示例9: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
// get the type
String type = (String) data.getAttribute("type");
// make it an object if none supplied
if (type == null) {
type = "java.lang.Object";
}
// return the infor about the deined object
VariableInfo[] vinfo = new VariableInfo[1];
vinfo[0] =
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_END);
/* return the results */
return vinfo;
}
示例10: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = (String) data.getAttribute("type");
Object name = data.getAttribute("name");
Object value = data.getAttribute("value");
if (type == null) {
if ((value != null) || (name == null)) {
type = "java.lang.String";
} else {
type = "java.lang.Object";
}
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_END)
};
}
示例11: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = null;
if (data.getAttribute("formBean") != null) {
type = "org.apache.struts.action.ActionFormBean";
} else if (data.getAttribute("forward") != null) {
type = "org.apache.struts.action.ActionForward";
} else if (data.getAttribute("mapping") != null) {
type = "org.apache.struts.action.ActionMapping";
} else {
type = "java.lang.Object";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_BEGIN)
};
}
示例12: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Returns information about the scripting variable containing document
* metadata message.
*
* @param data run-time attributes of the metadata tag
* @return an array containing a single element, detailing the scripting
* variable
*/
public VariableInfo[] getVariableInfo(TagData data) {
// declare the array we'll be returning
VariableInfo[] info = null;
// get the name of the scripting variable
Object varName = data.getAttribute(MetadataTag.ATTR_ID);
// proceed only if an id was defined!
if ((varName != null) && (varName != TagData.REQUEST_TIME_VALUE)) {
// decalare the type of the scripting variable
String varType = "org.apache.soap.rpc.Response";
// create the array containing the variable information
VariableInfo idVarInfo =
new VariableInfo((String) varName, varType, true, VariableInfo.AT_BEGIN);
info = new VariableInfo[] { idVarInfo };
}
// end if
// return the information on the variables
return info;
}
示例13: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Returns information about the scripting variable containing the all
* documents message.
*
* @param data run-time attributes of the alldocs tag
* @return an array containing a single element, detailing the scripting
* variable
*/
public VariableInfo[] getVariableInfo(TagData data) {
// declare the array we'll be returning
VariableInfo[] info = null;
// get the name of the scripting variable
Object varName = data.getAttribute(AlldocsTag.ATTR_ID);
// proceed only if an id was defined!
if ((varName != null) && (varName != TagData.REQUEST_TIME_VALUE)) {
// decalare the type of the scripting variable
String varType = "org.apache.soap.rpc.Response";
// create the array containing the variable information
VariableInfo idVarInfo =
new VariableInfo((String) varName, varType, true, VariableInfo.AT_BEGIN);
info = new VariableInfo[] { idVarInfo };
}
// end if
// return the information on the variables
return info;
}
示例14: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String className = null;
if (data.getAttribute("multiple") == null) {
className = "java.lang.String";
} else {
className = "java.lang.String[]";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), className, true,
VariableInfo.AT_BEGIN)
};
}
示例15: getVariableInfo
import javax.servlet.jsp.tagext.TagData; //导入方法依赖的package包/类
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = null;
if (data.getAttribute("input") == null) {
type = "java.lang.String";
} else {
type = "java.io.InputStream";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_BEGIN)
};
}