views:

408

answers:

2

I am very new to jsp and google appengine , but still I can do something if I get some basic idea , I wanna create an user registration form with fields like name, user id , password, confirm password, etc,. using google appengine datastore feature. and I wanna retrieve user information . Please help me ..

Thanks in advance.

Thanks for the replies, I need to get some information from user and I want to store it in database, and I will use that information for my application. How can I do that?

A: 

App Engine supports logging in already, using Google Accounts. If you're trying to design your own login system, my advice is, don't. It's tough and you will invariably mess it up. Use the built-in login system, or OpenID (built-in support for which is on App Engine's roadmap).

Now, if your question is how to store additional data related to a user (name, address, birthdate), the basic design would be to have a persistence-capable class called something like UserInfo whose key is a User, with other fields for name, address, etc.

Jason Hall
+1  A: 

Google App Engine provides you with Google Account authentication built-in so if your users have Google accounts you can authenticate them with your application. Once logged in your app has access to there email address (to send them messages) and you don't have to worry about building your own secure account creation and login system.

Google Users Tutorial (Java)

http://code.google.com/appengine/docs/java/users/overview.html

App Engine applications can authenticate users with Google Accounts. An application can detect whether the current user has signed in with a Google Account, and can redirect the user to the Google Accounts sign-in page to sign in or create a new account. While a user is signed in to the application, the app can access the user's email address. The app can also detect whether the current user is an administrator, making it easy to implement admin-only areas of the app.

There are also projects that let you use OpenID to authenticate users on Google Appengine: http://code.google.com/p/dyuproject/

Dougnukem
Okay, I agree with you, I can use google account authentication , actually, I need to get some data from an user for my application. How can I do that?
srivigneshwar
Well if you just need to show them a form that they can enter data, and you want to associate it with their account in the persistent Data store look at the "Using Datastore" example, it shows how you can store data from a user and retrieve it.http://code.google.com/appengine/docs/java/gettingstarted/usingdatastore.html
Dougnukem
See my answer about creating a `UserInfo` class to store the user's data. To create a form for the user to input their info, see this example code for writing a guestbook: http://code.google.com/appengine/docs/java/gettingstarted/usingjsps.html -- Just replace the `Greeting` class in the example with your `UserInfo` class.
Jason Hall
Thank you Dougnukem and Jason for your ideas :)
srivigneshwar