Js| compiled in WebLogic Publishing Web Application project, in order to protect JSP files to avoid unauthorized access and peep, you can use WEBLOGIC.JSPC JSP file precompile into a servlet file, put to Web-inf The/classes directory. Based on the servlet declaration, Web-inf is not part of the common document tree for WEB applications. Therefore, the resources under the Web-inf directory is not directly service for customers, so that to some extent, to ensure the security of JSP.
The specific implementation steps are as follows (Weblogic for Linux):
1. Compile JSP file with WEBLOGIC.JSPC
(1) Under the Linux working directory, create the following shell file, file name is jspc.sh
#!/bin/sh
java_home=/opt/ibmjava2-131
Wbl_lib=/u11/bea/wlserver6.1/lib/weblogic.jar
Classpath=${java_home}/lib:.:${wbl_lib}
Target_dir=.. /mofa/web-inf/classes # This is the Repository directory for JSP compiled servlet files
Webapp_dir=.. /mofa # This is the directory of the Web application you want to publish
The part of the blue font above is to be modified according to the user's own configuration.
(2) Set the executable property of the jspc.sh file
# chmod +x jspc.sh
(3) in the current directory, the implementation of jspc.sh files, JSP files compiled, compiled class files, should be in the Web-inf/classes/jsp_servlet directory.
2, then has been successful, from the Web application in the directory of all the JSP removed or deleted.
3, edit Weblogic.xml file, the contents of the Jsp-descriptor label empty, add the following content:
<jsp-descriptor>
<jsp-param>
<param-name>precompile</param-name>
<param-value>false</param-value>
</jsp-param>
<jsp-param>
<param-name>pageCheckSeconds</param-name>
<param-value>-1</param-value>
</jsp-param>
</jsp-descriptor>
4, edit the Web.xml file, add the following content:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.