?
Solved

Initialize JSF page?

Posted on 2005-03-29
1
Medium Priority
?
2,029 Views
Last Modified: 2012-05-05
hello,
before JSF page present first,i need initialize back bean data(from database) that the JSF page used.how can i do it?back bean scope is Request.

Thank You!
konrad
0
Comment
Question by:konrad_ying
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
arun99907 earned 150 total points
ID: 13660901
You can put an empty preStart.jsp page and inside web.xml add this to the welcome page list.

      <welcome-file-list>
         <welcome-file>preStart.jsp</welcome-file>
      </welcome-file-list>

Keep a javaScript for OnLoad() of the page and submit the page to firstPage.jsp with  faces-config.xml having the following navigation rule.

<navigation-rule>
    <description>
       for navigating from preStart page to firstPage.jsp
    </description>
    <from-view-id>/preStart.jsp</from-view-id>
    <navigation-case>
        <description>
              outcome is always success because onLoad will be called first.
              Note: while submitting it on load see to it that you mention the outcome of submit to success.
        </description>
      <from-outcome>success</from-outcome>
      <to-view-id>/firstPage.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>

Just where you are submitting it,

try to write the following :

<h:inputHidden id="putValuesFromDatabase" value="#{PreBacking.methodToSetBeanValuesFromDatabase}"/>

I guess you understood the logic.

All we do here is just put everything with an empty page onLoad as *.do are not present in JSF unlike Java Struts.

I hope u understood me. Thanks. get back to me if you have doubts.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introducing Priority Question, our latest feature.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question