Beware of JBUILDER unauthorized revision of web.xml, resulting in an application error

xiaoxiao2021-03-06  107

Summarizing the lessons learned, JBuilder X is related to Struts (the two issues found below), JBuilder will disperse automatic detection of Web.xml, and find that it is not properly automatically tampering, so that OK is Project cannot run normally.

1. Automatically delete the Struts Action Servlet to Encoding mapping. Friends who develop Chinese systems generally encoding this servlet via Web.xml, divided into definition and mapping, two-step implementation: a.encoding this filter definition: setENCoding com.vpay.utils.setcharacterencodingfilter Encoding GB2312 ignore true

B. Map it with an action servlet setEncoding action

This B step is that JBuilder is often automatically deleted, causing all Chinese data submitted in web applications to garbled, and it is not correct to enter the Action data.

2. Automatically increase the initialization parameters of the Action Servlet. When defining the Action servlet in web.xml, you can selectively provide parameters, some parameters can be configured in Struts-Config.xml, but JBuilder finds that there is no parameter to add it. Action servlet configuration demo: action org.apache.struts.Action.ActionServlet Application ApplicationResources config / web- INF / STRUTS-Config.xml debug 3 detail 3 1 The problem in the application is like this: ApplicationResources is configured in Struts-Config.xml, and web.xml is not for this configuration, but this is added automatically. , Resulting in a later web page ??? zh_cn.label ???. This problem occurs (Project for Existing Code), ApplicationResources is originally in the Resources directory, and the results of the project have been created after the resources versions.properties file. So this problem may only appear in Project For Existing Code, but there are similar situations, the specific scenarios are unclear, and the solution is very reckless, so there is no problem.

According to DELEDA, the IDE other than JBuilder does not detect Web.xml, JBuilder wants to do, but it is not possible to do, at least the Struts related action is not perfect. Study on the study.

转载请注明原文地址:https://www.9cbs.com/read-97243.html

New Post(0)