There is no any "<% ... %>" in the audit jsp. Below is one simple example of such file:

<%@ include file="/common/all.include.jsp" %>

<c:if test="${ audit != null }" >
        <log:info msg="${ audit.event } : ${ audit.userName }" />

<security:login loginName="${ audit.userName }" event="$ { audit.event }" sessionId="${ audit.sessionId }" />
</c:if>


"audit" is a hashtable object in session. it has all information needed ( "event" - login|logout| .... , "userName", "sessionId" ). <security:login> is a custom tag which does not have any <% ... %> in it either just some <sql:...> tags.

This is actually what made me go this way. With ability to define new tags using JSP (taglib) it is truly possible to have "java-less" JSP application. Audit is the only spot which required some java coding, with this JSPAudit valve I can code it once and then delegate all actual audit business logic to JSP writer.


On Oct 9, 2007, at 5:54 PM, Christopher Schultz wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrei,

Andrei Tchijov wrote:
I would love to let JSP application developers to stay in one language environment (JSP). And as soon as pretty much all but auditing could be
done in JSP (especially with JSTL), I feel that it will be nice (and
appropriate) to let people to code audit functionality using JSP as
well.

I don't believe this is an appropriate use of JSP technology; I believe it to be an abuse of it. Are you trying to use JSP's ability to produce
textual output, or do you just have regular Java code inside <% and %>
tags? If that's the case, then your developers aren't writing JSP:
they're writing Java and wrapping it in JSP.

And besides that one issue, this idea works just fine.

How do you get request and response objects for other events so that the
JSP has access to them?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHC/h99CaO5/Lv0PARAsvWAJ9A5ME1qG7mQerIkyK9sshcgSWyvACfcUY8
6/0EMnwlVR6huHi/0agEBn8=
=1qrf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to