here is my main question:
What is the most common way that Java is used in web development?

The reason I ask:
I am currently in the process of finding my first internship. Every employer has a separate set of languages, technologies and acronyms they want their candidates to know.

  • In school I did well with Java.
  • As a hobby and interest I have developed a handful of web pages widgets, scripts, etc.

My university emphasized Java, C and theory. My hobbies emphasize HTML, PHP, JavaScript, CSS, and a little jQuery, etc.

I can't learn a dozen different technologies to satisfy most prospective employers (in what is left of the summer). I think my best bet is combine my skills with Java and my interests in web development. That brings me back to my original question: What is the most common way that Java is used in web development?


All Java web stuff* ultimately uses servlets under the hood...

My advice would be to learn core Java, HTTP, and the Servlet API inside out. Once you can demonstrate that you have this low-level knowledge, everything else builds on top of that. For an internship (or indeed, even a graduate/junior role - which caters to a learning curve and where hitting the ground running with a particular framework isn't expected) these should be sufficient.

(*Note: Java Applets are the exception, they're a client side way to use Java for web development. But these aren't popular anymore. And even if you come across a job where they're used, they're not complicated to learn from basic core Java knowledge.)

  • +1 - If you've got Java, HTTP and Servlets covered have a look at JSTL and maybe one of the popular frameworks such as Spring MVC or Struts. – Qwerky Jun 22 '11 at 11:42

The predominant use of Java in web development is as the server-side host for dynamic web pages, similar to PHP or ASP. The technology is called Java Server Pages or JSP, and relies on "servlets", each of which is the "code-behind" of a particular webpage. The main solution stack for JSP is Apache Tomcat, run on Windows or Linux, usually with a MySQL DBMS. It would behoove you to learn about all of these technologies, and how to architect an entire "solution provider" from the ground up; except for Windows, these are all open-source, and free to download.

Java's original use in web pages was as client-side "applets" that are embedded into a section of a web page in the browser, and run in a tightly-controlled memory "sandbox" provided by the browser and hooked into the JRE via a browser plug-in. Much of the market for these embedded interactive applets has been subsumed by Flash, which requires less programming knowledge to get something off the ground, and is presumed by webmasters and admins to be "safer" than Java applets. However, Java is still very prevalent in online games and applets which require significant code muscle.

  • scripting host for dynamic web pages - wtf does this mean? Java isn't scripted. Also JSPs don't tend to contain any actual java, in fact this is strongly discouraged in favour of JSTL. Java's role in the web is all about server side processing based on Servlets. – Qwerky Jun 22 '11 at 11:40

The most common way to write Java web-server programming is by using the Spring Framework and maybe with Spring MVC.

But a popular runner-up is Play Framework - a web framework that is inspired from Ruby on Rails and has a very short development cycle - just save your source code and update your web browser. I can recommend this web framework for private projects, but most jobs are still by using Spring Framework. You can also use Play Framework with the Scala programming language.

Another thing that is good to know and common in the Java server world is Hibernate - used as a layer between your application and the database.


You mentioned knowing PHP already, take a look at building web applications using the Struts MVC Framework. It incorporates Java Server Pages (JSP) as @KethS mentioned. JSPs use a syntax similar to PHP to dynamically generate HTML and client-side code, but they integrate with server-side java classes which handle business logic and data access. You might also look at Groovy, Grails and ColdFusion which are also Java based web application frameworks.

  • which is most popular of Groovy, Grails and ColdFusion? – John R Jun 22 '11 at 0:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.