Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 66610
161
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: 1867
238
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: 66610
161
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!