error handling

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

error handling

Dressler, Erik(externe MA)

hello, everybody

i have really no idea how error handling in veloctiy works!

for example:

i have a form, in which the user can make entries for a database. if the
user makes an entry, which is not conform to the database-type, an
errorscreen should be displayed. i know that there is an Error.vm. i have an
Error.vm in my template/screens-directory. but the Error.vm was not
displayed until now!

i searched the web, but i found nothing, which helped me... :(

please help me!

greetz, erik
 
*  *  *  *  *  *  D I S C L A I M E R  *  *  *  *  *  *  *
 
This message is confidential and intended for the named addressee(s) only.
If you are not the intended recipient, please contact the sender by E-Mail
return and then delete this message from your system. You should not copy
or use it or disclose its contents to any other person.
 
If any part of this message is illegible or if you suspect that the message
may have been intercepted or amended, please contact the sender.
Dresdner Bank Luxembourg S.A. cannot accept any responsibility for the
accuracy or completeness of this message without further investigation.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: error handling

Edmund Urbani
Dressler,Erik(externe MA) wrote:

>hello, everybody
>
>i have really no idea how error handling in veloctiy works!
>
>for example:
>
>i have a form, in which the user can make entries for a database. if the
>user makes an entry, which is not conform to the database-type, an
>errorscreen should be displayed. i know that there is an Error.vm. i have an
>Error.vm in my template/screens-directory. but the Error.vm was not
>displayed until now!
>
>i searched the web, but i found nothing, which helped me... :(
>
>please help me!
>
>greetz, erik
>  
>
hmm. template/screens? Error.vm? looks like you are using turbine.
if so, i recommend posting this on the turbine list instead, since
turbine does most of the error handling for you. velocity knows nothing
about forms or database types or any such thing. it's just a generic
templating engine. so it merely renders the html template(s), that
is/are returned to the client and then it's done. it may throw/log
errors when the template syntax is invalid or when some error occurs
while processing the template, but these kinds of errors are not related
to verifying user input.
what you want is probably some checks performed in your turbine action
processing that request - or maybe some validation by intake, in case
you use that. actions can redirect to a different page (eg. Error.vm).
you might also want to put some javascript into the html page with to
form to validate input fields before they are submitted (mind you, this
sort of check can be done IN ADDITION to server-side checks, however it
can't replace them).

cheers,
 Edmund

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]