Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:12:20+00:00 2026-06-16T21:12:20+00:00

I have a problem with my Mojarra 2.1.6 web-application, I’m developing it using @ViewScoped

  • 0

I have a problem with my Mojarra 2.1.6 web-application, I’m developing it using @ViewScoped managed beans and each bean is attached to an xhtml page. This page is receiving some view params and after initializing the bean in that way:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
template="/templates/general_template.xhtml">

<ui:define name="metadata">
    <f:metadata>
        <f:viewParam id="user" name="user"
            value="#{navegableUserData._ParamUser}" />

        <f:viewParam id="NavIndex" name="NavIndex"
            value="#{navegableUserData._QueueIndex}" />
        <f:event type="preRenderView"
            listener="#{navegableUserData.initialize}" />
    </f:metadata>
    <h:message for="user" />
</ui:define>

<ui:define name="general_content">
    <p:outputPanel autoUpdate="false" id="Datos_Loged" name="Datos_Loged"
        layout="block">
        <h:form id="SystemUserForm">
            <ui:include
                src="/system/manage_user/content/edit_user/system_user_data/system_user.xhtml">
                <ui:param name="manager" value="#{navegableUserData}" />
            </ui:include>
        </h:form>
    </p:outputPanel>
</ui:define>

As you can see, I have my pages nested into a general template which looks like that:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">


<h:head>
    <meta http-equiv="Pragma" CONTENT="no-cache"></meta>
    <meta http-equiv="cache-control" content="no-cache"></meta>
    <meta http-equiv="Expires" CONTENT="-1"></meta>
    <meta http-equiv="Content-Type"
        content="text/html; charset=ISO-8859-15" />
    <h:outputStylesheet library="css" name="prime_styles.css" />
    <h:outputScript library="js" name="prime_translations.js" />
</h:head>

<h:body>
    <ui:insert name="metadata" />
    <o:importConstants
        type="com.company.system.view.beans.NavigationResults" />

<!-- More stuff -->

Problem comes when I make an ajax request such as a Primefaces table filtering. Although my backing bean is not being created again, <f:event type="preRenderView" listener="#{navegableUserData.initialize}" /> is being called again.

I’m doing a data loading based into view params and need that method to execute only when the page is rendered first time. I have been very careful using <c:xxx> tags and think that’s not the problem because I used them only in general template and my view beans properties are not attached to them. Also I have this problem with all my pages, so I think it is not an issue of an specific backing bean.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:12:21+00:00Added an answer on June 16, 2026 at 9:12 pm

    If this occur only during ajax request, try the following:

    public void initialize() {
        if (!FacesContext.getCurrentInstance().isPostback()) {
            // -----------
            // -----------
        }
    }
    

    Related as BalusC suggested:

    • What can f:metadata and f:viewParam be used for?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application using JSF 2.0, NetBeans 6.9.1, GlassFish Server 3.1, mojarra
I have an strange problem happening in my web application after I changed Mojarra
I have problem with customizing each page using pagecontrol and UIScrollView. I'm customizing Page
i have a problem with rendering #{} inside JSF page. I'm using Mojarra 2.1.5
I have a problem when using h:head tag. I am using JSF 2.0 Mojarra's
Im using Mojarra 2.1.3, NetBeans 7.0.1, Primefaces 3.2. I have a few dynamic xhtml
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with show or hide form in Window Form Application. I start
I have problem developing with live555. I already build the lib-files and example projects
I have problem with Text Field Auto Calculation in JAVA using Netbeans 7.2 My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.