All pastes #565717 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-14 03:30 UTC
rendered paste body
I  want to capture  parameters entered in a form (which uses post method), in the portlet. I am not using  beans. I had attached the form part of JSP file and the corresponding code in JAVA.



form.jsp

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


Java Code

public class FormPortlet extends ActionPortlet
{
   private static final String DISPLAY_PAGE = "form.jsp";
   public void init(PortletConfig config)
   throws PortletException
   {
       super.init(config);
       DEFAULT_VIEW_PAGE = "prepare";
   }
   public void prepare(RenderFormEvent event)
   throws PortletException
   {
       setNextState(event.getRenderRequest(), DISPLAY_PAGE);
   }
   public void formAction(ActionFormEvent event)
   {
       log.info("J4V4 f0rm portlet formAction function");
   }
}




The control never  passes to formAction function, thought i have action set to   http://localhost:8080/gridsphere/gridsphere/loggedin/52/r/formAcion in the form. 
Thanks a lot.