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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:28:49+00:00 2026-06-18T11:28:49+00:00

A tutorial on the Jersey REST server [1] says of the Jersey servlet: This

  • 0

A tutorial on the Jersey REST server [1] says of the Jersey servlet:

This servlet analyzes the incoming HTTP request and selects the correct class and method to respond to this request. This selection is based on annotations in the class and methods.

When the servlet “selects the correct class and method”, does it re-instantiate the class every time? Or does it keep one instance of every resource class?

This would seem to matter because, if these resources classes have references to objects that store application-wide state, these state objects would be re-instantiated along with the resources, and would not end up storing state data correctly.

[1] http://www.vogella.com/articles/REST/article.html#restjersey

  • 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-06-18T11:28:50+00:00Added an answer on June 18, 2026 at 11:28 am

    Jersey will establish a new instance of each class per request unless you annotate the class with @Singleton.

    See: https://jersey.java.net/documentation/latest/jaxrs-resources.html#d0e2331

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

Sidebar

Related Questions

I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html . As I understand,
I've written a simple REST server using JAX-RS, Jersey and Grizzly. This is how
ajax tutorial on w3school at http://www.w3schools.com/ajax/ajax_database.asp In this function (function GetXmlHttpObject()), it creates a
i'm following this tutorial: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide and downloading my own source of mod_wsgi. The problem
This tutorial - http://andytsui.wordpress.com/2011/06/29/tutorial-displaying-multiple-lists-in-one-single-listview-with-android-binding/ - shows exactly what I want to do, but it
I am looking into REST and protocol buffers atm. Therefore I found [this][1] tutorial
This tutorial http://www.blocsoft.com/blog/imageshack.asp shows a great way to upload to imageshack and get a
The tutorial I'm following ( http://www.bluerosegames.com/xna101/post/Lesson-9-Improving-the-BouncingBall-Class-Using-Properties.aspx ) private Vector2 _position; public Vector2 Position {
I am referring this tutorial for creating rest webservice and deploying in GAE. This
I was looking at a good REST tutorial using Jersey . Down the 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.