GithubHelp home page GithubHelp logo

jsp_info's Introduction

JSP

JSP는 자바 서버 페이지(java server pages)라고 한다.

JSP는 HTML 코드와 java 코드를 넣어서 동적 웹 페이지를 만들거나 생성하는 도구이다.

스크린샷 2023-01-31 오후 6 00 46

입클립스라는 툴을 이용해서 hello.jsp파일을 생성하게 되면 위의 사친처럼 초기화면이 나오게된다.

지금 화면에 보이는것은 마크코드(HTML)이다.

jsp는 위에서도 말했다시피 html와 자바를 쓸수 있다고 했다.

근데 그냥 여기에 자바코드르 넣게 되면 인식을 할수 없다.

  <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
   <%
     System.out.println("hello1");
   %>
</body>
 </html>

위의 코드처럼 <% %> 사이에 자바코드를 넣어주면 여기는 자바코드구나 라고 인식을 하게 된다.

그러고 나서 톰캣으로 서버를 실행하게 되면

스크린샷 2023-01-31 오후 6 15 00

위의 사진처럼 아무것도 뜨지 않고

스크린샷 2023-01-31 오후 6 15 14

콘솔에 hello1 라고 뜬다.

코드에서 out.println("hello2");

라고 적게 되면

스크린샷 2023-01-31 오후 6 17 06

위의 사진처럼 웹에서 글씨가 나타나지는것을 볼수 있다.

jsp_info's People

Contributors

deokgyunshin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.