当前位置:网站首页>Principle of struct2
Principle of struct2
2022-07-25 10:17:00 【Android World Library】
1. stay web.xml Filter in FilterDispatcher, bring strcut2 The system can take over the entire system request
2.struct2 Request from the page action The goal of , And then in struts.xml The corresponding processing class of the target is found in the configuration file of
3.2 At the same time, the framework uses the fields in the form to automatically assign values to those instantiated in the target processing class bean object
4. The return result obtained by the framework according to the processing class , lookup struts.xml The file corresponds to result Label content , Return to the specific page .
summary , The framework is to get control through the filter , And then in strcut.xml Help you link the submission form page with the class that processes and returns the processing results .( The parameters of the form attribute and the processing result return page are through , Form attributes are the same as those in the class !)
To make a form processing program, the general steps are , First : Create a form page , Create a separate class , Create a result page . The three data interact through the same attribute name !. Last , To configure strut.xml The document links the three ! The rest is strut2 Help you finish !
Focus on , because struts After becoming a filter , If you initialize normally as shown , It will make all pages of the whole website inaccessible , Tips 404 error ! especially struts6.0.0 This problem is more likely to occur after !
Often cause 404 The reason for the mistake is :
1.<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd"> Wrong version ,struts6.0.0 In the future, we will put 2.3 Change to 2.5. Otherwise, you must prompt 404.
2. The imported package is incomplete . In addition to those bags on the Internet ,commons-text-1.8.jar This package must contain .
struts6.0.0 Unwanted xwork-core.jar package
3.<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
struts6.0.0 in , The filter path changes , No, ng.filter It is filter
summary , Everyone may have the same problem , But the reason is strange , Learn to base on eclipse Prompt to solve the fastest .
边栏推荐
猜你喜欢

复现 SSL_Anti-spoofing, 使用 wav2vec 2.0 和数据增强的自动说话人认证的欺骗攻击与深度伪造检测

About the jar package of slf4j log4j log4j2 used together

Duplicate SSL_ Anti spoofing, spoofing attacks and deep forgery detection using wav2vec 2.0 and data enhanced automatic speaker authentication

升级 GLIBC 2.29 checking LD_LIBRARY_PATH variable... contains current directory error 解决方案
![[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.](/img/f5/e6739083f0dce8da1d09d078321633.png)
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.

静态路由的配置(以华为eNSP为例)

message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“

Attention is all you need 论文精读笔记 Transformer

VS Code 连接远程 Jupyter 服务器

【专栏】RPC系列(理论)-夜的第一章
随机推荐
Yarn quick reference manual
PyTorch 对 Batch 中每个样本计算损失 Loss for each sample
Angr(九)——angr_ctf
常用类的小知识
UE4 LoadingScreen动态加载启动动画
数论--约数研究
shortest-unsorted-continuous-subarray
UE4 碰撞(Collsion)
字典树的使用
广度优先遍历(图和二叉树的层序遍历相关问题)
Duplicate SSL_ Anti spoofing, spoofing attacks and deep forgery detection using wav2vec 2.0 and data enhanced automatic speaker authentication
CentOs安装redis
UE4 窗口控制(最大化 最小化)
链表相关(设计链表及环链表问题)
IDEA整体字体大小修改
拷贝过来老的项目变成web项目
Basic knapsack problem
二、unittest框架主要做什么
SQL 题目整理
message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“