> for instance, I have the following in config.xml: > > <mailet match="xxx" class="yyy" onMailetException="ignore" yo="123"> > <nn>12</nn> > </mailet> > > > so... > > does mailet or processor care of "onMailetException" ? if processor, > so it is general thing and should have been documented, I haven't found > anything in my documentation for James 2.2.
Processor. Basically the processor calls the service method on the mailet to service a mail. The mailet can deal with any exceptions internally, or can throw them. If it does throw an exception, then the processor will just catch it and ignore it if onMailetException="ignore", otherwise it will handle it. > > does mailet have yo="123" passed to it ? or it is totally to processor ? Processor i believe. The mailet only sees what is inside of the mailet tag. > "<nn>12</nn>" is passed to mailet and processor knows nothing is it > correct or not. right ? <nn>12</nn> is passed straight to the mailet. When the processor initialises the mailet, it passes it anything inside the mailet tags as it's config. > > > >> 3) I tried to pass really weird parameters to mailets, like > yo="123", but > >> mailets say nothing about it. I found this really bad. Because I want > >> mailet to complain when I mis-type something. I don't want them to > >> silently ignore mis-typed parameters. How can it be achived ? > > > > Write code. Mailets check for the parameters they know, and don't care > > I meant attributes. It will complain if any of the things the processor needs are wrong eg. class If you want your mailet to complain, then write code to check the config in the initialisation of the mailet. > > about others, which is often a good thing, since not all > parameters may be > > intended for the mailet. Some could be meta-information for > the container. > > This is consistent with other container managed components, > such as Servlets > > and Portlets. > > How those is connected to Servlets and Portlets ? Can You give some > examples ? we are writing portal, so our developers write code in Java, > that's why I chose James for smtp/pop3 server. But since there'll > be other > things in Java, I'd like to know how mailets can interoperate with > Servlets and Portlets. > There is no relationship between mailets and servlets/portlets. Noel was pointing out that mailets are a bit like servlets in the structure of the overall system: Servlets run inside a servlet container, and they service http requests, when the container calls a service method (eg doGet). Mailets run inside a mailet container (eg. processor), and they service mail objects, at the request of the container. There is a similar lifecycle - init is called when started, and the the same servlet/mailet is used to service all requests. Ok, so servlets actually have a more complex lifecycle, but that's off topic. Daniel. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
