Results 1 to 3 of 3

Thread: Batch admin "POST not supported" error

  1. #1
    Join Date
    May 2011
    Posts
    4

    Default Batch admin "POST not supported" error

    I have embedded spring batch admin into our webapp and am successfully able to list executions, however when I try to stop a running execution I get a 404 error and the below log message:

    Code:
    13:20:26,989 INFO  [STDOUT] 13:20:26:989 [http-127.0.0.1-8080-1] WARN  org.springframework.web.servlet.PageNotFound - Request method 'POST' not supported
    I am using spring-batch-admin ver 1.2.0.RELEASE running in JBoss 4.3

    My investigations so far seem to indicate that the AnnotationMethodHandlerAdapter bean is ignoring the JobExecutionController.stopAll method. I suspect that this might be because the @ReuquestMapping specifies the DELETE method (see below), and the web ui is submitting the form using POST (see below html), however that fact that nobody else is complaining of this indicates that it is something in my setup that is causing this.

    Code:
    	@RequestMapping(value = "/jobs/executions", method = RequestMethod.DELETE)
    	public @ModelAttribute("jobExecutions")
    	Collection<JobExecutionInfo> stopAll(ModelMap model, @RequestParam(defaultValue = "0") int startJobExecution,
    			@RequestParam(defaultValue = "20") int pageSize) {
    Code:
    <form action="/crt/admin/jobs/executions" method="POST">
    	<input type="hidden" name="_method" value="DELETE"/>	
    	<input id="stop" type="submit" value="Stop&nbsp;All" name="stop" />
    </form>
    My questions are:
    • Am I looking in the right place?
    • Is there anywhere else I should be investigating?
    • Is there any component that changes the request method from POST to DELETE?


    Any help or pointers appreciated

    Thanks

    Jake

  2. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    There needs to be a HiddenMethodFilter in your web.xml (standard Spring MVC feature). If you used the one from the sample or from the spring-batch-admin-resources jar it should be there already.

  3. #3
    Join Date
    May 2011
    Posts
    4

    Default

    That worked. Thanks for the quick response

    Jake

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •