0

I'm new to Java web development. I have a question specifically about the use of JSP and Servlets. When building a page when should you use these two? I tried building a dynamic web page using only JSP, but the file ends up with a lot of HTML and Java code. Is it possible having a separate HTML file connected to a JSP and Servlet? It is difficult to understand how this all works, but hope you could give a good answer.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Sedrido
  • 23
  • 4
  • Possibly related: [How can I avoid Java code in JSP files, using JSP 2?](https://stackoverflow.com/q/3177733) – Pshemo Dec 10 '20 at 13:27
  • Does this answer your question? [When do you use a JSP and when a Servlet?](https://stackoverflow.com/questions/101579/when-do-you-use-a-jsp-and-when-a-servlet) – Aalexander Dec 10 '20 at 13:27
  • For background: The [`servlets`](https://stackoverflow.com/tags/servlets/info) tag has an overview with some example code - and the [`jsp`](https://stackoverflow.com/tags/jsp/info) tag, also. – andrewJames Dec 10 '20 at 14:01
  • It is probably better to switch to more modern frameworks (that build on servlet). – Mark Rotteveel Dec 10 '20 at 15:54

0 Answers0