0

Web アプリケーションに問題があります。デフォルトのWebサーバーとしてグラスフィッシュを備えたnetbeansを使用してアプリケーションを作成しました。プログラムをコンパイルして localhost にデプロイすると問題なく動作しますが、Apache Tomcat 7.xx バージョンのリモート Web サーバーにプログラムをデプロイしようとすると、プログラムがサーブレットにアクセスするたびに http ステータス 404 エラーが返されます。サーブレットのマッピングを確認しましたが、すべて問題ないようです。ここに私の web.xml があります:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
<servlet>
    <servlet-name>mainservlet</servlet-name>
    <servlet-class>controller.MainServlet</servlet-class>
</servlet>
<servlet>
    <servlet-name>loginservlet</servlet-name>
    <servlet-class>controller.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>mainservlet</servlet-name>
    <url-pattern>/mainservlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>loginservlet</servlet-name>
    <url-pattern>/loginservlet</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
4

0 に答える 0