Created
September 25, 2012 08:15
-
-
Save kawasima/3780588 to your computer and use it in GitHub Desktop.
How to enable PUT and DELETE method in sastruts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.struts.action.ActionServlet; | |
@SuppressWarnings("serial") | |
public class RestfulActionServlet extends ActionServlet { | |
public void doPut(HttpServletRequest request, HttpServletResponse response) | |
throws IOException, ServletException { | |
process(request, response); | |
} | |
public void doDelete(HttpServletRequest request, | |
HttpServletResponse response) throws IOException, ServletException { | |
process(request, response); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>action</servlet-name> | |
<servlet-class>xxx.RestfulActionServlet</servlet-class> | |
<init-param> | |
<param-name>config</param-name> | |
<param-value>/WEB-INF/struts-config.xml</param-value> | |
</init-param> | |
<init-param> | |
<param-name>configFactory</param-name> | |
<param-value>org.seasar.struts.config.S2ModuleConfigFactory</param-value> | |
</init-param> | |
<load-on-startup>1</load-on-startup> | |
</servlet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment