newbye. setProperty exception bad format. how to handle ?

D

dpr

I use a setProperty with property="*" in a start of my jsp.

But I happen to have a property that is supposed to be an integer which
get initialised with bad data (alphabetic char).

To be clearer:

<jsp:useBean name="mybean" property="*" />

mybean have a property of type int named myProp and the page gets call
with a parameter myProp="abcdef"

This results in a exception displayed in the web browser.

I know I could encapsulate the useBean in a try catch block, or use a
string (instead of an int) and validate it myself.

But what is the usual way to handle this (if there is one) ?

Thanks in advance.
 

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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top