1

I have these 2 similar function in my jsp file.

PortletURL deleteURL = renderResponse.createActionURL();
deleteURL.setParameter(ActionRequest.ACTION_NAME, "deleteUser");
deleteURL.setParameter("redirectURL", redirectURL.toString());

and

<portlet:actionURL name="deleteUser" var="deleteURL">
<portlet:param name="resourcePrimKey" value="<%=userid%>" />
<portlet:param name="redirectURL" value="<%=userPage.toString()  %>" />
</portlet:actionURL>

They are however using GET method and I am trying to find a way to use POST instead. Where/how may I change to POST?

MerC
  • 323
  • 1
  • 5
  • 19

1 Answers1

2

These URLs are neither using GET nor POST, they are just URLs. In order to use them, you will have to do something with them, e.g. use them in a <form> or <a> element like this:

In addition to your code from the question, you'll have something like this:

GET:

 <a href="<%=deleteURL%>">click me</a>

POST:

 <form action="<%=deleteURL%>" method="POST">
   <input type="submit"/>
 </form>
Olaf Kock
  • 46,930
  • 8
  • 59
  • 90