我知道这里给其他有这种/类似问题的人的建议,即servlet最好是在包下编写的,而不是无包的,但我在这方面遵循教科书的指导,当然作为教科书,它的方法必须有效。我用这种方法寻求帮助。
我有一个名为htmlbank.Java的Java servlet,我成功地编译了它,没有出现编译错误。现在,根据课本:
1)将.class文件放入C:\Program Files\Apache Software Foundation\Tomcat5.5\webapps\ROOT\WEB-INF\classes文件夹。
2)运行Tomcat服务-它正在运行(显示为屏幕右下角的绿色“Play”箭头)。
3)在浏览器中,键入URL:http://localhost:8080/servlet/htmlbank并输入。这样做后,将出现以下错误:
错误。
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class HTMLBank extends HttpServlet
{
public void init() throws ServletException {}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
response.setHeader("Expires", "Tues, 01 Jan 1980 00:00:00 GMT");
out.println("<html>");
out.println("<title>Online Bank ATM Simulator</title>");
out.println("<h1>Tester Text.</h1>");
out.println("<body>This serves to test functioning of the servlet in browser.</body>");
out.println("</html>");
}
public void destroy(){}
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
<!-- JSPC servlet mappings end -->
<-- added the following for invoker servlet -->
<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>
org.apache.catalina.servlets.InvokerServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
</web-app>
下面是context.xml文件:
<!-- The contents of this file will be loaded for each web application -->
<Context reloadable="true"> <!-- Enabled Tomcat Servlet reloading -->
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
这个文件被编辑为启用servlet重新加载,也是按照图书指南。
以下是本讨论中涉及的所有文件/文件夹的路径:
因此,正如我所说的,我需要在没有包的情况下从根操作servlet。我该怎么做?
如果有助于识别问题,我还发布了Tomcat生成的错误日志文件的内容:
08 Sep 2017 10:47:53 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
08 Sep 2017 10:47:53 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3887 ms
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
08 Sep 2017 10:47:54 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08 Sep 2017 10:47:56 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08 Sep 2017 10:47:57 AM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 42 column 2: The content of elements must consist of well-formed character data or markup.
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 42 column 2
08 Sep 2017 10:47:57 AM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
08 Sep 2017 10:47:57 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
08 Sep 2017 10:47:57 AM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
08 Sep 2017 10:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
08 Sep 2017 10:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
08 Sep 2017 10:47:58 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
08 Sep 2017 10:47:58 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
08 Sep 2017 10:47:58 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/152 config=null
08 Sep 2017 10:47:58 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
08 Sep 2017 10:47:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4765 ms
09 Sep 2017 10:44:16 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
09 Sep 2017 10:44:18 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.jsp_classpath', '/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/servlets-examples/WEB-INF/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-en.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-es.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-fr.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-ja.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/commons-el.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler-jdt.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-runtime.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jsp-api.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory-dbcp.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-resources.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/bin/bootstrap.jar;/C:/Program%20Files/Java/jre6/lib/ext/dnsns.jar;/C:/Program%20Files/Java/jre6/lib/ext/localedata.jar;/C:/Program%20Files/Java/jre6/lib/ext/servlet-api.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunjce_provider.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunmscapi.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunpkcs11.jar')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@257f1b')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('javax.servlet.context.tempdir', 'C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\servlets-examples')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.resources', 'org.apache.naming.resources.ProxyDirContext@1bbdd48')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1d6fbb3')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1d6fbb3')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@126d3df')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.jsp_classpath', '/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/lib/jstl.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples/WEB-INF/lib/standard.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/shared/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/classes/;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-en.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-es.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-fr.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/i18n/tomcat-i18n-ja.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/commons-el.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler-jdt.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-compiler.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jasper-runtime.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/jsp-api.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory-dbcp.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-factory.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/naming-resources.jar;/C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar;/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/bin/bootstrap.jar;/C:/Program%20Files/Java/jre6/lib/ext/dnsns.jar;/C:/Program%20Files/Java/jre6/lib/ext/localedata.jar;/C:/Program%20Files/Java/jre6/lib/ext/servlet-api.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunjce_provider.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunmscapi.jar;/C:/Program%20Files/Java/jre6/lib/ext/sunpkcs11.jar')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@c5aa00')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('javax.servlet.context.tempdir', 'C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\jsp-examples')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeRemoved('org.apache.catalina.resources', 'org.apache.naming.resources.ProxyDirContext@11c0d60')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@136d9d8')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@136d9d8')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1827d1')
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
09 Sep 2017 10:44:18 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
好了,伙计们,我解决了这个问题:
错误日志实际上显示web.xml文件的第42行有一个错误。我检查了这一行,在开头发现了一个非常愚蠢的错误--注释开始标记不正确。在错误的地方搜索了将近3个星期,因为我从来没有想过要检查这样的东西。
尽管如此,还是要感谢每一个回复的人,这是非常感谢的!
我正在编写一个Java Servlet,我正在努力使一个简单的示例正常工作。 类是: 我正在运行TomcatV7.0,并且已经阅读了类似的问题,回答涉及到更改中的部分。这个部分实际上不存在于我的,当我添加它时,同样的问题仍然发生。
我的文件夹中的JSP文件中有一个HTML表单。我在文件夹的默认包中有一个servlet类。在我的中,它被映射为。 我在HTML表单的属性中尝试了几个URL: 但这些都没用。它们都在Tomcat 6/7/8中不断返回HTTP 404错误,如下所示: 描述:请求的资源(/servlet)不可用。 或在Tomcat 8.5/9中如下所示: 消息:/servlet 描述:源服务器找不到目标资源的当前表示形
我的文件夹中的JSP文件中有一个HTML表单。我有一个servlet类在文件夹中的默认包中。在我的它被映射为。 我在HTML表单的属性中尝试了几个URL: 但这些都不管用。它们都会不断返回HTTP 404错误,如Tomcat 6/7/8中的以下错误: 描述:请求的资源(/servlet)不可用。 或如Tomcat 8.5/9中所示: 消息:/servlet 描述:源服务器没有找到目标资源的当前表示
我正在尝试编写我的第一个JSF应用程序,但在Apache Tomcat 8.0/GlassFish 4服务器上部署它时遇到了问题。 例如,我使用了Horstmann的Core Java Server Faces中描述的应用程序(它来自这里的源代码ch01)。根据这本书,我应该做(对于Win 7 x64): < li >从路径ch01/login/src/java使用以下命令行命令编译项目: 如果使
我正在制作一个简单的程序,以几个字段作为输入,然后点击确认按钮后,confirm.jsp将出现。 我创建了Controller.java servlet来标识单击的按钮,然后打开JSP。controller.java存储在web-inf/classes/ch2/servletController目录中,而submit.jsp、register.jsp、confirm.jsp存储在/ch2/serv
我是Spring MVC的新手。在尝试基本程序时,我面临404错误页面。 Web.xml myDemoApp servletConfid。xml 控制器类 JSP页面 使用的URL: http://localhost/8050/springMVCDemo/getQuote.html 文件夹结构:[在此输入图像描述][1] 请告诉我这个错误的解决方法。