OK!!
My servlet works.
The problem was in method getPlace that was returning a Place instead a List.
But i still have the JSP problem: NullPointerException.
It seams that servlet cannot pass the List to the JSP.
In Servlet I have:

protected void doGet(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
                // TODO Auto-generated method stub
                
                //      HttpSession session = request.getSession(false);
                
                
                
                // Calls EJB
                com.samples.TestDataSource test = null;
                try{
                        com.samples.TestDataSourceHome home = 
com.samples.TestDataSourceUtil.getHome();
                        test = home.create();
                           
                }catch(javax.ejb.CreateException createException) {
                    System.out.println("CreateException - Couldn't create 
TestDataSource bean."+ createException.getMessage());
                }catch(Exception e) {
                           e.printStackTrace();
                }// test is an EJBObject
// Invoca o método disponivél na interface remota do EJB
                java.util.List result = test.getPlace();
        request.setAttribute("nameAtt",  result);
                        
         try{   
        request.getRequestDispatcher("/testServ.jsp").forward(request, 
response);
        }catch(ServletException se){
                System.out.println("Erro no Dispatcher");
        } 
                
        }       


protected void doPost(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
                // TODO Auto-generated method stub
                
                doGet(request, response);

        }       

In JSP I have:
<% 
java.util.List result = (java.util.List) request.getAttribute("nameAtt");


    for (java.util.Iterator iter = result.iterator(); iter.hasNext();)
  {      com.samples.model.Place place = (com.samples.model.Place) iter.next(); 
     
  out.println("Sitio: " + place.getName() );    }
 

%>

What is wrong??

Thankx, 
Cláudia

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3913962#3913962

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3913962


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to