I have some variables and I dont want their values to be set in code.
I want to change their values from an external file like web.xml.
Can I add some variables to web.xml and access to their values from my classes?
Can someone help me how to do this?
Yes this is possible. For example you can have the following in the \WEB-INF\web.xml:-
Welcome to my page
and then in your .JSP file you can use implicit ‘application’ object to retrieve these values, e.g
<% String title = application.getInitParameter(“title”); %>
Stuart beat me to it!