How to use @Configuration and @EnableScheduling together with Spring Batch

Since "Only void-returning methods may be annotated with @Scheduled ", how can I use Spring Batch and Spring Scheduler Task when I am using @Bean configuration instead of xml configuration? Below you can find my complete configuration file. It is running perfectly when I trigger from main() but only once. I want to add @Scheduled(fixedrate=9999) in order to evoke same job at certain

如何与Spring Batch一起使用@Configuration和@EnableScheduling

因为“只有返回无效的方法可以与注释@Scheduled ”,我怎么可以使用Spring Batch和春季调度任务时,我使用@Bean配置,而不是xml配置? 您可以在下面找到我的完整配置文件。 当我从main()触发但是只触发一次时,它运行完美。 我想添加@Scheduled(fixedrate=9999)以便以特定频率唤起相同的工作。 据我所看到的,为了做到这一点,我预计新增@Scheduled各地第一步方法,但我不能,因为它返回从虚空不同。 @Configuration @EnableBa

App name changed so redirect to new one in tomcat

We have a java web application running on tomcat with name, for example, abc/index.jsp It is now changed to xyz/index.jsp How can I redirect to the new url (xyz/index.jsp) when someone requesting with (abc/index.jsp)? I want to set something within the tomcat (server.xml, web.xml, etc.) to redirect to the new url. (I don't want to write code within the JSP to do that) Could anybody

应用程序名称已更改,因此重定向到tomcat中的新名称

我们有一个运行在tomcat上的java web应用程序,其名称为abc / index.jsp 它现在更改为xyz / index.jsp 当有人请求(abc / index.jsp)时,如何重定向到新的url(xyz / index.jsp)? 我想在tomcat中设置一些东西(server.xml,web.xml等)来重定向到新的url。 (我不想在JSP中编写代码来做到这一点) 有谁可以请帮忙 谢谢 如果你在前面有Apache,看看mod_proxy。 以下应该做的。 ProxyPass /abc /xyz 请记住启

Change tomcat base URL

I have a front facing lighttpd server on my domain that redirects a specific URL to a tomcat 8 application server. So, traffic to mydomain.com/app will be pushed to tomcat. Tomcat, however, sees the "app" portion of the url and tries to match it when serving requests from the default webapp directory location - resulting in 404's for everything. Is there a configuration change I

更改Tomcat基本URL

我的域名前面有一个lighttpd服务器,它将一个特定的URL重定向到一个tomcat 8应用服务器。 所以,到mydomain.com/app的流量将被推送到tomcat。 但是,Tomcat会看到url的“app”部分,并在从默认的webapp目录位置提供请求时尝试与其匹配 - 从而产生404的所有内容。 是否可以对tomcat进行配置更改,以便知道如何查看来自“/ app”的请求的默认webapp目录? 例如,我想在mydomain.com/app/mywebapp上访问我的web应用程序 - tomcat

Support for Dynamic path in URL with Nginx and Tomcat

The use case I am trying to implement. Display different content based on the {{random_string}} in the URL path. Users will see different content based on the {{random_string}} that the URL contains. eg: www.example.com/{{random_string}}/index.jsp The URLS will look like these below. ( They include random characters before the JSP) www.example.com/xc/index.jsp www.example.com/2b/inde

使用Nginx和Tomcat支持URL中的动态路径

我正在尝试实现的用例。 根据URL路径中的{{random_string}}显示不同的内容。 用户将根据该URL包含的{{random_string}}来查看不同的内容。 例如: www.example.com/{{random_string}}/index.jsp 网址如下所示。 (它们包含JSP之前的随机字符) www.example.com/xc/index.jsp www.example.com/2b/index.jsp www.example.com/43/index.jsp 我的问题 如何设置nginx和tomcat能够支持URL中的{{random_string}}而不

redirecting requests based on the body tomcat

I have a tomcat 7 application which I can get requests from external sources. Most of them call my request like this: http://localhost:8080/MyWeb/exRequest and I build servlet with URL pattern inside MyWeb app. However, one external source must send the request like this: http://localhost:8080/ and in the body: <xml name="test" /> Since I don't want to declare a general se

基于tomcat正文重定向请求

我有一个tomcat 7应用程序,我可以从外部获取请求。 他们大多数都是这样呼叫我的请求的: HTTP://本地主机:8080 / MyWeb即可/ exRequest 并在MyWeb应用程序中使用URL模式构建servlet。 但是,一个外部来源必须像这样发送请求: HTTP://本地主机:8080 / 并在体内: <xml name="test" /> 由于我不想声明一个普通的servlel(像tomcat默认),因为它意味着任何请求都需要通过我的servlet,所以我想将ROOT的i

Automatically add the "www" subdomain for my webapp

How can I set Tomcat to automatically redirect to "www"? I want that if a user enters my domain like: mydomain.com he will be redirected to: www.mydomain.com If you are using Apache, simple do (on htaccess): RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain.com RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301] This way you make sure anything that is not using www star

自动为我的webapp添加“www”子域名

我如何设置Tomcat自动重定向到“www”? 我希望如果用户进入我的域名如: mydomain.com 他将被重定向到:www.mydomain.com 如果你使用Apache,简单的做(在htaccess上): RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain.com RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301] 这样你就可以确保任何不使用www的东西开始使用 更新正如你所提到的你没有apache,我记得一年前我用过这个。 它和mod_rewri

How to parse a xhtml ignoring the DOCTYPE declaration using DOM parser

I face issue parsing xhtml with DOCTYPE declaration using DOM parser. Error: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%20 Declaration: DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd Is there a way to parse the xhtml to a Do

如何使用DOM解析器解析xhtml忽略DOCTYPE声明

我面临使用DOM解析器解析带有DOCTYPE声明的xhtml的问题。 错误:java.io.IOException:服务器返回HTTP响应代码:503:URL:http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%20 声明:DOCTYPE html PUBLIC“ - // W3C // DTD XHTML 1.0 Transitional // EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 有没有办法将xhtml解析为Document对象而忽略DOCTYPE声明。 一个适用于我的解决方案是给Docum

jLabels automatically goes newline

I have some jlabels which works fine, but i need them to be "bold".So i used html to introduce strong tags. Now my text is bold but it goes newline when the end of the jlabel is reached instead of truncate it adding some end dots, like was before using html. Minimum, Maximum and Preferred size of jlabels are set to [80,14] and they are not resizeable.Here some code: public PanelArch

jLabels自动换行

我有一些jlabels工作正常,但我需要他们是“大胆”。所以我用html来引入强大的标签。 现在我的文本是粗体的,但是当到达jlabel的末尾时它会换行,而不是截断它添加一些末端点,就像在使用html之前一样。 标签的最小,最大和首选大小设置为[80,14],它们不可调整大小。以下是一些代码: public PanelArchivio(Lavoro lavoro) { //Nimbus ha un bug che riguarda il colore di sfondo dei textpanel e altri pannelli di test

No enclosing instance of type Foo is accessible

I have the following code: class Hello { class Thing { public int size; Thing() { size = 0; } } public static void main(String[] args) { Thing thing1 = new Thing(); System.out.println("Hello, World!"); } } I know Thing does nothing, but my Hello, World program compiles just fine without it. It's only my defined classes t

没有可以访问Foo类型的封闭实例

我有以下代码: class Hello { class Thing { public int size; Thing() { size = 0; } } public static void main(String[] args) { Thing thing1 = new Thing(); System.out.println("Hello, World!"); } } 我知道Thing什么都不做,但是我的Hello,World程序编译得很好,没有它。 这只是我定义的类正在失败。 它拒绝编译。 我得到No enclosing i

Is there a "word wrap" property for JLabel?

I am displaying some text in a JLabel. Basically I am generating that text dynamically, and then I apply some HTML tags (eg, BR and B ) to format the text. Finally I assign this formatted text to my JLabel. Now I want my Jlabel to automatically wrap the text to the next line when it reaches the end of screen, like the "Word Wrap" feature in Note Pad. How can I do that? Should wo

是否有JLabel的“自动换行”属性?

我正在JLabel中显示一些文本。 基本上我是动态生成该文本,然后应用一些HTML标记(例如BR和B )来格式化文本。 最后,我将这个格式化的文本分配给我的JLabel。 现在我希望我的Jlabel在文本到达屏幕末尾时自动将文本包装到下一行,如记事本中的“文字包装”功能。 我怎样才能做到这一点? 如果将文本包装在<html>...</html>应该可以工作 更新:那么你应该设置最大尺寸。 可以使用HTML样式(CSS)为body设置