本文整理汇总了Java中javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN属性的典型用法代码示例。如果您正苦于以下问题:Java VariableInfo.AT_BEGIN属性的具体用法?Java VariableInfo.AT_BEGIN怎么用?Java VariableInfo.AT_BEGIN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.servlet.jsp.tagext.VariableInfo
的用法示例。
在下文中一共展示了VariableInfo.AT_BEGIN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScriptingVars
public List<Object> getScriptingVars(int scope) {
List<Object> vec = null;
switch (scope) {
case VariableInfo.AT_BEGIN:
vec = this.atBeginScriptingVars;
break;
case VariableInfo.AT_END:
vec = this.atEndScriptingVars;
break;
case VariableInfo.NESTED:
vec = this.nestedScriptingVars;
break;
}
return vec;
}
示例2: getVariableInfo
/**
* 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)
};
}
示例3: getVariableInfo
/**
* 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)
};
}
示例4: getVariableInfo
/**
* 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;
}
示例5: getVariableInfo
/**
* Return information about the scripting variables to be created.
*/
public VariableInfo[] getVariableInfo(TagData data) {
String type = null;
String property = data.getAttributeString("property");
if ("application".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletContext";
} else if ("config".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletConfig";
} else if ("request".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletRequest";
} else if ("response".equalsIgnoreCase(property)) {
type = "javax.servlet.ServletResponse";
} else if ("session".equalsIgnoreCase(property)) {
type = "javax.servlet.http.HttpSession";
} else {
type = "java.lang.Object";
}
return new VariableInfo[] {
new VariableInfo(data.getAttributeString("id"), type, true,
VariableInfo.AT_BEGIN)
};
}
示例6: getVariableInfo
/**
* 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
@Override
public VariableInfo[] getVariableInfo(TagData data) {
String name = null;
String className = null;
name = data.getAttributeString("name");
className = data.getAttributeString("type");
if (className == null)
className = "org.ofbiz.entity.GenericValue";
VariableInfo info =
new VariableInfo(name, className, true, VariableInfo.AT_BEGIN);
VariableInfo[] result = {info};
return result;
}
示例8: getVariableInfo
/**
* 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;
}
示例9: getVariableInfo
/**
* Returns two VariableInfo objects that define the following
* body objects
* <UL>
* <LI>A variable that represents the current value of the iterator.
* The name to reference this object is defined in the iterator tag
* with the value "varName". The type of this object is defined by
* the "varType" value passed in the iterator tag.
* </UL>
*
* @param data a value of type 'TagData'
* @return a value of type 'VariableInfo[]'
*/
public VariableInfo[] getVariableInfo( TagData data )
{
String varName = data.getAttributeString("id");
if ( varName == null ) {
return new VariableInfo[] {
};
} else {
return new VariableInfo[] {
new VariableInfo( varName,
"java.util.ResourceBundle",
true,
VariableInfo.AT_BEGIN ),
};
}
}
示例10: getVariableInfo
/**
* 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;
}
示例11: getVariableInfo
public VariableInfo[] getVariableInfo(TagData tagData) {
return new VariableInfo[]{
new VariableInfo("renderRequest",
"javax.portlet.RenderRequest",
true,
VariableInfo.AT_BEGIN),
new VariableInfo("renderResponse",
"javax.portlet.RenderResponse",
true,
VariableInfo.AT_BEGIN),
new VariableInfo("portletConfig",
"javax.portlet.PortletConfig",
true,
VariableInfo.AT_BEGIN)
};
}
示例12: copyTagToPageScope
/**
* Copies the variables of the given scope from the virtual page scope of
* this JSP context wrapper to the page scope of the invoking JSP context.
*
* @param scope
* variable scope (one of NESTED, AT_BEGIN, or AT_END)
*/
private void copyTagToPageScope(int scope) {
Iterator<String> iter = null;
switch (scope) {
case VariableInfo.NESTED:
if (nestedVars != null) {
iter = nestedVars.iterator();
}
break;
case VariableInfo.AT_BEGIN:
if (atBeginVars != null) {
iter = atBeginVars.iterator();
}
break;
case VariableInfo.AT_END:
if (atEndVars != null) {
iter = atEndVars.iterator();
}
break;
}
while ((iter != null) && iter.hasNext()) {
String varName = iter.next();
Object obj = getAttribute(varName);
varName = findAlias(varName);
if (obj != null) {
invokingJspCtxt.setAttribute(varName, obj);
} else {
invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
}
}
}
示例13: copyTagToPageScope
/**
* Copies the variables of the given scope from the virtual page scope of
* this JSP context wrapper to the page scope of the invoking JSP context.
*
* @param scope
* variable scope (one of NESTED, AT_BEGIN, or AT_END)
*/
private void copyTagToPageScope(int scope) {
Iterator iter = null;
switch (scope) {
case VariableInfo.NESTED:
if (nestedVars != null) {
iter = nestedVars.iterator();
}
break;
case VariableInfo.AT_BEGIN:
if (atBeginVars != null) {
iter = atBeginVars.iterator();
}
break;
case VariableInfo.AT_END:
if (atEndVars != null) {
iter = atEndVars.iterator();
}
break;
}
while ((iter != null) && iter.hasNext()) {
String varName = (String) iter.next();
Object obj = getAttribute(varName);
varName = findAlias(varName);
if (obj != null) {
invokingJspCtxt.setAttribute(varName, obj);
} else {
invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
}
}
}
示例14: copyTagToPageScope
/**
* Copies the variables of the given scope from the virtual page scope of
* this JSP context wrapper to the page scope of the invoking JSP context.
*
* @param scope
* variable scope (one of NESTED, AT_BEGIN, or AT_END)
*/
private void copyTagToPageScope(int scope) {
Iterator<String> iter = null;
switch (scope) {
case VariableInfo.NESTED:
if (nestedVars != null) {
iter = nestedVars.iterator();
}
break;
case VariableInfo.AT_BEGIN:
if (atBeginVars != null) {
iter = atBeginVars.iterator();
}
break;
case VariableInfo.AT_END:
if (atEndVars != null) {
iter = atEndVars.iterator();
}
break;
}
while ((iter != null) && iter.hasNext()) {
String varName = iter.next();
Object obj = getAttribute(varName);
varName = findAlias(varName);
if (obj != null) {
invokingJspCtxt.setAttribute(varName, obj);
} else {
invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
}
}
}
示例15: setScriptingVars
public void setScriptingVars(List<Object> vec, int scope) {
switch (scope) {
case VariableInfo.AT_BEGIN:
this.atBeginScriptingVars = vec;
break;
case VariableInfo.AT_END:
this.atEndScriptingVars = vec;
break;
case VariableInfo.NESTED:
this.nestedScriptingVars = vec;
break;
}
}