本文介绍了静态资源不会从Glassfish安全页面引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JSF 1.2和glassfish声明性安全性与j_security_check。



我的xhtml页面位于 secure_pages 文件夹中,通过使用web资源约束将安全性约束设置为/ secure_pages / * ...

我的javascript和CSS都在另一个(非安全)文件夹,它们是从xhtml引用的....



我根据指令链接...





另外在堆栈溢出的讨论之一中

p>

它写成, 它起作用,但不适用于安全性资源,Glassfish自行设置Expires标头。 所以我的问题是 我怎样才能在这个静态资源上设置缓存?

解决方案

只需要在sun-web.xml中写下如下属性:

 > < property name =securePagesWithPragmavalue =false/> 


I'm using JSF 1.2 and glassfish declarative security with j_security_check..

My xhtml page is in secure_pages folder and i secure all the resources in it by setting security constrant with web resources constraint as "/secure_pages/*"...

My javascripts and CSS are in another (non-secure) folder,which are referenced from the xhtml....

I've made resources cacheable according instruction given by link...

http://blogs.oracle.com/cwebster/entry/caching_static_resources_in_glassfish

Also in one of the discussion of stack overflow

Enable cache of J2EE web application's resources

it written as,it works, but not for security-enabled resources, where Glassfish sets the Expires header on its own.

So my question is "How can i set cache on this static resources?"

解决方案

Ok i got answer of my question after bit googling....

Just need to write the following property in sun-web.xml

  <property name="securePagesWithPragma" value="false" />

这篇关于静态资源不会从Glassfish安全页面引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 12:57