Providing Servlet Context Parameters thru' annotations

Providing Servlet Context Parameters thru' annotations

Postby javalatte » Thu Feb 07, 2013 4:06 am

Can you provide ServletContext parameters through annotations instead of through web.xml, as there is a choice of using annotations instead of web.xml in the case of ServletConfig parameters?
javalatte
 
Posts: 55
Joined: Tue Jan 29, 2013 2:31 pm

Re: Providing Servlet Context Parameters thru' annotations

Postby Kishan » Thu Feb 07, 2013 5:33 am

There are no annotations provided to represent context init parameters. If you want to include context init parameters you can declare them in web.xml file as below:

<context-param>
<param-name>training</param-name>
<param-value>Java/J2EE Online Training</param-value>
</context-param>
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am


Return to Servlets

Who is online

Users browsing this forum: No registered users and 2 guests

cron