You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by catalin <ca...@quattrosoft.ro> on 2001/09/27 09:01:11 UTC

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:catalin@quattrosoft.ro



Re: communicating between 2 diffrent sessions

Posted by Gang Liu <ga...@21vista.com>.
Hi,
    Is this right?
    In Java API, I found some useful information.
    "There is one context per "web application" per Java Virtual Machine. (A "web application" is a collection of servlets and content installed under a specific subset of the server's URL namespace such as /catalog and possibly installed via a .war file.) "
    I also test it with Tomcat 3.2.3.I create two webapps.one is 'test1',the other is 'test2'.In "test1", there is a javabean with "scope=application".All jsps in "test1" can get the value of the javabean.But got nothing in "test2".
    If I am wrong, please info me.
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<title>
Jsp1
</title>
</head>
<jsp:useBean id="Jsp1BeanId" scope="application" class="eim_domainadmin.Jsp1Bean" />
<jsp:setProperty name="Jsp1BeanId" property="*" />
<body>
<h1>
JBuilder Generated JSP
</h1>
<form method="post">
<br>Enter new value   :  <input name="sample"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value of Bean property is :<jsp:getProperty name="Jsp1BeanId" property="sample" />
</form>
</body>
</html>

Regards

Gang Liu

----- Original Message ----- 
From: "Christof Soehngen" <so...@nts-online.de>
To: "catalin" <ca...@quattrosoft.ro>; <to...@jakarta.apache.org>
Sent: Thursday, September 27, 2001 4:29 PM
Subject: Re: communicating between 2 diffrent sessions


> 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 <ca...@quattrosoft.ro>
> To: <to...@jakarta.apache.org>
> 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:catalin@quattrosoft.ro
> >
> 
> 

Re: How to get rid of timestamp in AccessLogValve ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 27 Sep 2001, Oleksandr Fedorenko wrote:

> Date: Thu, 27 Sep 2001 11:48:48 +0300
> From: Oleksandr Fedorenko <ma...@intercollab.kiev.ua>
> Reply-To: tomcat-user@jakarta.apache.org, afedoren@yahoo.com
> To: tomcat-user@jakarta.apache.org
> Subject: How to get rid of timestamp in AccessLogValve ?
>
> Hi.
>
> Does anybody know how to get rid of timestamp in AccessLogValve ?
>
> Catalina creates access log filename with timestamp every time .
>

It also rolls over to a new file on the first request after midnight, so
you never have to restart Tomcat to switch log files.

There isn't any current configuration switch to turn this off.

> Thanks. Alexander .
>

Craig McClanahan


How to get rid of timestamp in AccessLogValve ?

Posted by Oleksandr Fedorenko <ma...@intercollab.kiev.ua>.
Hi.

Does anybody know how to get rid of timestamp in AccessLogValve ?

Catalina creates access log filename with timestamp every time .

Thanks. Alexander .





Re: communicating between 2 diffrent sessions

Posted by Christof Soehngen <so...@nts-online.de>.
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 <ca...@quattrosoft.ro>
To: <to...@jakarta.apache.org>
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:catalin@quattrosoft.ro
>