こんにちは
ローカル環境にて、Centosを使いWeb Server兼、DB Serverを制作しています。
Webページ(ローカル)で入力したものに対しての返答(動的ページの表示)をさせることを最終目標としています。
--できたこと--
CenOSにApache,Apache Tomcat,PostgreSqlの導入、Apache Tomcatを使って "HELLO WORLD"を表示するWebページのローカル環境での公開に成功しています。
--問題点--
Java EE を使って開発したサンプルを動かしてみようとしたところ動作しないため苦悩しています。
--教えて頂きたいこと--
Tomcat内のファイル構成。
現段階では
tomcat/webapps/sample01/META-INF,WEB-INF,index.xhtml,output.xhtml
WEB-INF/classes,faces-config.xml,glassfish-web.xml,lib,web.xml
となっており、WEB-INF/web.xmlの内容として
xml
1<?xml version="1.0" encoding="UTF-8"?> 2<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_3_1.xsd" version="3.1"> 3 <display-name>sample01</display-name> 4 <welcome-file-list> 5 <welcome-file>index.xhtml</welcome-file> 6 </welcome-file-list> 7 <servlet> 8 <servlet-name>Faces Servlet</servlet-name> 9 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 10 <load-on-startup>1</load-on-startup> 11 </servlet> 12 <servlet-mapping> 13 <servlet-name>Faces Servlet</servlet-name> 14 <url-pattern>*.xhtml</url-pattern> 15 </servlet-mapping> 16</web-app>
としています。
Webブラウザを使い表示を試みると、
HTTP ステータス 404-Not Found
Type ステータスレポート
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
が返されます。
動的ページ以前にページすら表示されません。
”教えて頂きたいこと"の冒頭に、tomcat内のファイル構成と書きましたが、正直どこが悪いのか見当がつきません。
見当違いの質問をしているかもしれませんがどうかよろしくお願いします。
--仕様--
CenOS 7.4.1708
Apache 2.4.6
Apache Tomcat 8.5.28.0
Java Version 1.8.0
JDK 8
Java Version 1.8.0
--どのようなページか--
1.index.xhtmlにて 番号+名前 を入力。
2.データベースへ登録
3.output.xhtmlにて入力されたデータの確認。
posgresqlとの接続がまだなので、たちまちindex.xhtmlだけでも表示させたいと考えています。