<%@page 
import = "oracle.portal.provider.v2.render.*"
import = "oracle.portal.provider.v2.render.http.*"
import = "oracle.portal.provider.v2.http.HttpCommonConstants" 
%>

<%
    PortletRenderRequest pr = (PortletRenderRequest)
      request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    int zip;
    try 
    {
      zip = Integer.parseInt(pr.getParameter("p_zip"));
    } //try
    catch (NumberFormatException nfe)
    {zip=94065;} 
%>
<center>
<font class="PortletHeading1">
Zip code Portlet
</font>
<p>
<form method="post" action="<%=pr.getRenderContext().getPageURL()%>">
<table>
<tr>
<td> 
<font class="PortletHeading2">
Enter a ZIP code: 
</font>
</td>
<td> 
<input type="text" name="p_zip" size="6" value="<%=zip%>">
</td>
<td> 
<input type="submit" value="OK">
</td>
</tr>
</table>
</form>
<font class="PortletText2">
This portlet reads a ZIP code and passes to the other portlets residing on 
the page as a parameter.
</font>
</center>

<%!
  private String getContextRoot (PortletRenderRequest pr)
  // This method returns a URL to the Web application directory
  // Used when referring to portlet images located on the local OC4J
  // http://host.domain:port/J2EEWebContextRoot/
  {
    return HttpPortletRendererUtil.absoluteLink(pr,"/");   
  } //getContextRoot    
%>
