*
The moose likes JDBC and the fly likes totally stuck Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "totally stuck" Watch "totally stuck" New topic
Author

totally stuck

Dillon Millsap
Greenhorn

Joined: Aug 01, 2011
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60781
    
  65

Welcome to the Ranch.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

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

Joined: Aug 01, 2011
Posts: 4
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

Joined: Jan 10, 2002
Posts: 60781
    
  65

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

    Joined: Aug 01, 2011
    Posts: 4
    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
    Bartender

    Joined: Oct 14, 2005
    Posts: 18541
        
        8

    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: totally stuck
     
    Similar Threads
    Invoking functions in Javascript
    Dynamic Element Function Parameter
    change password
    Function call doubt
    session problem