Ever wondered why your HttpServlet on Google AppEngine didn't work, even if the code looks sooooo right?
You might have (accidentally) called super.doPost(...,...); or super.doGet(...,...); which calls the default implementation of HttpServlet, which throws an Exception!
You might have (accidentally) called super.doPost(...,...); or super.doGet(...,...); which calls the default implementation of HttpServlet, which throws an Exception!
package org.crazy.servlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CrazyServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest pReq, final HttpServletResponse pResp) throws ServletException, IOException { this.doPost(pReq, pResp); } @Override protected void doPost(final HttpServletRequest pReq, final HttpServletResponse pResp) throws ServletException, IOException { super.doPost(pReq, pResp); // <-- DON'T !!! Just delete this line // Insert actual work here... } }
Took me quite some to figure this out =D
Good God! you saved my life and saved me hours of browsing on GAE documentation. Thanks a lot!
AntwortenLöschenVery important codes.Actually my looking over the internate finally end here.Thanks
AntwortenLöschenWww.PeachtreeInk.com