This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 67199
169
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: 2278
290
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: 67199
169
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.
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!