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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:14:04+00:00 2026-05-21T03:14:04+00:00

I’m working on developing new Spring web applications, on a team that’s developed a

  • 0

I’m working on developing new Spring web applications, on a team that’s developed a ton of web apps around Vanilla HttpServlet’s. I’m new to Spring (please don’t run!) and I’m doing my best to find a tutorial, reference document, book, anything to help me leverage a “Vanilla Servlet”.

I was able to work around my last issue, by invoking the a particular Servlet I needed from the (Flex) client’s browser. The trouble now is, I have another Servlet (the source of which, I can’t modify) that I need to call when my application is started. The Servlet is involved in initializing application reference data (so this is really critical).

It seems to me this should be a typical problem… This must have been a common issue a few years ago when other teams converted to Spring, so why can’t I find the tutorial I need? I’ve tried researching a ton of different Spring classes, but I’m not getting anywhere on this.

Here’s some notes on what I’ve tried:

  • ServletWrappingController , but this isn’t for use as a Controller, I really only need the Servlet inside a Singleton DAO’s Constructor.
  • ResourceServlet , this Class name seems appropriate, and I’ve run across it in my searching, but I’m not entirely sure if this is something that would help.
  • ServletForwardingController (mentioned here), but I can’t seem to find an appropriate example.
  • ServletWrappingController (also from the above question), but -again- I can’t find an appropriate example.

Am I on a wild goose hunt here? Is there a way that I can invoke a static method (does that matter?) on a Servlet, during a Spring app’s startup?

I’m not sure a code snippet will help, but I’d be happy to post one. Really, my only tangential thoughts are “Does the Servlet need to be declared a particular way in web.xml” and “Does this need to be declared a certain way in as a Spring managed bean?” (i.e. in app-config.xml)

I can’t edit the Servlet, though I can tell you it does extend HttpServlet. I’m not calling doGet or doPost on it, instead there’s a static method on the Servlet that makes an RPC call that I need to invoke. If anyone knows a special @MagicInjectHttpServlet annotation, please pass it on!

  • 1 1 Answer
  • 4 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-21T03:14:05+00:00Added an answer on May 21, 2026 at 3:14 am

    I’m not sure I completely understand what you need, but if it’s geniunely just a static method that you need to call, I would have thought that:

    <bean id="myLegacyServlet" 
           class="com.legacy.thing.Servlet"
           init-method="thatStaticMethod" />
    

    and

    <bean id="myGoodStuff" 
           class="com.my.stuff.MyStuff" 
           depends-on="myLegacyServlet">
        ...
    </bean>
    

    would be sufficient. The fact that your legacy object is a servlet shouldn’t make any difference – the important thing is making sure that init-method gets called nice and early, and the best way I can think of is declaring that some other bean needs your legacy bean.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I know there's a lot of other questions out there that deal with this

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.