tomcat虚拟主机jsp工作,面孔不起作用

时间:2015-12-16 08:17:23

标签: jsf tomcat

in my tomcat virtual host configuration, while jsp work fine, without port number on URL, faces do not work without port number.
ortipisani.it_slash_old_slash_test2.jsp is ok but
ortipisani.it:8080_slash_faces_slash_home.xhtml is ok but
ortipisani.it_slash_faces_slash_home.xhtml do not work

我已经在httpd.conf,tomcat配置文件的server.conf和web.xml配置文件中设置了我的虚拟主机。 但今天我无法获得良好的配置。

我的web.xml

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <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>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>

    </web-app>

我在httpd.conf中的虚拟主机

    <VirtualHost *:80>
    ServerAdmin info@ortipisani.it
    DocumentRoot /home/ortipisani/www/html
    ServerName ortipisani.it
    ServerAlias www.ortipisani.it
    ErrorLog /home/ortipisani/www/error_log
    CustomLog /home/ortipisani/www/access_log combined
    JkMount /*.jsp ajp13
    </VirtualHost>

我在server.xml中的虚拟主机(tomcat conf):

    <Host 
        name="ortipisani.it">
        appBase="/home/ortipisani/www/html/"
        unpackWARs="false" autoDeploy="false"
        xmlValidation="false" 
        xmlNamespaceAware="false"
        >
        <Alias>www.ortipisani.it</Alias>
    </Host>

我尝试了几种类型的设置,但我无法获得良好的配置。 我该怎么办? 感谢

UPDATE 今天我已经把

JKMount /*.xhtml ajp13
JKMount /faces/* ajp13

进入httpd.conf中的虚拟主机设置。 从

<VirtualHost *:80>
ServerAdmin info@ortipisani.it
DocumentRoot /home/ortipisani/www/html
ServerName ortipisani.it
ServerAlias www.ortipisani.it
ErrorLog /home/ortipisani/www/error_log
CustomLog /home/ortipisani/www/access_log combined
JkMount /*.jsp ajp13
</VirtualHost>

<VirtualHost *:80>
ServerAdmin info@ortipisani.it
DocumentRoot /home/ortipisani/www/html
ServerName ortipisani.it
ServerAlias www.ortipisani.it
ErrorLog /home/ortipisani/www/error_log
CustomLog /home/ortipisani/www/access_log combined
JkMount /*.jsp ajp13
JKMount /*.xhtml ajp13
JKMount /faces/* ajp13
</VirtualHost>

现在它运作正常。

0 个答案:

没有答案