Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7990149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:55:26+00:00 2026-06-04T12:55:26+00:00

this is my first time trying to use java for backend web systems. I

  • 0

this is my first time trying to use java for backend web systems.

I have been reading up some guides on how to do this, and thus far i understand the following points:

  1. I am not allowed to import .java files, but rather, import the class files.
  2. <%@ page language=”java” import=”somefile.*”%> this is how i import a package.
  3. After importing a package, I am required to create an instance of the class.

However, I am confused with a few things.

I now have a Dynamic Web Project, developing in Eclipse IDE and using TomCat7.0 apache.

I have a directory
Java_Resources/src/somepackage/

and some .java files in the above directory.

Question 1, in Eclipse, when I run these files, they are automatically compiled. Where does these class files go?

Question 2, when I run the following code, I recieved some errors. What am I doing wrong? Is it because I do not have my class files in the right directory?

<%@ page language="java" import="twitter.*"%>

<%
    JavaFile jf = new Javafile();

    String result = jf.searchTweets("someString");
    System.out.println(result);
%>

Error report:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /hello.jsp at line 10

7: <%@ page language="java" import="twitter.*"%>
8: 
9: <%
10:     Javafile jf = new JavaFile();
11:     
12:     String result = jf.searchTweets("someString");
13:     System.out.println(result);

Thank you for your time and effort.

note: I have read the following links, but they do not seem to provide a solution on how to write your own .java files and import these classes into your jsp files.

http://www.jsptut.com/

How do you import classes in JSP?

http://www.coderanch.com/t/288534/JSP/java/importing-class-file-jsp

EDIT: I found my own answer.

This is my original directory

enter image description here

As you can see, my WEB-INF/lib is empty.

All that was required to do, is to move the relevant .jar files into this directory.

Note: I have already imported the relevant .jar files to the Eclipse project, but it seems that I need to move them into WEB-INF/lib on top of importing them into the project.

Thank you to all that helped answer my question.

This is my final directory imageenter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:55:28+00:00Added an answer on June 4, 2026 at 12:55 pm

    Only classes may be imported into a .java file, and a JSP “compiles” to a .java file, so this requirement holds for JSP files too.

    From a quick glance at the API, it seems that your import is formatted correctly; but, you are importing the wrong namespace. The javadoc for the twitter4j API indicates that you should be importing “twitter4j” namespaces, not “twitter” namespaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time trying to use Web Start, and I am trying
This is my first time trying Pandas. I think I have a reasonable use
this is my first time trying to use document classes in AS3 and im
Im trying to use generic types for the first time in Java , as
This has been bothering me for quite some time. I'm simply trying to change
This is my first time trying to use a custom view in XML and
This is the first time I'm trying random numbers with C (I miss C#).
This is my first time making a hash table. I'm trying to associate strings
Disclaimer: This is my first time writing unit tests...be gentle! :) I am trying
this is my first time posting here, I have a question which I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.