[jboss-user] [JBoss Portal] - SetRenderingParameter to renderer method dont work :( or i m

J0Ke do-not-reply at jboss.com
Mon Nov 27 05:00:47 EST 2006


i want just to show one text when submit a form .. 
i try this with dispatcher and 2 jsps but dont work so i try the easy version but dont work too.
public class TestPortletAction extends GenericPortlet 
{
public class TestPortletAction extends GenericPortlet 
{
response.setRenderParameter("secound","sec"); //hard coded value
} protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException
  {
    // Do nothing if window state is minimized.
    WindowState state = request.getWindowState();
    if (state.equals(WindowState.MINIMIZED))
    {
      super.doDispatch(request, response);
      return;
    }

    // Get the content type for the response.
    String contentType = request.getResponseContentType();
    response.setContentType(contentType);

    // Get the requested portlet mode.
    PortletMode mode = request.getPortletMode();

    // Dispatch based on content type and portlet mode.
    if (contentType.equals("text/html"))
    {
      if (mode.equals(PortletMode.VIEW))
      {
        doViewHtml(request, response);
        return;
      }
      else
      {
        super.doDispatch(request, response);
      }
    }
    else
    {
      super.doDispatch(request, response);
    }
  }

  private void doViewHtml(RenderRequest request, RenderResponse response) throws PortletException, IOException
  {
    // To do: markup the required content.
    PortletURL submitUrl = response.createActionURL();

    PrintWriter out = response.getWriter();
    String secound="none";
    out.print("Welcome");
    out.print(", this is the view mode.");
    out.println("");
      out.println("<form method='POST' action='" + submitUrl + "'>");
            out.println("");
            out.println("vavedi neshto:");
     out.println("<input type='text' name='secound' value='" + secound + "'>");
      out.println("");

   
      out.println("<input type='submit'");
      out.println("");

    String sec=(String)request.getAttribute("secound");
    if(sec !=null ) 
    {
      out.println("SEC IS NOT NULL ! : "+sec ); //i never see this :)
    }
}

so as you gues the request.getAttribute("secound"); is aways NULL ..
why ? 

i try to set the  request parameter on processAction too

   response.setRenderParameter("secound","sec");
    
    request.setAttribute("secound","sec");

but the secound is null again 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988770#3988770

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988770



More information about the jboss-user mailing list