0
현재 보고서 프로젝트에서 jsf2, primefaces 4 및 omnifaces를 사용하고 있습니다. 파라미터에 기초pdf 또는 html 응답으로 동적으로 jsf 페이지 업데이트
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core" >
<ui:composition template="/templates/reportLayout.xhtml">
<ui:define name="centerContent">
<h:form>
Parameter 1: <p:inputText />
Parameter 2: <p:inputText />
Output Type:
<p:selectOneMenu>
<f:selectItem itemValue="html" />
<f:selectItem itemValue="pdf" />
</p:selectOneMenu>
<hr/>
<p:commandButton value="Generate Report"
action="#{reportBean.generate}" />
</h:form>
<p:outputPanel id="output">
<p:lightBox iframe="true">
</p:lightBox>
</p:outputPanel>
</ui:define>
</ui:composition>
</html>
가 reportBean.generate 방법 PDF 응답 또는 다음과 같이 reportBean로부터 HTML 응답 하나를 생성 할 것이다 :
는 I는 다음과 JSF 형태를 갖는다.
> res27: String = application/pdf
> res28: Array[Byte] = Array(37, 80, 68, 70, 45, 49, 46, 54, 13, 10, 57, 32, 48, 3
2, 111, 98, 106, 13, 10, 60, 60, 47, 84, 121, 112, 101, 47, 88, 79, 98, 106, 1
01, 99, 116, 47, 83, 117, 98, 116, 121, 112, 101, 47, 70, 111, 114, 109, 47, 7
, 119, 51, -30,...
어떻게 출력 패널에 응답을 표시합니까?
pdf가 생성되는 HTML 응답 또는 html은 무엇입니까? – BholaVishwakarma
http://www.primefaces.org/showcase/ui/media.jsf – kolossus