[JSF-72] [Seasar-user:10659] 【s2jsf】Content-Typeの指定方法の問題 Created: 2007-09-28  Updated: 2007-09-28  Resolved: 2007-09-28

Status: Resolved
Project: S2JSF
Component/s: None
Affects Version/s: 1.1.2, 1.0.26
Fix Version/s: 1.1.3, 1.0.27

Type: Bug Priority: Major
Reporter: cero-t Assignee: cero-t
Resolution: Fixed Votes: 0
Labels: None
Environment:

s2jsf1.1.1
s2-2.4.16
teeda1.0.7


Attachments: HTML File baseLayout.html     HTML File hoge.html    

 Description   

org.seasar.jsf.processor.ViewProcessorが各htmlファイル毎に生成され、
それぞれのcontentTypeをmetaから取得し、値の管理を行っていると思いますが、
html継承によるlayout機能使用時の仕様を確認させてください。
添付のように子供のhtmlファイルはbody内の実際のコンテンツのみ定義してある
状態です。
baseLayoutが親のhtmlです。

私が確認したところ親に
<meta http-equiv="Content-Type" content="text/html; charset=Windows-31j" />
がありましても、子供のhtmlに対応する
org.seasar.jsf.processor.ViewProcessorは
親の値を取らずに子供に指定されている
<meta http-equiv="Content-Type" content="XXXX" />
を読むようになっていると思われます。
(私の場合は指定が無いのでnullになります)

生成されたhtml的には、親のheadの内容になっております。

なにが問題になっているかと言いますと、
WAS6.0.2.21で
org.seasar.jsf.runtime.ViewRendererImpl

renderView内の
response.setContentType(viewProcessor.getContentType());
の部分で、setContentTypeの引数がnullで呼ばれると
nullpoが起きてしまいます。
(IBMにバグではないかと言う問い合わせをしておりますが、
FIXを当てるのも厳しい状況です)

とりあえず回避は全てのhtmlに
<meta http-equiv="Content-Type" content="XXXX" />
を記述することでなんとかなりますが、
回避できる方法などありましたらお教えください。

私的には
response.setContentType(viewProcessor.getContentType());
にnullチェックを入れると言うのではなく、
response.setContentType(viewProcessor.getContentType());
が呼ばれること自体重要なはずなので、
親のhtmlの内容を参照していただけるか、
どこか一箇所に宣言できたりすると嬉しいと感じます。



 Comments   
Comment by cero-t [ 2007-09-28 ]

<html>タグにm:extendsが指定されている場合は、
親のContent-type、encodingを必ず使うようにした。

Generated at Tue Apr 15 21:36:13 JST 2025 using Jira 10.5.0#10050000-sha1:9d9d098bb7b67e8dba8da380ba9c3900d82ac3cf.