Can we use "Collection abc" as the second parameter in setAttribute()????
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jais_varghese
Posted On:   Friday, February 24, 2006 08:40 AM

The code i wrote in my Servlet is the following:


StatusLocalHome status= initialController();
try {
Collection stati = status.findAllStatus();
} catch (FinderException e1) {
// TODO Auto-generated catch block
throw new ServletException(e1);
}
session.setAttribute("ALLE_STATI", stati);

But in the last line its showing one error that stati cannot be resolved:-(.Can anyone Help me???

With regards,
Jais

Re: Can we use "Collection abc" as the second parameter in setAttribute()????

Posted By:   WarnerJan_Veldhuis  
Posted On:   Friday, February 24, 2006 08:53 AM

The scope of stati is the try{...} block. That's why it cannot be found outside the try-block... Move the session.setAttribute(...) inside the try-block, or declare the Collection outside the try-block.
About | Sitemap | Contact