Showing posts with label JSTL. Show all posts
Showing posts with label JSTL. Show all posts

7 June 2018

Java EE web technology version history (updated)


JSR numbers are included as links.
Servers are webcontainers.Take care, web containers do not include JSF. You have to add it yourself or use an enterprise application server. Enterprise application servers are included in the
complete Java EE version overview.

Java EEservletJSP     ELJSTLJSF    WebSocketMVCServer       What’s new
2.1
1.0

iPlanet
jetty 1
ServletContext, RequestDispatcher
1.2
2.2
1.1
tomcat 3.3
jetty 3
war
1.3
53 2.3
53 1.2
tomcat 4.1
jetty 4
filters
1.4
154 2.4
152 2.0
1.0
52 1.1
tomcat 5.5
jetty 5
5
2.5
245 2.1
2.1
1.2
127 1.2

tomcat 6
jetty 6
annotations
6
315 3.0
2.2
2.2

314 2.0

tomcat 7
jetty 8
asynchronous servlets, EL method calls, more...
7
340 3.1
 341 3.0

344 2.2
356 1.0

tomcat 8
jetty 9.1
HTML 5, non blocking (Listener) servlet IO
8
369 4.0


372 2.3
1.1
371 1.0tomcat 9 HTTP/2

19 December 2010

Adding JSTL/JSP EL to your web applicaton (updated)

Quite some environments do not come with JSTL: Eclipse for JEE (Galileo), Tomcat 6, Jetty 6... Follow these steps to add them:

  1. Add JSTL
    Grab the JSTL API (jstl-api.jar) and JSTL implementation (jstl-impl-1.2.jar).
    Add the jars to your Container (e.g. Tomcat) lib directory (or your webapp lib).
    Alternatively add them using maven dependencies:
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    
  2. Make sure the web-app root element in web.xml supports at least servlet 2.4/JSP 2.0
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    If you use <taglib> elements in web.xml, make sure they are embedded in a <jsp-config> element.

25 May 2010

JSP history of writing bean properties

  • JSP 0.9

<% ActionForm form = (ActionForm) request.getAttribute(”LoginForm”); %>
<%= form.getUserName()%>

  • JSP 1.0

<jsp:useBean id=“form" class=“be.uniway.LoginForm" />
<jsp:getProperty name=“form" property=“userName" />

  • Struts

<bean:write name=“loginForm" property="userName"/>

  • JSP 1.2

<c:out value} ="${loginForm.userName}">

  • JSP 2.0

${loginForm.userName}

16 May 2010

JSTL/JSP EL alternate Struts excercise solution

The De Post/PMC excercises (and the Struts blank sample application) are based on

  • Struts
    • tags-bean
    • tags-logic
    • tags-html
  • JSP scriptlets
In this post we will show how to move this to
  • Struts
    • tags-html
  • JSTL
  • JSP expression language
To enable JSTL/JSP/EL support in your application follow these instructions. Here’s the table from the excercise rendered with JSTL/JSP EL:
<c:forEach  var="product" items="${List}"  varStatus ="status">
  <tr class="${(status.index%2==1)?'odd':'even'}">
    <td>
      <html:link action="<%=modify%>" paramId="id" paramName="product" paramProperty="id">
        <html:img srcKey="icon.edit" altKey="icon.alt.edit" border="0"/>
      </html:link> 
    </td> 
    <td>
      <html:link action="<%=remove %>" paramId="id" paramName="product" paramProperty="id">
        <html:img srcKey="icon.trash" altKey="icon.alt.trash" border="0"/>
      </html:link>
    </td>
    <td> ${product.name}</td> 
    <td> ${product.description}</td>
  </tr>
</c:forEach>