3 Replies Latest reply on Aug 30, 2006 10:33 PM by brogers

    Simple? JSP script

    brogers

      I have a jar file and a JSP script that references it.

      The jar file contains a class "fortune.Fortune" but when I try the import directive "<%@ page import="fortune.Forutne" %>" i get the error message:

      "Only a type can be imported. fortune.Forutne resolves to a package"

      I have tried several places to put the fortune.jar file:

      * $JBOSS_HOME/sever/all/lib
      * $JBOSS_HOME/sever/all/deploy/jbossweb-tomcat55.sar/ROOT.war/WEB-INF/lib
      * $JBOSS_HOME/sever/all/deploy/jbossweb-tomcat55.sar/ROOT.war/
      * $JBOSS_HOME/sever/all/server/lib
      * same directory as my jsp file

      Each to no avail.

      Question:
      1. Where should I place the fortune.jar file
      2. Is there a config file I need to update to reference this jar file?

        • 1. Re: Simple? JSP script
          peterj

          Usually, I package my JSPs and jars in a war file and place the war file in server/all/deploy. My war file contents look like:

          myapp.war:
          ./index.jsp
          ./WEB-INF/web.xml
          ./WEB-INF/lib/some.jar

          index.jsp references classes in some.jar

          What are the contents of your jar file? Run "jar -tf yourjarfile.jar" and post the results.

          • 2. Re: Simple? JSP script
            brian.stansberry

            Is there any chance it's because you have a typo in the second "Forutne" in your import? Your post does; don't know if the jsp does. Maybe the error message is bogus.

            • 3. Re: Simple? JSP script
              brogers

              I did have a typo in the import statement

              I corrected it an was able to run the script.

              Thank You