web.xml忽略主要的JSP文件 [英] web.xml ignoring main JSP file
问题描述
我正在尝试创建一个在WEB-INF/jsp/FirstJSP.jsp中加载"FirstJSP.jsp"的servlet
I'm trying to create a servlet which loads "FirstJSP.jsp" in WEB-INF/jsp/FirstJSP.jsp
我的web.xml文件有问题.我浏览了数十篇有关SO以及其他方面的论坛帖子,但没有一个起作用.
I'm having a problem with my web.xml file. I've looked through dozens of forum posts both on SO and elsewhere, yet none of them work.
这是我当前的版本
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<servlet>
<servlet-name>Queue</servlet-name>
<jsp-file>/jsp/FirstJSP.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>Queue</servlet-name>
<url-pattern>/FirstJSP.jsp</url-pattern>
</servlet-mapping>
这是显示文件层次结构的屏幕截图.我想我已经尝试了所有可能的方法,所以肯定有一些非常简单的东西我很想念:)谢谢.
And here is a screenshot to show the file hierarchy. I think I've tried about every method possible, so there must be something very simple I am missing :) Thank you.
推荐答案
我想JSP应该在WEB-INF之外.您可能会在此处看到示例 http://code.google.com/appengine /docs/java/gettingstarted/creating.html
I guess JSPs should be outside the WEB-INF. You may see an example here http://code.google.com/appengine/docs/java/gettingstarted/creating.html
甚至更好,请参见: http://download.oracle. com/javaee/5/tutorial/doc/gexap.html
这篇关于web.xml忽略主要的JSP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!