来自Web ui的Spring批处理作业? [英] Spring batch jobs from Web ui?

查看:200
本文介绍了来自Web ui的Spring批处理作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人从Web UI执行Spring批处理作业或有任何经验。目前我已经为从CSV到数据库表的数据复制编写了很少的工作,它在命令提示符和JUnit测试中运行良好。但是现在这些工作必须通过web执行,JSF被用作前端控制器框架。关于这种情况下的最佳实践的任何建议都会非常有用。

Has anyone worked or has any experience with executing spring batch jobs from web UI. Currently I have written few jobs for data-copy from CSV to DB table, it runs fine from command prompt and in a JUnit test. But now these jobs have to be executed through web, JSF is being used as the front controller framework. Any suggestions about the best practices in this case would be very helpful.

谢谢!

推荐答案

Spring Batch Admin是Spring Batch作业的可部署Web前端。如果您只想要一个简单的UI而不是管理员的shell脚本,请采用以下方法:

Spring Batch Admin is a deployable web frontend for your Spring Batch jobs. If all you want is a simple UI instead of a shell script for Administrators, take this approach:

http://static.springsource.org/spring-batch-admin/getting-started.html

如果您正在寻找一种将作业触发机制与现有应用程序集成的方法,请使用Spring的JobLauncher查看此实现,可以从Controller / Servlet调用:

If you're looking for a way to integrate the job trigger mechanism with your existing application, look at this implementation using Spring's JobLauncher which can be invoked from Controller/Servlet:

http:// docs .spring.io / spring-batch / trunk / reference / html / configureJob.html#runningJobsFromWebContainer

这篇关于来自Web ui的Spring批处理作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆