joerg 2003/09/25 10:20:19
Modified: src/java/org/apache/cocoon/generation RequestGenerator.java
Log:
After Vadim has updated the RequestGenerator, not much was to do ;-)
Javadoc completion
Revision Changes Path
1.7 +21 -11
cocoon-2.1/src/java/org/apache/cocoon/generation/RequestGenerator.java
Index: RequestGenerator.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/RequestGenerator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RequestGenerator.java 25 Sep 2003 12:59:53 -0000 1.6
+++ RequestGenerator.java 25 Sep 2003 17:20:19 -0000 1.7
@@ -81,9 +81,10 @@
* <dt> <i>form-encoding</i> (optional)
* <dd> The supposed encoding of the request parameter. Default is null.
* <dt> <i>generate-attributes</i> (optional)
- * <dd> If true, also generates request attributes. Default is false.
+ * <dd> If true, request attributes were also included. Default is false.
* </dl>
- * These configuration options supported in both declaration and use time.
+ * These configuration options are supported at both declaration and use
time.
+ * The configuration at use time takes priority over declaration time.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
@@ -93,16 +94,24 @@
*/
public class RequestGenerator extends ServiceableGenerator implements
Parameterizable {
- /** The URI of the namespace of this generator. */
- private static final String PREFIX = "h";
- private static final String URI = "http://apache.org/cocoon/request/2.0";
+ /** The namespace prefix of this generator. */
+ private final static String PREFIX = "h";
+ /** The namespace URI of this generator. */
+ private final static String URI = "http://apache.org/cocoon/request/2.0";
+ /** The configured container encoding at declaration time. */
private String global_container_encoding;
- private String global_form_encoding;
- private boolean global_generate_attributes;
-
+ /** The configured container encoding at use time. */
private String container_encoding;
+
+ /** The configured form encoding at declaration time. */
+ private String global_form_encoding;
+ /** The configured form encoding at use time. */
private String form_encoding;
+
+ /** The configuration for including request attributes at declaration
time. */
+ private boolean global_generate_attributes;
+ /** The configuration for including request attributes at use time. */
private boolean generate_attributes;
public void parameterize(Parameters parameters)
@@ -130,6 +139,7 @@
this.contentHandler.startDocument();
this.contentHandler.startPrefixMapping(PREFIX, URI);
+
attribute(attr, "target", request.getRequestURI());
attribute(attr, "source", (this.source != null ? this.source : ""));
start("request", attr);
@@ -137,7 +147,7 @@
start("requestHeaders", attr);
Enumeration headers = request.getHeaderNames();
while (headers.hasMoreElements()) {
- String header = (String) headers.nextElement();
+ String header = (String)headers.nextElement();
attribute(attr, "name", header);
start("header", attr);
data(request.getHeader(header));
@@ -154,7 +164,7 @@
String values[] = request.getParameterValues(parameter);
if (values != null) {
for (int x = 0; x < values.length; x++) {
- start("value",attr);
+ start("value", attr);
if (form_encoding != null) {
try {
data(values[x], container_encoding,
form_encoding);