DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22743>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22743

A JSTL EL Validator rule would make a lot of sense.

           Summary: A JSTL EL Validator rule would make a lot of sense.
           Product: Struts
           Version: Unknown
          Platform: All
               URL: http://www.rickhightower.com/CustomRule.zip
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Validator Framework
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


A JSTL EL Validator rule would make a lot of sense.

I believe this approach has several advantages over requiredif and 
validatewhen. I call this new rule validatejstlel (Validate JSTL EL).

 
JSTL makes a lot of sense for the follwing reasons:


1) EASY TO LEARN
The first advantage of this approach is it is easy to learn since developers 
know JSTL EL already. JSTL EL is easy to learn and you have to learn it for JSP 
2.0 anyway. In fact, developers should be using JSTL tags in place of
logic:* tags already.


2) ACCESS TO PAGE CONTEXT 
The nice thing about this rule is that it has access to the complete 
pageContext (Headers, Request Parameters, Session, the whole thing) name space 
like any JSTL tag. (more on this trick later).

Since it uses JSTL EL you can make your expressions as complex as need be, 
e.g., you can check to see if one date is before another or if a string starts 
with a certain substring. It is very powerful, and yet very easy to learn and 
use.

3) VERY LITTLE CODE
This rule was very easy to implement. It relies on the Jakarta JSTL EL 
implementation. Struts relies on JSP and Servlets and JSP will be using JSTL so 
this rule is a natural fit. (Less code to add means less code to maintain....)

I've received some feedback from a few struts users (clients and peers). They 
like the idea of JSTL EL validator rule. It just makes so more sense and solves 
the problem of doing validation that involves relationships between form 
fields. This is a hole in the validator framework that gets filled quite nicely 
by validatejstlel. The beauty of this is it is so small.


Here is the war file.... 
http://www.rickhightower.com/CustomRule.war

Here is the src....
http://www.rickhightower.com/CustomRule.zip

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to