Struts2是以MVC架构为基础的WEB框架,通过WEB Filter的方式内嵌在WEB服务器中进行使用。
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
</struts>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</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>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="wwfy" extends="struts-default">
<action name="login" class="wwfy.user.LoginAction">
<!--省略Action其他配置-->
</action>
<action name="logout" class="wwfy.user.LogoutAction">
<!--省略Action其他配置-->
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="user.xml"/>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!--设置开发模式-->
<constant name="struts.devMode" value="true"/>
<!--设置编码形式为GB2312-->
<constant name="struts.i18n.encoding" value="GB2312"/>
<!--省略其他配置信息-->
</struts>
|
||
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
---|---|---|
|
|
|
|
|
|
<result name="success">hello.jsp</result>
<result name="error">index.jsp</result>
<interceptors>
<interceptor name="拦截器名" class="拦截器类"/>
<interceptor-stack name="拦截器栈名">
<interceptor-ref name="拦截器名">
</interceptor-stack>
</interceptors>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="product" class="com.javatpoint.Product">
<result name="success">welcome.jsp</result>
</action>
</package>
</struts>
- 结尾 - 精彩推荐 【技术分享】Apache httpd Server CVE-2021-41773 漏洞分析 【技术分享】通过一个CVE零基础入门V8-pwn 【技术分享】仅用三种字符实现 x86_64 架构的任意 shellcode 戳“阅读原文”查看更多内容 原文始发于微信公众号(安全客):【技术分享】Struts2 漏洞分析系列 - 初识 Struts2
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论