davej Posted April 5, 2012 Share Posted April 5, 2012 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. Link to comment Share on other sites More sharing options...
davej Posted April 9, 2012 Author 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
Archived
This topic is now archived and is closed to further replies.