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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:54:47+00:00 2026-05-29T14:54:47+00:00

I have a jsf 1.2 application where I need to show a page (jsp)

  • 0

I have a jsf 1.2 application where I need to show a page (jsp) which has a backing bean. Most examples I see for help show a blank jsp for user ot edit. In my case I need to get some Data from DB before jsp loads, how to accomplish this?

I tried @postconstruct on a backing bean method but if I share this bean with multiple JSPs it is initializing the info for all pages, I need different data for different page and each page should read some data from db before displaying in JSP.

I am coming from Struts background where I would invoke the URL for the Action which will call have Business logic to get data and then I would direct to JSP. For accomplishign this with JSF it seems not pretty straightforward.

  • 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-29T14:54:49+00:00Added an answer on May 29, 2026 at 2:54 pm

    I tried @postconstruct on a backing bean method but if I share this bean with multiple JSPs it is initializing the info for all pages, I need different data for different page and each page should read some data from db before displaying in JSP.

    The page (view) should have its own request/view scoped backing bean which is not shared elsewhere. That should fix your “problem” (which is actually just a design matter). Do not use a single session scoped bean for multiple views. That’s wrong use of the session scope.


    I am coming from Struts background where I would invoke the URL for the Action which will call have Business logic to get data and then I would direct to JSP. For accomplishign this with JSF it seems not pretty straightforward.

    JSF and Struts are very different. JSF is a component based MVC framework while Struts is an action based MVC framework. You should not design JSF backing bean classes while having Struts action classes in mind. Going through some decent JSF tutorials should put you on the right track. For an overview, see also the bottom of our JSF wiki page.

    Please note that JSF 1.2 is completely outdated. JSF 2.0 has been released over 2 years ago already. If this is a new application or just hobbying, I recommend to forget JSF 1.2 and continue with JSF 2.0.

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

Sidebar

Related Questions

We have a JSF 2.0 application running under Glassfish 3.1.1 which has been moved
Ok simple question. I have a JSF application, containing a login page. The problem
I have a Java-JSF Web Application on GlassFish, in which I want to use
I'm trying to create an Hello World JSF application. I have a bean with
In a JSF 2 application, which is developed on tomcat, I have the following
i have created a demo application Using JSF & EJB 3.0 (Stateless session bean
I have jsf application in which I have to use a facelet custom component
I have a JSF 2 application which uses a Richfaces 4 tree control. The
In my JSF application, I need to redirect the user from Page A to
In our application we use jsf,we have to redirect the user to home page

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.