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:12 UTC
[wicket] branch master updated: WICKET-6708 optimization
This is an automated email from the ASF dual-hosted git repository.
svenmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new 5be3bf1 WICKET-6708 optimization
5be3bf1 is described below
commit 5be3bf172ad33520a95c8fb55bbd76d99f296ea8
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 0713582..fd68258 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
@@ -799,15 +799,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;