Author: craigmcc
Date: Thu May 25 17:12:31 2006
New Revision: 409515
URL: http://svn.apache.org/viewvc?rev=409515&view=rev
Log:
Add convenience accessors for request parameters as well, since this is a
common way to communicate information between pages.
Modified:
struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java
Modified:
struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java
URL:
http://svn.apache.org/viewvc/struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java?rev=409515&r1=409514&r2=409515&view=diff
==============================================================================
---
struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java
(original)
+++
struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java
Thu May 25 17:12:31 2006
@@ -291,6 +291,38 @@
}
+ // ----------------------------------------------- Request Parameter
Methods
+
+
+ /**
+ * <p>Return the first (or only) value for the specified request parameter.
+ * If no such request parameter exists for the current requset, return
+ * <ocde>null</code> instead.</p>
+ *
+ * @param name Name of the request parameter to look for
+ */
+ public String getRequestParameter(String name) {
+
+ return (String)
getExternalContext().getRequestParameterMap().get(name);
+
+ }
+
+
+ /**
+ * <p>Return an array of all the values for the specified request
parameter,
+ * if there are any. If no such request parameter exists for the current
+ * request, return <code>null</code> instead.</p>
+ *
+ * @param name Name of the request parameter to look for
+ */
+ public String[] getRequestParameterValues(String name) {
+
+ return (String[])
+ getExternalContext().getRequestParameterValuesMap().get(name);
+
+ }
+
+
// ------------------------------------------------------------- Log
Methods