iframe call twice postConstruct init() method

UI Components for JSF
Post Reply
BipinK
Posts: 5
Joined: 12 Jun 2019, 12:05

17 Jun 2019, 09:36

Hello Team,

I am facing iframe issue in primefaces. iframe call twice postConstruct init() method in the backing bean.
- Call another page in the dialog using an iframe.

Scope of beans :
View


Code:

searchViewDlgBean.java
cndViewDlgUrl="/page/wf/candidateViewDlg.xhtml?cndId=123"
searchViewDlg.xhtml
<p:dialog closeOnEscape="true" responsive="true" id="searchViewDlg"
<h:form id="frmViewCndInfo">
<iframe height="100%" width="1110" style="border: #ccc solid 0px; height: 100%"
src="#{pc_quickSearchBean.cndViewDlgUrl}"> </iframe>
</h:form>
</p:dialog>
candidateViewDlg.xhtml
<ui:composition template="/page/candidate/templ.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<ui:define name="content">
<h:form id="frmDwnldRsm">
<p:outputLabel value="#{pc_candidateViewDlgBean.cndId}"></p:outputLabel>
</h:form>
</ui:define>
</ui:composition>
CandidateViewDlgBean.java
@PostConstruct
public void init() {
logger.info("entered in init() of CandidateViewDlgBean");
try {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
if (request .getParameter("cndId") != null) {
cndId = Integer.parseInt(request .getParameter("cndId"));
logger.debug("cndId>>>>>>>>>>>" + cndId);
}
} catch (Exception e) {
logger.error("Exception : ", e);
}
}
Log:
2019-06-17 07:34:30,948 [CandidateViewDlgBean]- entered in init() of CandidateViewDlgBean
2019-06-17 07:34:30,948 [CandidateViewDlgBean]- entered in init() of CandidateViewDlgBean
2019-06-17 07:34:30,948 [CommonUtil]- Session in getAttr14B2ACBF45DC1B43310EE7AEF282A542
2019-06-17 07:34:30,948 [CommonUtil]- Session in getAttr14B2ACBF45DC1B43310EE7AEF282A542
2019-06-17 07:34:30,948 [CandidateViewDlgBean]- cndId>>>>>>>>>>>123
2019-06-17 07:34:30,948 [CandidateViewDlgBean]- cndId>>>>>>>>>>>123

Please help me to solve out this issue.
Thanks

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

18 Jun 2019, 17:13

And how do you know it is nog logged twice?

BipinK
Posts: 5
Joined: 12 Jun 2019, 12:05

19 Jun 2019, 07:29

Hi,
in my application, we have configured a log4j logger so it is print all applications log.

Technologies
Primefaces 6.1
log4j 2.17
javax.faces 2.2

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

19 Jun 2019, 12:00

I have that too, but still have seen some spurious duplicate log lines... I just wanted to be sure. And did you check if there is a duplicate EL call somewhere else in your code?

BipinK
Posts: 5
Joined: 12 Jun 2019, 12:05

24 Jun 2019, 15:34

Hello friends,

I have already see duplicate EL in my code. there is not duplicate code in .XHTML file

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 48 guests