samples/xml/servletapi/src/main/java/org/springframework/security/samples/servletapi/mvc/ServletApiController.java
@RequestMapping("/async")
	public void asynch(HttpServletRequest request, HttpServletResponse response) {
		final AsyncContext async = request.startAsync();
		async.start(new Runnable() {
			public void run() {
				Authentication authentication = SecurityContextHolder.getContext()
						.getAuthentication();
				try {
					final HttpServletResponse asyncResponse = (HttpServletResponse) async
							.getResponse();
					asyncResponse.setStatus(HttpServletResponse.SC_OK);
					asyncResponse.getWriter().write(String.valueOf(authentication));
					async.complete();
				}
				catch (Exception e) {
					throw new RuntimeException(e);
				}
			}
		});
	}
@RequestMapping("/async")
	public void asynch(HttpServletRequest request, HttpServletResponse response) {
		final AsyncContext async = request.startAsync();
		async.start(new Runnable() {
			public void run() {
				Authentication authentication = SecurityContextHolder.getContext()
						.getAuthentication();
				try {
					final HttpServletResponse asyncResponse = (HttpServletResponse) async
							.getResponse();
					asyncResponse.setStatus(HttpServletResponse.SC_OK);
					asyncResponse.getWriter().write(String.valueOf(authentication));
					async.complete();
				}
				catch (Exception e) {
					throw new RuntimeException(e);
				}
			}
		});
	}
Demonstrates Spring Security with {@link AsyncContext#start(Runnable)}. Spring
Security will automatically transfer the {@link SecurityContext} from the thread
that {@link AsyncContext#start(Runnable)} is invoked to the new Thread that invokes
the {@link Runnable}.
@param request
@param response