"MyFirstServlet"의 두 판 사이의 차이

13번째 줄: 13번째 줄:
*Project Explorer --- MyFirstServlet --- Java resources --- src 우클릭 --- New --- Servlet
*Project Explorer --- MyFirstServlet --- Java resources --- src 우클릭 --- New --- Servlet
*"Create Servlet" --- Java package: myfirstservlet --- Name: MyFirstServletStarter --- [Finish]
*"Create Servlet" --- Java package: myfirstservlet --- Name: MyFirstServletStarter --- [Finish]
이클립스가 MyFirstServletStarter.java<ref>즉 MyFirstServletStarter 클래스</ref>을 생성해준다.
그런데 다음과 같이 오류 14개가 나타난다.
<source lang='dos'>
Description Resource Path Location Type
The import javax.servlet cannot be resolved MyFirstServletStarter.java /MyFirstServlet/src/myfirstservlet line 6 Java Problem
The import javax.servlet cannot be resolved MyFirstServletStarter.java /MyFirstServlet/src/myfirstservlet line 5 Java Problem
... (생략)
HttpServlet cannot be resolved to a type MyFirstServletStarter.java /MyFirstServlet/src/myfirstservlet line 14 Java Problem
</source>


==javax.servlet.jar==
==javax.servlet.jar==

2013년 1월 28일 (월) 01:16 판

Crystal Clear action info.png 작성 중인 문서입니다.
MyFirstServlet

1 사전 작업

2 절차

  • File --- New -- Project...
  • "Select a wizard" --- Web --- Dynamic Web Project --- [Next >]
  • "Dynamic Web Project" --- Project name: MyFirstServlet --- [Finish]
  • "Open Associated Perspective?" --- [Yes][1]
  • Project Explorer --- MyFirstServlet --- Java resources --- src 우클릭 --- New --- Servlet
  • "Create Servlet" --- Java package: myfirstservlet --- Name: MyFirstServletStarter --- [Finish]

이클립스가 MyFirstServletStarter.java[2]을 생성해준다.

그런데 다음과 같이 오류 14개가 나타난다.

Description	Resource	Path	Location	Type
The import javax.servlet cannot be resolved	MyFirstServletStarter.java	/MyFirstServlet/src/myfirstservlet	line 6	Java Problem
The import javax.servlet cannot be resolved	MyFirstServletStarter.java	/MyFirstServlet/src/myfirstservlet	line 5	Java Problem
... (생략)
HttpServlet cannot be resolved to a type	MyFirstServletStarter.java	/MyFirstServlet/src/myfirstservlet	line 14	Java Problem

3 javax.servlet.jar

  • javax.servlet.jar 다운로드
  • Project Explorer --- MyFirstServlet --- WebContent --- WEB-INF --- lib 폴더에 드래그하여 넣음

4 같이 보기

5 주석

  1. Package Explorer가 Project Explorer로 바뀜
  2. 즉 MyFirstServletStarter 클래스
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}