리그캣의 개발놀이터

jsp 예제 소스 3 본문

프로그래밍 언어/jsp

jsp 예제 소스 3

리그캣 2018. 1. 25. 16:08

뇌를 자극하는 jsp


8_1.jsp


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ page language = "java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<h3>책 소개</h3>
제목 : 뇌를 자극하는 Java 프로그래밍 <br>
저자 : 김윤명 <br>
페이지수 : 908 <br><br>
<jsp:include page="Copyright.html"/>
</body>
</html>
cs


8_6.jsp


1
2
3
4
5
6
<%@page contentType="text/html;charset=euc-kr"%>
<jsp:useBean class = "mall.PersonalInfo" id = "pinfo" scope="request"/>
<jsp:setProperty name ="pinfo" property="name" value="김현수"/>
<jsp:setProperty name ="pinfo" property="gender" value="남"/>
<jsp:setProperty name ="pinfo" property="age" value="23"/>
<jsp:forward page="CustomerInfoViewer.jsp"/>
cs


8_12.java


1
2
3
4
5
6
7
8
import java.awt.*;
import javax.swing.*;
public class HelloJavaApplet extends JApplet{
    public void init(){
        Container contentPane = getContentPane();
        contentPane.add(new JLabel("Hello, Java",SwingContants.CENTER));
    }
}
cs


8_19.java

1
2
3
4
5
6
7
8
9
10
11
12
13
import javax.servlet.http.*;
 
public class PersonalInfoServlet extends HttpServlet{
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException{
        PersonalInfo obj=new PersonalInfo();
        obj.setName("이정호");
        obj.setGender('남');
        obj.setAge(24);
        request.setAttribute("pinfo",obj);
        RequestDispatcher dispatcher=request.getRequestDispatcher("CustomerInfoViewer.jsp");
        dispatcher.forward(request, response);
    }
}
cs


8_22.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%@ page language ="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>회원정보</title>
</head>
<body>
    <jsp:useBean class="mall.PersonalInfo" id="pinfo"/>
    <jsp:setProperty name="pinfo" property="name" param="NAME"/>
    <jsp:setProperty name="pinfo" property="gender" param="GENDER"/>
    <jsp:setProperty name="pinfo" property="age" param="AGE"/>
    이름 : <jsp:getProperty name="pinfo" property="name"/> <br>
    성별 : <jsp:getProperty name="pinfo" property="gender"/> <br>
    나이 : <jsp:getProperty name="pinfo" property="age"/> <br>
</body>
</html>
cs


8_23.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ page language ="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>회원정보</title>
</head>
<body>
    <jsp:useBean class="mall.PersonalInfo" id="pinfo"/>
    <jsp:setProperty name="pinfo" property="*"/>
    이름 : <jsp:getProperty name="pinfo" property="name"/> <br>
    성별 : <jsp:getProperty name="pinfo" property="gender"/> <br>
    나이 : <jsp:getProperty name="pinfo" property="age"/> <br>
</body>
</html>
cs


8_28

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<%@ page language ="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
 
    <jsp:useBean class="mall.PersonalInfo" id="pinfo" scope="request"/>
    <jsp:setProperty name="pinfo" property="cod" value="50001"/>
    <jsp:setProperty name="pinfo" property="name" value="의뢰인"/>
     <jsp:setProperty name="pinfo" property="gender" value="9000"/>
    <jsp:setProperty name="pinfo" property="writer" value="졷 그라삼"/>
    <jsp:setProperty name="pinfo" property="age" value="704"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>책 정보 관리</title>
</head>
<body>
    책 정보가 저장되었습니다. <br>
    --------------------------------<br>
    <h3> 제품 개략 정보 </h3>
    <jsp:include page="ProductInfo.jsp"/>
</body>
</html>
cs


8_33.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
<%@page contentType="text/html;charset = euc-kr"%>
<HTML>
    <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
    <HEAD><TITLE>익스프레션 언어 연산자 연습 </TITLE></HEAD>
    <BODY>
        <jsp:plugin type="applet" code="GreetingApplet.class" codebase="Greeting.jsp" width="500" height="200">
        <jsp:params>
            <jsp:param name="GREETING" value="기체후 일향 만강하시옵니까."/>
            <jsp:param name="FONT" value="궁서체"/>
        </jsp:params>
        </jsp:plugin>
    </BODY>
</HTML>
cs


'프로그래밍 언어 > jsp' 카테고리의 다른 글

jsp 예제 소스 5  (0) 2018.01.25
jsp 예제 소스 4  (0) 2018.01.25
jsp 예제 소스코드 2  (0) 2018.01.25
jsp 예제 소스코드 - 1  (0) 2018.01.25
Comments