Today I had a bit of a fiddle with JBoss 4.2 due to IE7/IE8 compatibility differences.
When opening or downloading a file in IE7 over an SSL connection (HTTPS), IE7 requires a bit of HTTP header-fu to allow you to actually perform that action.
It’s simple really. Just add “Pragma: public” and “Cache-Control: maxage=3600″ to your HTTP headers and you’re good to go.
In Java code:
1
2
|
response.setHeader( "Pragma" , "public" );
response.setHeader( "Cache-Control" , "maxage=3600" );
|
To check if it’s working was a different matter. How to check the HTTP header content when things get sent over an HTTPS connection… FireBug doesn’t work, and so doesn’t any other developer tooling in any browser. Tracing the network traffic is pretty useless too, it’s encrypted. Last option, trace it on the server. Simply enabling network tracing on the Java VM didn’t work. For some reason JBoss doesn’t pick up this Java VM setting, probably because they are using a NIO based stack or something. I really don’t know.
JBoss does use Catalina for it’s HTTP/HTTPS/Web container handling. Catalina is another name for Tomcat. Tomcat has this valve thing which allows you to plug into the processing pipe. Good thing there are standard Valve implementations available that do just what I needed.
Just drop the next snippet somewhere appropriate:
1
2
3
4
5
|
<!-- Enable http request/response logging.--> < Valve className = org .apache.catalina.valves.RequestDumperValve
prefix = localhost_access_log . suffix=.log
pattern = common directory=${jboss.server.home.dir}/log
resolveHosts = false />
|
Appropriate in my case was in the file “[JBOSS-HOME]/server/default/deploy/jboss-web.deployer/server.xml”.
And lo and behold it logged:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
11:46:44,262 INFO [[localhost]] authType=BASIC 11:46:44,262 INFO [[localhost]] contentLength=48189 11:46:44,262 INFO [[localhost]] contentType=application/pdf 11:46:44,262 INFO [[localhost]] header=Pragma=public 11:46:44,262 INFO [[localhost]] header=Cache-Control=maxage=3600 11:46:44,262 INFO [[localhost]] header=Expires=Thu, 01 Jan 1970 01:00:00 CET 11:46:44,262 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0 11:46:44,332 INFO [[localhost]] header=X-Powered-By=JSF/1.2 11:46:44,332 INFO [[localhost]] header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0 11:46:44,332 INFO [[localhost]] header=X-Powered-By=JSF/1.2 11:46:44,332 INFO [[localhost]] header=Content-Type=application/pdf 11:46:44,332 INFO [[localhost]] header=Content-Length=48189 11:46:44,332 INFO [[localhost]] header=Date=Thu, 26 Aug 2010 09:46:44 GMT 11:46:44,332 INFO [[localhost]] message=null 11:46:44,332 INFO [[localhost]] remoteUser=admin 11:46:44,332 INFO [[localhost]] status=200 |
相关推荐
PRISM: Enabling Personal Verification of Code Integrity, untampered execution, and Trusted I/O on legacy systems. One in the seriese of work by Mark Ryan on trusted computing.
信息安全_数据安全_Secure by Default:Enabling Devel web安全 数据安全 法律法规 安全架构数据分析
Java Fast sockets是用于高速集群上的优化的sockets库,目前国内少有人研究,这是对别人论文的简要翻译
这是一个Android平台的Bluetooth(蓝牙)编程实现,包含了整个工程的实现步骤以及完整代码及配置文档,上传了部分界面效果
Such a framework allows us to present a unified workflow to our end users through a web interface, enabling ad-hoc queries over large data sets without having to learn Spark for themselves.
行业研究报告
GeoCrowd-Prasentation GeoCrowd: Enabling Query Answering with Spatial Crowdsourcing
SubTrack: Enabling Real-Time Tracking of Subway Riding on Mobile Devices
ATK: Enabling Ten-Finger Freehand Typing in Air Based on 3D Hand Tracking Data
ATK:Enabling Ten-Finger Freehand Typing in Air Based on 3D Hand Tracking Data.
Tornado: Enabling Blockchain in Heterogeneous Internet of Things through A Space-Structured Approach
I-WBAN: Enabling Information-centric data retrieval in heterogeneous WBAN
Vehicular fog computing: Enabling real-time traffic management for smart cities
OpenFlow-Enabling-Innovation-in-Campus-Network以及中文翻译.docx
Vehicular social networks: Enabling smart mobility(ESI 0.1%热点论文,ESI 1%高被引论文)
(SCIPY 2013)Pythran: Enabling Static Optimization of Scientific Python ProgramsSerge Guelton∗†, Pierrick Brunet‡, Alan Raynaud‡, Adrien Merlini‡, Mehdi Amini§...
经典的国外软件无线电教材,(2002 Wiley)
Enabling network-layer security on IPv6 Wireless Sensor NetworksEnabling network-layer security on IPv6 Wireless Sensor Networks
VMworld 2009 - DC32: Technologies Enabling The Next Generation of Cloud Services
TRIZ创新原理实例 TRIZ(Theory of Inventive Problem Solving)是一种创新解决问题的理论,旨在解决技术和技术发展中的问题。该理论由前苏联科学家阿奇舒勒(Genrich Altshuller)于1946年提出。...