Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 999
  • Last Modified:

Servlet not available


I am trying to run a project who's source code was provided as part of a tutorial.


When I go the address, http://localhost:7777/bikestore/bikes.bikes, I get the following message in my browser:

HTTP Status 404 - Servlet rentaBikeApp is not available
type Status report
message Servlet rentaBikeApp is not available
description The requested resource (Servlet rentaBikeApp is not available) is not available.
Apache Tomcat/5.5.16


This is the web.xml file included in the project:

<!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>
 <taglib>
   <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
   <taglib-location>/WEB-INF/lib/c.tld</taglib-location>
 </taglib>

 <servlet>
    <servlet-name>rentaBikeApp</servlet-name>
    <servlet-class>
      org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
    <servlet-name>rentaBikeApp</servlet-name>
    <url-pattern>*.bikes</url-pattern>
 </servlet-mapping>
</web-app>


This is the xml file for the servlet, named rentaBikeApp-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
   <bean id="rentaBike" class="com.springbook.ArrayListRentABike">
      <property name="storeName"><value>Bruce's Bikes</value></property>
   </bean>
   <bean id="bikesController" class="com.springbook.BikesController">
      <property name="facade"><ref bean="rentaBike"/></property>
   </bean>
   <bean id="editBikeController" class="com.springbook.EditBikeController">
      <property name="facade"><ref bean="rentaBike"/></property>
   </bean>
   <bean id="submitBikeController" class="com.springbook.SubmitBikeController">
      <property name="facade"><ref bean="rentaBike"/></property>
   </bean>
   <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
      <property name="mappings">
         <props>
            <prop key="/bikes.bikes">bikesController</prop>
            <prop key="/editBike.bikes">editBikeController</prop>
            <prop key="/newBike.bikes">editBikeController</prop>
            <prop key="/submitBike.bikes">submitBikeController</prop>
         </props>
      </property>
   </bean>
</beans>


This is a tutorial, so I'm assuming that they ran these same files on their machines and they worked.

I am assuming that this servlet is failing to start but I am unable to figure out why.  Is there something that I am forgetting to change in these files?  Do I need to change Tomcat's web.xml file?

I am a beginner with Tomcat and webapps, so any advice in general would be much appreciated.  Please let me know if there are other relevant files (or other information) that I should show in a comment to this question.




0
tlDeveloper
Asked:
tlDeveloper
  • 21
  • 20
  • 2
1 Solution
 
objectsCommented:
check the log, the reason for it failing will be in there
0
 
tlDeveloperAuthor Commented:
Where is the log in Tomcat??
0
 
objectsCommented:
<tomcat>/logs/catalina.out
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
tlDeveloperAuthor Commented:
The file C:\apache-tomcat-5.5.16\logs\manager.2006-04-01.log is empty.  Is that the log file you are refering to?  Should it be empty?

0
 
tlDeveloperAuthor Commented:

Here are the recent entries from catalina.2006-04-01:

Apr 1, 2006 5:14:49 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\j2sdk1.4.2_07\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\j2sdk1.4.2_07\bin
Apr 1, 2006 5:14:50 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:14:50 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2333 ms
Apr 1, 2006 5:14:50 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 1, 2006 5:14:50 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.16
Apr 1, 2006 5:14:50 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 1, 2006 5:14:56 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:14:56 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 1, 2006 5:14:56 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/151  config=null
Apr 1, 2006 5:14:57 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 1, 2006 5:14:57 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6840 ms
Apr 1, 2006 5:16:55 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:16:56 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Apr 1, 2006 5:16:56 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:16:56 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime


Do these provide relevant information???:
org.apache.coyote.http11.Http11BaseProtocol pause,
org.apache.coyote.http11.Http11BaseProtocol destroy,
org.apache.catalina.core.AprLifecycleListener lifecycleEvent

I'm not sure what to make of this log file.

Thank you again, I appreciate the help.

0
 
objectsCommented:
no, catalina.out

where have you put your class files.
0
 
tlDeveloperAuthor Commented:

I did a search on the Tomcat folder, and there is no catalina.out file.  Are you sure that there will always be a catalina.out file?

The class files are located in C:\apache-tomcat-5.5.16\webapps\bikestore\war\WEB-INF\classes\com\springbook.



0
 
objectsCommented:
are all the spring and dependant jars in <webapp>/WEB-INF/lib?
0
 
objectsCommented:
think 5.5 doesn't log to file by default.  how do u start it up?
if you run startup.bat directly you should get the logging to stdout
0
 
tlDeveloperAuthor Commented:

Yes, I am using 5.5 and am using startup.bat.  This is what appears in standard out:

Created MBeanServer with ID: b753f8:10a584a6a36:-8000:SPUTNIK:1
Apr 1, 2006 5:49:34 PM org.apache.catalina.core.AprLifecycleListener lifecycleEv
ent
INFO: The Apache Tomcat Native library which allows optimal performance in produ
ction environments was not found on the java.library.path: C:\j2sdk1.4.2_07\bin;
.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syste
m32\Wbem;c:\j2sdk1.4.2_07\bin
Apr 1, 2006 5:49:34 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:49:34 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1482 ms
Apr 1, 2006 5:49:34 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 1, 2006 5:49:34 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.16
Apr 1, 2006 5:49:34 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Apr 1, 2006 5:49:39 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-7777
Apr 1, 2006 5:49:39 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Apr 1, 2006 5:49:39 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/80  config=null
Apr 1, 2006 5:49:39 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Apr 1, 2006 5:49:39 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5438 ms


It seems to be the same at the catalina.2006-04-01 file.  It does not seem to be reporting a problem in this file but I could be misunderstanding it.

0
 
objectsCommented:
that all looks fine.
can you use log4j for looging, it will give you better control over the level of logging
0
 
tlDeveloperAuthor Commented:

I have included the log4j jar file in the project as instructed by the tutorial so I'm guessing that it must be doing some log4j logging somewhere.  Though there does not appear to be an obvious log4j folder. Do you know where it logs the log4j info, which files??


0
 
objectsCommented:
you'll need a log4j4 config file log4j.xml (or log4j.properties) in your classes directory
0
 
tlDeveloperAuthor Commented:

This is the log file which I've been using:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
       
  <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.SimpleLayout"/>
  </appender>

  <root>
    <priority value ="debug" />
    <appender-ref ref="ConsoleAppender"/>
  </root>

</log4j:configuration>


It was located in the main project folder and also an exact copy in the bin folder in main project folder.
Do you know where the log4j log is?  Or should I copy this file to another directory (which class directory did you mean? there are a few)?  Should I change the log4j.xml file?


0
 
objectsCommented:
thats logging to stdout
put it in your webapps classes directory and restgart tomcat

0
 
tlDeveloperAuthor Commented:

So should I copy the log4j.xml file to C:\apache-tomcat-5.5.16\webapps\bikestore\war\WEB-INF\classes and not change the file itself??  There is no classes directory in C:\apache-tomcat-5.5.16\webapps folder.

Here are some calls from the cmd window ...

C:\apache-tomcat-5.5.16\webapps>
C:\apache-tomcat-5.5.16\webapps>
C:\apache-tomcat-5.5.16\webapps>
C:\apache-tomcat-5.5.16\webapps>dir
 Volume in drive C has no label.
 Volume Serial Number is 68D3-1367

 Directory of C:\apache-tomcat-5.5.16\webapps

03/31/2006  01:04 AM    <DIR>          .
03/31/2006  01:04 AM    <DIR>          ..
03/24/2006  08:35 PM    <DIR>          balancer
04/01/2006  12:42 PM    <DIR>          bikestore
03/24/2006  08:35 PM    <DIR>          jsp-examples
03/31/2006  01:04 AM    <DIR>          RABProj
04/01/2006  03:27 PM    <DIR>          ROOT
03/24/2006  08:35 PM    <DIR>          servlets-examples
03/24/2006  08:35 PM    <DIR>          tomcat-docs
03/24/2006  08:35 PM    <DIR>          webdav
               0 File(s)              0 bytes
              10 Dir(s)  62,122,823,680 bytes free
C:\apache-tomcat-5.5.16\webapps>dir bikestore
 Volume in drive C has no label.
 Volume Serial Number is 68D3-1367

 Directory of C:\apache-tomcat-5.5.16\webapps\bikestore

04/01/2006  12:42 PM    <DIR>          .
04/01/2006  12:42 PM    <DIR>          ..
03/31/2006  12:32 AM               924 .classpath
03/18/2006  09:11 PM               383 .project
04/01/2006  12:42 PM               626 bikes.jsp
03/31/2006  06:17 PM    <DIR>          bin
03/31/2006  06:14 PM             2,655 build.xml
03/31/2006  06:17 PM    <DIR>          db
04/01/2006  12:42 PM             1,953 editBike.jsp
04/01/2006  12:42 PM               131 include.jsp
04/01/2006  12:42 PM               822 Listbikes.jsp
03/19/2006  01:26 AM               446 log4j.xml
03/31/2006  06:17 PM    <DIR>          src
04/01/2006  11:02 AM    <DIR>          test
03/31/2006  06:17 PM    <DIR>          war
04/01/2006  01:13 PM    <DIR>          WEB-INF
               8 File(s)          7,940 bytes
               8 Dir(s)  62,122,823,680 bytes free

C:\apache-tomcat-5.5.16\webapps>dir bikestore\war
 Volume in drive C has no label.
 Volume Serial Number is 68D3-1367

 Directory of C:\apache-tomcat-5.5.16\webapps\bikestore\war

03/31/2006  06:17 PM    <DIR>          .
03/31/2006  06:17 PM    <DIR>          ..
03/30/2006  11:33 PM               626 bikes.jsp
03/30/2006  11:32 PM             1,953 editBike.jsp
03/30/2006  11:32 PM               131 include.jsp
03/29/2006  10:19 PM               822 Listbikes.jsp
04/01/2006  01:13 PM    <DIR>          WEB-INF
               4 File(s)          3,532 bytes
               3 Dir(s)  62,122,823,680 bytes free
C:\apache-tomcat-5.5.16\webapps>dir bikestore\war\WEB-INF
 Volume in drive C has no label.
 Volume Serial Number is 68D3-1367

 Directory of C:\apache-tomcat-5.5.16\webapps\bikestore\war\WEB-INF

04/01/2006  01:13 PM    <DIR>          .
04/01/2006  01:13 PM    <DIR>          ..
04/01/2006  12:52 PM            15,999 c.tld
04/01/2006  12:42 PM    <DIR>          classes
04/01/2006  12:52 PM            19,595 fmt.tld
04/01/2006  01:33 PM    <DIR>          lib
03/29/2006  10:10 PM               469 RentABikeApp-context.xml
03/30/2006  11:35 PM             1,249 rentaBikeApp-servlet.xml
03/30/2006  11:34 PM               644 web.xml
               5 File(s)         37,956 bytes
               4 Dir(s)  62,122,823,680 bytes free

C:\apache-tomcat-5.5.16\webapps>


0
 
objectsCommented:
> So should I copy the log4j.xml file to C:\apache-tomcat-5.5.16\webapps\bikestore\war\WEB-INF\classes and not change the file itself??  

correct

> There is no classes directory in C:\apache-tomcat-5.5.16\webapps folder.

sorry, forgot you were running the webapp in the war directory
0
 
tlDeveloperAuthor Commented:

I copied the file into there and reran it (restarted tomcat and tried to open bikes.bikes).  I do not see a log4j log anywhere though.  Where should it be and what should it be called??

0
 
objectsCommented:
it should be going to stdout.
are you sure you're running the webapp in the war directory, and not the one in webapps directory?
0
 
tlDeveloperAuthor Commented:

stdout does not say anything different.  I am not certain which class files tomcat is using with that address (do you know how to tell?  would it change where the log file will be?).  Class files are located in 3 locations and I put the log4j.xml file in all 3:

C:\apache-tomcat-5.5.16\webapps\bikestore\bin
C:\apache-tomcat-5.5.16\webapps\bikestore\war\WEB-INF\classes
C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\classes

0
 
objectsCommented:
do u have commons logging installed?
0
 
tlDeveloperAuthor Commented:
Yes, I am using a commons logging jar file in the project as instructed by the tutorial.
0
 
objectsCommented:
where are you jar file installed, I just noticed there was no lib directory in the dir listings?

and what does RentABikeApp-context.xml look like?
0
 
tlDeveloperAuthor Commented:

This is RentABikeApp-context:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

      <bean id="rentaBike" class="com.springbook.ArrayListRentABike">
            <property name="storeName"><value>"Bruce's Bikes"</value></property>
      </bean>
      
      <bean id="commandLineView" class="com.springbook.CommandLineView">
            <property name="rentaBike"><ref bean="rentaBike" /></property>
      </bean>
      
</beans>



The jar files are located in various directories and the Eclipse project links them all together.  In relation to the project (RABProj), they are located in the highest level, at the top node of the project.
0
 
objectsCommented:
> The jar files are located in various directories

they need to be in the webapps lib directory which does not appear to be the case from what u posted above
0
 
tlDeveloperAuthor Commented:

Which lib folder are you refering to?  There is no folder called lib in the webApps directory.  

Also, I thought I'd show you the Ant build file which is used to compile and deploy the project (it does not seem to copy any of the jar files, I assume that it links them somehow).  This is build.xml:

<?xml version="1.0"?>
<project name="RentABike" default="compile" basedir=".">

   <property name="src.dir" value="src"/>
   <property name="test.dir" value="test"/>
   <property name="war.dir" value="war"/>
   <property name="class.dir" value="${war.dir}/WEB-INF/classes"/>
   <property name="test.class.dir" value="${test.dir}/classes"/>
   <property name="spring.dir" value="C:/TenantLife/lib/spring-2.0-with-dep"/>
   <property name="webapp.dir" value="C:/apache-tomcat-5.5.16/webapps/bikestore"/>

   <path id="bikestore.class.path">
            <fileset dir="${spring.dir}/dist">
                  <include name="*.jar" />
            </fileset>

      <pathelement location="${spring.dir}/lib/jakarta-commons/commons-logging.jar"/>
      <pathelement location="${spring.dir}/lib/log4j/log4j-1.2.8.jar"/>
      <pathelement location="${spring.dir}/lib/j2ee/servlet-api.jar"/>
      <dirset dir="${basedir}"/>
      </path>

    <path id="run.class.path">
        <path refid="bikestore.class.path"/>
        <dirset dir="${class.dir}"/>
    </path>

   <path id="junit.class.path">
      <path refid="run.class.path"/>
      <pathelement location="/Users/jgehtland/Tools/junit.jar"/>
   </path>

   <target name="init">
      <mkdir dir="${class.dir}"/>
      <mkdir dir="${test.class.dir}"/>
   </target>

   <target name="compile" depends="init"
      description="Compiles all source code.">
      <javac srcdir="${src.dir}" destdir="${class.dir}"
         classpathref="bikestore.class.path"/>
   </target>

   <target name="clean" description="Erases contents of classes dir">
      <delete dir="${class.dir}"/>
      <delete dir="${test.class.dir}"/>
   </target>

   <target name="compile.test" depends="init" description="Compiles all unit test source">
      <javac srcdir="${test.dir}"
             destdir="${test.class.dir}"
             classpathref="junit.class.path"/>
   </target>

   <target name="test" depends="compile, compile.test"
      description="Runs the unit tests">
      <junit printsummary="withOutAndErr" haltonfailure="no"
         haltonerror="no" fork="yes">
         <classpath refid="junit.class.path"/>
         <formatter type="xml" usefile="true" />
         <batchtest todir="${test.dir}">
            <fileset dir="${test.class.dir}">
               <include name="*Test.*"/>
            </fileset>
         </batchtest>
      </junit>
   </target>

   <target name="deploy" depends="compile"
      description="Copies the contents of web-app to destination dir">
      <copy todir="${webapp.dir}">
         <fileset dir="${war.dir}"/>
      </copy>
   </target>

</project>



0
 
objectsCommented:
> Which lib folder are you refering to?  There is no folder called lib in the webApps directory.  

thats right, there should be :)
you need to copy all the required libs into the webapps lib directory

<webapp>/WEB-INF/lib
0
 
tlDeveloperAuthor Commented:

By <webapp> are you refering to C:\apache-tomcat-5.5.16\webapps or C:\apache-tomcat-5.5.16\webapps\bikestore.  I'm guessing that it refers to the second one.  The folder C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\lib already exists but the jar files do not get copied there.  Should I just change the Ant build file so that they get copied there??  Should I link them in some other way as well, so that the class files know to look in that directory (or is that the default?) ??


0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> By <webapp> are you refering to C:\apache-tomcat-5.5.16\webapps or C:\apache-tomcat-5.5.16
>> \webapps\bikestore.  I'm guessing that it refers to the second one.

Correct.

>> The folder C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\lib already exists but the jar files do not get copied
>> there.  

Does it already contain them by any chance? Try stopping the server, then copying, then restarting.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> <servlet-class>
>>      org.springframework.web.servlet.DispatcherServlet
>>    </servlet-class>

Never tried that with spaces/ new-lines between the class-name and the XML node.
0
 
tlDeveloperAuthor Commented:


Thank you.  I no longer get that the servlet is unavailable.  Also, debug statement print in stdout.  A new issue has arose though.  In the browser, phrases like ${rentaBike.storeName} appear rather than the variable which they represent (in this case it is the store name).  Any obvious reason why this would occur.  Please tell me if you think that this should be made into a separate thread/question.  I think I am very close to getting this tutorial example fully working.

0
 
objectsCommented:
try adding the following to the top of your jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
0
 
tlDeveloperAuthor Commented:

I already include that line.  My jsp files include a file called include.jsp, which has that line.

These are the relavent jsp files (bikes.bikes ends up loading bikes.jsp):

bikes.jsp:

<%@ page import="com.springbook.*"%>
<%@ include file="include.jsp" %>
<html>
    <head>
        <title>
            <c:out value="${rentaBike.storeName}"/>
        </title>
    </head>
    <body>
        <h1><c:out value="${rentaBike.storeName}"/></h1>
        Edit a bike: <br/>
        <c:forEach items="${rentaBike.bikes}" var="bike">
        <a href="editBike.bikes?bikeSerialNo=<c:out value="${bike.serialNo}"/>"><c:out value="${bike.manufacturer}"/> - <c:out value="${bike.model}"/><br/>
        </c:forEach>
        <br/><br/>
        <a href="newBike.bikes">Add a new bike</a>

    </body>
</html>




include.jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>        



Listbikes.jsp:

<%@ page import="com.springbook.*" %>
<% RentABike store = new ArrayListRentABike("Bruce's bikes"); %>
<html>
   <head>
      <title>
         <%= store.getStoreName() %>
      </title>
   </head>
   <body>
      <h1><%= store.getStoreName() %></h1>
      <table border="1" cellspacing="2" cellpadding="2">
         <tr style="font-weight: bold;">
            <td>Manufacturer</td><td>Model</td><td>Status</td>
         </tr>
         <% for(int i=0;i<store.getBikes().size();i++) { %>
            <% Bike bike = (Bike)store.getBikes().get(i); %>
            <tr>
               <td><%= bike.getManufacturer() %></td>
               <td><%= bike.getModel() %></td>
               <td><%= bike.getStatus() %></td>
            </tr>
            <% } %>            
      </table>
   </body>
</html>





Editbike.jsp:

<%@ page import="com.springbook.*"%>
<%@ include file="include.jsp" %>

<html>
    <head>
        <title>
            Edit Bike
        </title>
    </head>
    <body>
        <h1>Edit Bike</h1>
        <form method="POST" action="submitBike.bikes">
           <table border="1" cellspacing="2" cellpadding="2">
                <tr>
                    <td align="right">Manufacturer:</td>
                    <td>
                        <input type="text" name="manufacturer" value="<c:out value="${bike.manufacturer}"/>">
                    </td>
                </tr>
                <tr>
                    <td align="right">Model:</td>
                    <td>
                        <input type="text" name="model" value="<c:out value="${bike.model}"/>">
                    </td>
                </tr>
                <tr>
                    <td align="right">Frame:</td>
                    <td>
                        <input type="text" name="frame" value="<c:out value="${bike.frame}"/>">
                    </td>
                </tr>
                <tr>
                    <td align="right">Serial Number:</td>
                    <td>
                        <input type="text" name="serialNo" value="<c:out value="${bike.serialNo}"/>">
                    </td>
                </tr>
                <tr>
                    <td align="right">Weight:</td>
                    <td>
                        <input type="text" name="weight" value="<c:out value="${bike.weight}"/>">
                    </td>
                </tr>
                <tr>
                    <td align="right">Status:</td>
                    <td>
                        <input type="text" name="status" value="<c:out value="${bike.status}"/>">
                    </td>
                </tr>
            </table>
            <input type="submit" value="Submit">
        </form>
    </body>
</html>








Am I doing the including incorrectly??  Thanks again.




0
 
tlDeveloperAuthor Commented:

This is the logging being done in stdout when I reload the webpage:


DEBUG - Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHa
ndlerMapping@f864fe] in DispatcherServlet with name 'rentaBikeApp'
DEBUG - Looking up handler for [/bikes.bikes]
DEBUG - Testing handler adapter [org.springframework.web.servlet.mvc.SimpleReque
stHandlerAdapter@1ae9aaa]
DEBUG - Testing handler adapter [org.springframework.web.servlet.mvc.SimpleContr
ollerHandlerAdapter@d9896e]
DEBUG - Last-Modified value for [/bikestore/bikes.bikes] is [-1]
DEBUG - DispatcherServlet with name 'rentaBikeApp' received request for [/bikest
ore/bikes.bikes]
DEBUG - Bound request context to thread: org.apache.catalina.connector.RequestFa
cade@103de90
DEBUG - Testing handler adapter [org.springframework.web.servlet.mvc.SimpleReque
stHandlerAdapter@1ae9aaa]
DEBUG - Testing handler adapter [org.springframework.web.servlet.mvc.SimpleContr
ollerHandlerAdapter@d9896e]
DEBUG - Rendering view [org.springframework.web.servlet.view.InternalResourceVie
w: name 'bikes.jsp'; URL [bikes.jsp]] in DispatcherServlet with name 'rentaBikeA
pp'
DEBUG - Rendering view with name 'bikes.jsp' with model {rentaBike=RentABike: Br
uce's Bikes} and static attributes {}
DEBUG - Added model object 'rentaBike' of type [com.springbook.ArrayListRentABik
e] to request in InternalResourceView 'bikes.jsp'
DEBUG - servletPath=/bikes.jsp, pathInfo=null, queryString=null, name=null
DEBUG -  Path Based Forward
DEBUG - JspEngine --> /bikes.jsp
DEBUG -              ServletPath: /bikes.jsp
DEBUG -                 PathInfo: null
DEBUG -                 RealPath: C:\apache-tomcat-5.5.16\webapps\bikestore\bike
s.jsp
DEBUG -               RequestURI: /bikestore/bikes.jsp
DEBUG -              QueryString:
DEBUG -           Request Params:
DEBUG -  Disabling the response for futher output
DEBUG - Forwarded to resource [bikes.jsp] in InternalResourceView 'bikes.jsp'
DEBUG - Cleared thread-bound request context: org.apache.catalina.connector.Requ
estFacade@103de90
DEBUG - Successfully completed request
DEBUG - Publishing event in context [WebApplicationContext for namespace 'rentaB
ikeApp-servlet']: ServletRequestHandledEvent: url=[/bikestore/bikes.bikes]; clie
nt=[127.0.0.1]; method=[GET]; servlet=[rentaBikeApp]; session=[639818328AA19F41D
8AC7CF5101E583D]; user=[null]; time=[111ms]; status=[OK]




0
 
objectsCommented:
looks ok, are the jstl jars in the lib directory
0
 
tlDeveloperAuthor Commented:

Looks like the jstl.jar file is in the lib folder:




C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\lib>dir
 Volume in drive C has no label.
 Volume Serial Number is 68D3-1367

 Directory of C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\lib

04/02/2006  01:57 PM    <DIR>          .
04/02/2006  01:57 PM    <DIR>          ..
10/25/2004  02:33 PM            15,999 c.tld
07/08/2004  11:16 PM            38,015 commons-logging.jar
10/25/2004  02:33 PM            19,595 fmt.tld
04/01/2006  01:51 PM            20,682 jstl.jar
10/25/2003  05:15 PM           121,070 junit.jar
02/27/2006  11:43 PM           358,180 log4j-1.2.13.jar
11/30/2003  05:03 PM            92,621 servlet-api.jar
03/08/2006  05:56 PM         1,956,175 spring.jar
04/01/2006  01:51 PM           393,259 standard.jar
               9 File(s)      3,015,596 bytes
               2 Dir(s)  62,135,033,856 bytes free

C:\apache-tomcat-5.5.16\webapps\bikestore\WEB-INF\lib>


0
 
objectsCommented:
try adding it directly instead of via the include, shouldn't make a difference though.
0
 
tlDeveloperAuthor Commented:


No, it did not change anything.  Any other suggestions??

0
 
objectsCommented:
try changing your page directive to:

<%@ page isELIgnored="false" import="com.springbook.*" %>
0
 
tlDeveloperAuthor Commented:

Yeah!!!!!! That did it.  It works.  Thank you!!  What does the isELIgnored="false" do??


0
 
objectsCommented:
woo hoo :)

Tells it to not ignore EL which is the ${} stuff.
0
 
tlDeveloperAuthor Commented:

Hmm, the code came from a tutorial book so I'm assuming that they must have tested the code and it had worked for them.  Any idea how it may have worked for them??

0
 
objectsCommented:
Most likely because false is the default, I've never actually had to use it myself for the same reason.
May be the combination of tomcat 5.5 and webapp 2.2, buts thats just a guess.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 21
  • 20
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now