• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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
 
Marshal
Posts: 67257
170
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.
 
Saloon Keeper
Posts: 2508
321
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
Marshal
Posts: 67257
170
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.
 
This is my favorite show. And this is my favorite tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!