CAS ajax请求无法获得响应

时间:2015-09-07 12:14:29

标签: javascript ajax web-services single-sign-on cas

我正在使用CAS进行单点登录,在我的cas客户端中,我有一个包含几个js文件的main.html页面,而一些js文件将触发ajax调用,但是当我首先键入http://localhost:8443/casClient/main.html时向我显示登录页面,登录后,CAS服务器将重定向到main.html,所有js文件和css文件都可以无条件加载,但是ajax webservice调用挂起,没有任何响应几分钟。

当我重新启动CAS客户端并在浏览器中逐个输入webservice url时,它可以显示我正确的响应,但是当我再次在浏览器中输入main.html时,所有ajax webservice将再次挂起。

任何人都可以帮我解决那里的错误吗?

我附上了我的web.xml

<listener>
    <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>

<context-param>
    <param-name>resteasy.scan</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>resteasy.scan.providers</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>resteasy.scan.resources</param-name>
    <param-value>false</param-value>
</context-param>
<servlet>
    <servlet-name>SpringDispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>4</load-on-startup>
</servlet>

<servlet>
    <servlet-name>AgentRESTService</servlet-name>
    <servlet-class>
        com.sun.jersey.spi.container.servlet.ServletContainer
    </servlet-class>
    <init-param>
        <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
        <param-value>true</param-value>
    </init-param>
    <load-on-startup>4</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>SpringDispatcherServlet</servlet-name>
    <url-pattern>/service/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>AgentRESTService</servlet-name>
    <url-pattern>/agentrest/*</url-pattern>
</servlet-mapping>

<filter>
    <filter-name>CAS Single Sign Out Filter</filter-name>
    <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>CAS Single Sign Out Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
    <filter-name>CAS Authentication Filter</filter-name>
    <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
    <init-param>
        <param-name>casServerLoginUrl</param-name>
        <param-value>https://localhost:8443/cas/login</param-value>
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>https://localhost:8443</param-value>
    </init-param>
</filter>

<filter>
    <filter-name>CAS Validation Filter</filter-name>
    <filter-class>
        org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
    <init-param>
        <param-name>casServerUrlPrefix</param-name>
        <param-value>https://localhost:8443/cas</param-value>
    </init-param>
    <init-param>
        <param-name>serverName</param-name>
        <param-value>https://localhost:8443</param-value>   </init-param>
</filter>

<filter>
    <filter-name>CAS Assertion Thread Local Filter</filter-name>
    <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>CAS Assertion Thread Local Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>CAS Validation Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>CAS Authentication Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<session-config>
    <session-timeout>3</session-timeout>
</session-config>

<mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
</mime-mapping>

<mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
</mime-mapping>

<welcome-file-list>
    <welcome-file>main.html</welcome-file>
</welcome-file-list>

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd“&GT;

OrderDetailListAdatper adapter = new OrderDetailListAdatper(Yourclass.this,Resource,
    listorderlistInfo);
//set your adapter..

enter image description here

0 个答案:

没有答案