Re: Equivalent of servlet filters in Helma

"Maksim Lin for technical support mailling lists" <[email protected]> Tue, 5 Feb 2008 14:07:06 +1100
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
Hi James,

onRequest() method may be what you are after.
It will be called at the start of request processing, though after th
path has been rsolved to a helma object.
However if you were to define it on the HopObject it will be called no
matter what object is matched. So in the HopObject folder, in any .js
file define a function:

function onRequest() {
	//my custom intercept code...
}

This is often used to implement security checks for example.

If however you want to be able to intrcept arbitrary paths and even ones
that don't map to any object you could use the getChildElement(name)
method.
see here for more info:
http://helma.zumbrunn.com/reference/HopObject.html#HopObject.getChildEle
ment

Maks.

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of James Burke
> Sent: Tuesday, 5 February 2008 12:28
> To: [email protected]
> Subject: [Helma-user] Equivalent of servlet filters in Helma
> 
> Is there a way to use servlet filters in Helma? Ideally I 
> want the ability to code the servlet filters using JavaScript 
> in Helma, or something like a servlet filter: something that 
> intercepts request paths, and may do some redirection or 
> changing of the request in some manner before forwarding it 
> to the endpoint. I can use a solution that uses Java if necessary.
> 
> I am new to Helma and still learning, so I apologize if this 
> is covered somewhere. I have not been successful in my search so far.
> 
> Thank you,
> James
> _______________________________________________
> Helma-user mailing list
> [email protected]
> http://helma.org/mailman/listinfo/helma-user
> 
> 
>