Skip to content

Instantly share code, notes, and snippets.

@nikuyoshi
Last active August 29, 2015 14:25
Show Gist options
  • Save nikuyoshi/855159921c43ac240013 to your computer and use it in GitHub Desktop.
Save nikuyoshi/855159921c43ac240013 to your computer and use it in GitHub Desktop.
Servlet3.0から@WebServlet(urlPatterns={"hoge"})を使えばweb.xmlにURLマッピング定義が要らない ref: http://qiita.com/nikuyoshi/items/d9857aa74065f4f67794
@WebServlet(urlPatterns={"/LoginForm"})
public class LoginForm extends HttpServlet{
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response){
}
}
<web-app>
<servlet>
<servlet-name>LoginForm</servlet-name>
<servlet-class>com.github.nikuyoshi.form.LoginForm</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginForm</servlet-name>
<url-pattern>/LoginForm</url-pattern>
</servlet-mapping>
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment