This content has been marked as final.
Show 4 replies
-
1. Re: Only GET supported?
apemberton Nov 13, 2009 5:53 PM (in response to thinwath)No, both the POST and GET http methods are supported. Have you had problems with POST?
-
2. Re: Only GET supported?
thinwath Nov 18, 2009 5:23 AM (in response to thinwath)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?
skhobarekar Dec 16, 2009 1:34 AM (in response to thinwath)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?
thinwath Dec 16, 2009 8:42 AM (in response to skhobarekar)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