4 Replies Latest reply on Dec 16, 2009 8:42 AM by cemal unal

    Only GET supported?

    cemal unal Newbie

      Short question,

      does the portal only supports GET from forms etc? If yes, anyway to turn this to POST?

      Thanks a lot

        • 1. Re: Only GET supported?
          Andy Pemberton Newbie

          No, both the POST and GET http methods are supported. Have you had problems with POST?

          • 2. Re: Only GET supported?
            cemal unal Newbie

            Hi Andy,

            yes I've problems with post forms.

            Example:

            <form method="post" action="/portal/authsec/portal/Portlet_Window">
            <input type="hidden" name="action" value="1" />
            <input type="test" name="user_name" value="" />
            <input type="submit" name="submit" value="submit" />
            </form>
            


            When this form is submitted no "processAction" method will be triggerd. Change the method to GET - it will work.

            I've found a workaround (?) for this problem

            <form method="post" action="/portal/authsec/portal/Portlet_Window?action=1">
            <input type="test" name="user_name" value="" />
            <input type="submit" name="submit" value="submit" />
            </form>
            


            This piece of code will trigger the action method. The Portal has Version 2.7.0

            Dunno why first solution doesn't work.

            • 3. Re: Only GET supported?
              Suchit Khobarekar Newbie

              Hi,

               

              I am not sure why are you using a hard coded URL to call your portlet class. Why dont you use the <portlet:actionURL/> tag as your form action.

               

              Your code could be formed like this

               

              <form method="post" action="<portlet:actionURL/>">
              <input type="hidden" name="action" value="1" />
              <input type="test" name="user_name" value="" />
              <input type="submit" name="submit" value="submit" />
              </form>
              
              

               

              Also make sure that you import the portlet tld and define the portlet objects

               

              <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
              ....
              ....
              <portlet:defineObjects/>
              

               

              this will enable you to use the actionURL tag in your form.

               

              The above code will call the ProcessAction method of your portlet class and you can get the input parameters using

               

              actionRequest.getParameter("user_name");
              
              
              • 4. Re: Only GET supported?
                cemal unal Newbie

                Hi,

                 

                I'm not using any hardcoded URLs in my forms, the posted code was just the rendered result. I already use the portlet:tags

                 

                Anyways thanks for your answer