jsp weblogic server deployment on projects often there will be "garbage" when as a servlet

Recently doing a project to use the export function (export excel), on my machine can normally export (this machine is tomcat service, windows operating system), but when the project portion opposed to the production environment (production environment is weblogic service , when exporting linux system) will appear abnormal, the following are the details:

1. In the event of a problem:

    Export excel file report "does not match the file format and file extensions may be damaged or unsafe ...." If you open the content appears garbled mess, as displayed:

  



2. The cause of the problem:

    They are inconsistent with the development and production environments server, server to resolve different way is not the same jsp, jsp will lead to an error in the weblogic service.


3. Solution:

   If you have introduced in jsp class, we must not line breaks or spaces, the introduction of classes are held in a row, as is right and wrong examples:

 Examples of errors:


Right:



4. Summary:

   This problem occurs because it is a headache, so in order to avoid such a situation occur, must be introduced as a single line when java class and does not have a space in the jsp (this is important, remember !!)

Published 118 original articles · won praise 59 · views 490 000 +

Guess you like

Origin blog.csdn.net/u012255097/article/details/78136258