Share on Google+Share on Google+

Java Coder
HttpServletRequest cannot be resolved to a type in eclipse - Solved
2 Answer(s)      11 months ago
Posted in : Java Beginners

Hi,

How to solve the error which comes like this:

HttpServletRequest cannot be resolved to a type in eclipse

How to solve the error "HttpServletRequest cannot be resolved to a type"?

How to solve the error "HttpServletResponse cannot be resolved to a type"?

How to solve the error "HttpSession cannot be resolved to a type"?

For your information I am using Eclipse and maven for my project.

Thanks

Ads

View Answers

April 21, 2016 at 7:55 AM


Hi,

This error comes in project when servlet jar file is not added to project.

If you are using maven then add following line in pom.xml file:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

If you are not using maven in your project then find servlet.jar from Tomcat server and then add it to your project.

This should solve error.

Thanks



May 4, 2016 at 4:02 AM


Hi

First you need to configure the server then follow the steps

1.Right click on Project-->Build Path-->Configure Build Path

2.go to libraries tab -->add Library-->server run time-->Select the server-->Finish

Now u can resolve the errors










Related Tutorials/Questions & Answers:
The import javax.validation cannot be resolved
The import javax.validation cannot be resolved  Hi, I have a web application and due to missing maven dependency it is giving following error in Eclipse: The import javax.validation cannot be resolved. What maven dependency
PdfCopyFields cannot be resolved - Java Beginners
PdfCopyFields cannot be resolved  PdfCopyFields cannot be resolved but other classes in the iText-2.1.0.jar are resolved. Any suggestions? Thanks
Advertisements
combobox cannot be resolved in JavaFX
combobox cannot be resolved in JavaFX  I want to design one application with a combobox containing items. and while selecting i want to give user autocomplete suggestion. but while doing this combobox is not getting resolved. i
PdfCopyFields cannot be resolved - Java Beginners
PdfCopyFields cannot be resolved   Trying to concatenate PDF files. I downloaded the example from PdfCopyFields cannot be resolved but other
jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
/core cannot be resolved in either web.xml or the jar files deployed...: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml... file error was resolved. Next: Check more tutorials of Eclipse Integrated
why i'm getting this error?The import javax.servlet.http cannot be resolved
-quick-tip-resolving-error-the-import-javaxservlet-cannot-be-resolved/ ** any...why i'm getting this error?The import javax.servlet.http cannot be resolved  hey buddy's i had one problem in servlet in jsp program. Exactly i'm
org.hibernate.validator cannot be resolved error
org.hibernate.validator cannot be resolved error  In Hibernate based... cannot be resolved error Program is not compiling due to this error. How... and Eclipse for developing the application. Thanks   This error is due
Java HttpServletRequest
Java HttpServletRequest In this section we will read about HttpServletRequest. HttpServletRequest is an interface and extends the ServletRequest interface... information for HTTP Servlets. Object of the HttpServletRequest is created
Cannot convert 1/23/13 1:18 PM of type class java.util.Date to class java.sql.Timestamp
Cannot convert 1/23/13 1:18 PM of type class java.util.Date to class java.sql.Timestamp  I keep receiving this error every time i select date through jsf calendar, I declared my variable as Timestamp not date. my db is postgresQl
HttpServletRequest Example
HttpServletRequestExample extends HttpServlet { protected void doGet(HttpServletRequest request
Eclipse hibernate problem
an error saying "import org.hibernate.* cannot be resolved" ,mport org.hibernate.SessionFactory cannot be resolved. Can u please help me with this..   ...Eclipse hibernate problem  hie..i've just started a basic hibernate
Interface HttpServletRequest methods
Description: The interface HttpServletRequest called from the javax.servlet.http package which extends the ServletRequest interface.The HttpServletRequest... doGet(HttpServletRequest request, HttpServletResponse response) throws
cannot connect to database - JDBC
cannot connect to database  Iam using eclipse in my system ,when connecting the database mysql version 5.0 to the eclipse iam getting an error as ""Creating connection to mysql has encountered a problem.Could not connect to mysql
Eclipse
Eclipse  how to compile using eclipse
Eclipse
Eclipse   I am new to eclipse. i want to create a login page in eclipse and want to connect with mysql. what are the software and jar file i need to include in eclipse
eclipse
eclipse  Hi how to debug in eclipse ide and how to find bug in eclipse ? Thanks kalins naik
Cannot find tag library descriptor
Cannot find tag library descriptor  Cannot find tag library descriptor...? How to resolve in struts in eclipse
eclipse
eclipse  how to add tomcat server first time in eclipse
Eclipse
Eclipse  I am new to eclipse. I want to write a jsp program and want to connect it with mysql. What are the configurations i need to check in eclipse
Eclipse
Eclipse  How to develope web application servlets or jsp using eclipse id
org.apache.struts.action.ActionMessage cannot be cast to org.apache.struts.action.ActionError - Struts
org.apache.struts.action.ActionMessage cannot be cast... - -------------------------------------------------------------------------------- type Exception...: org.apache.struts.action.ActionMessage cannot be cast to org.apache.struts.action.ActionError
cannot do the additional operator
cannot do the additional operator  i got problem with additional...;!-- first text field --> <input type="text" name="num1"> <!-- selection...;input type="text" name="num2"> </p> <p align="center"> <
cannot display an arrayList in JSP
cannot display an arrayList in JSP  Hello, My bean is called Zone, i got all Zones from sql Server with Hibernate. in DAO.Class: print("List zones = session.createQuery("FROM Zone").list();"); i want to send this List from
System.out.println cannot be written inside a class
System.out.println cannot be written inside a class  why System.out.println cannot be written inside a class
data type used to store name.(getting an error)
getting an error like dis: "ename cannot be resolved to a variable" whats...data type used to store name.(getting an error)    Statement stm=con.createStatement(); String query="select * from employee where ename
java.lang.IllegalArgumentException: node to traverse cannot be null!
java.lang.IllegalArgumentException: node to traverse cannot be null!  Can Any body help me out regarding the above exception in Hibernate HQL
cannot find symbol - Java Beginners
cannot find symbol  public class Areatest { public static void main(String[]args) { Figure[]figures={new Triangle(2.0,3.0,3.0),new Rectangle(4.0,6.0),new Square(5.0)}; for(int i=0;i
image cannot be saved - Java Beginners
image cannot be saved  In the following program when we click...) { int type = BufferedImage.TYPE_INT_RGB; if (hasAlpha == true) {type...), image.getHeight(null), type); } Graphics g = image1.createGraphics(); g.drawImage
java.lang.IllegalArgumentException: node to traverse cannot be null!
java.lang.IllegalArgumentException: node to traverse cannot be null!  Hi, I am new to Hibernate. I am facing the problem java.lang.IllegalArgumentException: node to traverse cannot be null! while updating a row. The code
ls: cannot access >: No such file or directory
ls: cannot access >: No such file or directory  import java.io.BufferedReader; import java.io.InputStreamReader; public class Example...: cannot access >: No such file or directory error is displayed .No f.txt
cannot find symbol method nextchar()??
cannot find symbol method nextchar()??  import java.util.Scanner; public class Calc5{ public static void main(String args[]){ Scanner obj = new Scanner(System.in); System.out.println("please enter
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads