All pastes #587901 Raw Edit

Anonymous

public text v1 · immutable
#587901 ·published 2007-06-25 07:50 UTC
rendered paste body
Hi All,
  I want to access the input values entered in a form inside the portlet and JSP page.  I had created a simple JSP that has a simple form which uses POST method.

JSP file:

<%
   final String browser_name = (String) request.getAttribute("javax.servlet.forward.request_uri");
%>
<form name="input" action="<%= browser_name %>" method="post">
Username_post:
<input type="text" name="user_post">
<input type="submit" value="submit_post">
</form>






Portlet Code:

public class FormPortlet extends GenericPortlet
{
   public void doView(RenderRequest request,RenderResponse response)
   throws PortletException, IOException
   {
       parseRequestParameters(request);
       PortletContext portletcontext = getPortletContext();
       PortletRequestDispatcher prd = portletcontext.getRequestDispatcher("/jsp/form.jsp");
       prd.include(request,response);
   }
  }



How do I access the  value entered in  user_post input box inside the Java code and JSP code?
I tried printing all parameters and attributes from the request object, but could not find the value of user_post.