[JSTL] <c:url>

jstl 2013. 5. 21. 09:18

[JSTL] <c:url>

url에 프로젝트 이름 안적어도 자동으로 잡아줌

프로젝트 내 script 등 경로를 지정시 컨텍스트 루트가 포함되지 않을 경우 포장작업 필요

src="/resource/~~" 인 경우 앞에 컨텍스트 루트 포함하기 위해 src="<c:url value='/resource/~' />"포장작업

<a href="<c:url value='/list.jsp' / > ">목록</a>

/ 앞에 프로젝트 경로가 잡힘




출처 : http://javastore.tistory.com/26

<c:url>

- 현재 서블릿 콘텍스트 됨(프로젝트 이름을 URL에 써야하는데 이걸 쓰면 url에 프로젝트를 써도 되고 안쓰면 자동으로 처리해준다)
- 세션 관리를 위한 URL 재작성
- 요청 매개변수 이름과 값의 URL 인코딩

<!--파라미터가 없는 형태 -->
<a href="<c:url value='/list.jsp' / > ">목록</a>

<!-- 파라미터가 있는 형태-->
<c:url value="/list.jsp" >

<c:param name="searchColumn" value="${searchColumn}" />
<c:param name="searchWord" value="${searchWord}" />
</c:url>


'jstl' 카테고리의 다른 글

[jstl] jstl 문법 2  (0) 2013.06.17
[jstl] jstl 문법 1  (0) 2013.06.17
Posted by airlueos
,

[jQuery] :input 선택자 

폼 태그 내 모든 입력 관련 선택



출처 : http://api.jquery.com/input-selector/

Description: Selects all input, textarea, select and button elements.

  • version added: 1.0jQuery( ":input" )

The :input selector basically selects all form controls.

Additional Notes:

  • Because :input is a jQuery extension and not part of the CSS specification, queries using :input cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. To achieve the best performance when using :input to select elements, first select the elements using a pure CSS selector, then use.filter(":input").

Example:

Finds all input elements.

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<style>
textarea { height:25px; }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<form>
<input type="button" value="Input Button"/>
<input type="checkbox" />
<input type="file" />
<input type="hidden" />
<input type="image" />
<input type="password" />
<input type="radio" />
<input type="reset" />
<input type="submit" />
<input type="text" />
<select><option>Option</option></select>
<textarea></textarea>
<button>Button</button>
</form>
<div id="messages">
</div>
<script>
var allInputs = $(":input");
var formChildren = $("form > *");
$("#messages").text("Found " + allInputs.length + " inputs and the form has " +
formChildren.length + " children.");
// so it won't submit
$("form").submit(function () { return false; });
</script>
</body>
</html>


Posted by airlueos
,

[eclipse] 찾기 단축키(ctrl + shift + R , ctrl + H)

ctrl + shift + R : 파일 내에서 찾기(프로젝트 내 파일 검색)

ctrl + H : 전 범위 찾기(모든 파일 검색)

Posted by airlueos
,