• 背景:

从一个Member的增删改查,来了解Struts2的运行原理及学习ModelDriven拦截器、Preparable拦截器。

  • 新建项目实现列表的展示及删除功能:

Struts(十六):通过CURD来学习Struts流程及ModelDriven的用法

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Struts 02</display-name>

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <!-- Restricts access to pure JSP files - access available only via Struts 
        action <security-constraint> <display-name>No direct JSP access</display-name> 
        <web-resource-collection> <web-resource-name>No-JSP</web-resource-name> <url-pattern>*.jsp</url-pattern> 
        </web-resource-collection> <auth-constraint> <role-name>no-users</role-name> 
        </auth-constraint> </security-constraint> <security-role> <description>Don't 
        assign users to this role</description> <role-name>no-users</role-name> </security-role> -->
</web-app>
View Code

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2021-06-18
  • 2021-08-30
  • 2021-12-18
  • 2021-07-14
  • 2021-12-20
猜你喜欢
  • 2021-10-25
  • 2021-08-30
  • 2022-12-23
  • 2021-05-20
  • 2022-01-23
  • 2022-01-18
  • 2021-06-03
相关资源
相似解决方案