This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

When I go to \myapp\batch I get the Batch Admin homepage, but if I click on any of the other links like \jobs\, I get a 404 error and it looks like the Grails application is looking for it in \views\jobs\. Could I use the UrlMappings.groovy file in Grails to fix this, perhaps?

Below is my configuration, it'd be great if someone could let me know if there is anything wrong with it, or even if it is possible to use this UI in Grails. I'm using the 1.2.2 snapshot version of spring batch admin manager since I was already using spring integration 2.1.

Comment

So looking at the html source, it seems the links in the Batch Admin pages are all pointing at /myapp/<spring batch admin page> or /myapp/resources/styles/<various spring batch admin css files> whereas it should be pointing at /myapp/batch/<spring batch admin page> or /myapp/batch/resources/styles/<various spring batch admin css files>

How do these links get generated? It looks like everywhere they use the "myapp" variable, I have to replace it with "myapp/batch" and I'll be good to go. Anyone know where this is read in from?

Cheers,
Tony

Comment

Judging by the silence I'm going to take it that this can't work with Grails, and that the page's links are hard-coded or something. If any Spring people are viewing this thread, it'd be a nice integration/feature if you could get it working with Grails.

The URLs are generated prefixed with the "servletPath". That servlet path can be configured via the DefaultResourceService. By default, that prefix should be empty. You can override it per the override instructions http://static.springsource.org/sprin...g-started.html (Overriding Components from Spring Batch Admin). You should be able to configure your own DefaultResourceService and inject the context you want.

Comment

Thanks for the reply mminella, I'll give this a try and hopefully it'll sort out my issue.

I haven't any files in the META-INF folder yet, they are all stored in my Grails conf/spring folder, so should I stick with the directions above and use the META-INF, or will I create a folder called conf/spring/override within grails-app?

Comment

I did what you suggested and moved the declaration of the DefaultResourceService bean from my spring xml file in conf/spring to a file called override-context.xml in META-INF/spring/batch/override but it had no affect.

The URLs in the source of the pages generated are still looking for resources at /myapp/whatever instead of /myapp/batch/whatever. Below is my entire override-context.xml file.

What is the servlet mapping for the grails servlet? It's been a while since I played with this type of thing but I'm wondering if it's more broadly mapped so the request is going there instead. Just brainstorming...

Now it doesn't seem to be going to /grails-app/views/ anymore but I still get a 404 just saying that "the requested resource () is not available" when I hit any of the links at the top of the batch admin pages: