Difference between revisions of "Request Object"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:request Object}} | {{DISPLAYTITLE:request Object}} | ||
The <tt>request</tt> object is available in any JSP [[Page]]. It contains information provided when the HTTP request is made. | The <tt>request</tt> object is available in any JSP [[Page]]. It contains information provided when the HTTP request is made. The information it contains can be used with the [[REST API:record Resource| REST record Resource]] or [[Java API:Record Handling|Java Record Handling]] APIs to get further information from the record. | ||
<noinclude> | |||
When a JSP page is invoked by an active record, the <tt>request</tt> object contains record identifiers. | |||
Record-identifying information is available when: | Record-identifying information is available when: | ||
:* The JSP page is acting as a [[Print Templates|Print Template]]. | :* The JSP page is acting as a [[Print Templates|Print Template]]. | ||
:* The JSP page is acting as a [[Custom Control]] on a record form. | :* The JSP page is acting as a [[Custom Control]] on a record form. | ||
</noinclude> | |||
To obtain the identifiers from the <tt>request</tt> object: | To obtain the identifiers from the <tt>request</tt> object: | ||
:<syntaxhighlight lang="java" enclose="div"> | :<syntaxhighlight lang="java" enclose="div"> |
Revision as of 02:04, 18 February 2012
The request object is available in any JSP Page. It contains information provided when the HTTP request is made. The information it contains can be used with the REST record Resource or Java Record Handling APIs to get further information from the record.
When a JSP page is invoked by an active record, the request object contains record identifiers.
Record-identifying information is available when:
- The JSP page is acting as a Print Template.
- The JSP page is acting as a Custom Control on a record form.
To obtain the identifiers from the request object:
- <syntaxhighlight lang="java" enclose="div">
<%
String object_id = request.getParameter("object_id"); String record_id = request.getParameter("record_id");
%> </syntaxhighlight>
To list all of parameters available in the request object and display their values:
- <syntaxhighlight lang="java" enclose="div">
<%
String[] params = request.getParameterValues(); for (int i=0; i<params.length; i++) { String paramName = params[i]; String paramValue = request.getParameter( paramName ); }
%> </syntaxhighlight>