validation function problem
<p>Hello 
I am not able to get the correct validation.I think there is some error in this code so can anyone please help me solving this problem.</p>

<pre><code> public static boolean validateFee(String value) {

        boolean isvalid = true;
        try {
            int fee = 0;
            if (value != null &amp;&amp; !value.isEmpty()) {
                fee = Integer.parseInt(value);
            }
        } catch (NumberFormatException ne) {
            // ne.printStackTrace();
            isvalid = false;
            return isvalid;

        }
        return isvalid;
    }
}
</code></pre>

<p>I am actaully using this code for validation of fee in which i m using a regex as [0-9]+.
This code i m using it in a common function.Actually validation call is done in the servlet as follows:</p>

<pre><code>private Boolean validateFee(HttpSession session, PropertiesHandler props, String number) {
    Boolean isvalid = true;
    HashMap hashMap = new LinkedHashMap();
    number = ApplicationConstants.FEE_PATTERN;
    if (!Validation.validateFee(number)) {
        isvalid = false;
        hashMap.put("time", props.getText("error.fee.invalid.type"));
    }
    session.setAttribute("errorMessage", hashMap);
    System.out.println("Map size " + hashMap.size());
    logger.info("Exit validateTIme"); return isvalid;
} 
</code></pre>

<p>I think there is no error in that but i have a doubt in this function.I am facing a problem like if i give number to the fee also its taking validation.please help me out</p>
