访问 Websphere 中的 servlet
我编写了一个简单的测试 servlet 并将其部署在 websphere 应用程序上。
当我尝试访问 servlet 时,出现以下错误
错误 404:SRVE0190E:
我已经检查了所有基本内容,例如 web.xml 条目、servlet 语法等。
一切都正确。部署在 Tomcat 上的同一个 servlet 工作正常。
我还检查了
Servers > 中的 com.ibm.ws.webcontainer.invokefilterscompatibility 属性服务器> Web 容器设置 >网络容器>自定义属性..它设置为 true。
不明白到底是什么问题。如果有人可以帮助解决此问题
我创建的 servlet :
public class TestServlet extends HttpServlet{
private static final long serialVersionUID = 1L;
public TestServlet() {
super();
}
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.print("This is a testing servlet ... Please ignore");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
}
web.xml 中的条目:
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>com.wizard.servlet.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
包含 servlet 的 war 文件部署在 Websphere 服务器的单元之一上。 提前致谢。
I have written a simple test servlet and deployed it on websphere applications.
When i try to access the servlet it gives me following error
Error 404: SRVE0190E:
I have checked all the basic things like web.xml entry, servlet syntax etc.
Everything is correct.. The same servlet when deployed on Tomcat is working fine.
I also checked the
com.ibm.ws.webcontainer.invokefilterscompatibility property in Servers > Server > Web Container Settings > Web Container > Custom Properties .. it is set to true.
Not getting exactly what is the issue. If any one could help to resolve this issue
The serlvet that i created :
public class TestServlet extends HttpServlet{
private static final long serialVersionUID = 1L;
public TestServlet() {
super();
}
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.print("This is a testing servlet ... Please ignore");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
}
Entry in web.xml :
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>com.wizard.servlet.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
The war file which contains the servlet is deployed on one of the cells in Websphere server.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论