java 在 Weblogic 10.3 中使用 Servlet 3.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17230082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-01 01:23:21  来源:igfitidea点击:

Using Servlet 3.0 with Weblogic 10.3

javajakarta-eeauthenticationglassfish-3weblogic-10.x

提问by Ahmet Karakaya

I am working on a form-based authentication and using following statements. I have realized on the way of implementation that HttpServletRequest->login method comes with servlet 3.0.(with help of stackoverflow users)

我正在研究基于表单的身份验证并使用以下语句。我在实现的过程中意识到 HttpServletRequest->login 方法是 servlet 3.0 自带的。(在 stackoverflow 用户的帮助下)

HttpServletRequest request = getHttpServletRequest();
request.login() 

So I am using weblogic as an AppServer, I have prepared a war file without any compilation error and it works at glassfish 3.1 appserver. But since weblogic 10.3 has implicit support 2.5 it overwrites Servlet 3.0.1.jar so having following error.

所以我使用 weblogic 作为 AppServer,我准备了一个没有任何编译错误的 war 文件,它在 glassfish 3.1 appserver 上工作。但是由于 weblogic 10.3 具有隐式支持 2.5,它会覆盖 Servlet 3.0.1.jar,因此出现以下错误。

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.login(Ljava/lang/String;Ljava/lang/String;)V

How I can run my war file with servlet 3.0 api on weblogic 10.3 , in other words how I can stop weblogic overwriting servlet 3.0 api?

如何在 weblogic 10.3 上使用 servlet 3.0 api 运行我的 war 文件,换句话说,我如何停止 weblogic 覆盖 servlet 3.0 api?

回答by NINCOMPOOP

Weblogic 10.3.xis a Servlet 2.5container.You have to use Weblogic 12cand above . It provides supportfor Servlet 3.0.

Weblogic 10.3.xServlet 2.5容器。您必须使用Weblogic 12c及更高版本。它提供对Servlet 3.0 的支持