Repository: wicket Updated Branches: refs/heads/master c65648c7b -> 8ff5eb558
Fixed various formatting problems with user guide. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8ff5eb55 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8ff5eb55 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8ff5eb55 Branch: refs/heads/master Commit: 8ff5eb5586d3190f67eb9b31a6fd5399603dcecb Parents: c65648c Author: Andrea Del Bene <[email protected]> Authored: Fri Jan 13 10:55:20 2017 +0100 Committer: Andrea Del Bene <[email protected]> Committed: Fri Jan 13 10:55:20 2017 +0100 ---------------------------------------------------------------------- wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc | 2 +- .../src/main/asciidoc/http2push/http2push_2.adoc | 8 ++++---- .../src/main/asciidoc/internals/autocomponents.adoc | 2 +- .../src/main/asciidoc/internals/pagestoring.adoc | 2 +- .../src/main/asciidoc/modelsforms/modelsforms_3.adoc | 4 ++-- .../src/main/asciidoc/modelsforms/modelsforms_4.adoc | 4 ++-- .../src/main/asciidoc/monitoring/monitoring_1.adoc | 10 +++++----- 7 files changed, 16 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc b/wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc index 3dac717..206ed76 100644 --- a/wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc +++ b/wicket-user-guide/src/main/asciidoc/forms2/forms2_2.adoc @@ -55,7 +55,7 @@ To display feedback messages we must use component _org.apache.wicket.markup.htm </ul> ---- -CSS classes [feedbackPanel] and [feedbackPanelERROR] can be used in order to customize the style of the message list: +CSS classes _feedbackPanel_ and _feedbackPanelERROR_ can be used in order to customize the style of the message list: image::../img/feedback-panel-style.png[] http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/http2push/http2push_2.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/http2push/http2push_2.adoc b/wicket-user-guide/src/main/asciidoc/http2push/http2push_2.adoc index 5600f8b..017f37c 100644 --- a/wicket-user-guide/src/main/asciidoc/http2push/http2push_2.adoc +++ b/wicket-user-guide/src/main/asciidoc/http2push/http2push_2.adoc @@ -12,11 +12,11 @@ To create a server specific http/2 push support of the Wicket PushBuilder API ju ---- [arabic, start=2] -1. Add a text file called [org.apache.wicket.IInitializer] into the folder src/main/resources/META-INF/services/ +1. Add a text file called _org.apache.wicket.IInitializer_ into the folder src/main/resources/META-INF/services/ -2. Add a single line with the name of the IInitializer class example: [org.apache.wicket.http2.Initializer] to the created file +2. Add a single line with the name of the _IInitializer_ class example: _org.apache.wicket.http2.Initializer_ to the created file -3. Implement your own server specific PushBuilder class which implements the interface [org.apache.wicket.http2.markup.head.PushBuilder] This is an example how it was done for jetty: +3. Implement your own server specific PushBuilder class which implements the interface _org.apache.wicket.http2.markup.head.PushBuilder_ This is an example how it was done for jetty: [source,java] ---- public class Jetty9PushBuilder implements PushBuilder @@ -37,7 +37,7 @@ public class Jetty9PushBuilder implements PushBuilder } ---- [arabic, start=5] -1. Implement the class within the package [org.apache.wicket.http2.Initializer] and add your own server specific PushBuilder class to the Http2Settings. This is an example how it was done for jetty: +1. Implement the class within the package _org.apache.wicket.http2.Initializer_ and add your own server specific PushBuilder class to the Http2Settings. This is an example how it was done for jetty: [source,java] ---- public class Initializer implements IInitializer http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/internals/autocomponents.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/internals/autocomponents.adoc b/wicket-user-guide/src/main/asciidoc/internals/autocomponents.adoc index 12e9214..9c8b8ec 100644 --- a/wicket-user-guide/src/main/asciidoc/internals/autocomponents.adoc +++ b/wicket-user-guide/src/main/asciidoc/internals/autocomponents.adoc @@ -9,7 +9,7 @@ Before rendering any component Wicket must retrieve its markup calling method _g Application.get().getMarkupSettings().getMarkupFactory() ---- -After the markup has been loaded by _MarkupFactory_, it's parsed with class _org.apache.wicket.markup.MarkupParser_. _MarkupFactory_ creates a new _MarkupParser_ with method _newMarkupParser(MarkupResourceStream resource)_. The effective markup parsing is performed with a chain of entities implementing interface _org.apache.wicket.markup.parser.IMarkupFilter_. The default set of _IMarkupFilters_S used by _MarkupParser_ takes care of different tasks such as HTML validation, comments removing, Wicket tags handling, etc... +After the markup has been loaded by _MarkupFactory_, it's parsed with class _org.apache.wicket.markup.MarkupParser_. _MarkupFactory_ creates a new _MarkupParser_ with method _newMarkupParser(MarkupResourceStream resource)_. The effective markup parsing is performed with a chain of entities implementing interface _org.apache.wicket.markup.parser.IMarkupFilter_. The default set of _IMarkupFilters_ used by _MarkupParser_ takes care of different tasks such as HTML validation, comments removing, Wicket tags handling, etc... To customize the set of _IMarkupFilters_S used in our application we can create a subclass of _MarkupFactory_ overriding method _newMarkupParser(MarkupResourceStream resource)_: http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc index 3a0c28e..e38412e 100644 --- a/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc +++ b/wicket-user-guide/src/main/asciidoc/internals/pagestoring.adoc @@ -10,7 +10,7 @@ image::../img/page-storage.png[] _org.apache.wicket.page.IPageManager_'s task is to manage which pages have been used in a request and store their last state in the backing stores, namely _IPageStore_. The default implementation _org.apache.wicket.page.PageStoreManager_ collects all stateful pages which have been used in the request cycle (more than one page can be used in a single request if for example _setResponsePage()_ or _RestartResponseException_ is used). -At the end of the request all collected page instances are being stored in the first level cache - http session. They are stored in http session attribute named _ [wicket:persistentPageManagerData-APPLICATION_NAME] and passed to the underlying _IPageStore_. +At the end of the request all collected page instances are being stored in the first level cache - http session. They are stored in http session attribute named "_wicket:persistentPageManagerData-APPLICATION_NAME_" and passed to the underlying _IPageStore_. When the next http request comes _IPageProvider_ will ask for page with specific id and _PageStoreManager_ will look first in the http session and if no match is found then it will delegate to the IPageStore. At the end of the second request the http session based cache is being overwritten completely with the newly used page instances. To setup another _IPageManager_ implementation use _org.apache.wicket.Application.setPageManagerProvider(IPageManagerProvider)_. http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_3.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_3.adoc b/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_3.adoc index 85d976a..5490d61 100644 --- a/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_3.adoc +++ b/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_3.adoc @@ -53,7 +53,7 @@ Person person = new Person(); Label label = new Label("name", new PropertyModel(person, "name")); ---- -PropertyModel has just one constructor with two parameters: the model object (person in our example) and the name of the property we want to read/write ( [name] in our example). This last parameter is called property expression. Internally, methods getObject/setObject use property expression to get/set property's value. To resolve class properties PropertyModel uses class _org.apache.wicket.util.lang.Property_ Resolver which can access any kind of property, private fields included. +PropertyModel has just one constructor with two parameters: the model object (person in our example) and the name of the property we want to read/write ( _name_ in our example). This last parameter is called property expression. Internally, methods getObject/setObject use property expression to get/set property's value. To resolve class properties PropertyModel uses class _org.apache.wicket.util.lang.Property_ Resolver which can access any kind of property, private fields included. Just like the Java language, property expressions support dotted notation to select sub properties. So if we want to display the name of the Person's spouse we can write: @@ -136,7 +136,7 @@ add(new Label("email")); add(new Label("spouse.name")); ---- -CompoundPropertyModel can save us a lot of boring coding if we choose the id of components according to properties name. However it's also possible to use this type of model even if the id of a component does not correspond to a valid property expression. The method bind(String property) allows to create a property model from a given CompoundPropertyModel using the provided parameter as property expression. For example if we want to display the spouse's name in a label having [xyz] as id, we can write the following code: +CompoundPropertyModel can save us a lot of boring coding if we choose the id of components according to properties name. However it's also possible to use this type of model even if the id of a component does not correspond to a valid property expression. The method bind(String property) allows to create a property model from a given CompoundPropertyModel using the provided parameter as property expression. For example if we want to display the spouse's name in a label having "xyz" as id, we can write the following code: [source,java] ---- http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_4.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_4.adoc b/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_4.adoc index db125ec..160f0c8 100644 --- a/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_4.adoc +++ b/wicket-user-guide/src/main/asciidoc/modelsforms/modelsforms_4.adoc @@ -96,7 +96,7 @@ If we don't provide a model to a form component, we will get the following excep java.lang.IllegalStateException: Attempt to set model object on null model of component: ---- -Component TextField corresponds to the standard text field, without any particular behavior or restriction on the allowed values. We must bind this component to the <input> tag with the attribute type set to [text] PasswordTextField is a subtype of TextFiled and it must be used with an <input> tag with the attribute type set to [password] For security reasons component PasswordTextField cleans its value at each request, so it wil be always empty after the form has been rendered. By default PasswordTextField fields are required, meaning that if we left them empty, the form won't be submitted (i.e. onSubmit won't be called). Class FormComponent provides method setRequired(boolean required) to change this behavior. Inside onSubmit, to get/set model objects we have used shortcut methods setDefaultModelObject and getDefaultModelObject. Both methods are defined in class Component (see class diagram from Illustration 9.1). +Component TextField corresponds to the standard text field, without any particular behavior or restriction on the allowed values. We must bind this component to the <input> tag with the attribute type set to "text" PasswordTextField is a subtype of TextFiled and it must be used with an <input> tag with the attribute type set to "password". For security reasons component PasswordTextField cleans its value at each request, so it will be always empty after the form has been rendered. By default PasswordTextField fields are required, meaning that if we left them empty, the form won't be submitted (i.e. _onSubmit_ won't be called). Class FormComponent provides method _setRequired(boolean required)_ to change this behavior. Inside _onSubmit_, to get/set model objects we have used shortcut methods _setDefaultModelObject_ and _getDefaultModelObject_. Both methods are defined in class Component (see class diagram from Illustration 9.1). The following are the possible markup and code for the login page: @@ -188,5 +188,5 @@ spouseContainer.add(name = new Label("name")); add(spouseContainer); ---- -The value displayed by label [name] will be [John] and not the spouse's name [Jill] as you may expect. In this example the label doesn't own a model, so it must search up its container hierarchy for an inheritable model. However, its container (WebMarkup Container with id 'spouse') doesn't own a model, hence the request for a model is forwarded to the parent container, which in this case is the page. In the end the label inherits CompoundPropertyModel from page but only its own id is used for the property expression. The containers in between are never taken into account for the final property expression. +The value displayed by label "name" will be "John" and not the spouse's name "Jill" as you may expect. In this example the label doesn't own a model, so it must search up its container hierarchy for an inheritable model. However, its container (WebMarkup Container with id 'spouse') doesn't own a model, hence the request for a model is forwarded to the parent container, which in this case is the page. In the end the label inherits CompoundPropertyModel from page but only its own id is used for the property expression. The containers in between are never taken into account for the final property expression. http://git-wip-us.apache.org/repos/asf/wicket/blob/8ff5eb55/wicket-user-guide/src/main/asciidoc/monitoring/monitoring_1.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/monitoring/monitoring_1.adoc b/wicket-user-guide/src/main/asciidoc/monitoring/monitoring_1.adoc index a30477a..588dceb 100644 --- a/wicket-user-guide/src/main/asciidoc/monitoring/monitoring_1.adoc +++ b/wicket-user-guide/src/main/asciidoc/monitoring/monitoring_1.adoc @@ -79,8 +79,8 @@ To disable measurement: WicketMetrics.getSettings().setEnabled(false); ---- -*IMPORTANT INFORMATION* -** It is only possible to collect metrics for *one wicket filter per webapp* - don't declare more then one if you want to use wicket-metrics -** The WicketFilterInitAspect is required so that the application can be resolved - otherwise runtime exceptions will be thrown -** If you use the SessionCountListener you have to clear the session store if you restart the server - otherwise physically stored session will corrupt the data, because the count is initialized with 0. -** If you have set wicket-metrics as dependency you can open [wicket-metrics.template.xml] to get a full template of the [aop.xml] ** For the weaver options refer to the AspectJ LTW configuration documentation: https://eclipse.org/aspectj/doc/next/devguide/ltw-configuration.html +WARNING: *IMPORTANT INFORMATION* +It is only possible to collect metrics for *one wicket filter per webapp* - don't declare more then one if you want to use wicket-metrics +The WicketFilterInitAspect is required so that the application can be resolved - otherwise runtime exceptions will be thrown +If you use the SessionCountListener you have to clear the session store if you restart the server - otherwise physically stored session will corrupt the data, because the count is initialized with 0. +If you have set wicket-metrics as dependency you can open [wicket-metrics.template.xml] to get a full template of the [aop.xml]. For the weaver options refer to the AspectJ LTW configuration documentation: https://eclipse.org/aspectj/doc/next/devguide/ltw-configuration.html
