2 Replies Latest reply on Jul 10, 2006 12:12 AM by Leonard Paul

    How cab i submite and save the content of the html in portle

    Leonard Paul Newbie

      Hi

      I showing a html page in a portlet. That html have some text box and submite button. i want to save the content.
      How do i code to carried out. can any one help me please


      Thanks in advance

      A.Peter

        • 1. Re: How cab i submite and save the content of the html in po
          Louise Liddell Newbie

          Here is a rough answer:

          You need to change your html page into a jsp. It should look something like this:

          <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
          <portlet:defineObjects/>
          <%
          String name = (String)request.getAttribute("name");
          if(name==null)
          {
          %>
          <form action="<portlet:actionURL></portlet:actionURL>" method=post>
           <table cellspacing=2 cellpadding=2 border=0>
          
          //some form tags in here - remember to make the input class //portlet-form-input-field
          <input class ="portlet-form-input-field" type=text name="name" value="Type your name">
          
          
          <input class ="portlet-form-input-field" type=submit name="submit" value="Submit">
          </table>
          </form>
          <%
          else
          {
          %>
          Hello <%=name%>!
          <%
          }
          %>
          


          In your servelet:
          public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, PortletSecurityException, IOException
           {
          
           String name = aRequest.getParameter("name");
           aResponse.setRenderParameter("name", name);
          }
          



          Louise