일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- hyperlink 쿼리스트링 바인딩
- Oracle 10g
- SQL 명령어가 올바르게 종료되지 않았습니다.
- ASP.NET Error
- 페이지 간 게시
- 자바스윙
- Repeater
- Ajax댓글
- RowCount 폐이징
- 이벤트 처리
- ASP.NET 회원가입
- prototype
- jsp
- JDK1.5
- ajax
- 우편번호검색
- ASP.NET
- prototype.js
- json
- ORA-00942
- 스크립트릿
- ASP.NET 방명록
- XML
- 테이블또는 뷰가 존재하지 않습니다.
- DataList컨트롤
- Ajax한글 처리문제
- 웹표준
- JavaScript
- 자동완성기능
- 객체생성
- Today
- Total
IT 쟁이
JSP MVC1 스크립트릿사용시 -ㅁ- 삽질.... 본문
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ page import="javax.rmi.*" %>
<%@ page import="javax.naming.*" %>
<%@ page import="javax.transaction.*" %>
<%@ page import="java.util.*" %>
<%@ page import="kiuk.student.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
<--------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("euc-kr");
Context ctx =null;
String cont=request.getParameter("dden");
String name=request.getParameter("name");
String ssn =request.getParameter("ssn");
String grade=request.getParameter("grade");
try{
if(cont!=null) {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
ctx = new InitialContext(p);
Object h = ctx.lookup("StudentBean");
StudentHome home=(StudentHome)PortableRemoteObject.narrow(h,StudentHome.class);
Student student =home.create(name,Integer.parseInt(ssn),Integer.parseInt(grade));
}
%>
<%=cont %>
<%=name %>
<%=ssn %>
<%=grade %>
<form name="listForm" method="post" action="../student/list.jsp">
이름<input type="text" name="name" size="5">
SSN<input type="text" name="ssn" size="5">
GRADE<input type="text" name="grade" size="5"><br>
<input type="hidden" name="dden" value="--">
<input type="submit" name="insert" value="입력">
<%
}catch(Exception ex){} %>
</form>
</body>
</html>
EJB를 가지고 작업하던걸 다시 JSP로 변환하던중..엄청난 착각을 했던것이 있었다.
너무 오랜만에 스크립트릿을 사용했을까..
내용관련된 스크립트릿의 처리위치는 <body></body> 사이에 있는것과
<html>앞에 위치하는것이 좋다..
절대 <head></head>사이에는 -ㅁ- 삽질....