You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Henri Yandell <ba...@generationjava.com> on 2003/04/23 07:36:53 UTC

easy validation framework

I'm looking for a validation framework for JSP designers. I want the
designer to be able to do a tag some-what like:

<form ...>
  <val:next>some-url</val:next>
  <val:errors/>
  <val:input type="text" name="survey5email" .. />
</form>

The form would be submitted to a jsp file [or Servlet, though I prefer
submitting to a JSP as it's more easily installed and fits the
page-metaphor] along with a hidden tag which tells it which page to go if
validation passes.

Now, this is pretty much struts, but for JSP designers and not Java
coders. I don't want to spend time creating Forms or Actions, though
plugging Validators in is good.

It seems to me that what I want to do is tie a HttpServletRequest behind a
DynaBean, through that into a default Action [or pull the code from the
Struts controller out into a JSP].

Before I leap into this, do all the steps in this seem doable with Struts
as is, or do I need to pull some bits out of Struts and link them with
Commons Validator to get it all working.

The JSP Designer will be managing a host of Web Designers, so nothing that
isn't very very simple will be workable.

Hen


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


RE: easy validation framework

Posted by Henri Yandell <ba...@generationjava.com>.
Yeah, I have validator downloaded. It works on JavaBeans, but via
BeanUtils so I should be able to use BeanUtils. I also think that I can
create a DynaBean directly from a ServletRequest. So if I were to create
my own taglib, then my system would basically be:

A custom taglib 'validate' which sits on top of Commons Validator and
Commons BeanUtils. It would ship with a Servlet and a re-usable JSP which
would basically wrap the validation handling code, and hidden away would
be an xml tha defines it and hooks up the validators themselves.

However, I suspect that I could do this by just taking Struts, configuring
it slightly oddly, installing one of the taglibs and setting up a
controler servlet somewhere :) Will have to play.

Thanks,

Hen

On Wed, 23 Apr 2003, Andrew Hill wrote:

> Ive not tried using the validator myself so Im not all that familiar with
> it.
> (I gather its actually part of the commons project now - as it can be used
> outside of struts.)
> It lets you define your validations in an xml file rather than having to
> hard code them. Used in conjuction with DynaBeans this might be what your
> after?
>
> http://jakarta.apache.org/struts/userGuide/dev_validator.html
>
> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com]
> Sent: Wednesday, 23 April 2003 13:56
> To: Struts Users Mailing List; andrew.david.hill@gridnode.com
> Subject: RE: easy validation framework
>
>
>
> On Wed, 23 Apr 2003, Andrew Hill wrote:
>
> > "prefer submitting to a JSP"
> > Shame on you! Go wash your keyboard out with soap!
>
> Probably not worth the arguing :) But yes, I don't like servlets for web
> design, it does not fit the page-metaphor and is too complex for web
> designers.
>
> As a Java programmer I like them, as a JSP developer I find them wrong.
>
> > You have looked at the struts validator already I presume?
>
> I'm a bit out of date. Haven't used Struts in anger since an internally
> forked version of 0.3 about 18 months ago. I see various parts of Struts
> in Jakarta Commons and Jakarta Taglibs, and have done some basic recent
> Struts stuff and some JSF reading, but generally I'm rusty.
>
> Struts has all the components I need, but I'm unsure if they are useable
> yet or if I'd have to remove them from Struts and build a separate Taglib.
>
> Hen
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


RE: easy validation framework

Posted by Andrew Hill <an...@gridnode.com>.
Ive not tried using the validator myself so Im not all that familiar with
it.
(I gather its actually part of the commons project now - as it can be used
outside of struts.)
It lets you define your validations in an xml file rather than having to
hard code them. Used in conjuction with DynaBeans this might be what your
after?

http://jakarta.apache.org/struts/userGuide/dev_validator.html

-----Original Message-----
From: Henri Yandell [mailto:bayard@generationjava.com]
Sent: Wednesday, 23 April 2003 13:56
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: RE: easy validation framework



On Wed, 23 Apr 2003, Andrew Hill wrote:

> "prefer submitting to a JSP"
> Shame on you! Go wash your keyboard out with soap!

Probably not worth the arguing :) But yes, I don't like servlets for web
design, it does not fit the page-metaphor and is too complex for web
designers.

As a Java programmer I like them, as a JSP developer I find them wrong.

> You have looked at the struts validator already I presume?

I'm a bit out of date. Haven't used Struts in anger since an internally
forked version of 0.3 about 18 months ago. I see various parts of Struts
in Jakarta Commons and Jakarta Taglibs, and have done some basic recent
Struts stuff and some JSF reading, but generally I'm rusty.

Struts has all the components I need, but I'm unsure if they are useable
yet or if I'd have to remove them from Struts and build a separate Taglib.

Hen



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


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


RE: easy validation framework

Posted by Henri Yandell <ba...@generationjava.com>.
On Wed, 23 Apr 2003, Andrew Hill wrote:

> "prefer submitting to a JSP"
> Shame on you! Go wash your keyboard out with soap!

Probably not worth the arguing :) But yes, I don't like servlets for web
design, it does not fit the page-metaphor and is too complex for web
designers.

As a Java programmer I like them, as a JSP developer I find them wrong.

> You have looked at the struts validator already I presume?

I'm a bit out of date. Haven't used Struts in anger since an internally
forked version of 0.3 about 18 months ago. I see various parts of Struts
in Jakarta Commons and Jakarta Taglibs, and have done some basic recent
Struts stuff and some JSF reading, but generally I'm rusty.

Struts has all the components I need, but I'm unsure if they are useable
yet or if I'd have to remove them from Struts and build a separate Taglib.

Hen



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


RE: easy validation framework

Posted by Andrew Hill <an...@gridnode.com>.
"prefer submitting to a JSP"
Shame on you! Go wash your keyboard out with soap!

You have looked at the struts validator already I presume?

-----Original Message-----
From: Henri Yandell [mailto:bayard@generationjava.com]
Sent: Wednesday, 23 April 2003 13:37
To: struts-user@jakarta.apache.org
Subject: easy validation framework



I'm looking for a validation framework for JSP designers. I want the
designer to be able to do a tag some-what like:

<form ...>
  <val:next>some-url</val:next>
  <val:errors/>
  <val:input type="text" name="survey5email" .. />
</form>

The form would be submitted to a jsp file [or Servlet, though I prefer
submitting to a JSP as it's more easily installed and fits the
page-metaphor] along with a hidden tag which tells it which page to go if
validation passes.

Now, this is pretty much struts, but for JSP designers and not Java
coders. I don't want to spend time creating Forms or Actions, though
plugging Validators in is good.

It seems to me that what I want to do is tie a HttpServletRequest behind a
DynaBean, through that into a default Action [or pull the code from the
Struts controller out into a JSP].

Before I leap into this, do all the steps in this seem doable with Struts
as is, or do I need to pull some bits out of Struts and link them with
Commons Validator to get it all working.

The JSP Designer will be managing a host of Web Designers, so nothing that
isn't very very simple will be workable.

Hen


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

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