AgileApps Support Wiki Pre Release

Difference between revisions of "Using the request Object"

From AgileApps Support Wiki
imported>Aeric
(Created page with "To obtain record identifiers from the <tt>request</tt> object: :<syntaxhighlight lang="java" enclose="div"> <% String object_id = request.getParameter("object_id"); String re…")
 
imported>Aeric
Line 1: Line 1:
To obtain record identifiers from the <tt>request</tt> object:
'''To list all of the parameters available in the <tt>request</tt> object and display their values:'''
:<syntaxhighlight lang="java" enclose="div">
<%
  String object_id = request.getParameter("object_id");
  String record_id = request.getParameter("record_id");
%>
</syntaxhighlight>
 
{{Note|Although the <tt>object_id</tt> is alphanumeric, it can be used in any API that requires an object name.}}
 
To list all of the parameters available in the <tt>request</tt> object and display their values:
:<syntaxhighlight lang="java" enclose="div">
:<syntaxhighlight lang="java" enclose="div">
<%
<%
Line 20: Line 10:
%>
%>
</syntaxhighlight>
</syntaxhighlight>
'''To obtain a record identifier from the <tt>request</tt> object:'''
:<syntaxhighlight lang="java" enclose="div">
<%
  String object_id = request.getParameter("object_id");
  String record_id = request.getParameter("record_id");
%>
</syntaxhighlight>
{{Note|Although the <tt>object_id</tt> is alphanumeric, it can be used in any API that requires an object name.}}

Revision as of 01:13, 9 January 2013

To list all of the 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>

To obtain a record identifier from the request object:

<syntaxhighlight lang="java" enclose="div">

<%

 String object_id = request.getParameter("object_id");
 String record_id = request.getParameter("record_id");

%> </syntaxhighlight>

Notepad.png

Note: Although the object_id is alphanumeric, it can be used in any API that requires an object name.