You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2016/03/08 13:35:48 UTC

[1/3] wicket git commit: Return an empty string buffer if the input is null

Repository: wicket
Updated Branches:
  refs/heads/master fa83afe98 -> ebe8dfc48


Return an empty string buffer if the input is null


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b59fde50
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b59fde50
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b59fde50

Branch: refs/heads/master
Commit: b59fde50eb122693e56782cb01ef74be64fd3360
Parents: f082d03
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Mar 8 09:36:35 2016 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Mar 8 13:35:03 2016 +0100

----------------------------------------------------------------------
 .../wicket/response/filter/XmlCleaningResponseFilter.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b59fde50/wicket-core/src/main/java/org/apache/wicket/response/filter/XmlCleaningResponseFilter.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/response/filter/XmlCleaningResponseFilter.java b/wicket-core/src/main/java/org/apache/wicket/response/filter/XmlCleaningResponseFilter.java
index 3b5df10..33c292b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/response/filter/XmlCleaningResponseFilter.java
+++ b/wicket-core/src/main/java/org/apache/wicket/response/filter/XmlCleaningResponseFilter.java
@@ -18,6 +18,7 @@ package org.apache.wicket.response.filter;
 
 import org.apache.wicket.page.XmlPartialPageUpdate;
 import org.apache.wicket.util.string.AppendingStringBuffer;
+import org.apache.wicket.util.string.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,6 +87,10 @@ public class XmlCleaningResponseFilter implements IResponseFilter
 	 */
 	public AppendingStringBuffer stripNonValidXMLCharacters(AppendingStringBuffer input)
 	{
+		if (input == null) {
+			return new AppendingStringBuffer();
+		}
+
 		char[] chars = input.getValue();
 		AppendingStringBuffer out = null;
 		boolean isDebugEnabled = LOG.isDebugEnabled();
@@ -108,7 +113,7 @@ public class XmlCleaningResponseFilter implements IResponseFilter
 					if (isDebugEnabled)
 					{
 						LOG.debug("An invalid character '{}' found at position '{}' in '{}'",
-								new Object[] {String.format("0x%X", codePoint), i, new String(chars)});
+								String.format("0x%X", codePoint), i, new String(chars));
 					}
 				}
 				else if (isDebugEnabled)


[2/3] wicket git commit: Update forms2_3.gdoc

Posted by mg...@apache.org.
Update forms2_3.gdoc

TextField for regexp pattern was named mail, renamed to regExpPatternTxt for consistency.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f082d034
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f082d034
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f082d034

Branch: refs/heads/master
Commit: f082d034393644fe654e45dc35328979b4ab89f9
Parents: c010e2d
Author: meno <am...@users.noreply.github.com>
Authored: Tue Mar 8 08:51:09 2016 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Mar 8 13:35:03 2016 +0100

----------------------------------------------------------------------
 .../src/docs/guide/forms2/forms2_11.gdoc        |  2 +-
 .../src/docs/guide/forms2/forms2_3.gdoc         |  8 +--
 .../src/docs/guide/forms2/forms2_5.gdoc         | 38 +++++-----
 .../src/docs/guide/forms2/forms2_8.gdoc         | 74 ++++++++++----------
 .../src/docs/guide/forms2/forms2_9.gdoc         |  4 +-
 .../src/docs/guide/repeaters/repeaters_2.gdoc   | 14 ++--
 .../src/docs/guide/repeaters/repeaters_3.gdoc   |  6 +-
 .../src/docs/guide/repeaters/repeaters_4.gdoc   |  4 +-
 8 files changed, 75 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/forms2/forms2_11.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_11.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_11.gdoc
index fa656f6..e591240 100644
--- a/wicket-user-guide/src/docs/guide/forms2/forms2_11.gdoc
+++ b/wicket-user-guide/src/docs/guide/forms2/forms2_11.gdoc
@@ -131,7 +131,7 @@ Person bob = new Person("Bob", "Smith");
 Person jill = new Person("Jill", "Smith");
 List<Person> theSmiths = Arrays.asList(john, bob, jill); 
 ChoiceRenderer render = new ChoiceRenderer("name");
-     	form.add(new CheckBoxMultipleChoice("checkGroup", new ListModel<String>(new ArrayList<String>()),   
+form.add(new CheckBoxMultipleChoice("checkGroup", new ListModel<String>(new ArrayList<String>()),   
                                     theSmiths, render));
 {code}
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/forms2/forms2_3.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_3.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_3.gdoc
index b99ccf4..2478a27 100644
--- a/wicket-user-guide/src/docs/guide/forms2/forms2_3.gdoc
+++ b/wicket-user-guide/src/docs/guide/forms2/forms2_3.gdoc
@@ -101,11 +101,11 @@ Finally, in the home page of the project we build the form which displays (with
 
 {code}
 public class HomePage extends WebPage {
-    private Pattern regExpPatter;
+    private Pattern regExpPattern;
     private String stringToSplit;
     
     public HomePage(final PageParameters parameters) {		
-    	TextField mail;
+    	TextField regExpPatternTxt;
 	TextField stringToSplitTxt;
 		
     	Form form = new Form("form"){
@@ -113,7 +113,7 @@ public class HomePage extends WebPage {
 			protected void onSubmit() {
 				super.onSubmit();
 				String messageResult = "Tokens for the given string and pattern:<br/>";
-				String[] tokens = regExpPatter.split(stringToSplit);
+				String[] tokens = regExpPattern.split(stringToSplit);
 			
 				for (String token : tokens) {
 					messageResult += "- " + token + "<br/>";
@@ -123,7 +123,7 @@ public class HomePage extends WebPage {
 	};
     	
 		form.setDefaultModel(new CompoundPropertyModel(this));
-		form.add(mail = new TextField("regExpPatter"));
+		form.add(regExpPatternTxt = new TextField("regExpPattern"));
 		form.add(stringToSplitTxt = new TextField("stringToSplit"));
 		add(new FeedbackPanel("feedbackMessage").setEscapeModelStrings(false));
 		

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/forms2/forms2_5.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_5.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_5.gdoc
index 46a2b0b..f5869b4 100644
--- a/wicket-user-guide/src/docs/guide/forms2/forms2_5.gdoc
+++ b/wicket-user-guide/src/docs/guide/forms2/forms2_5.gdoc
@@ -33,12 +33,12 @@ In the following snippet we have a form with two submit buttons bound to an <inp
 
 {code:html}
 <body>
-		<form wicket:id="form">
-			Username: <input type="text" wicket:id="username"/>
-			<br/>
-			<input type="submit" wicket:id="submit1"/>
-			<input type="submit" wicket:id="submit2"/>
-		</form>
+	<form wicket:id="form">
+		Username: <input type="text" wicket:id="username"/>
+		<br/>
+		<input type="submit" wicket:id="submit1"/>
+		<input type="submit" wicket:id="submit2"/>
+	</form>
 </body>
 {code}
 
@@ -47,17 +47,17 @@ In the following snippet we have a form with two submit buttons bound to an <inp
 {code}
 public class HomePage extends WebPage {
 	
-    public HomePage(final PageParameters parameters) {		
+	public HomePage(final PageParameters parameters) {		
 		Form form = new Form("form");
-
-     	form.add(new TextField("username", Model.of("")));
-    	form.add(new Button("submit1", Model.of("First submitter")));
+	
+	     	form.add(new TextField("username", Model.of("")));
+	    	form.add(new Button("submit1", Model.of("First submitter")));
 		Button secondSubmitter;
 		form.add(secondSubmitter = new Button("submit2", Model.of("Second submitter")));
-	
-    	form.setDefaultButton(secondSubmitter);
+		
+	    	form.setDefaultButton(secondSubmitter);
 		add(form);
-    }
+	}
 }
 {code}
 
@@ -85,10 +85,10 @@ A notable difference between this component and Button is that SubmitLink can be
 
 {code:html}
 <html xmlns:wicket="http://wicket.apache.org">
-<head>
+	<head>
 	</head>
 	<body>
-	<form wicket:id="form">
+		<form wicket:id="form">
 			Password: <input type="password" wicket:id="password"/>
 			<br/>					
 		</form>
@@ -104,14 +104,14 @@ A notable difference between this component and Button is that SubmitLink can be
 {code}
 public class HomePage extends WebPage {
 	
-    public HomePage(final PageParameters parameters) {		
+	public HomePage(final PageParameters parameters) {		
 		Form form = new Form("form");
-    	
+	    
 		form.add(new PasswordTextField("password", Model.of("")));
 		//specify the form to submit
 		add(new SubmitLink("externalSubmitter", form));
 		add(form);
-    }
+	}
 }
 {code}
 
@@ -121,4 +121,4 @@ With an IFormSubmittingComponent we can choose to skip the default form submissi
 
 This can be useful if we want to implement a “Cancel” button on our form which redirects user to another page without validating his/her input. 
 
-When we set this flag to false we can decide to manually invoke the form processing by calling the process(IFormSubmittingComponent) method.
\ No newline at end of file
+When we set this flag to false we can decide to manually invoke the form processing by calling the process(IFormSubmittingComponent) method.

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc
index 8b03d1b..9543c29 100644
--- a/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc
+++ b/wicket-user-guide/src/docs/guide/forms2/forms2_8.gdoc
@@ -11,13 +11,13 @@ In the next example (project UploadSingleFile) we will see a form which allows u
 	<head>
 	</head>
 	<body>
-	<h1>Upload your file here!</h1>
-	<form wicket:id="form">
-		<input type="file" wicket:id="fileUploadField"/> 
-		<input type="submit" value="Upload"/>
-	</form>
-	<div wicket:id="feedbackPanel">
-	</div>
+		<h1>Upload your file here!</h1>
+		<form wicket:id="form">
+			<input type="file" wicket:id="fileUploadField"/> 
+			<input type="submit" value="Upload"/>
+		</form>
+		<div wicket:id="feedbackPanel">
+		</div>
 	</body>
 </html>
 {code}
@@ -26,36 +26,36 @@ In the next example (project UploadSingleFile) we will see a form which allows u
 
 {code}
 public class HomePage extends WebPage {
-   private FileUploadField fileUploadField;
-
-    public HomePage(final PageParameters parameters) {
-    	fileUploadField = new FileUploadField("fileUploadField");
-    	
-    	Form form = new Form("form"){
-    		@Override
-    		protected void onSubmit() {
-    		  super.onSubmit();
-    			 
-    		  FileUpload fileUpload = fileUploadField.getFileUpload();
-    			
-    		    try {
-			File file = new File(System.getProperty("java.io.tmpdir") + "/" +
-    						fileUpload.getClientFileName());
-    				
-			    fileUpload.writeTo(file);
-		        } catch (IOException e) {
-			   e.printStackTrace();
-			 }
-    		}
-    	};	
+	private FileUploadField fileUploadField;
+	
+	public HomePage(final PageParameters parameters) {
+	   	fileUploadField = new FileUploadField("fileUploadField");
+	    
+		Form form = new Form("form"){
+			@Override
+			protected void onSubmit() {
+				super.onSubmit();
+			     
+				FileUpload fileUpload = fileUploadField.getFileUpload();
+			    
+				try {
+					File file = new File(System.getProperty("java.io.tmpdir") + "/" +
+					fileUpload.getClientFileName());
+				    	
+					fileUpload.writeTo(file);
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+		};	
 	
-	form.setMultiPart(true);
-	//set a limit for uploaded file's size
-	form.setMaxSize(Bytes.kilobytes(100));
-	form.add(fileUploadField);
-	add(new FeedbackPanel("feedbackPanel"));
-	add(form);
-    }
+		form.setMultiPart(true);
+		//set a limit for uploaded file's size
+		form.setMaxSize(Bytes.kilobytes(100));
+		form.add(fileUploadField);
+		add(new FeedbackPanel("feedbackPanel"));
+		add(form);
+	}
 }
 {code}
 
@@ -70,7 +70,7 @@ The maximum size for uploaded files can also be set at application's level using
 @Override
 public void init()
 {
- getApplicationSettings().setDefaultMaximumUploadSize(Bytes.kilobytes(100));  
+	getApplicationSettings().setDefaultMaximumUploadSize(Bytes.kilobytes(100));  
 }
 {code}
 {note}

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/forms2/forms2_9.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/forms2/forms2_9.gdoc b/wicket-user-guide/src/docs/guide/forms2/forms2_9.gdoc
index 4f6dd73..aa95cf6 100644
--- a/wicket-user-guide/src/docs/guide/forms2/forms2_9.gdoc
+++ b/wicket-user-guide/src/docs/guide/forms2/forms2_9.gdoc
@@ -51,7 +51,7 @@ public class TemperatureDegreeField extends FormComponentPanel<Double> {
 	protected void onInitialize() {
 		super.onInitialize();	
 		
-	     AbstractReadOnlyModel<String> labelModel=new AbstractReadOnlyModel<String>(){
+		AbstractReadOnlyModel<String> labelModel=new AbstractReadOnlyModel<String>(){
 			@Override
 			public String getObject() {
 				if(getLocale().equals(Locale.US))
@@ -62,7 +62,7 @@ public class TemperatureDegreeField extends FormComponentPanel<Double> {
 		
 		add(new Label("mesuramentUnit", labelModel));
 		add(userDegree=new TextField<Double>("registeredTemperature", new 
-                           Model<Double>()));
+                        Model<Double>()));
 		userDegree.setType(Double.class);
 	}
 {code}

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/repeaters/repeaters_2.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/repeaters/repeaters_2.gdoc b/wicket-user-guide/src/docs/guide/repeaters/repeaters_2.gdoc
index 6b06ea8..c3bcc71 100644
--- a/wicket-user-guide/src/docs/guide/repeaters/repeaters_2.gdoc
+++ b/wicket-user-guide/src/docs/guide/repeaters/repeaters_2.gdoc
@@ -23,14 +23,14 @@ To generate its children, ListView calls its abstract method populateItem(ListIt
 *Java Code (Page Constructor):*
 {code}
 public HomePage(final PageParameters parameters) {
-	   List<Person> persons = Arrays.asList(new Person("John", "Smith"), 
+	List<Person> persons = Arrays.asList(new Person("John", "Smith"), 
                                         new Person("Dan", "Wong"));
 		
-   add(new ListView<Person>("persons", persons) {
-	@Override
-	protected void populateItem(ListItem<Person> item) {
-	   item.add(new Label("fullName", new PropertyModel(item.getModel(), "fullName")));
-	}			
+   	add(new ListView<Person>("persons", persons) {
+		@Override
+		protected void populateItem(ListItem<Person> item) {
+	   		item.add(new Label("fullName", new PropertyModel(item.getModel(), "fullName")));
+		}			
    });
 }
 {code}
@@ -45,4 +45,4 @@ h3. ListView and Form
 
 By default @ListView@ replaces its children components with new instances every time is rendered. Unfortunately this behavior is a problem if @ListView@ is inside a form and it contains form components. The problem is caused by the fact that children components are replaced by new ones before form is rendered, hence they can't keep their input value if validation fails and, furthermore, their feedback messages can not be displayed.
 
-To avoid this kind of problem we can force @ListView@ to reuse its children components using its method setReuseItems and passing true as parameter. If for any reason we need to refresh children components after we have invoked setReuseItems(true), we can use MarkupContainer's method @removeAll()@ to force @ListView@ to rebuild them.
\ No newline at end of file
+To avoid this kind of problem we can force @ListView@ to reuse its children components using its method setReuseItems and passing true as parameter. If for any reason we need to refresh children components after we have invoked setReuseItems(true), we can use MarkupContainer's method @removeAll()@ to force @ListView@ to rebuild them.

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/repeaters/repeaters_3.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/repeaters/repeaters_3.gdoc b/wicket-user-guide/src/docs/guide/repeaters/repeaters_3.gdoc
index ec21719..5ad775f 100644
--- a/wicket-user-guide/src/docs/guide/repeaters/repeaters_3.gdoc
+++ b/wicket-user-guide/src/docs/guide/repeaters/repeaters_3.gdoc
@@ -35,10 +35,10 @@ public HomePage(final PageParameters parameters) {
 	   item.add(new Label("fullName", new PropertyModel(item.getModel(), "fullName")));
 	}
 
-@Override
+	@Override
 	protected Iterator<IModel<Person>> getItemModels() {
 	   return persons.iterator();
-}			
+	}			
    });
 }
 {code}
@@ -47,4 +47,4 @@ h3. Item reuse strategy
 
 Similar to @ListView@, the default behavior of the @RefreshingView@ is to replace its children with new instances every time is rendered. The strategy that decides if and how children components must be refreshed is returned by method @getItemReuseStrategy@. This strategy is an implementation of interface IItemReuseStrategy. The default implementation used by @RefreshingView@ is class @DefaultItemReuseStrategy@ but Wicket provides also strategy @ReuseIfModelsEqualStrategy@ which reuses an item if its model has been returned by the iterator obtained with method @getItemModels@. 
 
-To set a custom strategy we must use method @setItemReuseStrategy@.
\ No newline at end of file
+To set a custom strategy we must use method @setItemReuseStrategy@.

http://git-wip-us.apache.org/repos/asf/wicket/blob/f082d034/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc b/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc
index 71c5793..9424115 100644
--- a/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc
+++ b/wicket-user-guide/src/docs/guide/repeaters/repeaters_4.gdoc
@@ -103,10 +103,10 @@ public HomePage(final PageParameters parameters) {
 }
 {code}
 
-The data of a single country (ISO code, name, long name, capital and population) are handled with an array of strings. The usage of PagingNavigator it's quite straightforward as we need to simply pass the pageable repeater to its constructor. 
+The data of a single country (ISO code, name, long name, capital and population) are handled with an array of strings. The usage of PagingNavigator is quite straightforward as we need to simply pass the pageable repeater to its constructor. 
 
 To explore the other pageable repeaters shipped with Wicket you can visit the page at "http://www.wicket-library.com/wicket-examples/repeater/":http://www.wicket-library.com/wicket-examples/repeater/ where you can find live examples of these components.
 
 {note}
-Wicket provides also component PageableListView which is a sublcass of ListView that implements interface IPageable, hence it can be considered a pageable repeaters even if it doesn't use interface IDataProvider as data source.
+Wicket provides also component PageableListView which is a sublcass of ListView that implements interface IPageable, hence it can be considered a pageable repeater even if it doesn't use interface IDataProvider as data source.
 {note}


[3/3] wicket git commit: Merge branch 'pr-163-master'

Posted by mg...@apache.org.
Merge branch 'pr-163-master'


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ebe8dfc4
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ebe8dfc4
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ebe8dfc4

Branch: refs/heads/master
Commit: ebe8dfc48fcb5813a6249cdb6a265ac0daab4900
Parents: fa83afe b59fde5
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Mar 8 13:35:34 2016 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Mar 8 13:35:34 2016 +0100

----------------------------------------------------------------------
 .../src/docs/guide/forms2/forms2_11.gdoc        |  2 +-
 .../src/docs/guide/forms2/forms2_3.gdoc         |  8 +--
 .../src/docs/guide/forms2/forms2_5.gdoc         | 38 +++++-----
 .../src/docs/guide/forms2/forms2_8.gdoc         | 74 ++++++++++----------
 .../src/docs/guide/forms2/forms2_9.gdoc         |  4 +-
 .../src/docs/guide/repeaters/repeaters_2.gdoc   | 14 ++--
 .../src/docs/guide/repeaters/repeaters_3.gdoc   |  6 +-
 .../src/docs/guide/repeaters/repeaters_4.gdoc   |  4 +-
 8 files changed, 75 insertions(+), 75 deletions(-)
----------------------------------------------------------------------