• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

totally stuck

 
Dillon Millsap
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
playgame.jsp


and the GameServlet:


I can not retrieve info from the database that is being created... Can someone help me with this...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to have stuck a lot of Java into the page as JavaScript. Can you spend a bit more time explaining your environment and what you are trying to do?
 
Dillon Millsap
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's currently a web application in Google. Here's the link to the "game": islandtest11.appspot.com/

I'm new to Java and have done tons of searches on trying to learn datastore but it's fairly new and not much out there for it...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64832
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, step 1. Learn the difference between Java and JavaScript. Despite their name, they have nothing at all to do with each other.

Step 2: Learn a bit more about JSP and Servlets. Modern JSP should have no Java code in the JSP. All the Java should be in the servlet controller for the JSP page.

I always recommend that JSP novices read these article to get a good start:
  • The Secret Life of JSPs
  • The Front Man

  •  
    Dillon Millsap
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Okay, so basically everything that is in that function, needs to be in a seperate Servlet.

    So how do I go to the Servlet from the onclick on the button?
     
    Paul Clapham
    Sheriff
    Posts: 21107
    32
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The usual way. Your <form> element should have an action which causes it to send a request to the servlet when the button is clicked. That's the most ordinary way to make an HTML form do something.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic