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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to