@RequestParam
.
This class does not directly provide access to the parameter value. For such services, please see {@link RequestParser} and {@link ModelFromRequest}.
This class separates request parameters into two kinds : file upload request parameters, and all others (here called "regular" request parameters).
Regular Request Parameters
Regular request parameters are associated with :
File Upload Request Parameters
Files are uploaded using forms having :
In addition, note that the Servlet API does not have extensive services for processing file upload parameters. It is likely best to use a third party tool for that task.
File upload request parameters, as represented by this class, have only a name associated with them, and no regular expression. This is because WEB4J cannot perform hard validation on the value of a file upload parameter - since the user may select any file whatsoever, validation of file contents can only be treated as a soft validation. If there is a problem, the response to the user must be polished, as part of the normal operation of the application.
As an example, an {@link Action} might perform soft validation on a file upload parameter for these items :
Naming Convention
Parameter names are usually not arbitrary in WEB4J. Instead, a simple convention is used which allows for automated mapping between request parameter names and corresponding getXXX methods of Model Objects (see {@link hirondelle.web4j.ui.tag.Populate}). For example, a parameter named 'Birth Date' (or 'birthDate') is mapped to a method named getBirthDate() when prepopulating a form with the contents of a Model Object. (The 'Birth Date' naming style is recommended, since it has this advantage : when messages regarding form input are presented to the user, the control name may be used directly, without trivial mapping of a 'coder-friendly' parameter name into more user-friendly text.)
Some parameters - notably those passed to Template.jsp - are not processed at all by the Controller, but are used directly in JSPs instead. Such parameters do not undergo hard validation by the {@link hirondelle.web4j.security.ApplicationFirewall}, and are not represented by this class.
See {@link java.util.regex.Pattern} for more information on regular expressions.
RequestParameter
class represents a single parameter sent with the client request. Instances of this class are returned by the {@link org.apache.sling.api.SlingHttpServletRequest#getRequestParameter(String)}, {@link org.apache.sling.api.SlingHttpServletRequest#getRequestParameters(String)} and{@link org.apache.sling.api.SlingHttpServletRequest#getRequestParameterMap()} method.
@see org.apache.sling.api.SlingHttpServletRequest#getRequestParameter(String)
@see org.apache.sling.api.SlingHttpServletRequest#getRequestParameters(String)
@see org.apache.sling.api.SlingHttpServletRequest#getRequestParameterMap()
The mixin renders an (initially invisible) progress indicator after the field (it will also be after the error icon most fields render). The progress indicator is made visible during the request to the server. The mixin then renders a <div> that will be filled in on the client side with dynamically obtained selections.
Multiple selection on the client is enabled by binding the tokens parameter (however, the mixin doesn't help split multiple selections up on the server, that is still your code's responsibility).
The container is responsible for providing an event handler for event "providecompletions". The context will be the partial input string sent from the client. The return value should be an array or list of completions, in presentation order. I.e.
String[] onProvideCompletionsFromMyField(String input) { return . . .; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|