users@jersey.java.net

[Jersey] Servlet.Init() For Jersey REST Service

From: juminoz <juminoz_at_hotmail.com>
Date: Wed, 22 Jun 2011 21:36:32 -0700 (PDT)

Hi,

I was wondering what is the best way to initialize Jersey servlet. I tried
implementing the Servlet interface and overiding this method, but it doesn't
seem to get called.

public void init(ServletConfig config) throws ServletException;

Then I tried adding the init logic in the constructor only to find that it's
being invoked multiple times with each request. Is this supposed to happen?
Why is the constructor called with every request? I'm using Jersey 1.7.

Thanks,
Jack

--
View this message in context: http://jersey.576304.n2.nabble.com/Servlet-Init-For-Jersey-REST-Service-tp6507144p6507144.html
Sent from the Jersey mailing list archive at Nabble.com.