labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r903365 - in /labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview: BeanFormProducer.java SmartForm.java
Date Tue, 26 Jan 2010 18:57:13 GMT
Author: simoneg
Date: Tue Jan 26 18:57:13 2010
New Revision: 903365

URL: http://svn.apache.org/viewvc?rev=903365&view=rev
Log:
Option to avoid post and use get instead

Modified:
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java?rev=903365&r1=903364&r2=903365&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
(original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
Tue Jan 26 18:57:13 2010
@@ -55,6 +55,7 @@
 	protected List<LocalizableStringWithSubject> errors;
 	protected List<LocalizableString> sentErrors = new ArrayList<LocalizableString>();
 	protected String code;
+	protected boolean post = true;
 	protected BeanHandler handler;
 	protected List<FormAction> actions;
 	protected String[] validationLayers;
@@ -104,7 +105,9 @@
 			}
 			beanStyle.setWithCustomClasses(true);
 			beanStyle.setValidationLayers(this.validationLayers);
-			out.write("<form name=\"form" + this.code + "\" action=\"filled\" method=\"post\" enctype=\"multipart/form-data\"
accept-charset=\"utf-8\"><div>");
+			out.write("<form name=\"form" + this.code + "\" action=\"filled\" method=\"");
+			out.write(post ? "post" : "get");
+			out.write("\" enctype=\"multipart/form-data\" accept-charset=\"utf-8\"><div>");
 			out.write("<input type=\"submit\" class=\"DefaultHiddenSubmit\" value=\"-\"/>");
 			out.flush();
 			super.produce(out);
@@ -254,6 +257,14 @@
 		this.validationLayers = validationLayers;
 	}
 
+	public boolean isPost() {
+		return post;
+	}
+
+	public void setPost(boolean post) {
+		this.post = post;
+	}
+
 	
 
 	/*

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java?rev=903365&r1=903364&r2=903365&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java
(original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java
Tue Jan 26 18:57:13 2010
@@ -60,6 +60,8 @@
 	protected Map<String, String[]> allParams = null;
 	protected String paramMagmaWorkingButton = null;
  	
+	protected boolean post = true;
+	
 	String[] layers = null;
 	
 	Map<String, List<?>> lists = new HashMap<String, List<?>>();
@@ -142,6 +144,7 @@
 		BeanFormProducer producer = new BeanFormProducer(this.bean, errors, getMyCode(), this.layers);
 		producer.setActions(this.actions);
 		producer.setBeanStyle(this.beanStyle);
+		producer.setPost(this.post);
 		producer.setOuterCssClass(outerCssClass);
 		producer.setElementCssClass(elementCssClass);
 		producer.setValidationLayers(validationLayers);
@@ -364,5 +367,14 @@
 		return this;
 	}
 
+	public boolean isPost() {
+		return post;
+	}
+
+	@LateConfigurable
+	public void setPost(boolean post) {
+		this.post = post;
+	}
+
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message