Can my JSP page access initalization parameters from the servlet context?

Govind Seshadri

The only way you can obtain the init param from the servlet context is if you have context initialization params defined within your web.xml. For example, if your web.xml has something like:

You can then access the "webmaster" init param from within your JSP scriptlet as:
String value = getServletContext().getInitParameter("webmaster");
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact