0
In my java application I have a declosed object like Extrair extrair = new Extrair();
And I use this object and its attributes for my Serrvlet. But I need to pass this object to .jsp.
In jsp I use extrair = request.getAttribute();
, only that the request method returns an Object and I am assigning an Object to an Extract.
How can I fix this?
Maybe I didn’t quite understand the question, but it wouldn’t simply be the case to make a cast?
extrair = (Extrair)request.getAttribute();
– mgibsonbr
He won’t accept, it was the first thing I tried. @mgibsonbr
– Pacíficão
Does not accept syntax, or does not work (i.e. gives a
ClassCastException
)? I ask because as far as I know there is nothing in JSP that prevents a code inline to make a cast... If it is the second case, check if the way you are adding this object in the request (I believe I sawsetAttribute
) is correct. By the way, no parameter is missing in thegetAttribute
?– mgibsonbr