sultan aljahwary
sultan aljahwary

Reputation: 39

Firebase Backend With Java web application

I want to use firebase with Java web application using the full potential of java web like faces, Servlets

so lets say I want to register a user and the faclet will create an object of entered data and sends it to a servlet that will run some validation, then how can I add him to firebase from the servlet (Of course using JavaScript but how)?

Upvotes: 1

Views: 4029

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598797

You seem confused about the difference between Java and JavaScript. If you build a web app using Java on the server, you have two types of code that can run:

  1. You have the Java code of your servlet, which run on the server.
  2. You have JavaScript code, which runs in the user's browser.

If you need to access Firebase products from the servlet, you do so using the Firebase Admin SDK for Java. The documentation contains a section on creating a user from there.

If you need to access Firebase products from the browser, you do so using the Firebase Web SDK. The documentation for that also contains a section on creating a user.

There is no single right-or-wrong way to create a user. You will have to make up your mind where you want user creation to happen.

That said, since you're new to this, I recommend foregoing the Java server for a moment and first get started with just client-side Firebase. For a quick start, I recommend taking the Firebase codelab for web developers.

Upvotes: 5

Related Questions