JSTL - get 방식으로 넘어온 파라미터 값을 JSTL로 받기

Published on: 2009. 4. 7. 00:20 by louis.dev
만약 get 값으로
http://127.0.0.1:8080/jstl/ifTag.jsp?name=bk

이렇게 넘어 들어오면 JSTL에서는
${param.name}
으로 받을수 있다.

param 은 파라미터값으로 넘어온 데이터를 뜻하고
name 은 그 데이터중 name이라는 이름을 갖는 데이터의 값을 가져오겠다는 뜻이다.

${param.name} 는
request.getParameter("name") 과 같다.

'Web > JSTL' 카테고리의 다른 글

JSTL - fmt를 사용해서 데이터 format 변경하기.  (0) 2009.07.29
JSTL - <c:import> , <c:redirect>  (0) 2009.04.15
JSTL - <c:url>  (0) 2009.04.15
JSTL - 라이브러리 다운받기  (0) 2009.04.03

JSTL - 라이브러리 다운받기

Published on: 2009. 4. 3. 12:11 by louis.dev
1.http:www.apache.org
-jakarta 선택
2.왼쪽 메뉴에서 Subprojects - Taglibs

3.왼쪽 메뉴에서 Jakarta Taglibs - download

3.Standard 1.1 Taglib 다운로드
http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi

주의::
다운로드후 압축풀면 lib 폴더에 jar파일이 있는데(jstl.jar,standard.jar) 이파일들을 라이브러리로 추가 하기 전에 몇 버젼인지 파일자체 이름에다 명시적으로 써 주어야 한다.(나중에 헷갈리지 않게 하기 위해서)
jstl.jar ->> jstl-1.1.2.jar
standard.jar ->> standard-1.1.2.jar

jsp 파일에 코드 삽입

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Ajax - Ajax의 XMLHTTPRequest 객체 생성의 일반적 루틴

Published on: 2009. 4. 2. 02:24 by louis.dev

<script type="text/javascript">
//1.XMLHTTPRequest 가 생성 되었는지 안되었는지 알아보는 변수를 선언
var xmlRequest = false;

//2.XMLHTTPRequest 가 생성 되었는지 안되었는지 체크하는 실질적 메소드 선언
function ajaxInit() {
 if (xmlRequest == null || !xmlRequest) {
  xmlRequest = getXMLHttpRequest();
 }
}

//3.위의 메소드에서 XMLHTTPRequest 객체가 생성이 안되있으면 getXMLHttpRequest() 를 불러 객체 생성
// 참조:: http://javastore.tistory.com/entry/Ajax-브라우저에-따라-XMLHTTPRequest-객체-생성하기

function getXMLHttpRequest() {
 var request = false;
 try {
   request = new XMLHttpRequest();
 } catch (trymicrosoft) {
   try {
     request = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (othermicrosoft) {
     try {
       request = new ActiveXObject("Microsoft.XMLHTTP");
     } catch (failed) {
       request = false;
     }
   }
 }

 if (!request) {
  alert("Error initializing XMLHttpRequest!");
 }
 return request;
}


</script>

Ajax - 기존의 Ajax로 뿌려주던 html을 지워주는 init() 메소드

Published on: 2009. 4. 2. 02:13 by louis.dev

//1.init() method
function init() {
 var printTable = document.getElementById("idPrintTable");                 //id가 idPrintTable인 곳을 가져와 printTable에 저장
 removeChildAll(printTable);
}

//2. 실질적으로 reset 시켜주는 method
function removeChildAll(obj) {
 while(obj.firstChild) {
  obj.removeChild(obj.firstChild);
 }
}

============================table 태그에 id 주는 방법=============================
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tbody id="idPrintTable">
    </tbody>
</table>