Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling java class from JSP  RSS feed

 
Girish Solanke
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have written a simple JSP i.e Test.jsp.
I am trying to call a java class from that jsp.
I have created a application under webapps i.e myJSP.
I am using Tomcat 5.

The problem i am facing as --
==========================================================================
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\myJSP\org\apache\jsp\Test_jsp.java:6: cannot access mypack.MyClass

bad class file: C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\myJSP\WEB-INF\classes\mypack\MyClass.class

class file contains wrong class: MyClass
Please remove or make sure it appears in the correct subdirectory of the classpath.

import mypack.MyClass;
========================================================================

It shows me a error at "import mypack.MyClass;" line


Regards,
Girish.
[ August 11, 2006: Message edited by: Girish S. ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Girish S.", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the package line from MyClass.java, e.g.,


Also, where is the MyClass.class file located (which directory on the web server)? Please post the full path from your application ("webapps/mywebapp/...") on down to the class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!