Click add to add a new security constraint.
单击add添加一个新的安全约束。
Add a security constraint for this Web application.
为这个Web应用程序添加一项安全约束。
Configuring a security constraint for the login page.
为登录页面配置安全约束。
Next, you need to define a second security constraint.
接下来,需要定义第二个安全约束。
Stanza 3: Defining a security constraint for a RESTful service
第三部分:为REST 式服务定义一个安全约束
You will need to define a security constraint for the Web application.
需要定义Web应用程序的安全约束。
Figure 4 shows the security constraint we defined for our form-login page
图4显示了在表单登录页面上定义的安全约束
Figure 5 shows the security constraint we defined for the SecureServlet Web resource.
图5显示了为SecureServletWeb资源定义的安全约束。
It gives you the ability to protect a resource with a defined security constraint and then define the user roles that can access the protected resource.
它向您提供使用定义的安全约束保护资源的能力,然后定义可以访问受保护资源的用户角色。
Note: if you need to access resources that require authentication, you can specify a second servlet mapping that is associated with a security constraint.
注意:如果您想访问需要认证的资源,那么您可以指定第二个与安全性限制相关联的servlet映射。
The web.xml file for the servlet contains a <security-constraint> element that defines the security constraint, the HTTP methods that it applies to, and the roles that use the constraint.
servlet的web.xml文件包含一个 <security-constraint>元素,该元素定义安全性约束、它应用的HTTP方法以及使用该约束的角色。
The next 3 figures show how to add the security constraint (Figure 8), how to set the right URL and HTTP methods (Figure 9) and how to allow the role "DADXUser" for that constraint (Figure 10).
接下来的三个图展示如何添加安全性约束(图8),如何设置正确的URL和HTTP方法(图9)以及如何针对该约束允许“DADXUser”角色(图10)。
Listing 5. Security constraint inside web.xml.
清单5.web . xml中的安全性约束。
For other web applications, use a security-constraint element in the deployment descriptor.
对于其他的Web应用程序,请在部署描述符里面使用security - constraint元素来规定应用程序的安全约束。
For other web applications, use a security-constraint element in the deployment descriptor.
对于其他的Web应用程序,请在部署描述符里面使用security - constraint元素来规定应用程序的安全约束。
应用推荐