In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to enhance the security of JSP and Servlet". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to enhance the security of JSP and Servlet".
1. Set up XML files
The first step in configuring the web.xml file is to define a security constraint, that is, a label. This tag protects the URL of the response so that it can only be accessed by specific users. Note that we have to define one or more HTTP methods using tags. If you want security constraints to be applied to all HTTP methods, simply ignore the tags.
After completing the above settings, the next step is to set up SSL. We can use the tag and a child tag of this tag.
To set up. But will
Is set to CONFIDENTIAL
In the last step, we need to set up the validation method. This requires the setting of labels and child tags. Here we will set it to BASIC. Here is part of the web.xml file:
In the above example, only the user "ttrole" can access the Servlet and JSP pages.
These user authentications will be used in JavaEE environments, but in many operating system environments, users and groups are associated. Therefore, security-role-mapping provides a bridge between user header groups. In the JavaEE5 application server, we can literally mean the security-role-mapping tag in the sun-application.xml file as follows:
There is no need to modify the code to enhance the security of JSP and Servlet
Second, run the example code
In this section we will talk about how to run the above program. The integrated development environment we use here is NetBeansIDE5.5 and the NetBeans enterprise development kit. After installing NetBeans, we need to take the following steps to run the program.
1. First, we need to download this program. And then decompress it.
File type: * .zip example code (35.83KB)
two。 Start NetBeans.
3. Open the webann project (the NetBeans project in the zip file just now). If a "Resolvemissingserverproblem" message appears, the application server has not been added to the list of servers in NetBeans. We can select Tools > ServerManager, and then add the corresponding server to the list.
4. Start JavaSystemApplicationServer with Sun embedded in NetBeans. We can also start the server by entering the following command in the command:
/ bin/asadminstart-domaindomain1
Above is the installation directory of the application server.
Thank you for reading, the above is the content of "how to enhance the security of JSP and Servlet". After the study of this article, I believe you have a deeper understanding of how to enhance the security of JSP and Servlet. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.