Win a copy of Microservices in Action this week in the Web Services 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

totally stuck  RSS feed

 
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...
 
Marshal
Posts: 67165
169
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
Marshal
Posts: 67165
169
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
Marshal
Posts: 67165
169
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?
     
    Sheriff
    Posts: 23885
    50
    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.
     
    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!