• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Whats wrong with that code?  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! Im using netbeans! I need to make a form (html5) where people can type name, email and phone number. Call a Servlet (POST) Save the data in Arraylist and if the Servlet is called directly (GET) it must display a table with the informations that were typed.

My codes:
HTML


and Servlet:



In this part of the code an error is showing up:



the error says incompatible types: Object cannot be converted to ProcessForm.People
And when i executed the program, typed the informations and sended, nothing came up.
 
Nate Lewis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the List to List<People> and the mistake was fixed but, nothing shows up when i executed the program
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a View Source at the browser to see what it thinks it is getting.

Any reason you are not using JSP for the views? (Let me guess: homework assignment?)
 
Nate Lewis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Do a View Source at the browser to see what it thinks it is getting.

Any reason you are not using JSP for the views? (Let me guess: homework assignment?)



Yes, it is for homework! Nothing looks wrong now that i changed the List to List <people> but the page goes blank when i send the informations.
 
Bartender
Posts: 2038
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nate Lewis wrote:... the page goes blank when i send the informations.


The page is blank because you are not sending content back to the browser.

The out in out.println(saida.toString()); is System.out.  You probably want to use ServletResponse.html#getWriter
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you do a view source at the browser? It would have shown you that nothing was getting returned in the response.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!