struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satish Talim" <satish_ta...@hotmail.com>
Subject Using JSTL 1.1 with Struts 1.2.4 and JBoss 3.2.5 or 4.0?
Date Wed, 13 Oct 2004 06:00:56 GMT
I am using JBoss 4.0 (which I believe is a Servlet 2.4 / JSP 2.0 container) and Struts 1.2.4.

I want to use JSTL 1.1 with Struts and JBoss. For example, I would like to use something like
this:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
..
<c:choose>
  <c:when test="${empDbInfo.rowCount == 0}">
    <sql:update>
      INSERT INTO Employee 
        (UserName, Password, FirstName, LastName, Dept, 
          EmpDate, EmailAddr, ModDate)
        VALUES(?, ?, ?, ?, ?, ?, ?, ?)
      <sql:param value="${param.userName}" />
      <sql:param value="${param.password}" />
      <sql:param value="${param.firstName}" />
      <sql:param value="${param.lastName}" />
      <sql:param value="${param.dept}" />
      <sql:dateParam value="${parsedEmpDate}" type="date" />
      <sql:param value="${param.emailAddr}" />
      <sql:dateParam value="${now}" />
    </sql:update>
  </c:when>
  <c:otherwise>
    <sql:update>
      UPDATE Employee
        SET Password = ?, 
            FirstName = ?, 
            LastName = ?, 
            Dept = ?,
            EmpDate = ?,
            EmailAddr = ?,
            ModDate = ?
        WHERE UserName = ?
      <sql:param value="${param.password}" />
      <sql:param value="${param.firstName}" />
      <sql:param value="${param.lastName}" />
      <sql:param value="${param.dept}" />
      <sql:dateParam value="${parsedEmpDate}" type="date" />
      <sql:param value="${param.emailAddr}" />
      <sql:dateParam value="${now}" />
      <sql:param value="${param.userName}" />
    </sql:update>
  </c:otherwise>
</c:choose>
..

a. How do I use this in Struts 1.2.4?

b. I can see a folder C:\jakarta-struts-1.2.4\contrib\struts-el\lib on my hard-disk. Do I
use the jar and tld files there?

c. If these are to be used then what's the difference between sql.tld and sql-rt.tld?

d. Also, should my application context's web.xml contain:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<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">


All this is very confusing for lack of proper documentation. I appreciate all help on this.
Thanks.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message