tomcat url在两台机器上的行为不同(JSF2、Spring3、prettyfaces)

tomcat url在两台机器上的行为不同(JSF2、Spring3、prettyfaces),spring,tomcat7,prettyfaces,Spring,Tomcat7,Prettyfaces,我在两台不同的机器上开发,它们的规格几乎相同(Win7、EclipseJuno、Tomcat7),源代码是从github签出的 但在我的笔记本电脑上,我的url行为与在工作站上不同。 进入 http://localhost:8080/jeiwomisa/auth/login.xhtml 可以在笔记本电脑上工作,但不能在工作站上工作 在我的工作站上,我必须使用: http://localhost:8080/jeiwomisa/faces/auth/login.xhtml 区别在于“/face

我在两台不同的机器上开发,它们的规格几乎相同(Win7、EclipseJuno、Tomcat7),源代码是从github签出的

但在我的笔记本电脑上,我的url行为与在工作站上不同。 进入

http://localhost:8080/jeiwomisa/auth/login.xhtml 
可以在笔记本电脑上工作,但不能在工作站上工作

在我的工作站上,我必须使用:

http://localhost:8080/jeiwomisa/faces/auth/login.xhtml
区别在于“/faces/”部分。这对所有链接都是一样的。 我不明白这一点,因为我想我在两台机器上的配置都是一样的

我不确定这个问题到底需要哪种配置,所以我只发布了我的web.xml:

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>


<!-- -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/app/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<!-- pretty faces -->

<filter>
    <filter-name>Pretty Filter</filter-name>
    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>Pretty Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>


<context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>de.sveri.jeiwomisa.managed</param-value>
</context-param>

<!-- Project Stage Level -->
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<!-- JSF Servlet is defined to container -->
<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>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
</context-param>

上下文配置位置
/WEB-INF/spring/root-context.xml
org.springframework.web.context.ContextLoaderListener
org.springframework.web.context.request.RequestContextListener
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*
appServlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/spring/app/servlet-context.xml
1.
appServlet
/
漂亮的过滤器
com.ocpsoft.pretty.PrettyFilter
漂亮的过滤器
/*
向前地
要求
错误
com.ocpsoft.pretty.BASE\u软件包
德斯维里·杰沃米萨
javax.faces.PROJECT_阶段
发展
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.xhtml
javax.faces.STATE_保存方法
客户
这是我的security-app-context.xml,其中定义了login.xhtml:

<http use-expressions="true" auto-config="true">
    <intercept-url pattern="/test/**" access="permitAll" />
    <intercept-url pattern="/tasks/**" access="isAuthenticated()" />

    <!-- <intercept-url pattern="/**" access="denyAll" /> -->
    <form-login login-page="/auth/login.xhtml" />   
</http>

<context:annotation-config />
<b:bean id="userRepositoryImpl" class="de.sveri.jeiwomisa.model.UserRepositoryImpl"
    autowire="byType">
</b:bean>

<b:bean id="passwordEncoder"
    class="org.springframework.security.crypto.password.StandardPasswordEncoder">
</b:bean>


<authentication-manager>
    <authentication-provider user-service-ref="userRepositoryImpl">
            <password-encoder hash="md5" />
    </authentication-provider>
</authentication-manager>

致以最良好的祝愿,
Sven

您应该为这两个应用程序添加servlet映射。尝试将以下代码添加到youe web.xml文件中

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>

Facesservlet
/面孔/*

奇怪。尝试清除浏览器缓存?您的配置显然是正确的