• Coding
  • [Java] How to build a web application or website?

I know php and i know the job of php in the web... but i don't get if Java does the same job or what?
Can somebody please explain how does the Java work for the web i dont get it... i just went to W3schools couldnt find any tutorial... so am confused on what does Java do exactly in the web...

i did some search i found something called "glassfish" no idea what it is tho...

i know HTML,CSS,Javascript,PHP... yet i still dont get if java replace php or replaces html as well or something...
In order to develop Java Web Applications, you will need a web container. A web container hosts Java Servlets that are classes at the lowest possible level of the web container architecture preceded only by the API itself.

The dominant web container today, is Apache's Tomcat, which is used in quite a bit of application servers.

What you need to learn to build a web application:
1- Java
2- JDBC/JPA for database access.
3- Servlets (intermediate, you might get away from using them)
4- Java Server Pages and Java Server Faces
5- Architecture of a Web Archive (.WAR)
6- Deploying to a web container.
7- Ant/Maven (you might get away from using them)

Here's the Java EE's really big index

Good luck.
@xterm

thanks again ^_^
i have a question about java and oracle. thanks to my university professor, i took the database course without learning anything about oracle. In this course we implemented java with an access db. we worked on the same boring project (student registration system). We connected to ODBC and sent queries from JAVA as Strings to Access db. How about oracle? Is it the same strategy but with using a more powerful database? sorry if my post is irrelevant to the main theme of the thread.
MrClass wroteHow about oracle? Is it the same strategy but with using a more powerful database? sorry if my post is irrelevant to the main theme of the thread.
Not only is it relevant, it's a very good question. The core database connectivity library in Java is JDBC. It provides you with accessibility to multiple database vendors through the core api available in (if i recall correctly) java.sql.* - JDBC takes into account the need to access multiple database systems, hence there are database provider drivers for pretty much every database system out-there. What you used is something called a "JDBC ODBC Bridge" which is i believe the way to access an access database (I believe the bridge is available by default). In order to connect to an oracle database, all you need is the JDBC driver which you can find on oracle's website alongside information pertaining to the connection string. After you're done with loading the jdbc driver alongside providing the connection string to the SQLConnection class, everything else is the same, except for the Oracle specific sql constructs.

Here we go: http://www.orafaq.com/wiki/JDBC

Scroll to the Thin Driver sample.
Java and Oracle are two completely different things.

Oracle is a database vendor, the most succesful one in the world. They sell a program that manages and contains your data. It is called the Database


Java can refer to two things: A programming language published by Sun that made everyone dream of absolute portability, or the Java Virtual Machine, a C program that allows the execution of Java Code.

So needless to say, you can access your Oracle Database with many different languages like Java, PHP, Python, C, C++ Perl, C#, ...
At the same time you can store the data of your Java program in any kind of database like Oracle but also Microsoft SQL Server, PostgreSQL, MySQL, Microsoft Access, ...

Java and Oracle are very often used together because:
1) they both provide good solutions for large entreprise application
2) Oracle has recently bought Sun, and is now the publisher of the Java language.
Also, if you're familiar with php, I think you will find JSP very easy, as it's very close to php