简体   繁体   中英

How to get ServeletConfig in Jersey Provider?

So I have a Jersey REST service and I need to get access to a ServletConfig so that I can pull a param out of the web.xml. I can use @Context to wire one in but I don't think it will get me the params I need. Only the ones in the ServletContext.

Any ideas? I'm new to Jersey and this Provider isn't a Servelet. Perhaps I should start with trying to retrieve the servelet?

@Context: annotation can be used to inject the following classes

  1. HttpServletRequest

  2. HttpServletResponse

  3. ServletContext

  4. ServletConfig

  5. WebConfig.

onto a root resource, provider and Application classes.

Java Doc of Servlet Container

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM