You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Manuchehar Khan <ma...@smdi.com> on 2005/02/15 21:53:15 UTC

RE: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses

I am using HttpSessionListener and works fine. But problem is when I
compile my project I have to remove it from web.xml as compilation
fails. I am using JDeveloper .  This is first entry in my web.xml file.

<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
 <listener>
	<listener-class> OLDCSessionListener</listener-class>
</listener>
<listener>
	<listener-class> OLDCSessionAttributeListener</listener-class>
</listener>

Any help will be appreciated.
Thanks


-----Original Message-----
From: Craig McClanahan [mailto:craigmcc@gmail.com] 
Sent: Monday, February 14, 2005 4:43 PM
To: Leon Rosenberg
Cc: Struts Users Mailing List
Subject: [SPAM] - Re: Caching Appliction Level Data? (session listener)
- Email has different SMTP TO: and MIME TO: fields in the email
addresses

HttpSessionBindingListener only works on an attribute itself (so you
can tell when you get added or removd) -- it's been around since
Servlet 2.0.  I was referring to HttpSessionListener (tells you about
session creations and deletions) and HttpSessionAttributeListener
(tells you about attribute add/remove/replace events).

Craig


On Mon, 14 Feb 2005 22:29:07 +0100, Leon Rosenberg
<st...@anotheria.net> wrote:
> >
> > * There are also other listeners that you should
> >   explore which are available in this version -- did
> >   you know, for example, that you can be notified
> >   whenever anyone else in your app adds, removes,
> >   or replaces an application or session scope attribute?
> >   (In Servlet 2.4 you can do this for request scope too.)
> 
> You mean something like:
>         <listener>
>                 <listener-class>
>                 ...presentation.util.SessionObjectPrintln
>                 </listener-class>
>         </listener>
> 
> public class SessionObjectPrintln implements
HttpSessionBindingListener{
> 
>         public void valueBound(HttpSessionBindingEvent e) {
>                 System.out.println("Value bound:"+e.getName()+",
> "+e.getSource());
> 
>         }
> 
>         public void valueUnbound(HttpSessionBindingEvent e) {
>                 System.out.println("Value unbound:"+e.getName()+",
> "+e.getSource());
> 
>         }
> }
> 
> Tried it with resin 3.0.8 and tomcat 5.0.25,28, neither worked :-(
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [SPAM] - Re: Caching Appliction Level Data? (session listener) - Email has different SMTP TO: and MIME TO: fields in the email addresses

Posted by Craig McClanahan <cr...@gmail.com>.
On Tue, 15 Feb 2005 15:53:15 -0500, Manuchehar Khan
<ma...@smdi.com> wrote:

> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

This is the problem ... the <listener> element was added in Servlet
2.3, so you need to use the 2.3 version of the DTD:

    <!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">

Of course, you'll need a 2.3 container to run in as well.

If you only have 2.2, then use a Struts PlugIn instead of
ServletContextListener.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org