husted 2002/07/09 16:58:52
Modified: src/share/org/apache/struts/taglib/html FormTag.java
ImageTag.java LinkTag.java
JavascriptValidatorTag.java
OptionsCollectionTag.java ErrorsTag.java
ImgTag.java
Log:
Javadoc updates. No code changes.
Revision Changes Path
1.24 +113 -113
jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java
Index: FormTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- FormTag.java 25 Jun 2002 00:13:05 -0000 1.23
+++ FormTag.java 9 Jul 2002 23:58:52 -0000 1.24
@@ -104,7 +104,7 @@
/**
- * The application configuration for our sub-application.
+ * The application configuration for our module.
*/
protected ApplicationConfig appConfig = null;
@@ -229,7 +229,7 @@
*/
public String getAction() {
- return (this.action);
+ return (this.action);
}
@@ -241,7 +241,7 @@
*/
public void setAction(String action) {
- this.action = action;
+ this.action = action;
}
@@ -250,7 +250,7 @@
*/
public String getEnctype() {
- return (this.enctype);
+ return (this.enctype);
}
@@ -261,7 +261,7 @@
*/
public void setEnctype(String enctype) {
- this.enctype = enctype;
+ this.enctype = enctype;
}
@@ -270,7 +270,7 @@
*/
public String getFocus() {
- return (this.focus);
+ return (this.focus);
}
@@ -282,7 +282,7 @@
*/
public void setFocus(String focus) {
- this.focus = focus;
+ this.focus = focus;
}
@@ -292,7 +292,7 @@
*/
public String getMethod() {
- return (this.method);
+ return (this.method);
}
@@ -304,7 +304,7 @@
*/
public void setMethod(String method) {
- this.method = method;
+ this.method = method;
}
@@ -314,7 +314,7 @@
*/
public String getName() {
- return (this.name);
+ return (this.name);
}
@@ -326,7 +326,7 @@
*/
public void setName(String name) {
- this.name = name;
+ this.name = name;
}
@@ -336,7 +336,7 @@
*/
public String getOnreset() {
- return (this.onreset);
+ return (this.onreset);
}
@@ -348,7 +348,7 @@
*/
public void setOnreset(String onReset) {
- this.onreset = onReset;
+ this.onreset = onReset;
}
@@ -358,7 +358,7 @@
*/
public String getOnsubmit() {
- return (this.onsubmit);
+ return (this.onsubmit);
}
@@ -370,7 +370,7 @@
*/
public void setOnsubmit(String onSubmit) {
- this.onsubmit = onSubmit;
+ this.onsubmit = onSubmit;
}
@@ -380,7 +380,7 @@
*/
public String getScope() {
- return (this.scope);
+ return (this.scope);
}
@@ -392,7 +392,7 @@
*/
public void setScope(String scope) {
- this.scope = scope;
+ this.scope = scope;
}
@@ -402,7 +402,7 @@
*/
public String getStyle() {
- return (this.style);
+ return (this.style);
}
@@ -414,7 +414,7 @@
*/
public void setStyle(String style) {
- this.style = style;
+ this.style = style;
}
@@ -424,7 +424,7 @@
*/
public String getStyleClass() {
- return (this.styleClass);
+ return (this.styleClass);
}
@@ -436,7 +436,7 @@
*/
public void setStyleClass(String styleClass) {
- this.styleClass = styleClass;
+ this.styleClass = styleClass;
}
@@ -461,7 +461,7 @@
this.styleId = styleId;
}
-
+
/**
@@ -469,7 +469,7 @@
*/
public String getTarget() {
- return (this.target);
+ return (this.target);
}
@@ -481,7 +481,7 @@
*/
public void setTarget(String target) {
- this.target = target;
+ this.target = target;
}
@@ -491,7 +491,7 @@
*/
public String getType() {
- return (this.type);
+ return (this.type);
}
@@ -503,7 +503,7 @@
*/
public void setType(String type) {
- this.type = type;
+ this.type = type;
}
@@ -527,15 +527,15 @@
// Look up the form bean name, scope, and type if necessary
lookup();
- // Create an appropriate "form" element based on our parameters
- HttpServletResponse response =
- (HttpServletResponse) pageContext.getResponse();
- StringBuffer results = new StringBuffer("<form");
- results.append(" name=\"");
- results.append(name);
- results.append("\"");
- results.append(" method=\"");
- results.append(method);
+ // Create an appropriate "form" element based on our parameters
+ HttpServletResponse response =
+ (HttpServletResponse) pageContext.getResponse();
+ StringBuffer results = new StringBuffer("<form");
+ results.append(" name=\"");
+ results.append(name);
+ results.append("\"");
+ results.append(" method=\"");
+ results.append(method);
results.append("\" action=\"");
results.append(response.encodeURL(getActionMappingURL()));
results.append("\"");
@@ -544,21 +544,21 @@
results.append(styleClass);
results.append("\"");
}
- if (enctype != null) {
- results.append(" enctype=\"");
- results.append(enctype);
- results.append("\"");
- }
- if (onreset != null) {
- results.append(" onreset=\"");
- results.append(onreset);
- results.append("\"");
+ if (enctype != null) {
+ results.append(" enctype=\"");
+ results.append(enctype);
+ results.append("\"");
+ }
+ if (onreset != null) {
+ results.append(" onreset=\"");
+ results.append(onreset);
+ results.append("\"");
}
if (onsubmit != null) {
- results.append(" onsubmit=\"");
- results.append(onsubmit);
- results.append("\"");
- }
+ results.append(" onsubmit=\"");
+ results.append(onsubmit);
+ results.append("\"");
+ }
if (style != null) {
results.append(" style=\"");
results.append(style);
@@ -569,12 +569,12 @@
results.append(styleId);
results.append("\"");
}
- if (target != null) {
- results.append(" target=\"");
- results.append(target);
- results.append("\"");
- }
- results.append(">");
+ if (target != null) {
+ results.append(" target=\"");
+ results.append(target);
+ results.append("\"");
+ }
+ results.append(">");
// Add a transaction token (if present in our session)
HttpSession session = pageContext.getSession();
@@ -590,19 +590,19 @@
}
}
- // Print this field to our output writer
+ // Print this field to our output writer
ResponseUtils.write(pageContext, results.toString());
- // Store this tag itself as a page attribute
- pageContext.setAttribute(Constants.FORM_KEY, this,
+ // Store this tag itself as a page attribute
+ pageContext.setAttribute(Constants.FORM_KEY, this,
PageContext.REQUEST_SCOPE);
-
- // Locate or create the bean associated with our form
- int scope = PageContext.SESSION_SCOPE;
- if ("request".equals(this.scope))
- scope = PageContext.REQUEST_SCOPE;
- Object bean = pageContext.getAttribute(name, scope);
- if (bean == null) {
+
+ // Locate or create the bean associated with our form
+ int scope = PageContext.SESSION_SCOPE;
+ if ("request".equals(this.scope))
+ scope = PageContext.REQUEST_SCOPE;
+ Object bean = pageContext.getAttribute(name, scope);
+ if (bean == null) {
bean = RequestUtils.createActionForm
((HttpServletRequest) pageContext.getRequest(),
mapping, appConfig, servlet);
@@ -616,11 +616,11 @@
}
pageContext.setAttribute(name, bean, scope);
}
- pageContext.setAttribute(Constants.BEAN_KEY, bean,
+ pageContext.setAttribute(Constants.BEAN_KEY, bean,
PageContext.REQUEST_SCOPE);
- // Continue processing this page
- return (EVAL_BODY_INCLUDE);
+ // Continue processing this page
+ return (EVAL_BODY_INCLUDE);
}
@@ -632,17 +632,17 @@
*/
public int doEndTag() throws JspException {
- // Remove the page scope attributes we created
- pageContext.removeAttribute(Constants.BEAN_KEY,
+ // Remove the page scope attributes we created
+ pageContext.removeAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);
- pageContext.removeAttribute(Constants.FORM_KEY,
+ pageContext.removeAttribute(Constants.FORM_KEY,
PageContext.REQUEST_SCOPE);
- // Render a tag representing the end of our current form
- StringBuffer results = new StringBuffer("</form>");
+ // Render a tag representing the end of our current form
+ StringBuffer results = new StringBuffer("</form>");
// Render JavaScript to set the input focus if required
- if (focus != null) {
+ if (focus != null) {
String tempFocus = focus;
StringBuffer refocus = new StringBuffer("[");
if (tempFocus.indexOf("[") > 0) {
@@ -652,10 +652,10 @@
refocus.append(st.nextToken());
}
}
- results.append("\r\n");
- results.append("<script language=\"JavaScript\"");
+ results.append("\r\n");
+ results.append("<script language=\"JavaScript\"");
results.append(" type=\"text/javascript\">\r\n");
- results.append(" <!--\r\n");
+ results.append(" <!--\r\n");
results.append(" if (document.forms[\"");
results.append(name);
results.append("\"].elements[\"");
@@ -665,27 +665,27 @@
results.append(refocus.toString());
}
results.append(".type != \"hidden\") \r\n");
- results.append(" document.forms[\"");
- results.append(name);
- results.append("\"].elements[\"");
+ results.append(" document.forms[\"");
+ results.append(name);
+ results.append("\"].elements[\"");
results.append(tempFocus);
results.append("\"]");
if (refocus.length() > 1) {
results.append(refocus.toString());
}
- results.append(".focus()\r\n");
- results.append(" // -->\r\n");
- results.append("</script>\r\n");
- }
-
- // Print this value to our output writer
- JspWriter writer = pageContext.getOut();
- try {
- writer.print(results.toString());
- } catch (IOException e) {
- throw new JspException
- (messages.getMessage("common.io", e.toString()));
- }
+ results.append(".focus()\r\n");
+ results.append(" // -->\r\n");
+ results.append("</script>\r\n");
+ }
+
+ // Print this value to our output writer
+ JspWriter writer = pageContext.getOut();
+ try {
+ writer.print(results.toString());
+ } catch (IOException e) {
+ throw new JspException
+ (messages.getMessage("common.io", e.toString()));
+ }
// Restore original property values used to invoke this tag. Needed
// for tag reuse to work correctly.
@@ -693,8 +693,8 @@
scope = savedScope;
type = savedType;
- // Continue processing this page
- return (EVAL_PAGE);
+ // Continue processing this page
+ return (EVAL_PAGE);
}
@@ -704,23 +704,23 @@
*/
public void release() {
- super.release();
- action = null;
+ super.release();
+ action = null;
appConfig = null;
- enctype = null;
- focus = null;
+ enctype = null;
+ focus = null;
mapping = null;
- method = "POST";
- name = null;
- onreset = null;
- onsubmit = null;
- scope = "session";
+ method = "POST";
+ name = null;
+ onreset = null;
+ onsubmit = null;
+ scope = "session";
servlet = null;
- style = null;
- styleClass = null;
+ style = null;
+ styleClass = null;
styleId = null;
- target = null;
- type = null;
+ target = null;
+ type = null;
}
@@ -770,7 +770,7 @@
if (config != null) {
value.append(config.getPrefix());
}
-
+
// Use our servlet mapping, if one is specified
String servletMapping = (String)
pageContext.getAttribute(Action.SERVLET_KEY,
@@ -820,7 +820,7 @@
*/
protected void lookup() throws JspException {
- // Look up the application configuration information we need
+ // Look up the application module configuration information we need
appConfig = (ApplicationConfig)
pageContext.getRequest().getAttribute(Action.APPLICATION_KEY);
if (appConfig == null) { // Backwards compatibility hack
1.17 +6 -6
jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java
Index: ImageTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImageTag.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ImageTag.java 25 Jun 2002 00:45:41 -0000 1.16
+++ ImageTag.java 9 Jul 2002 23:58:52 -0000 1.17
@@ -119,7 +119,7 @@
/**
- * The application-relative URI of the image.
+ * The module-relative URI of the image.
*/
protected String page = null;
@@ -133,7 +133,7 @@
/**
- * The message resources key of the application-relative URI of the image.
+ * The message resources key of the module-relative URI of the image.
*/
protected String pageKey = null;
1.24 +5 -5
jakarta-struts/src/share/org/apache/struts/taglib/html/LinkTag.java
Index: LinkTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/LinkTag.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- LinkTag.java 25 Jun 2002 00:45:41 -0000 1.23
+++ LinkTag.java 9 Jul 2002 23:58:52 -0000 1.24
@@ -185,7 +185,7 @@
/**
- * The application-relative page URL (beginning with a slash) to which
+ * The module-relative page URL (beginning with a slash) to which
* this hyperlink will be rendered.
*/
protected String page = null;
1.4 +1 -0
jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java
Index: JavascriptValidatorTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JavascriptValidatorTag.java 25 Jun 2002 00:45:41 -0000 1.3
+++ JavascriptValidatorTag.java 9 Jul 2002 23:58:52 -0000 1.4
@@ -86,6 +86,7 @@
* defined in the struts-config.xml file.
*
* @author David Winterfeldt
+ * @version $Revision$ $Date$
* @since Struts 1.1
*/
public class JavascriptValidatorTag extends BodyTagSupport {
1.5 +2 -1
jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java
Index: OptionsCollectionTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- OptionsCollectionTag.java 22 Jun 2002 21:54:56 -0000 1.4
+++ OptionsCollectionTag.java 9 Jul 2002 23:58:52 -0000 1.5
@@ -89,6 +89,7 @@
*
* @author Martin Cooper
* @version $Revision$ $Date$
+ * @since Struts 1.1
*/
public class OptionsCollectionTag extends TagSupport {
1.16 +17 -17
jakarta-struts/src/share/org/apache/struts/taglib/html/ErrorsTag.java
Index: ErrorsTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ErrorsTag.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ErrorsTag.java 23 Jun 2002 04:38:44 -0000 1.15
+++ ErrorsTag.java 9 Jul 2002 23:58:52 -0000 1.16
@@ -85,7 +85,7 @@
* Custom tag that renders error messages if an appropriate request attribute
* has been created. The tag looks for a request attribute with a reserved
* key, and assumes that it is either a String, a String array, containing
- * message keys to be looked up in the application's MessageResources, or
+ * message keys to be looked up in the module's MessageResources, or
* an object of type <code>org.apache.struts.action.ActionErrors</code>.
* <p>
* The following optional message keys will be utilized if corresponding
@@ -158,11 +158,11 @@
protected String name = Action.ERROR_KEY;
public String getName() {
- return (this.name);
+ return (this.name);
}
public void setName(String name) {
- this.name = name;
+ this.name = name;
}
@@ -192,16 +192,16 @@
*/
public int doStartTag() throws JspException {
- // Were any error messages specified?
- ActionErrors errors = null;
- try {
+ // Were any error messages specified?
+ ActionErrors errors = null;
+ try {
errors = RequestUtils.getActionErrors(pageContext, name);
} catch (JspException e) {
RequestUtils.saveException(pageContext, e);
throw e;
}
if ((errors == null) || errors.empty()) {
- return (EVAL_BODY_INCLUDE);
+ return (EVAL_BODY_INCLUDE);
}
// Check for presence of header and footer message keys
@@ -215,7 +215,7 @@
RequestUtils.present(pageContext, bundle, locale, "errors.suffix");
// Render the error messages appropriately
- StringBuffer results = new StringBuffer();
+ StringBuffer results = new StringBuffer();
boolean headerDone = false;
String message = null;
Iterator reports = null;
@@ -260,11 +260,11 @@
results.append("\r\n");
}
- // Print the results to our output writer
+ // Print the results to our output writer
ResponseUtils.write(pageContext, results.toString());
- // Continue processing this page
- return (EVAL_BODY_INCLUDE);
+ // Continue processing this page
+ return (EVAL_BODY_INCLUDE);
}
@@ -274,10 +274,10 @@
*/
public void release() {
- super.release();
+ super.release();
bundle = Action.MESSAGES_KEY;
locale = Action.LOCALE_KEY;
- name = Action.ERROR_KEY;
+ name = Action.ERROR_KEY;
property = null;
}
1.17 +69 -69
jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java
Index: ImgTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ImgTag.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ImgTag.java 22 Jan 2002 01:18:07 -0000 1.16
+++ ImgTag.java 9 Jul 2002 23:58:52 -0000 1.17
@@ -194,11 +194,11 @@
protected String lowsrc = null;
public String getLowsrc() {
- return (this.lowsrc);
+ return (this.lowsrc);
}
public void setLowsrc(String lowsrc) {
- this.lowsrc = lowsrc;
+ this.lowsrc = lowsrc;
}
@@ -215,16 +215,16 @@
protected String name = null;
public String getName() {
- return (this.name);
+ return (this.name);
}
public void setName(String name) {
- this.name = name;
+ this.name = name;
}
/**
- * The application-relative path, starting with a slash character, of the
+ * The module-relative path, starting with a slash character, of the
* image to be displayed by this rendered tag.
*/
protected String page = null;
@@ -317,11 +317,11 @@
protected String property = null;
public String getProperty() {
- return (this.property);
+ return (this.property);
}
public void setProperty(String property) {
- this.property = property;
+ this.property = property;
}
@@ -345,11 +345,11 @@
protected String src = null;
public String getSrc() {
- return (this.src);
+ return (this.src);
}
public void setSrc(String src) {
- this.src = src;
+ this.src = src;
}
@@ -420,8 +420,8 @@
*/
public int doStartTag() throws JspException {
- // Evaluate the body of this tag
- return (EVAL_BODY_TAG);
+ // Evaluate the body of this tag
+ return (EVAL_BODY_TAG);
}
@@ -433,12 +433,12 @@
*/
public int doEndTag() throws JspException {
- // Generate the name definition or image element
+ // Generate the name definition or image element
HttpServletRequest request =
- (HttpServletRequest) pageContext.getRequest();
- HttpServletResponse response =
- (HttpServletResponse) pageContext.getResponse();
- StringBuffer results = new StringBuffer("<img");
+ (HttpServletRequest) pageContext.getRequest();
+ HttpServletResponse response =
+ (HttpServletResponse) pageContext.getResponse();
+ StringBuffer results = new StringBuffer("<img");
String tmp = src();
String srcurl = url(tmp);
if (srcurl != null) {
@@ -499,13 +499,13 @@
}
results.append(prepareStyles());
results.append(prepareEventHandlers());
- results.append(">");
+ results.append(">");
- // Print this element to our output writer
+ // Print this element to our output writer
ResponseUtils.write(pageContext, results.toString());
// Evaluate the reaminder of this page
- return (EVAL_PAGE);
+ return (EVAL_PAGE);
}
@@ -515,23 +515,23 @@
*/
public void release() {
- super.release();
+ super.release();
border = null;
height = null;
hspace = null;
imageName = null;
ismap = null;
lowsrc = null;
- name = null;
+ name = null;
page = null;
pageKey = null;
paramId = null;
paramName = null;
paramProperty = null;
paramScope = null;
- property = null;
+ property = null;
scope = null;
- src = null;
+ src = null;
srcKey = null;
usemap = null;
vspace = null;
@@ -634,7 +634,7 @@
return (url);
// Start with an unadorned URL as specified
- StringBuffer src = new StringBuffer(url);
+ StringBuffer src = new StringBuffer(url);
// Append a single-parameter name and value, if requested
@@ -651,34 +651,34 @@
src.append(URLEncoder.encode(value.toString()));
}
- // Just return the URL if there is no bean to look up
- if ((property != null) && (name == null)) {
- JspException e = new JspException
- (messages.getMessage("getter.name"));
+ // Just return the URL if there is no bean to look up
+ if ((property != null) && (name == null)) {
+ JspException e = new JspException
+ (messages.getMessage("getter.name"));
RequestUtils.saveException(pageContext, e);
throw e;
}
- if (name == null)
- return (src.toString());
+ if (name == null)
+ return (src.toString());
- // Look up the map we will be using
+ // Look up the map we will be using
Object mapObject = RequestUtils.lookup(pageContext, name,
property, scope);
- Map map = null;
+ Map map = null;
try {
map = (Map) mapObject;
} catch (ClassCastException e) {
RequestUtils.saveException(pageContext, e);
throw new JspException
(messages.getMessage("imgTag.type"));
- }
+ }
- // Append the required query parameters
- boolean question = (src.toString().indexOf("?") >= 0);
- Iterator keys = map.keySet().iterator();
+ // Append the required query parameters
+ boolean question = (src.toString().indexOf("?") >= 0);
+ Iterator keys = map.keySet().iterator();
while (keys.hasNext()) {
- String key = (String) keys.next();
- Object value = map.get(key);
+ String key = (String) keys.next();
+ Object value = map.get(key);
if (value == null) {
if (question)
src.append('&');
@@ -689,34 +689,34 @@
src.append(key);
src.append('=');
// Interpret null as "no value specified"
- } else if (value instanceof String[]) {
- String values[] = (String[]) value;
- for (int i = 0; i < values.length; i++) {
- if (question)
- src.append('&');
- else {
- src.append('?');
- question = true;
- }
- src.append(key);
- src.append('=');
- src.append(URLEncoder.encode(values[i]));
- }
- } else {
- if (question)
- src.append('&');
- else {
- src.append('?');
- question = true;
- }
- src.append(key);
- src.append('=');
- src.append(URLEncoder.encode(value.toString()));
- }
- }
+ } else if (value instanceof String[]) {
+ String values[] = (String[]) value;
+ for (int i = 0; i < values.length; i++) {
+ if (question)
+ src.append('&');
+ else {
+ src.append('?');
+ question = true;
+ }
+ src.append(key);
+ src.append('=');
+ src.append(URLEncoder.encode(values[i]));
+ }
+ } else {
+ if (question)
+ src.append('&');
+ else {
+ src.append('?');
+ question = true;
+ }
+ src.append(key);
+ src.append('=');
+ src.append(URLEncoder.encode(value.toString()));
+ }
+ }
- // Return the final result
- return (src.toString());
+ // Return the final result
+ return (src.toString());
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>