Can somebody tell me what I am doing wrong over here,
(Util.parseBoolean((String)request.getAttribute("testVal"), false))
I am getting this error.
java.lang.ClassCastException: java.lang.Boolean incompatible with java.lang.String
If what value I get from the request would do this. Thanks
Util just looks for request value and if it is y or true than sends back boolean value true. but my issue is when it goes to this line its throwing exception saying that error so I am not able to know whats happening
When you get an exception and you don’t understand what’s causing it, a good first step is to isolate exactly where it is happening. There are a lot of things happening in that one line of code, so it’s difficult to know exactly what operation is causing the error.
Seeing the full stack trace of the exception might help, since it would give an idea of where you are in the execution path when the exception occurs.
However, a simple debugging technique is to break that one line with many operations into many lines with fewer operations, and see which line actually generates the exception. In your case this might be something like:
If the cause suggested by Shivan Dragon is correct, then the exception would occur on the second of these three lines.