I have a Front Controller JSP/Servlet system. On the JSP, I decided to replace the usual html SELECT widgets with the more elegant "input-0.90 taglib" SELECTS. For sake of clarity lets call the original JSP as JSP1 and the one that bears the input taglibs as JSP2. Note that JSP1 works just fine. The goal is adding elegant state preservation behavior to the SELECT widgets and eliminating code clutter. However the apparently experiment resulted in some incomprehensible behavior...

Both JSP1 and JSP2 forward the form elements to a servlet. The servlet, in turn, has a bunch of SQL and other database management statements. Well oddly enough, it does not work if I use JSP2. I'm certain that the problem is not on the servlet side since I can verify that servlet is reading the request parameters correctly and they are the right type of objects -so no casting issues suspected.

Bottom line is that the servlet receives the same input parameters with other either JSP1 or JSP2. But the database access breaks down when JSP2 is sending the parameters. It's quite baffling since I would assume that the taglib would have a bunch of private variables that wouldn't conflict with my existing code.

The code is too lengthy to post but below is a sniplet of JSP2. JSP1 is just a bunch of the usual static HTML. Have any of you encounter similar behavior? How did you resolve it? I'm on Java 1.3.1.

Thanks ,
-FB



************************************************************************ **********************

<%@ taglib uri="virtumundo_taglib" prefix="display" %>
<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/input-0.90"; prefix="input" %>
<%@ page session="true" %>

<%
org.apache.commons.collections.SequencedHashMap months = new org.apache.commons.collections.SequencedHashMap();

months.put("January" , "01");
months.put("February" , "02");
months.put("March" , "03");
months.put("April" , "04");
months.put("May" , "05");
months.put("June" , "06");
months.put("July" , "07");
months.put("August" , "08");
months.put("September" , "09");
months.put("October" , "10");
months.put("November" , "11");
months.put("December" , "12");

org.apache.commons.collections.SequencedHashMap years = new org.apache.commons.collections.SequencedHashMap();
years.put("2000", "00");
years.put("2001", "01");
years.put("2002", "02");
years.put("2003", "03");
years.put("2004", "04");

org.apache.commons.collections.SequencedHashMap days = new org.apache.commons.collections.SequencedHashMap();

for(int m=1; m < 32; m++ ){
days.put( new Integer(m).toString(), new Integer(m).toString() );
}

java.util.HashMap a = new java.util.HashMap();
%>

<HTML>
<HEAD>

<input:select name="fromMonth" attributes="<%= a %>" options="<%= months %>" />
<input:select name="fromDay" attributes="<%= a %>" options="<%= days %>" />
<input:select name="fromYear" attributes="<%= a %>" options="<%= years %>" />


************************************************************************ **********************










--
To unsubscribe, e-mail: <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to