Good day!

I had a need to quickly create a simple Java web application that would stupidly give up an html page and a couple of scripts, and moreover, quickly. It seems everything is trivial ... No. Alas, but I am confused in the abundance of java-libraries and platforms.

I apologize right away if questions are asked incorrectly, but I am sure you will understand me. To a person who will be able to give a sensible answer, I will be immensely grateful.

So, if I understand correctly, I need to download jdk. What other libraries do I need? How to run the application? Do I need a glassfish server for this (as I understand it, java ITS it is it)?

Where can I read in Russian tutorial (for zero, like me) on launching a simple java web application?

Thank.

Well, it is necessary to clarify. I do not know java, I have 2 standard, earthly days (or rather, about 4-5 hours in each of them) to write an application that gives the page, and there is no way to study it thoroughly. Please do not waste your time writing answers in the "read manuals" style. What I need is a description of the environment in which the web applications run on java.

  • @Angry, but are you at least in Java (without the web)? At least at the level of writing a console application and building a maven? - Nofate
  • Looking ahead, glassfish, like other Java EE, you do not need. - Nofate

2 answers 2

What I need is a description of the environment in which web applications run on java.

Well, OK. As a rule, the bare minimum is a web server with a servlet container. The most common are Apache Tomcat and Jetty . In the most standard version, a web application is a WAR archive that is deployed to a servlet container. This WAR file contains a web.xml application descriptor describing which servlets to run, your application classes themselves, configuration files and statics (pictures and client js).

A servlet is a special kind of class (inheriting HttpServlet ) that can respond to HTTP requests. The direct implementation of how he will respond, you write.

Since giving HTML manually is not very convenient, we came up with JSP. It's kind of like "HTML with java inserts", reminiscent of php-style development. A JSP page is compiled by the servlet container into a servlet on its own, saving you from the routine.

The above things are minimum minimorum within the specifications of java web applications.

In order to somehow live in the real world, it is usually further deepened either in Java EE or in the Spring Framework. And hung with libraries, template engines, REST-s, web sockets and other.

  • @Angry, how to decide on specifics - write. - Nofate
  • This is what you need. Thank. - Angry
  • one
    start.spring.io and everything, before that put jdk - Mage
  • @Mage, I also thought of throwing this link to the vehicle, but I doubted. Too many things will fall on him at once: maven, spring-ioc, spring mvc, embedded tomcat. And then you could immediately send it to download JHipster for a full stack. - Nofate
  • JHipster is definitely not needed here - Mage

@Angry first you need to learn Java itself, learn the standard JDK, otherwise creating a web app in Java without knowing Java will be like hell. And when you learn, you download yourself a simple Apache Tomcat server, which will "тупо отдавать html страничку и пару скриптов, и при том быстро" here are guides for dummies. Only they are designed for those who somehow know Java.

In general, what do you mean by the word "script"? Js? If you need to give only a couple of unchangeable HTML pages with JS, then you don’t need Java. You take Apache Http Server, he is able to give simple content.

  • one
    I completely agree. Is that the "student personnel department" is already somewhat old-fashioned. Today there are no special reasons to use JSP and XML for the task of the TS. - Nofate
  • Thank you, but you apparently got the impression that I don’t even know what js is) I hurry to assure that I am well acquainted with web development. And to write a backend, move / curve / oblique, but in Java it is a reinforced concrete condition. Thanks for the guide. - Angry