davej Posted April 5, 2012 Report Share Posted April 5, 2012 (edited) If you have several JSP pages or servlets that need the same bit of information, such as a filepath, how do you handle that? I realize globals are generally frowned upon, so what is usually done? Thanks. Edited April 6, 2012 by davej Link to comment Share on other sites More sharing options...
davej Posted April 9, 2012 Author Report Share Posted April 9, 2012 To answer my own question -- it looks like these can go in the web.xml file. Servlets can retrieve constants defined using the <context-param> tag using the call context.getInitParameter(). I don't know if JSP's can also access these items with a scriptlet. There is also a <init-param> tag. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now