Using alf_method to simulate POST

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2011 04:56 AM
I developed an application using webscripts in Alfresco 3.0. To reduce the number of webscripts often i declared webscripts supporting POST but i called them also with a GET using the parameter alf_method.
http://....../wcsevice/...?alf_method=POST¶m1=….
Also indicated in this post
http://forums1.man.alfresco.com/en/viewtopic.php?f=36&t=25633#p83399
In Alfresco 3.4 seems that these feature is no longer available. The wiki page of webscripts report that these feature (tunneling) is available only for POST call. Is that right?
Thanks
Andrea
http://....../wcsevice/...?alf_method=POST¶m1=….
Also indicated in this post
http://forums1.man.alfresco.com/en/viewtopic.php?f=36&t=25633#p83399
In Alfresco 3.4 seems that these feature is no longer available. The wiki page of webscripts report that these feature (tunneling) is available only for POST call. Is that right?
Thanks
Andrea
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2011 12:04 PM
Looking into spring framework extension source code version CI included in Alfresco I found the problem.
Class org.springframework.extensions.webscripts.servlet.WebScriptServletRuntime
Row 73
Looking last release RC1 on subversion the "if" statement is
Class org.springframework.extensions.webscripts.servlet.WebScriptServletRuntime
Row 73
protected String getScriptMethod() { // Is this an overloaded POST request? String method = req.getMethod(); if (method.equalsIgnoreCase("post")) { boolean overloadParam = false; String overload = req.getHeader("X-HTTP-Method-Override"); if (overload == null || overload.length() == 0) { overload = req.getParameter("alf_method"); overloadParam = true; } if (overload != null && overload.length() > 0) { if (logger.isDebugEnabled()) logger.debug("POST is tunnelling method '" + overload + "' as specified by " + (overloadParam ? "alf_method parameter" : "X-HTTP-Method-Override header")); method = overload; } } return method; }
The problem is the if that check only the post methodLooking last release RC1 on subversion the "if" statement is
if (method.equalsIgnoreCase("get") || method.equalsIgnoreCase("post"))
