繁体   English   中英

Java Apache Tomcat v7.0中我的XML文件出现问题

[英]Issue with my XML file in Java Apache Tomcat v7.0

大家好,我想将表单发送到src /“程序包所在的位置”内的类文件。 我遇到了问题,因为如果我在WebContent文件夹中包含的表单页面上,则该URL为... http://localhost:8080/Final_Project/Band_roster.jsp一旦我点击“提交”,它将被发送到类文件中并将其发送到该网址。 http://localhost:8080/bandser这个网址看起来不正确吗? 因此,一旦将其发送到这里,我会收到404错误。 我正在使用xml文件进行传输。

XML代码:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


    <servlet>
  <servlet-name>BandListServ</servlet-name>
  <servlet-class>bandServ.BandListServ</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>BandListServ</servlet-name>
  <url-pattern>/bandser</url-pattern>
</servlet-mapping>

    <error-page>
        <error-code>404</error-code>
        <location>/error_404.jsp</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error_java.jsp</location>
    </error-page>

    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

    <welcome-file-list>
        <welcome-file>BandForm.jsp</welcome-file>
    </welcome-file-list>
</web-app>

这是类文件url,当我点击属性\\workspace\\finalprojectfor_client\\src\\BandListServ.java ,它会告诉我。 因此,如果您需要更多信息,请告诉我,我非常感谢您的帮助!

编辑:

同样在XML文件中,我收到一条错误消息- Referenced file contains errors (http://java.sun.com/xml/ns/javaee/javaee_5.xsd). For more information, right click on the message in the Problems View and select "Show Details..." Referenced file contains errors (http://java.sun.com/xml/ns/javaee/javaee_5.xsd). For more information, right click on the message in the Problems View and select "Show Details..."

我遇到了这个问题,我用j2ee替换了javaee,它起作用了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM