Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jstl.jar and jstl-api.jar

 
Linwood Hayes
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In some maven web projects, I see different jstl related jars.  In one pj, I see

<groupId>jstl</groupId>
<artifactId>jstl</artifactId>

But in another project, I see

<groupId>org.glassfish.web</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>

<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>

I omitted the version part for simplicity.
What confuse me is

1) what is jstl-api.jar for ?
2) why in the first project, it works fine without jstl-api.jar,  but in the second project it uses a combination of them ?
3) For jstl.jar, the second one is clear it is from "javax.servlet.jsp", but the first one is just "jstl", sounds strange.
 
Tim Holloway
Saloon Keeper
Posts: 25463
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that probably those projects (POMs) are messed up.

JSTL is the Java Standard Template Library, but as far as I can recall (which isn't very far), there's not going to be a need to explicitly reference a JSTL API or Implementation library in a webapp, since JSTL is a language of its own and it's handled entirely(?) at runtime.

In any event, looking for a specific webserver version of either of those libraries rings major alarm bells. JSTL is part of the webapp server, so in Maven terms, its scope is "provided", not the default (which is "compile").
 
Linwood Hayes
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:I think that probably those projects (POMs) are messed up.

JSTL is the Java Standard Template Library, but as far as I can recall (which isn't very far), there's not going to be a need to explicitly reference a JSTL API or Implementation library in a webapp, since JSTL is a language of its own and it's handled entirely(?) at runtime.

In any event, looking for a specific webserver version of either of those libraries rings major alarm bells. JSTL is part of the webapp server, so in Maven terms, its scope is "provided", not the default (which is "compile").



so you think  makes better sense than the other one ?
 
Tim Moores
Saloon Keeper
Posts: 7317
170
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Maven coordinates for the latest JSTL API (those part of Jakarta EE) can be found at https://mvnrepository.com/artifact/jakarta.servlet.jsp.jstl/jakarta.servlet.jsp.jstl-api/1.2.7. Currently that is

... if a web app for some reason needs those (which offhand I can't think of any reason for).

IIRC, JSTL does not come with all servlet containers; I seem to recall that it needs to be added to Tomcat, for example. But it's been a while, so I could be mistaken. And yes, it shouldn't be part of any web app, it should go into the server's "lib" directory.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic