HttpServletRequest cannot be resolved to a type in eclipse - Solved

Ads

 
 

Share on Google+Share on Google+

Java Coder
HttpServletRequest cannot be resolved to a type in eclipse - Solved
2 Answer(s)      a year and 4 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


Ads









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
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
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
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
HttpServletRequest Example
HttpServletRequestExample extends HttpServlet { protected void doGet(HttpServletRequest request
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  how to compile using 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
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 develope web application servlets or jsp using eclipse id
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
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"> <
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
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
eclipse - Struts
Eclipse keyboard shortcuts  I need a list of eclipse keyboard shortcuts.Thanks
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
Version of eclipse>eclipse-boot dependency
List of Version of eclipse>eclipse-boot dependency
Version of eclipse>eclipse-jface dependency
List of Version of eclipse>eclipse-jface dependency
Version of eclipse>eclipse-runtime dependency
List of Version of eclipse>eclipse-runtime dependency
Version of eclipse>eclipse-ui dependency
List of Version of eclipse>eclipse-ui dependency