I am using the sun reference implementation of JSP 1.0

I have the following JSP Files: "JSPExample.jsp" and "ToDoListTable.jsp".

The problem is that the <jsp:request include="ToDoListTable.jsp"/>
does not invoke a "nested" JSP file and as such be processed as a JSP
servlet. It seems to be only looking for plain servlets (i.e. no JSP
processing).

The example shows a "To Do List" implementation with a nested
JSP file called via <jsp:request include="ToDoListTable.jsp"/>
to render the HTML table showing the list items.

Note: To do items are added via the form included in "JSPExample.jsp".

Thanks

Lawrence Turcotte
XOL
Dallas, Texas
---------------------------------------------JSPExample.jsp
<!--
  JSP ToDo List Table Example
  Written by Lawrence Turcotte <[EMAIL PROTECTED]>
-->

<%@ page import = "com.xol.ToDoList" %>

<jsp:useBean id="todolist" class="com.xol.ToDoList" scope="session"/>
<jsp:setProperty name="todolist" property="*"/>

<html>
<head><title>JSP To Do List Table Example</title></head>
<body bgcolor="white">
<font size=4>

<%= todolist.processRequest(request) %>

<% if (todolist.getNumberOfItems() > 0) {  %>

 <jsp:request include="ToDoListTable.jsp"/>

 <% } %>

  <form method=post>
  Index: <input type=number name=index><br>
  Priority: <input type=number name=priority><br>
  Description: <br> <TEXTAREA Name=desc Rows="4" Cols ="40"></TEXTAREA><br>
  <INPUT TYPE=submit name="submit" value="done">
  <INPUT TYPE=submit name="submit" value="new">
  <INPUT TYPE=submit name="submit" value="change">
  </form>

</font>
</body>
</html>

---------------------------------------------ToDoListTable.jsp
<TABLE Boder="2" Cellpadding="3" Cellspacing="3">

<TR><TH>Index</TH><TH>Priority</TH><TH>Create</TH><TH>Update</TH><TH>Desc</T
H></TR>

<% int index = 0;
  ListIterator it = todoList.listiterator();
  while (it.hasNext()) {
    ToDoItem item = it.next();
    index++; %>

  <TR><TD><%=index></TD><TD>
  <% if (item.getPriority()  < 2) { // if priority is or higher then make
font red  %>
  <FONT COLOR="Red"> <%  } else {  %> <FONT> <% } %>
  <%= item.getPriority()>
  </FONT></TD>
  <TD><%= item.getCreateDate()%></TD>
  <TD><%= item.getUpdateDate()%></TD>
  <TD><%= item.getDesc()%></TD></TR>
  <% } // while %>
  </TABLE>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to