MoreMotionRequest Class |
![]() ![]() ![]() |
When we develop services or other types of classes for MoreMotion environment we use org.moremotion.servlet.MoreMotionRequest class very often. MoreMotionRequest implements the javax.http.servlet.HttpServletRequest interface so it provides all the methods that HttpServletRequest provides and more. Request Parameter Decoding When a request is sent to the server the parameters existing in the request are encoded by the browsers using an encoding, e.g. ISO-8859-1. When an application server receives a request, it decodes these parameters and prepare a request object to pass to the Servlet. If the application server does not use the same encoding that the browser used to encode the parameters during the decoding, the request parameters can get corrupted. Unfortunately this is the case for Tomcat. Tomcat always decode the request parameters using ISO-8859-1. MoreMotion solves this problem with the help of a request parameter called _enc. This parameter should contain the encoding that was used in encoding the request parameters. If you are getting the value of a request parameter from the MoreMotionRequest object, the parameters are converted using the value supplied with this _enc parameter.
The name string will get the converted value of the "name" parameter. However, some application servers can nicely guess the case and reads request parameters correctly. In that case you should disable the character conversion by setting a sysinfo.xml parameter to false. Here is the section that you have to change:
HttpServletResponse Objects Since an MoreMotion programmer does not need to write directly to the HttpServletResponse, this object is not passed as a separate parameter to the other MoreMotion Classes. Most of the time you will have only MoreMotionRequest which contains all the necessary objects in it.
MoreMotionRequest Methods
Accessing to HttpServletResponse object
Accessing to ServletContext object
MoreMotionRequest is one of the most important classes of the MoreMotion API since it provides a rich set of methods to perform the common tasks of a MoreMotion Service. See the examples below.
|