• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Calling java class from JSP

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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. ]
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic