Help validating form server-side then posting to an external URL

F

flo

Hopefully this will be a very easy question for any of you to answer.
I'm new to JSP and would like to do some server-side validation on an
HTML form before posting the information to an external CRM database.
We are already doing client-side validation, but are finding that some
users have disabled javascript and submitting blank forms -- not good.

I aslo have a question out to tech support for the CRM, with no help so
far.

For some reason, this task is turning out to be a bigger headache then
it should be. Any suggestions or advice? How can I validate via
server-side code and submit the form to this external URL?

Thanks in advance!
 
G

Guest

Flo--
For simple web applications, you can probably manage to just have a
validate() function in your servlet that takes the HttpServletRequest
object and does your validation manually.

For anything larger than a few pages and a few forms, I'd suggest using
the Jarkarta Commons Validator
(http://jakarta.apache.org/commons/validator/). It'll take a little
longer to set up, but it'll save you time and headaches later on.
Basically, you create an XML file with rules like
<rule>
<parameter name="client_age" type="numeric" min="0"/>
<parameter name="client_name" required="true"/>
</rule>

I just made that actual <rule> up, it's something like that though.
Give it a shot.


-Mike
 
B

Bernd Maierhofer \(dato\)

Additionally you may want to have a look at the STRUTS framework which does
client side validation as well as server side vaildation.

hth Bernd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top