动态Web项目的web.xml文件

时间:2019-04-17 10:53:53

标签: java jsp servlets web.xml

我正在尝试将Java中的动态Web应用程序部署到Heroku,并且在创建web.xml时遇到问题

该项目由样式(css,图像,字体等),JSP和Java servlet组成。该项目正在运行,然后我添加了一个web.xml(我以前从未创建过其中一个),然后停止了工作。(我正在使用eclipse)

- java resources
   - src
     - Login_Register
        - Login.java
     - ...
-WebContent
   - Fonts
   - Images
   - WEB-INF
      - web.xml
   - META-INF
   - login.jsp
   - login.css
   - ....






<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
  <display-name>CSCI201L_Group_Project</display-name>
 <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
    <welcome-file>registration.jsp</welcome-file>
  </welcome-file-list>

  <servlet>
        <servlet-name>login</servlet-name>
        <servlet-class>Login_Register.Login</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>register</servlet-name>
        <servlet-class>Login_Register.Register</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>profiledata</servlet-name>
        <servlet-class>PageData.ProfileData</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>requirementsdata</servlet-name>
        <servlet-class>PageData.RequirementsData</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>settingsdata</servlet-name>
        <servlet-class>PageData.SettingsData</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>followsearch</servlet-name>
        <servlet-class>Search.FollowSearch</servlet-class>
  </servlet>
  <servlet>
        <servlet-name>main</servlet-name>
        <jsp-file>/main.jsp</jsp-file>
  </servlet>
  <servlet>
        <servlet-name>profile</servlet-name>
        <jsp-file>/profile.jsp</jsp-file>
  </servlet>
   <servlet>
        <servlet-name>settings</servlet-name>
        <jsp-file>/settings.jsp</jsp-file>
  </servlet>
   <servlet>
        <servlet-name>results</servlet-name>
        <jsp-file>/results.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
        <servlet-name>login</servlet-name>
        <url-pattern>/Login</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
        <servlet-name>register</servlet-name>
        <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>registration</servlet-name>
        <url-pattern>/registration</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>profiledata</servlet-name>
        <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>requirementsdata</servlet-name>
        <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>settingsdata</servlet-name>
        <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>followsearch</servlet-name>
        <url-pattern>/followsearch</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
        <servlet-name>main</servlet-name>
        <url-pattern>/main</url-pattern>
  </servlet-mapping>  
  <servlet-mapping>
        <servlet-name>profile</servlet-name>
        <url-pattern>/profile</url-pattern>
  </servlet-mapping> 
  <servlet-mapping>
        <servlet-name>requirements</servlet-name>
        <url-pattern>/requirements</url-pattern>
  </servlet-mapping> 
  <servlet-mapping>
        <servlet-name>settings</servlet-name>
        <url-pattern>/settings</url-pattern>
  </servlet-mapping> 
  <servlet-mapping>
        <servlet-name>results</servlet-name>
        <url-pattern>/results</url-pattern>
  </servlet-mapping> 
</web-app>

所有页面均不再加载,我收到404错误,描述为:原始服务器找不到目标资源的当前表示形式,或者不愿意透露该资源的存在。

0 个答案:

没有答案