concept xsrf protection in category gwt

appears as: XSRF protection, XSRF Protection
GWT in Action

This is an excerpt from Manning's book GWT in Action.

  • In chapter 7 we look in detail at how to use GWT’s XsrfProtectedServiceServlet instead of RemoteServiceServlet to gain access to GWT’s built-in XSRF protection for GWT-RPC.
  • Enabling XSRF Protection on the Server

    Enabling XSRF protection on the server side is as simple as swapping out RemoteServiceServlet and replacing it with XsrfProtectedServiceServlet. Back in section 7.5.3 you might recall that we implemented the class TwitterServiceImpl, which is the server-side servlet that’s the target of GWT-RPC calls from the client. In the example we had that class extend RemoteServiceServlet, which provides the glue that connects incoming GWT-RPC calls to our class. The class XsrfProtectedServiceServlet is a drop-in replacement for RemoteServiceServlet, so all you need to do is change the class declaration, as shown in the following listing.

    Listing 7.16. An updated web.xml with additions for supporting XSRF protection