如何在 struts2-core 2.3.16.1 上访问 ServletRequestAware? [英] How to have access to ServletRequestAware on struts2-core 2.3.16.1?

查看:28
本文介绍了如何在 struts2-core 2.3.16.1 上访问 ServletRequestAware?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把我的 struts2 版本从 2.3.14 改成了 2.3.16.1,最新版本好像不支持 ServletRequestAwareServletResponseAware,我该怎么办?我在网上找不到任何东西.

I changed my struts2 version from 2.3.14 to 2.3.16.1, it seems that newest version does not support ServletRequestAware and ServletResponseAware anymore, what should I do? I could not find anything online.

<dependency>    
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>2.3.16.1</version>
    <type>jar</type>    
</dependency>

代码

 import org.apache.struts2.interceptor.ServletRequestAware;
 public class MyExample implements ServletRequestAware, ServletResponseAware { 

错误

package org.apache.struts2.interceptor does not exist.

当我尝试为它查找依赖项时,Maven 显示支持它的 Struts2 的最新版本是 2.3.14!

When I try to find a dependency for it Maven shows the latest version of Struts2 which is supporting it is 2.3.14!

推荐答案

欢迎使用 Struts2 的第 3 步 将以下依赖项添加到您的 pom.xml

At the Step 3 of Welcome to Struts2 add the following dependency to your pom.xml

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <version>X.X.X.X</version>
</dependency>

检查存储库中的文件版本 X.X.X.X 是否可用并下载到您的硬盘.

Check the file version X.X.X.X is available in the repository and downloaded to your hard drive.

这篇关于如何在 struts2-core 2.3.16.1 上访问 ServletRequestAware?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆