This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java files in tomcat

 
Gopi Krrishna
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to access ordinary java files in my jsp code. access in the sense i want to create an object like ClassA obj=new ClassA(); My problem is where should i put that ClassA.class file in my webapps folder?

i have put that class file inside my WEB-INF/classes folder but still when i try to run my jsp file i get error as
ClassA cannot be resolved to a type

Please help
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the JSP have the proper import statement, i.e.

<%@ page import="package.ClassA" %>

Note that I prepended a package name, because classes can't be in the default package to be used like this.
 
Gopi Krrishna
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
Does the JSP have the proper import statement, i.e.

<%@ page import="package.ClassA" %>

Note that I prepended a package name, because classes can't be in the default package to be used like this.


Thanks Ulf Dittmer,
When i use it with package as you said, its working fine. Thanks for help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is covered in the JSP FAQ. Please be sure to check the FAQ before posting to the forum.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is covered in the JSP FAQ.


I have added that particular error message to the FAQ page, so that it's easy to find through a search.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic