Posts

Showing posts with the label jsp

IE browser Version Check script

/* function getInternetExplorerVersion(){   var rv = -1; // Return value assumes failure.   if (navigator.appName == 'Microsoft Internet Explorer')   {     var ua = navigator.userAgent;     var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");     if (re.exec(ua) != null)       rv = parseFloat( RegExp.$1 );   }   return rv; } */

엑셀다운로드 파일명 한글깨짐

response.setHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes("euc-kr"),"8859_1")+".xlsx");

jstl function fmt

숫자 : <fmt:formatNumber value="12345.678" type="number"/><br/> 통화 : <fmt:formatNumber value="12345.678" type="currency" currencySymbol="$"/><br/> 백분율 : <fmt:formatNumber value="12345.678" type="percent"/><br/> 소수이하 : <fmt:formatNumber value="12345.678" pattern="#,##0.0"/><br/> JSTL tag ex)  : https://ahnsk39.blogspot.com/2017/08/jstljsp-standard-tag-library.html

jstl sql

<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <sql:setDataSource url="jdbc:mysql://127.0.0.1:1521/testdb?useUnicode=true&characterEncoding=UTF8" driver="org.gjt.mm.mysql.Driver" user="root...

jstl function trim

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> <c:set var="array" value="${fn:split(str,' ')}"/> join : <b>${fn:join(array,"-")}</b> <hr width="500" color=...

jstl function join

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> <c:set var="array" value="${fn:split(str,' ')}"/> join : <b>${fn:join(array,"-")}</b> <hr width="500" color=...

jstl function contains, containsIgnoreCase

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> contains : <b>${fn:contains(str,"Library")}</b><br> contains : <b>${fn:contains(str,"jstl")}</b><br> containsIgnoreCase : ...

jstl function indexOf, startsWith, endsWith

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> indexOf : <b>${fn:indexOf(str,"tag")}</b><br> indexOf : <b>${fn:indexOf(str,"Tag")}</b><br> startsWith : <b>${fn:starts...

jstl function replace

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> replace : <b>${fn:replace(str,"JSP","JAVA")}</b><br> <hr width="500" color="red" align="left"> </body...

jstl function toUpperCase toLowerCase

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> toUpperCase : <b>${fn:toUpperCase(str)}</b><br> toLowerCase : <b>${fn:toLowerCase(str)}</b><br> <hr width="500" color=...

jstl function substring

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> substring: <b>${fn:substring(str,0,17)}</b><br> substringAfter  : <b>${fn:substringAfter(str,"JSP")}</b><br> substringBefore : <b...

jstl function length

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <hr width="500" color="red" align="left"> <c:set var="str" value="JSTL(JSP Standard Tag Library)"/> length : <b>${fn:length(str)}</b><br> <hr width="500" color="red" align="left"> </body> </html> JSTL tag ex)  ...

JSTL(JSP Standard Tag Library)

jstl jar download : https://ahnsk39.blogspot.com/2017/08/can-not-find-tag-library-descriptor-for.html 1. CORE  1) 변수 선언, 실행흐름의 제어 기능  2) JSP 페이지 제어 기능    - c:out, c:set :  https://ahnsk39.blogspot.com/2017/08/jstl-cset-cout.html    - c:if :   https://ahnsk39.blogspot.com/2017/08/jstl-cif.html    - c:choose :  https://ahnsk39.blogspot.com/2017/08/jstl-cchoose.html    - c:forEach :  https://ahnsk39.blogspot.com/2017/08/jstl-foreach.html    - c:forTokens :  https://ahnsk39.blogspot.com/2017/08/jstl-fortokens.html 2. FORMAT  1) 숫자, 날짜, 시간을 포매팅하는 기능과 국제화, 다국어 지원 기능    - c:fmt :  https://ahnsk39.blogspot.com/2017/09/jstl-function-fmt.html 3. SQL  1) 데이터베이스의데이터 입력/수정/삭제/조회하는 기능    - sql :  https://ahnsk39.blogspot.com/2017/08/jstl-sql.html 4. XML  1) XML 문서 처리 기능 5. FUNCTIONS  1) 문자열을처리하...

jstl forTokens

Image
<body> <c:set var="str" value="A|P|P|L|E"/> <c:forTokens var="item" items="${str}" delims="|" > ${item}<br /> </c:forTokens> </body> JSTL tag ex)  :  https://ahnsk39.blogspot.com/2017/08/jstljsp-standard-tag-library.html

jstl forEach

Image
<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ page import="java.util.*"%> <!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=UTF-8"> <title>Insert title here</title> </head> <body> <% List list = new ArrayList(); list.add("A"); list.add("P"); list.add("P"); list.add("L"); list.add("E"); %> collection<br /> <c:forEach var="item" items="<%=list%>"> <c:out value="${...

jstl choose

Image
<c:set var="num1" value="9"/> <c:set var="num2" value="2"/> <c:choose>  <c:when test="${num1 == 2}"> 2   </c:when>  <c:when test="${num1 eq 9}">  9  </c:when>  <c:otherwise> <c:out value="${num1}"/> </c:otherwise> </c:choose> <br /> <br /> <br /> <c:set var="num1" value="11"/> <c:choose>  <c:when test="${num1 == 2}"> num1 2   </c:when>  <c:when test="${num1 eq 9}"> num1 9  </c:when>  <c:otherwise> <c:out value="${num1}"/> </c:otherwise> </c:choose> JSTL tag ex)  :  https://ahnsk39.blogspot.com/2017/08/jstljsp-standard-tag-library.html

jstl if

Image
<c:set var="num1" value="9"/> <c:set var="num2" value="2"/> <c:if test="${num1 == 9}">  ok </c:if> <c:if test="${num1 == 8}"> no </c:if> JSTL tag ex)  :  https://ahnsk39.blogspot.com/2017/08/jstljsp-standard-tag-library.html

jstl set out

Image
<c:set var="num1" value="9"/> <c:set var="num2" value="2"/> <c:out value="${num1}"/> <br /> <c:out value="${num2}"/> <br /> <c:out value="${num1+num2}"/> JSTL tag ex)  :  https://ahnsk39.blogspot.com/2017/08/jstljsp-standard-tag-library.html

tomcat index 설정

Image
 tomcat index.jsp /WebContent/WEB-INF/web.xml 수정 (Eclipse 단추키 Ctrl+R 후 web.xml입력)

Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" jstl

Image
Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" jstl jar download :  http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/ 1. jakarta-taglibs-standard-1.1.2.zip 2. 압축을 해제 하고 \jakarta-taglibs-standard-1.1.2\jakarta-taglibs-standard-1.1.2\lib 폴터에 가보면 jstl.jar, standard.jar가 있다. 3. 프로젝트의 WEB-INF/lib/ 밑에 파일을 복사 4. JSP에서 확인