Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Madeline Ross   on Jun 16 In Java Category.

  
Question Answered By: Lurline Fischer   on Jun 16

Try putting you counter  class in a package.

So, in the first line  of your counter.java class, you would have a
line like:

package beans;

public class  counter ...

(You should arrange source  files in a directory tree that reflects
their package tree. In case you've never worked with packages before,
when you compile  counter.java, you have to have it in a directory
called "beans". Run the javac  compiler in the directory just above
the beans directory.
e.g. javac beans\counter.java)

Then create a directory called beans in the classes directory. Put
the compiled class file  in the directory:
F:\jakarta-tomcat-5.0.24\webapps\ROOT\WEB-INF\classes\beans\


Finally,
change your jsp  to the following:

...
<@page language="java" import="beans.counter" />
<jsp:useBean id="test" class="beans.counter" />
...

Of course, you can name the package anything you like.
Honestly, I'm not exactly sure why it can't find your class, but this
should work - and packages are actually common practice anyway.

See if this works for you.

Share: 

 
 
Didn't find what you were looking for? Find more on Problem with JSP on Tomcat Server 5.0.24 Or get search suggestion and latest updates.


Tagged: