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 7582387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:25:24+00:00 2026-05-30T18:25:24+00:00

I got this big newbie question. When i try the following; the ‘servlet’ turns

  • 0

I got this big newbie question.
When i try the following; the ‘servlet’ turns red and indicates ‘Cannot resolve symbol ‘servlet’.

import javax.servlet.http.*;
import javax.servlet.ServletException;

I got apache tomcat running. I am a very big java newbie. Can anyone help me where to find a servlet library or something ? I googled but got no clear explanation of how to make this work.

This is the content of my web.xml file;

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">

    <display-name>
        HelloWorld
    </display-name>
    <description>
        This is my first webapp
    </description>

    <servlet>
        <servlet-name>Hello world!</servlet-name>
        <description>This is a hello world servlet</description>
        <servlet-class>servlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloWorldServlet</servlet-name>
        <url-pattern>HelloWorldServlet</url-pattern>
    </servlet-mapping>

</web-app>

EDIT: I use the IntelliJ IDEA IDE.
And I am using Maven.

  • 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-05-30T18:25:26+00:00Added an answer on May 30, 2026 at 6:25 pm

    The servlet jar needs to be in your build path.

    If you are using maven you could do this :

    <dependency>
     <groupId>org.apache.tomcat</groupId>
     <artifactId>tomcat-servlet-api</artifactId>
     <version>7.0.21</version>
     <scope>provided</scope>
    </dependency>
    

    Or use one of the providers listed here, Such as the below which is not dependent on a specific container :

    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
       <version>3.0.1</version>
       <scope>provided</scope>
    </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While compiling a program in Java I got this big WARNING warning: [unchecked] unchecked
Got this error on a big $_GET query in size ~9 000 symbols (they
Searching for solutions for my problem, I got this question , suggesting composite grammars
I've got this error while compiling a big c# solution in Visual Studio 2010.
I've got this question regarding Android activities and AndroidManifest.xml. The question arised when I
So ive got this big-ass collection right? Its tree-backed(RBTree), so look-ups are fast, and
Got this error message while trying to load view: The model item passed into
Got this line of code here but its not working. private void Button_Click(object sender,
Got this site with UN/PW set via the Createuserwizard control. Client considers PW too
Got this: Table a ID RelatedBs 1 NULL 2 NULL Table b AID ID

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.