wicket切换开发部署模式
wicket切换开发部署模式
张悟空 发表于7个月前
wicket切换开发部署模式
  • 发表于 7个月前
  • 阅读 17
  • 收藏 0
  • 点赞 0
  • 评论 0

Problem By default, Wicket is running in development mode. How to switch it to production mode?

WebApplication:759 - [WicketApplication] Started Wicket version 1.4.17 in development mode
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode.              ***
***                               ^^^^^^^^^^^                    ***
*** Do NOT deploy to your live server(s) without changing this.  ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************

Solution As i know, there are two ways to change Wicket to run in deployment (production) mode :

WebApplication:759 - [WicketApplication] Started Wicket version 1.4.17 in deployment mode

1 web.xml

The 1st way is add a “configuration” context-param in web.xml.

File : web.xml

<web-app ...>

	<context-param>
		<param-name>configuration</param-name>
		<param-value>deployment</param-value>
	</context-param>

	...
</web-app>

2 Wicket getConfigurationType()

The 2nd way is override the Wicket application getConfigurationType() method.

File : Wicket Application class

import org.apache.wicket.Application;
import org.apache.wicket.protocol.http.WebApplication;

public class WicketApplication extends WebApplication {

	@Override
	public String getConfigurationType() {

		return Application.DEPLOYMENT;

	}
}

Note The Wicket application always has the highest priority. For example, if web.xml is “development” and Wicket application is “deployment“, Wicket will run in “deployment” mode.

重写getConfigurationType()方法的优先级比web.xml的高

共有 人打赏支持
粉丝 9
博文 70
码字总数 20473
×
张悟空
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: