[Seasar-user:4430] Re: [S2JSF] initAction時のresponseCompleteでhtmlタグが出力される

Shouhei Shirai [E-MAIL ADDRESS DELETED]
2006年 8月 28日 (月) 15:14:49 JST


$B$7$i$$$G$9!#(B

$B0J2<D9J8$H$J$C$F$7$^$$$^$7$?!#$9$_$^$;$s!#(B

># Action$B$NLa$jCM$O(B null $B$[E-MAIL ADDRESS DELETED]$7$F$$$k$N$G$9$h$M(B?

$B$O$$!#(B return null; $B$H$7$F$$$^$9!#(B

>> $B$9$k$H!"%P%$%J%j%G!<%?$NKvHx$K(B
>> <html></html>
>> $B$,IU2C$5$l$F$7$^$$!"ITL@$J%U%!%$%k$H$7$F=hM}$5$l$k>l9g$,=P$F$7$^$$$^$7$?!#(B
>
>$B$3$A$i$K$D$$$F$G$9$,!"I,$:8=>]$,H/@8$9$k$N$G$O$J$/(B
>$[E-MAIL ADDRESS DELETED]>o$KF0:n$9$k>l9g$b$"$k$H$$$&;v$G$7$g$&$+(B?

$B$3$l$O!";d$N(BPC$B$N(B Adobe Reader 7 $B$@$HKvHx$KIU$$$F$/$k(B<html>$B%?%0$,L5;k$5$l$F$$$k!)$i$7$/(B
$BA[Dj$7$?DL$j$K(BPDF$B$,%&%#%s%I%&Fb$K3+$/$,!"(BAdobe Acrobat 6 $B$,%$%s%9%H!<%k$5$l$F$$$k(B
$BJL$N(BPC$B$@$H!"ITL@$J%U%!%$%k$H$7$FJ]B8%@%$%"%m%0$,I=<($5$l$k!"$H$$$&$b$N$G$9!#(B
Acrobat$B$N%P!<%8%g%s$N0c$$!)$GF0:n$,JQ$o$k$N$G$9!#!JMW5a>e(BAcrobat$B$N%P!<%8%g%sE}0l$OIT2D!K(B


>$B$*<j?t$r$*$+$1$7$^$9$,?7$7$$%&%#%s%I%&$r%*!<%W%s$9$k<BAuJ}K!$H(B
>$B$*;H$$$N%V%i%&%6$d%5!<%V%l%C%H%3%s%F%J$N%P!<%8%g%s$b(B
>$B65$($FD:$1$^$9$G$7$g$&$+(B?

$B0J2<$N$h$&$J46$8$G$9!#(B
----- $BF0:n4D6-(B
WinXP SP2
Internet Explorer 6 SP2
J2SE 5.0 update 6
Tomcat 5.5.12

----- $B%&%#%s%I%&(BOPEN
var para = 'hoge.pdf'
var win  = window.open('/hoge/pdftest.html?FILE='+para, 'hoge','width=850,height=
692,titlebar=no,scrollbars=no,resizable=yes,menubar=no,toolbar=no,location=no,directories=no,status=no');

----- pdftest.html
<html xmlns:m="http://www.seasar.org/maya" m:action="#{pdftestAction.init}" />

>$B$^$?!"(BPDF$B=hM}MQ$N(BServlet$B$rJLES!"(Bweb.xml$B$[E-MAIL ADDRESS DELETED]$5$l$F$$$^$9$G$7$g$&$+(B?

$B$$$$$(!"F~$l$F$$$^$;$s!#(B

$B$J$*!"(B
$B-!(BS2JSF Example 1.0.16 $B$N(B AddActionImpl $B$K0J2<$NMM$K(B init() $B%a%=%C%I$r<BAu(B
    public String init(){
    	try{
  	  HttpServletResponse res = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
	  res.getOutputStream().write("$B$"$"$"$"(B".getBytes());	
	}catch(IOException ex){
	  ex.printStackTrace();
	}
    	FacesContext.getCurrentInstance().responseComplete();
    	return null;
    }

$B-"(Badd.html$B$r0J2<$NMM$KJT=8(B
<html xmlns:m="http://www.seasar.org/maya" m:action="#{addAction.init}" />
$B$H$7$FI=<($5$l$?(BHTML$B$N%=!<%9$r8+$k$H!"(B

$B$"$"$"$"(B<html></html>

$B$H$J$j$^$7$?!#(B

$B0J>e!"59$7$/$*4j$$$7$^$9!#(B

----------
-- Syouhei Shirai :[E-MAIL ADDRESS DELETED]




Seasar-user メーリングリストの案内