why would a form post to a servlet work in author but not publish?
Hi all,
I have been working on converting a custom form component from a GET to a POST action. Using the following forum discussion from last year: http://forums.adobe.com/thread/1120136, I modified my existing servlet to intercept the POST. It works great on my author server, but it will not work at all on my publish instance. Essentially, my servlet extends SlingAllMethodsServlet, but doPost is never called on in Publish but it is called in Author.
Is there something obvious that I am missing?
Here are some of my code snippets:
<form action="/my/content/path.feedbacksurveysubmit.html" id="feedbacksurveyform" name="feedbacksurveyform" method="post"> ... <input type="submit" value="Send My Response"/> </form>
@Component(immediate = true, metatype = false, label="FeedbackSurveyServlet") @Service @Properties(value = { @org.apache.felix.scr.annotations.Property(name = "sling.servlet.methods", value = { "POST" }), @org.apache.felix.scr.annotations.Property(name = "sling.servlet.resourceTypes", value = { "sling/servlet/default" }), @org.apache.felix.scr.annotations.Property(name = "sling.servlet.selectors", value = { FeedbackConstants.FEEDBACK_SURVEY_FORM_SUBMIT }), @org.apache.felix.scr.annotations.Property(name = "sling.servlet.extensions", value = { "html" }) }) public class FeedbackSurveyServlet extends AbstractComponentServlet { ... @Override public void process(final ComponentRequest request) throws ServletException, IOException { /*here, I send the relevant data to our backend system*/ } }public abstract class AbstractComponentServlet extends SlingAllMethodsServlet { ... @Override protected final void doPost(final SlingHttpServletRequest request, final SlingHttpServletResponse response) throws ServletException, IOException { LOG.debug("doPost()"); // NOTE: the publish instance never hits this, while author goes all the way through final ComponentRequest componentRequest = new ComponentRequestImpl(request, response); process(componentRequest); } }