• Question about JSP

    From Ralf Schneider@21:1/5 to All on Fri Aug 12 17:10:01 2022
    Dear All,

    one Question I have about JSP files: Are they old fashioned today as some people say or is this only one opinion from many others ?

    I will write web pages with Spring and I don't want to mix JSP files with thymeleaf/html pages.

    Best regards.
    Ralf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From e.d.programmer@gmail.com@21:1/5 to All on Mon Aug 15 12:01:57 2022
    one Question I have about JSP files: Are they old fashioned today as some people say or is this only one opinion from many others ?

    Web apps tend to start with JSP files. I don't know what you mean by old fashioned; it does support a lot of syntax which is currently not recommended.
    If you write clean tags with expression language (EL) and libraries (JSTL), it works fine.
    If you're starting a clean new app, I think you can avoid JSP. JSP files can call other code, other code doesn't do so well calling JSP files, so maybe unavoidable working with an existing app already full of JSPs.

    JSP is all back end. There's a pre-process that turns it into a .java file when the servlet gets a request for it. That Java program runs all back end code first (you can write Java code in a JSP file using scriptlets but there is a better way now). Then
    it kicks off any in-line Javascript code. Then it sends any html code to the front end and loads that. If you want to do back end code before the JSP loads and avoid the scriptlets, you can save the JSP file somewhere other than the default web path,
    catch the requests with a servlet, set pass values using EL, then forward the request to the JSP file.

    It is probably best to avoid JSP files if nothing in the app is forcing the use of them. If you can write them clean, they're basically fancy HTML, but can still be harder to debug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Schneider@21:1/5 to All on Tue Aug 16 08:20:28 2022
    Am Mon, 15 Aug 2022 12:01:57 -0700 (PDT) schrieb e.d.pro...@gmail.com:

    If you're starting a clean new app, I think you can avoid JSP.

    It is probably best to avoid JSP files if nothing in the app is forcing
    the use of them.

    That is what I will do. Thank you for your explanation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=c3=b8j?=@21:1/5 to Ralf Schneider on Tue Aug 16 19:11:58 2022
    On 8/12/2022 1:10 PM, Ralf Schneider wrote:
    one Question I have about JSP files: Are they old fashioned today as some people say or is this only one opinion from many others ?

    I will write web pages with Spring and I don't want to mix JSP files with thymeleaf/html pages.

    JSP is an old technology. But it is also a somewhat foundational
    technology for Java web development. I will claim that all Java
    web developers should know JSP.

    So you should definitely learn JSP. Whether you should use JSP
    for a project will depend on the framework choice.

    DIY framework: I would say go for JSP - it is simple and easy.

    JSF: definitely facelet - JSP is officially obsolete and lots
    of JSF stuff does not work with JSP.

    Spring MVC: different people have different preferences - some
    like JSP - some like Thymeleaf - you pick what you like (or
    you pick what has already been chose if it is an existing
    application).

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)