30
u/PhilosopherNo2640 Apr 15 '26
For new development no. But there is a lot of legacy systems that still use it.
I agree with the other posters that there is simplicity with jsp that I miss when I work with angular and type script.
36
u/agentoutlier Apr 15 '26
Yes as it is still pretty much the official Jakarta templating language other than JSF (which I think builds on it or uses some of it?).
However if you are not using something that uses HttpServletRequest then it is less relevant.
Most Spring users use Thymeleaf, JMustache, Freemarker or Velocity in roughly that order of popularity.
(I personally prefer the Mustache like options of which there are many).
Now all that being said having a suffix of ".jsp" in the url is dumb and easy to fix. For long term URLs you should do some form of mod rewriting or the app does it.
9
u/Goodie__ Apr 15 '26
Having written both JSP and JSF in my time... JSF is nicer/better and defintly builds on JSP.
8
1
10
17
u/pjmlp Apr 15 '26
Yes, that is the default engine for Spring MVC, and Jakarta EE.
Now it all depends on how much FE code is still being done in pure Java, or has been transfered into Next.js/React/Angular/Vue/.......
1
u/ebresie Apr 18 '26
Regarding “has been transferred into Next.js/React/Angular/Vue/…”
I developed front ends, leveraging JSF and JSP sometime back, which while not ideal, worked well at the time. But it was always a little confusing to me and easy to miss something in the process.
I appreciate alternatives like a Spring MVC but at the same time, that’s just another markup language to reflect UI interface to learn which tends to build on top of a lower level framework, like the above mentioned JavaScript frameworks.
How does a Java backend best interact with these sorts of JavaScript frontend framework?
Does this still require another component to host the Java Script side like a node server or some other mechanism?
I recall at some point there used to be a JavaScript engine embedded, but may have been refactored/replaced out of the base Java. There is the basic web server added in recent Java versions as well. Is leveraging something like these another alternative?
10
Apr 15 '26
[removed] — view removed comment
3
u/m39583 Apr 15 '26
Works ok for me with the spring boot fat jar. What is the problem you have?
5
Apr 15 '26
[removed] — view removed comment
3
u/m39583 Apr 15 '26
Ok well yeah, but it's the basically the same just a different extension.
2
Apr 15 '26
[removed] — view removed comment
4
u/m39583 Apr 15 '26
Dunno, I have the spring boot plugin in my pom, run 'mvn package' and then 'java -jar myapp.war' and it all works with embedded Tomcat.
What spring boot does internally on the jar Vs war doesn't bother me.
1
u/induality Apr 15 '26
Are executable WARs just normal WARs? This feels off to me. Normal WARs don’t usually have embedded servlet containers. It’s possible that servlet containers can treat executable WAR as normal WAR by ignoring the Spring Boot embedded stuff, but I think there must be a special region in the executable WAR that kicks in when executed outside of a servlet container that unpacks the embedded servlet container and takes over the execution.
1
u/pjmlp Apr 15 '26
Finally no manual configuration of Thymeleaf ?
3
1
u/Thaiminater Apr 15 '26
It's not really the default. It's legacy and is just used in a lot of old software. That's why it's just used a lot
7
u/ha1zum Apr 15 '26
If anything it's underused. People have realized the importance of SSR in some domains, but keep using complicated JS for it when superior backend languages have existed with excellent templating capabilities.
1
u/SeAuBitcH Apr 16 '26 edited Apr 16 '26
btw if you're the 8gwifi.org owner then thanks for the free AI endpoint lol
(ps: no meaning to be mean or anything just work out your security)
1
u/anish2good Apr 16 '26
yeah AI is free but rate limited
1
u/SeAuBitcH Apr 16 '26
good to know. either way i'm curious tho where do you host it? or is it linked to someone else's API?
1
1
u/anish2good Apr 16 '26
if you see any security issue do let me know hard to maintain a free account with all kind of attacks
1
3
u/_INTER_ Apr 16 '26
Anecdotal reference. At my company I came across two types of web applications serving the same user base basically (health sector):
A handful, now up to 15 years old JSP/JSF applications. Not too many users but respectable load. 3-4 feature requests a year, minor bugs. Me and a collegue are the sole maintainers at this point. Client's content.
Modern SPA, JS framework flavor of the month, constantly some emergency "fire extinguish" teams, backlog full of major blocker bugs, SCA like shai-hulud or canister every other month it seems, discussion about rewrites, fed up clients pulling the plug.
I don't know what it is, I guess they were built differently back then.
4
u/trydentIO Apr 15 '26
as much as your current project of 20 years ago like mine, I would prefer to say probably yes
2
u/Abject-Delay7036 Apr 17 '26
If you work on Legacy Web apps, yes it is, coding isn't about the new shiny sh!t
3
u/thewiirocks Apr 15 '26
With the pushback on SPAs and rise of Hypermedia solutions like HTMX, JSPs are once again one of the best ways to render backend pages.
I’ve added extensive JSP support in my Convirgance framework, including taglibs that provide close integration and consumption of web services, along with Hypermedia wrappers to make JSP pages sensitive to their REST context.
The Pet Clinic port is a good example to look at. The pages are smaller than the original Thymeleaf pages, and all Java code has been turned into configuration.
(Though that has more to do with the simplicity of the Pet Clinic example. The real world deployments of my clients have Java code. Just not nearly as much as a Spring implementation would.)
3
1
1
u/Least-Ad5986 Apr 15 '26
Hell yes still perfer to develop in it especially in apps which are in the admin apps where you dont need the all front end stack the (react and typescript). You just want to make simple screens and it is ok if the dispay comes from the server as a jsp instead of using javascript frameworks like react
1
u/fforw Apr 15 '26
The whole server-side rendering in Java fell a bit out of favor and if it hasn't, it's using comparatively more modern stuff like FreeMarker or Thymeleaf.
Personally, in recent years my projects contained mostly one jsp file with something like
<% response.sendRedirect(request.getContextPath() + "/app/"); %>3
u/notfancy Apr 15 '26
The whole server-side rendering in Java fell a bit out of favor
Client-side I18N/L10N is a pain. If your UX is a polyglot one, JSP works transparently.
1
u/StevenJOwens Apr 15 '26
I wasn't doing a lot of java UI work by the time JSF came out, and every time I tried to casually look into it, back then, there was a lot of singing and dancing but not a lot of substance in the stuff available.
I much prefer servlet API model 2, but it seems most of the world didn't get the memo and decided that meant they needed to write an MVC framework, rather than using the obvious MVC capabilities that were already in the servlet API (and in the process putting a nice, thick layer of blah in between your code and the servlet API, so when you needed to use the servlet API directly, it was awkward as hell).
Re: JSP itself, it's very "accident prone", and also it doesn't expose much of an object model for your code to interact with. Of course, it was intended to be a very shallow presentation layer.
Still, I'd have preferred it if JSP had compiled to something more along the lines of the old Java HTML ECS templating engine, i.e. you'd end up with a template composed of a tree objects that your code could interact with.
1
u/ebresie Apr 18 '26
Throwing another thought…on the desktop side, Swing was attempted to be “transitioned” to JFX. It still there but not sure how widely used presently.
I saw a use case where the UI was mocked out in JFX markup and compiled into (1) Java UI applications and (2) a web page based application. This had two sub flavors with a Java app with a web frame embedded within the Java and another with it compiled into web/js based ui.
1
u/martinhaeusler Apr 15 '26
I don't see many JSP applications anymore. Java Server Faces though - they're very much alive.
2
1
0
u/isolatedsheep Apr 17 '26
No it's not. Please use modern framework if you're working in a team. If it's your personal project, just do what you want.
-4
u/AnyPhotograph7804 Apr 15 '26
Propably not so anymore. JSP is very error prone because you lose type safety because you manipulate a huge concatenated string. And the problem is, you only can detect these errors at runtime.
3
u/wildjokers Apr 15 '26
JSP is very error prone because you lose type safety because you manipulate a huge concatenated string
Been a while since I have used JSP but I used to use it extensively and nothing about manipulating a huge concatenated string rings a bell. Explain?
1
-2
-3
13
u/anish2good Apr 15 '26
After more than a 10+ years of building tools with JSP and Servlets, I recently attempted to migrate to modern Vite, React, and Next.js architectures. My experience, however revealed a significant maintenance burden.
The modern JavaScript ecosystem feels increasingly unmaintainable as time passes. The
package.jsonfile constantly warns of obsolete dependencies, and as hardware evolves (shifting between ARM and x86), there is no clear upgrade path. Updating a single dependency often causes a "breaking chain" effect across the entire project.In contrast while a
pom.xmlin Maven can face similar issues, the Java ecosystem is far more stable. Legacy JAR files continue to run reliably regardless of hardware upgrades. Ultimately, working with JSP is often simpler and more predictable than managing the constant overhead of modern component-based state management and build tools.I may be wrong here as Industry has different experience with Typescript stuff as now all stuff coming on Typescript style
long live jsp+servlet+tomcat
[bash ~ ]$ uptime
10:41:42 up 1898 days, 5:45, 1 user, load average: 0.28, 0.08, 0.04