JSTL Quick 레퍼런스.
ITWeb/개발일반 2010. 3. 15. 18:15원본링크 : http://cs.roosevelt.edu/eric/books/JSP/jstl-quick-reference.pdf
구글링 하다 찾은 자료구요..
누구나 쉽게 얻을 수 있는 자료 입니다.
제가 너무 노력 없이 얻은 것 같아 미안하긴 하지만.. ㅎㅎ 정보의 공유란 좋은게 아닌가 싶내요.. :)
즐프~
'ITWeb/개발일반'에 해당되는 글 490건
JSTL Quick 레퍼런스.ITWeb/개발일반 2010. 3. 15. 18:15원본링크 : http://cs.roosevelt.edu/eric/books/JSP/jstl-quick-reference.pdf 구글링 하다 찾은 자료구요.. 누구나 쉽게 얻을 수 있는 자료 입니다. 제가 너무 노력 없이 얻은 것 같아 미안하긴 하지만.. ㅎㅎ 정보의 공유란 좋은게 아닌가 싶내요.. :) 즐프~ SiteMesh 매뉴얼 정리본ITWeb/개발일반 2010. 3. 15. 17:40주관적으로 필요한 내용만 발췌해서 정리한 문서 입니다.
원문은 opensymphony 에서 보시면 됩니다. 원문링크 : http://www.opensymphony.com/sitemesh/ SiteMesh Flow Diagram Character Sets
1. If possible, the web application should be configured to use UTF-8 as the default encoding. Orion allows this to be specific in orion-web.xml, as the <%@ page contentType="text/html; charset=utf-8"%> Note that some older versions of Orion do not respect the contentType page directive in included pages, so to be on the safe side, this directive should be specified in ALL pages, not just the top level one (one could use an include). 2. The next step is to inform the browser that the page contents are of a specific character set. This is done by specifying a meta tag in the HEAD element of the html page, like this: <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8"> 3. The final step is informing SiteMesh's decorator mechanism that it should use a specific encoding other than the default. This is done by specifying an encoding attribute to the applyDecorator tag with the name of the encoding to use. <page:applyDecorator name="form" encoding="utf-8"> ... </page:applyDecorator> SiteMesh Tags 원문링크 : http://www.opensymphony.com/sitemesh/tags.html 아래 코드들에 대해서 <page:applyDecorator...></page:applyDecorator> 한 페이지에 포함이 된 값들은 original page's HTML 범주에 포함이 되지 않습니다. 다시 말해 <decorator:TAGS /> 를 사용하기 위해서는 1 depth 까지만 적용 된다는 점을 감안 해셔서 사용하세요. 아래 예는 단순 비교 입니다... ^^;; 감안 하시길.. 좋은예의 경우 <decorator:title> 이 original page's 의 title 값으로 변경이 되지만 나쁜예의 경우는 변경이 되지 않습니다. 좋은 예) defaultLayout.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %> <html lang="ko"> <head> <title><decorator:title default="INDEX" /></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> <!-- document.domain=".naver.com"; //--> </script> <decorator:head /> <!-- 이 부분은 original page's HTML 에서 <head></head>사이의 코드를 append 합니다. --> </head> <decorator:body /> <page:applyDecorator name="bbsFooterLayout" /> 나쁜 예) defaultLayout.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %> <page:applyDecorator name="bbsHeaderLayout" /> <decorator:body/> <page:applyDecorator name="bbsFooterLayout" /> Decorator TagsThese tags are used to create page Decorators. A Decorator is typically built up from an HTML layout (or whatever is appropriate for the original page content-type) with these tags inserted to provide place-holders for the data from the original (undecorated) page. For more details, see Building Decorators. <decorator:head />Description: Insert contents of original page's HTML
Attributes:
<decorator:body />Description: Insert contents of original page's HTML Attributes:
<decorator:title [ default="..." ] />Description: Insert title of original page (obtained from
Attributes:
<decorator:getProperty property="..." [ default="..." ] [ writeEntireProperty="..." ]/>Description: Insert property of original page. See API reference for HTMLPage for details of how properties are obtained from a page. Attributes:
<decorator:usePage id="..." />
|
Attribute | Required | Description |
---|---|---|
name | yes | key to for other packages to reference |
extends | no | inherits package behavior of the package it extends |
namespace | no | see Namespace Configuration |
abstract | no | declares package to be abstract (no action configurations required in package) |
Actions are the basic "unit-of-work" in XWork, they define, well, actions. An action will usually be a request, (and usually a button click, or form submit). The main action element has two parts, the friendly name (referenced in the URL, i.e. saveForm.action) and the corresponding "handler" class.
<action name="formTest" class="com.opensymphony.xwork.example.SampleAction" method="processSample">
The optional "method" parameter tells XWork which method to call based upon this action. If you leave the method parameter blank, XWork will call the method execute() by default. If there is no execute() method and no method specified in the xml file, XWork will throw an exception.
<package name="myPackage" ....>
...
<default-action-ref name="simpleViewResultAction">
<!--
An example of a default action that is just a simple class
that has 3 fields: successUrl, errorUrl, and inputUrl. This action
parses the request url to set the result values. In the normal case
it just renders velocity results of the same name as the requested url.
-->
<action name="simpleViewResultAction" class="SimpleViewResultAction">
<result type="velocity">${successUrl}</result>
<result name="error" type="velocity">${errorUrl}</result>
<result name="input" type="velocity">${inputUrl}</result>
</action>
...
</package>
Result tags tell XWork what to do next after the action has been called. There are a standard set of result codes built-in to XWork, (in the Action interface) they include:
String SUCCESS = "success"; String NONE = "none"; String ERROR = "error"; String INPUT = "input"; String LOGIN = "login";
You can extend these as you see fit. Most of the time you will have either SUCCESS or ERROR, with SUCCESS moving on to the next page in your application;
<result name="success" type="dispatcher"> <param name="location">/thank_you.jsp</param> </result>
...and ERROR moving on to an error page, or the preceding page;
<result name="error" type="dispatcher"> <param name="location">/error.jsp</param> </result>
Results are specified in a xwork xml config file (xwork.xml) nested inside <action>. If the location param is the only param being specified in the result tag, you can simplify it as follows:
<action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher"> <param name="location">foo.jsp</param> </result> </action>
or simplified
<action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher">foo.jsp</result> </action>
or even simplified further
<action name="bar" class="myPackage.barAction"> <result>foo.jsp</result> </action>
Webwork provides several implementations of the com.opensymphony.xwork.Result interface to make web-based interactions with your actions simple. These result types include:
<interceptors> <interceptor name="security" class="com.mycompany.security.SecurityInterceptor"/> <interceptor-stack name="defaultComponentStack"> <interceptor-ref name="component"/> <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors>
To use them in your actions:
<action name="VelocityCounter" class="com.opensymphony.xwork.example.counter.SimpleCounter"> <result name="success">...</result> <interceptor-ref name="defaultComponentStack"/> </action>
A sibling is an element that shares the same parent with another element. In the diagram below, the <li>'s are siblings as they all share the same parent - the <ul>.
같은 부모를 갖는 동일 level 의 node 들...
Handle | Name | Description |
0 | stdin | Standard input |
1 | stdout | Standard output |
2 | stderr | Standard error |
아래는 뽑아서 올려 놓은 거랍니다.. :)
REDIRECTION
Before a command is executed, its input and output may be redirected using a special notation inter-
preted by the shell. Redirection may also be used to open and close files for the current shell exe-
cution environment. The following redirection operators may precede or appear anywhere within a sim-
ple command or may follow a command. Redirections are processed in the order they appear, from left
to right.
In the following descriptions, if the file descriptor number is omitted, and the first character of
the redirection operator is <, the redirection refers to the standard input (file descriptor 0). If
the first character of the redirection operator is >, the redirection refers to the standard output
(file descriptor 1).
The word following the redirection operator in the following descriptions, unless otherwise noted, is
subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic
expansion, quote removal, pathname expansion, and word splitting. If it expands to more than one
word, bash reports an error.
Note that the order of redirections is significant. For example, the command
ls > dirlist 2>&1
directs both standard output and standard error to the file dirlist, while the command
ls 2>&1 > dirlist
directs only the standard output to file dirlist, because the standard error was duplicated as stan-
dard output before the standard output was redirected to dirlist.
Bash handles several filenames specially when they are used in redirections, as described in the fol-
lowing table:
/dev/fd/fd
If fd is a valid integer, file descriptor fd is duplicated.
/dev/stdin
File descriptor 0 is duplicated.
/dev/stdout
File descriptor 1 is duplicated.
/dev/stderr
File descriptor 2 is duplicated.
/dev/tcp/host/port
If host is a valid hostname or Internet address, and port is an integer port number or
service name, bash attempts to open a TCP connection to the corresponding socket.
/dev/udp/host/port
If host is a valid hostname or Internet address, and port is an integer port number or
service name, bash attempts to open a UDP connection to the corresponding socket.
A failure to open or create a file causes the redirection to fail.
Redirections using file descriptors greater than 9 should be used with care, as they may conflict
with file descriptors the shell uses internally.
Redirecting Input
Redirection of input causes the file whose name results from the expansion of word to be opened for
reading on file descriptor n, or the standard input (file descriptor 0) if n is not specified.
The general format for redirecting input is:
[n]<word
Redirecting Output
Redirection of output causes the file whose name results from the expansion of word to be opened for
writing on file descriptor n, or the standard output (file descriptor 1) if n is not specified. If
the file does not exist it is created; if it does exist it is truncated to zero size.
The general format for redirecting output is:
[n]>word
If the redirection operator is >, and the noclobber option to the set builtin has been enabled, the
redirection will fail if the file whose name results from the expansion of word exists and is a regu-
lar file. If the redirection operator is >|, or the redirection operator is > and the noclobber
option to the set builtin command is not enabled, the redirection is attempted even if the file named
by word exists.
Appending Redirected Output
Redirection of output in this fashion causes the file whose name results from the expansion of word
to be opened for appending on file descriptor n, or the standard output (file descriptor 1) if n is
not specified. If the file does not exist it is created.
The general format for appending output is:
[n]>>word
Redirecting Standard Output and Standard Error
Bash allows both the standard output (file descriptor 1) and the standard error output (file descrip-
tor 2) to be redirected to the file whose name is the expansion of word with this construct.
There are two formats for redirecting standard output and standard error:
&>word
and
>&word
Of the two forms, the first is preferred. This is semantically equivalent to
>word 2>&1
Here Documents
This type of redirection instructs the shell to read input from the current source until a line con-
taining only word (with no trailing blanks) is seen. All of the lines read up to that point are then
used as the standard input for a command.
The format of here-documents is:
<<[-]word
here-document
delimiter
No parameter expansion, command substitution, arithmetic expansion, or pathname expansion is per-
formed on word. If any characters in word are quoted, the delimiter is the result of quote removal
on word, and the lines in the here-document are not expanded. If word is unquoted, all lines of the
here-document are subjected to parameter expansion, command substitution, and arithmetic expansion.
In the latter case, the character sequence \<newline> is ignored, and \ must be used to quote the
characters \, $, and ?
If the redirection operator is <<-, then all leading tab characters are stripped from input lines and
the line containing delimiter. This allows here-documents within shell scripts to be indented in a
natural fashion.
Here Strings
A variant of here documents, the format is:
<<<word
The word is expanded and supplied to the command on its standard input.
Duplicating File Descriptors
The redirection operator
[n]<&word
is used to duplicate input file descriptors. If word expands to one or more digits, the file
descriptor denoted by n is made to be a copy of that file descriptor. If the digits in word do not
specify a file descriptor open for input, a redirection error occurs. If word evaluates to -, file
descriptor n is closed. If n is not specified, the standard input (file descriptor 0) is used.
The operator
[n]>&word
is used similarly to duplicate output file descriptors. If n is not specified, the standard output
(file descriptor 1) is used. If the digits in word do not specify a file descriptor open for output,
a redirection error occurs. As a special case, if n is omitted, and word does not expand to one or
more digits, the standard output and standard error are redirected as described previously.
Moving File Descriptors
The redirection operator
[n]<&digit-
moves the file descriptor digit to file descriptor n, or the standard input (file descriptor 0) if n
is not specified. digit is closed after being duplicated to n.
Similarly, the redirection operator
[n]>&digit-
moves the file descriptor digit to file descriptor n, or the standard output (file descriptor 1) if n
is not specified.
Opening File Descriptors for Reading and Writing
The redirection operator
[n]<>word
causes the file whose name is the expansion of word to be opened for both reading and writing on file
descriptor n, or on file descriptor 0 if n is not specified. If the file does not exist, it is cre-
ated.
아래 글에 이어서.. 추가 입니다.
참고 URL :
http://alma.ch/perl/Mail-Sendmail-FAQ.html
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/Sendmail.pm
sub setSendMail {
my $message = $_[0];
%mail = (
To => 'to@email.com',
From => 'from@email.com',
Subject => 'TITLE',
'Content-type' => 'text/html; charset="UTF-8"',
Message => "<span style='font-size:11px; font-family:맑은 고딕, 돋움'>$message</span>"
);
if ( $message ) {
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
}
}
보시는 바와 같이 빨간 부분을 추가해 주시면 됩니다.
Content-type 앞뒤로 quotation 빼먹으시면 정상적으로 적용 안되니 유의 하세요.
우선 기본적으루다.. sendmail 을 이용해서 발송 해야 하는 건 아시죠..
리눅스 기반 입니다.
일단 sendmail 이 실행 되어 있어야 겠죠.
http://www.faqs.org/docs/linux_network/x15649.html
Perl 용 sendmail 모듈을 설치 하시죠.
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79_16/Sendmail.pm
저는 매뉴얼 설치 했습니다.
별거 없죠... 기냥.. 소스 받아서 압축 풀고 /usr/sbin/perl/site_perl 에 가져다 놓으면 끝..
샘플 코드 위에 링크 보면 있죠.. ㅋ
아래 코드는 구글링 해보시면 가장 많이 나오는 예제 중 하나 입니다.
두 가지를 다 넣어서 테스트 해본 거죠..
sub setSendMail {
my $sendmailer = '/usr/sbin/sendmail';
%mail = (
To => 'your@email.com',
From => 'your@email.com',
Subject => '제목 입력',
Message => "메시지 입력"
);
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
open (MAIL, "|$sendmailer -oi -t");
print MAIL "From: your@email.com\n";
print MAIL "To: your@email.com\n";
print MAIL "Subject: 제목입력\n\n";
print MAIL "메시지 입력\n";
close(MAIL);
}
그럼 즐프 하세요.
아주 초보적인 스크립트죠.
#!/usr/bi/perl
@files = </home/계정/*>;
foreach $file (@files) {
if ( -f $file ) {
print "This is a file (" . $file . ")\n";
}
if ( -d $file ) {
print "This is a directory (" . $file . ")\n";
}
}
사실 제가 만들고 싶은걸 작성 하기 전에 이 기초적인 것 부터.. 기록해 두려고.. 글 등록 합니다.
내가 만들고 싶은거..
1. 특정 디렉토리를 recursive 하게 search 를 한다.
2. inode 가 변경 된 최신 파일을 대상으로 file size 가 특정 용량을 넘는지 검사를 한다.
- daily 로 검사 하면 된다.
- 근데 파일은 매일 매일 증가를 할 텐데 추가된 거나 inode 만 변경 된 걸로 increase 하게 검색 할 수 있을까?
- 파일 올릴때 어디 기록을 해야 하나..ㅡ.ㅡ;
3. 특정 용량이 넘으면 alert mail 을 발송 또는 통계를 작성 하여 메일 발송 한다.
암튼.. 지금은 배도 무지 고프고 머리도 멍 하고..
대충 이정 도만 정리를 하자..
뭐.. 보니 recursive function 하나 만들어서 잘 돌리면 몇 줄 안짜고 쉽게 만들수도 있을 것 같다.
근데.. 고민은.. 2번 이다..ㅡ.ㅡ;;
파일은 무한정 늘어 날텐데... 흠..
[원본 글]
http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html
http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html
기본적으로 알고 계셔야 하는 annotation 이지요... :)
The@Deprecated
annotation indicates that the marked method should no longer be used. The compiler generates a warning whenever a program uses a deprecated method, class, or variable. When an element is deprecated, it should be documented using the corresponding@deprecated
tag, as shown in the preceding example. Notice that the tag starts with a lowercase "d" and the annotation starts with an uppercase "D". In general, you should avoid using deprecated methods — consult the documentation to see what to use instead.
The@Override
annotation informs the compiler that the element is meant to override an element declared in a superclass. In the preceding example, the override annotation is used to indicate that thegetPreferredFood
method in theHorse
class overrides the same method in theAnimal
class. If a method marked with@Override
fails to override a method in one of its superclasses, the compiler generates an error.While it's not required to use this annotation when overriding a method, it can be useful to call the fact out explicitly, especially when the method returns a subtype of the return type of the overridden method. This practice, called covariant return types, is used in the previous example:
Animal.getPreferredFood
returns aFood
instance.Horse.getPreferredFood
(Horse
is a subclass ofAnimal
) returns an instance ofHay
(a subclass ofFood
). For more information, see Overriding and Hiding Methods.
The@SuppressWarnings
annotation tells the compiler to suppress specific warnings that it would otherwise generate. In the previous example, theuseDeprecatedMethod
calls a deprecated method ofAnimal
. Normally, the compiler generates a warning but, in this case, it is suppressed.Every compiler warning belongs to a category. The Java Language Specification lists two categories: "deprecation" and "unchecked". The "unchecked" warning can occur when interfacing with legacy code written before the advent of generics. To suppress more than one category of warnings, use the following syntax:
@SuppressWarnings({"unchecked", "deprecation"})
위 원문에 대한 번역이 잘된 글 링크 넣습니다.
원본 글 : http://decoder.tistory.com/21