The Liferay Portlet archetype (version 6.2) references old Servlet and JSP API versions that differ from what is included in the actual Liferay bundles.
Looking at a source bundle for Liferay 6.2 (https://github.com/liferay/liferay-portal/blob/6.2.2-ga3/lib/versions.xml), you can see that the following versions are in place for the JSP API and the servlet API:
- lib/development/jsp-api.jar 2.1
- lib/development/servlet-api.jar 3.0.1
However, the dependencies specified in the archetype (https://github.com/liferay/liferay-maven-support/blob/126.96.36.199/archetypes/liferay-portlet-archetype/src/main/resources/archetype-resources/pom.xml) are:
- jsp-api 2.0
- servlet-api 2.4
What is provided in the Maven archetype should correspond to what is provided by Liferay to prevent the usage of potentially incompatible APIs.
It may be possible that more recent APIs were not bundled in the archetype because some Java EE 6 artifacts (Servlet 3 is part of Java EE 6) are hard to find, if nonexistent, in "separated" forms.
If this is the case, JBoss produced Java EE 6 artifacts for pretty much each part of the spec, including Servlet, JSP and JSTL. They may be JBoss-prefixed in their name, but they do contain standard Java EE 6 APIs.
Forum thread where this was initially discussed : https://www.liferay.com/fr/community/forums/-/message_boards/message/50396052
The thread also discusses API version choices and how they could be more consistent with what the application servers provide. Feedback would be very much appreciated on that thread.