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 505345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:35:21+00:00 2026-05-13T06:35:21+00:00

I have a very simple page that is displaying canned data. I experienced this

  • 0

I have a very simple page that is displaying canned data. I experienced this problem with data from a DB so I made this simple example and still have the issue. When this page is navigated to for the first time for a session, the first column in the first row shows no data.

It doesn’t matter if I change the scope to request or session, nor does it make a difference if I use firefox or IE. All I know is that if I reload the page or navigate away and come back it will all of a sudden show my data – until I close all instances of that browser and load up a new one. Then, again, it won’t show my data until I reload the page.

The question is why does my beloved first title of my first book never show up until i reload the page (“Operating System Concepts” doesn’t show, but “Silberschatz” does)?

Below is the relevant code.

HomePage.java:

public class HomePage {

    private Book[] books;

    public HomePage() {
        books = new Book[3];
        books[0] = new Book("Operating System Concepts", "Silberschatz");
        books[1] = new Book("Learning Sql", "Beaulieu");
        books[2] = new Book("Effective Java", "Bloch");
    }

    public Book[] getBooks() {
        return books;
    }
    public void setBooks(Book[] books) {
        this.books = books;
    }
}

Book.java

public class Book {

    private String title;
    private String author;

    public Book() {}

    public Book(String title, String author) {
        this.title = title;
        this.author = author;
    }


    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }
    public void setAuthor(String author) {
        this.author = author;
    }
}

home.jsp:

<html>
  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

  <link href="../css/styles.css" rel="stylesheet" type="text/css" />
  <f:loadBundle basename="omitted.for.anonymity.bundle.home" var="msgs"/>

  <f:view>
    <body>
      <h:form>
        <h:panelGrid columns="2" columnClasses="sideControlColumn,contentColumn">
          <f:facet name="header">
            <f:subview id="header">
              <jsp:include page="header.jsp" />
            </f:subview>
          </f:facet>

          <f:subview id="sideControl" >
            <jsp:include page="sideControl.jsp" />
          </f:subview>

          <h:dataTable value="#{homePage.books}"
                var="book"
                styleClass="homeTable"
                rowClasses="evenColumn,oddColumn"
                >

            <h:column>
              <f:facet name="header">
                <h:outputText value="#{msgs.columnHeader1}"/>
              </f:facet>

              <h:outputText value="#{book.title}" />
            </h:column>

            <h:column>
              <f:facet name="header">
                <h:outputText value="#{msgs.columnHeader2}"/>
              </f:facet>

              <h:outputText value="#{book.author}" />
            </h:column>

          </h:dataTable>

        </h:panelGrid>
      </h:form>
    </body>
     </f:view>
</html>

faces-config.xml:

<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>

    <navigation-rule>
    <from-view-id>/pages/login.jsp</from-view-id>
        <navigation-case>
            <from-outcome>login</from-outcome>
            <to-view-id>/pages/home.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id>/pages/home.jsp</from-view-id>
        <navigation-case>
            <from-outcome>searchForBooks</from-outcome>
            <to-view-id>/pages/searchCriteria.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id>/pages/searchCriteria.jsp</from-view-id>
        <navigation-case>
            <from-outcome>searchForBooks</from-outcome>
            <to-view-id>/pages/searchCriteria.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id>/pages/searchResults.jsp</from-view-id>
        <navigation-case>
            <from-outcome>searchForBooks</from-outcome>
            <to-view-id>/pages/searchCriteria.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
    <from-view-id>/pages/searchCriteria.jsp</from-view-id>
        <navigation-case>
            <from-outcome>search</from-outcome>
            <to-view-id>/pages/searchResults.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>


    <managed-bean>
        <managed-bean-name>book</managed-bean-name>
        <managed-bean-class>omitted.for.anonymity.beans.Book</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>homePage</managed-bean-name>
        <managed-bean-class>omitted.for.anonymity.beans.page.HomePage</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>searchCriteriaPage</managed-bean-name>
        <managed-bean-class>omitted.for.anonymity.beans.page.SearchCriteriaPage</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>searchResultsPage</managed-bean-name>
        <managed-bean-class>omitted.for.anonymity.beans.page.SearchResultsPage</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

</faces-config>
  • 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-05-13T06:35:21+00:00Added an answer on May 13, 2026 at 6:35 am

    Table that sets a book request scope variable:

    <h:dataTable value="#{homePage.books}"
        var="book"
        styleClass="homeTable"
        rowClasses="evenColumn,oddColumn">
    

    Managed bean that sets a book session scope variable:

    <managed-bean>
        <managed-bean-name>book</managed-bean-name>
        <managed-bean-class>omitted.for.anonymity.beans.Book</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    

    Just guessing, but I wonder if the Expression Language is resolving the session bean here for some reason. It shouldn’t – the ScopedAttributeELResolver “searches the page, request, session and application scopes for an attribute with the given name and returns it, or null if no attribute exists with the current name.” But it isn’t beyond possibility that there is a bug in the Expression Language implementation. Try changing the name of the var attribute to avoid collision or resolve it explicitly to the scope using #{requestScope.book.title}.

    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    

    I notice from your doctype that you’re using JSF 1.1. I recommend upgrading to at least 1.2 (preferably 2.0) if you can.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple ASP.Net page that acts as a front end for
i have very simple problem. I need to create model, that represent element of
I have very simple select like this: SELECT * FROM table WHERE column1 IN
We have a very simple page for displaying the records. Basically, it passes certain
I have a very simple test page that tests jquery (1.4.2) queue and delay.
I have this very simple page: <html> <head> </head> <body>Handling... <script> var token =
I have a very simple problem which requires a very quick and simple solution
I have a very simple WPF application in which I am using data binding
I have a very simple bit of script that changes the status of an
I have a very simple Java RMI Server that looks like the following: import

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.