The context is a container like a session, only that it's valid for the
lifetime of the tomcat process and is accessible by all webpages.
In JSP you refer to it as the "application"
You could say in your Servlet:
-----------------------------------------
public class TestServlet extends HttpServlet {
ServletContext context = null;
public void init (ServletConfig config) {
context = config.getServletContext();
}
public void doPost (HttpServletRequest request, HttpServletResponse
response) {
String parameter = (String) context.getAttribute("parameter_name");
if (parameter==null) {
parameter = "Some standard value for the parameter"
context.setAttribute("parameter_name", parameter);
}
}
}
-----------------------------------------
Now, in your JSP, you should be able to access the parameter as a bean with
scope = "application"
Hope there are no typos, and it helps, this could be one way to solve your
problem.
Christof
----- Original Message -----
From: catalin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 27, 2001 9:01 AM
Subject: communicating between 2 diffrent sessions
> Hello,
>
> I have 2 apps (one in "/webapps/myapp1"-with jsp and other
> "webapps/root/myapp2"-with servlets) on a "jakarta-tomcat-3.3-m4" on a
win98 OS.
> My problem is that I need parameters that are in session of myapp2 to
> transmmit in session of myapp1.
> Can I do that?
> It is possible to set the same session for both apps?
> Thanks!
>
>
>
> --
> Best regards,
> catalin mailto:[EMAIL PROTECTED]
>