Hello, I can build websites (medium complexity). Now I am learning to write web applications on java, in parallel I study spring. Everything is good, but I do not understand how this happens in life.

Suppose we put it on the layout, got html, css and js files. There we used the form , sent to the servlet, everything is clear. But can we only work with jsp? How is the design that we put on there? That is, we just copy our htm and remake it under jsp, connecting our css and js there already?

I think this is somehow more beautifully done. For example, after authorization, we always show under what login we are. Where is it done? Where we put this login value in.

Sorry if it is not completely described.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants Pavel Mayorov , Akina , user194374, Denis Bubnov , 10 Feb '17 at 7:04 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Can you formulate the question more specifically? - Nofate
  • 2
    Think of JSP as a templating engine. If you need to show the user name after logging in, then you need to pass an object containing the user name and the login flag from the servlet to the JSP, and output the user name to the JSP if there is a flag. It is possible without a servlet, then the code will have to be written in the JSP itself, but this is not good. Well, in general: who needs JSP in 2017? ) - Nofate
  • @Nofate I somehow did not understand - what do you mean, who needs servlets in 2017? Of course, I haven’t written servlets for a long time, but let me ask what is happening there in Java web development? - Barmaley
  • @Barmaley, typo, not "servlets", but "JSP". However, servlets are a big question, like the whole EE. Now, Spring Boot / Dropwizard, or even micro-framework, templating to taste (the same Thymeleaf) and Angular / React on the frontend rules the ball in web java. It is still under the hood, but a generation will soon grow up that hasn't written its servlets with its hands) - Nofate

1 answer 1

Regarding registration https://www.mkyong.com/tutorials/spring-security-tutorials/, here are a lot of examples of how to implement.

http://javastudy.ru/frameworks/spring/spring-mvc/ is a good place to get answers to your questions.

  • Although the link can find the answer to the question, it is better to provide an answer extract here, and the link as a source. Link references may become invalid in case of changing the page to which the link is given. However, you can transfer the text of the answer in the comments to the question . - ߊߚߤߘ