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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:44:40+00:00 2026-05-13T15:44:40+00:00

IN JSP i used to put things in bean’s constructor which is in APPLCIATION

  • 0

IN JSP i used to put things in bean’s constructor which is in APPLCIATION scope,
similarly
i want to load a function upon deploy of application where i can put .

i tried putting in listener but @ that time i am not getting faces config ‘s injection .

so is there any way out ?

  • 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-13T15:44:40+00:00Added an answer on May 13, 2026 at 3:44 pm

    Tt sounds suspicious that the listener hadn’t worked for you. It should’ve worked. What I assume has happened is that you expect your request-scoped beans to get their dependencies injected outside a request/response cycle. Well, this won’t happen.

    So you’d better do one of these:

    • put the @PostConstruct annotation on every bean and initialize it.
    • register a ServletRequestListener which gets triggered on each request

    If you want a managed bean to initialize something application-wide (what is that something, btw):

    1. Create a managed bean with scope application
    2. Do your initialization in a method annotated with @PostConstruct

    Btw, you have been wrong to put JSP initialization code in constructor. It should’ve been in the init(..) method. (and actually, shouldn’t have been in a JSP at all)

    Alternatively you can use a PhaseListener (in the faces-config.xml), where to lazily load tha application settings.

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

Sidebar

Related Questions

In my parent jsp page I've used: function popUpClosed() { window.location.reload(); } And in
I have developed a web application on Struts2 and used JSP. I want to
since today - I always used simple JSP Tags and JSTL which works but
I have a problem. I have used a jsp page which contains multiple frames.In
I have used spring MVC with JSP/JSTL for my previous application. I was going
What I have: I have a generic JSP page that is used throughout my
I'm sending multipart/mixed content message from JSP to servlets but when I used ServletFileUpload.isMultipartContent(request);
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
Below am posting my jsp page. home.jsp <%@taglib uri=/WEB-INF/struts-bean.tld prefix=bean%> <%@taglib uri=/WEB-INF/struts-html.tld prefix=html %>
Folks, Used to be that when you hit a servlet/jsp, the app server would

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.