0

我在eclipse上写了一个简单的jsf web app。当我在 eclipse 中的 tomcat 7 服务器上运行它时,我的 web 应用程序运行良好。现在我正在将其部署到服务器主机名 = cheetah.arvixe.com。

为此,我已将我的 Web 应用程序导出为 war 文件,并将此 war 文件解压缩到 arvixe 服务器的 public_html 文件夹中。

当我在浏览器上访问我的网站时,我得到一个空白页面。当我查看页面源代码时,我看到我的 index.xhtml 带有 jsf 标签。我想知道为什么我的页面没有显示。有任何想法吗?

这是我的 index.html 代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">


<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
    <ui:define name="content">

        <h:form>

            <h:panelGrid columns="2">
                <h:outputText value="Name"></h:outputText>
                <h:inputText id="userid" value="#{user2.userId }"></h:inputText>

                <h:outputText value="Password"></h:outputText>

                <h:inputSecret id="password" value="#{user2.pincode}"
                    required="true"  requiredMessage= "#{vm['loginBean.password']}">
                    <h:messages for="password" style="color:red" />
                </h:inputSecret>
            </h:panelGrid>
            <h:commandButton value="Register" action="query_results"></h:commandButton>


        </h:form>

    </ui:define>
</ui:composition>


</html>

这是我的 web.xml 代码:

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>Redlancelogin</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.xhtml</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>
  <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>
  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
  </context-param>
  <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  </listener>
</web-app>

在我的 web-ing/lib 中,我有 jsf-api.jar 和 jsf-imp.jar

请告诉我为什么在部署到主机服务器时总是出现空白页。先感谢您!!!!

4

0 回答 0