본문 바로가기
웹사이트 개발하기

Servlet과 JSP

by 노화방지 Anti-aging Hairstyle 2016. 6. 16.
반응형

둘 사이의 기본적인 차이점:
A very basic difference:

  • Servlet java로 된 html입니다
    Servlet
     is html in java
  • JSP is java in html JSP는 java in html로 된 java입니다

다른 차이점:
Other diff are:

  • JSP는 다이나믹 컨텐트를 생성시킬 수 있는 웹페이지 scripting 언어인 반면, Servlets도 또한 다이나믹 웹컨트를 생성시키는, 이미 컴파일된 Java programs입니다nt
    JSP is a webpage scripting language that can generate dynamic content while Servlets are Java programs that are already compiled which also creates dynamic web content
  • Servlets run faster compared to JSP
    Servlets은 JSP보다 빨리 실행됩니다
  • JSP can be compiled into Java Servlets
    JSP는 Java Servlets로 컴파일될 수 있습니다
  • It’s easier to code in JSP than in Java Servlets
    Java Servlets보다 JSP로 코드하는 것이 쉽습니다
  • In MVC, jsp act as a view and servlet act as a controller.
    MVC에서 jsp는 view로 servlet은 controller로 동작합니다
  • JSP는 일반적으로 많지 않은 데이터 처리가 필요한 경우에 사용됩니다.
    하지만 servlets은 보다 많은 관련된 처리 및 조작의 경우에 최적으로 사용됩니다.
    JSP are generally preferred when there is not much processing of data required. But servlets are best for use when there is more processing and manipulation involved.
  • Servlets 대비 JSP 프로그래밍의 장점은 Java beans를 직접 call할 수 있는 사용자 맞춤 태그를 만들 수 있다는 것입니다 
    The advantage of JSP programming over servlets is that we can build custom tags which can directly call Java beans. There is no such facility in servlets.
  • 클라이언트 측에서 JSP의 기능은 JavaScript를 실행하여 구현할 수 있습니다. 
    servlet에 상응하는 메소드는 없습니다.
    We can achieve functionality of JSP at client side by running JavaScript at client side. There are no such methods for servlets.

servlets은 다른 자바 클래스와 같습니다.
System.out을 사용하는 것처럼, 
자바 스크립트가 document.write를 사용하는 방법 처럼, print 문에 HTML을 넣습니다.
A servlet is like any other Java class. You put HTML into print statements like you use System.outor how JavaScript uses document.write.

JSP는 기술적으로 servlet으로 변환되지만, HTML에 자바를 포함시키는 경우의 PHP 파일과 보다 비슷합니다.
A JSP technically gets converted to a servlet but it looks more like PHP files where you embed the Java into HTML.

요약: 자바보다 HTML이 많이 있는 경우에는 servlets이 사용되어야 하고, HTML이 자바 보다 많은 경우에슨 JSP가 사용되어야 합니다.
In short: servlets should be used if you have more Java than HTML and JSP should be used if you have more HTML than Java.

초기 요청이 일부 자바 작업을 수행하는 서블릿에 전송되도록 하고 그런 다음 실제로 HTML 출력을 만드는 JSP로 전달하도록, 서블릿과 JSP를 결합하는 것은 매우 일반적입니다 .
It is very common to combine servlets and JSP so that the initial request gets sent to a servlet which does some Java work and then forwards it to a JSP which actually makes the HTML output.





반응형

'웹사이트 개발하기' 카테고리의 다른 글

Resizer  (0) 2016.03.07

댓글