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

  • Home
  • SEARCH
  • 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 6387245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:07:39+00:00 2026-05-25T03:07:39+00:00

I have a simple Web App that receives data via a web service and

  • 0

I have a simple Web App that receives data via a web service and persists it in a database. I am using CXF, Hibernate and Glassfish 3. I am very new to all of this, however I am trying to work out how I can develop a simple plugin model so that when the App fisrt starts up it searches for plugin’s in a folder and calls an instantiation(?) class for each plugin. The issue is that I am not really sure how to initiate this process (that is when the App firsts starts) – how do I know when the app first starts. Any advice/comments appreciated!

ok here is a sample class with the modification of web.xml:

package foo.bar.startup;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class AppStartup implements ServletContextListener {

    public void contextInitialized(ServletContextEvent event) {
        // App started - do start up stuff
    }
    public void contextDestroyed(ServletContextEvent event) {
        // App stopped - do something
    }
}




  <listener>
    <listener-class>foo.bar.AppStartup</listener-class>
  </listener>
  • 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-25T03:07:40+00:00Added an answer on May 25, 2026 at 3:07 am

    When a web application starts, it fires a ServletContextEvent which goes to every registered ServletContextListener. These listeners must be configured in the web.xml of the application:

    <listener>
        <listener-class>com.foo.bar.MyServletContextListener</listener-class>
    </listener>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty simple scenario. I have a web service that receives a byte array that
I have a web app built in coldfusion that receives medical referral letters from
Say I want to have a simple web app that takes some user input,
I have a simple ASP.NET 3.5 SP1 Web Forms app... I've added the System.Web.Routing
I have a simple web service operation like this one: [WebMethod] public string HelloWorld()
I have a simple web page that till now didn't need any login. It
I have a really simple ASP.NET web application and a web setup project that
I have a simple PowerShell script that uses WMI to create a web site
I am writing a simple database with web access. I have previous experience with
First off, The Problem: We have a Web App with a Flash front-end that

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.