Re: Accessing a servlet context from a JavaBean
Posted By:
kevin_rowe
Posted On:
Thursday, January 23, 2003 04:09 AM
one way to do it is...
make a public method in the bean called init or some such
and make it accept a pageContext object as parameter.
run this from the jsp as <%mybean.init(pageContext);%>
passing in the pageContext object from the local objects.
you can then use bean methods like
pageContext.getServletContext()
pageContext.getResponse()
pagecontext.getRequest()