You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2019/10/10 20:14:57 UTC

[wicket] branch wicket-8.x updated: WICKET-6708 optimization

This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-8.x by this push:
     new 8f25fc4  WICKET-6708 optimization
8f25fc4 is described below

commit 8f25fc4a7bcf2165e519b19da92f381a022903b4
Author: Sven Meier <sv...@apache.org>
AuthorDate: Thu Oct 10 21:55:53 2019 +0200

    WICKET-6708 optimization
    
    prevent form lookup if not needed
---
 .../org/apache/wicket/markup/html/form/FormComponent.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
index c764190..a0fc78e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
@@ -800,15 +800,18 @@ public abstract class FormComponent<T> extends LabeledWebMarkupContainer impleme
 	protected List<StringValue> getParameterValues(String inputName)
 	{
 		String method = Form.METHOD_POST;
-		final Form form = findParent(Form.class);
 		final Request request = getRequest();
 		if (getRequest().getContainerRequest() instanceof HttpServletRequest)
 		{
-			method = ((HttpServletRequest) getRequest().getContainerRequest()).getMethod();
+			method = ((HttpServletRequest)getRequest().getContainerRequest()).getMethod();
 		}
-		else if (form != null)
+		else
 		{
-			method = form.getMethod();
+			final Form<?> form = findParent(Form.class);
+			if (form != null)
+			{
+				method = form.getMethod();
+			}
 		}
 
 		final IRequestParameters parameters;