• 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
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

jstl.jar and jstl-api.jar

 
Ranch Hand
Posts: 148
  • 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.
 
Saloon Keeper
Posts: 23544
161
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: 148
  • 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 ?
 
Saloon Keeper
Posts: 6930
164
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic