Programming/jsp2014. 3. 27. 19:43
jsp 파일에서 page를 통해 buffer를 설정이 가능하다.
기본값은 8K 에 autoFlush(=true) 하도록 되어 있다.
<%@ page contentType="text/html; charset=euc-kr"%>
<%@ page buffer="16kb" autoFlush="false"%> 

jsp 파일에서 설정된 내용은 java/class로 변환되는데 
public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=EUC-KR");
      pageContext = _jspxFactory.getPageContext(this, request, response,
       null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out; 

javax.servlet.jsp.JspFactory.getPageContext() 메소드를 통해 설정하게 된다.
java.lang.Object
  extended by javax.servlet.jsp.JspFactory
 
public abstract PageContext getPageContext(Servlet servlet,
                                           ServletRequest request,
                                           ServletResponse response,
                                           String errorPageURL,
                                           boolean needsSession,
                                           int buffer,
                                           boolean autoflush)
 
[링크 : http://docs.oracle.com/javaee/5/api/javax/servlet/jsp/JspFactory.html#getPageContext(...)

Posted by 구차니
Programming/jsp2014. 3. 27. 19:32
jsp의 scope가 있는데
page는 하나의 페이지에 대해서 유효
request는 HTTP request 에 대해서 유효
session은 HTTP session에 대해서 유효
applicatoin은 WAS에 대해서 유효한 값 범위를 지닌다.

조금 다르게 설명을 하면
page는 단일 jsp 파일 하나에 대한
request는 jsp 파일 하나에서 링크로 이어지는 파일까지
session은 웹 브라우저에서 서버로 접속한 세션이 유효한 동안(주로 로그인 인증에 사용)
application은 웹 서버에서 서비스 하는 하나의 전체 홈페이지에 대해서 유효하다.


There are four possible scopes:
  • scope="page" (default scope): The object is accessible only from within the JSP page where it was created. A page-scope object is stored in the implicitpageContext object. The page scope ends when the page stops executing.

    Note that when the user refreshes the page while executing a JSP page, new instances will be created of all page-scope objects.

  • scope="request": The object is accessible from any JSP page servicing the same HTTP request that is serviced by the JSP page that created the object. A request-scope object is stored in the implicit request object. The request scope ends at the conclusion of the HTTP request.

  • scope="session": The object is accessible from any JSP page that is sharing the same HTTP session as the JSP page that created the object. A session-scope object is stored in the implicit session object. The session scope ends when the HTTP session times out or is invalidated.

  • scope="application": The object is accessible from any JSP page that is used in the same Web application as the JSP page that created the object, within any single Java virtual machine. The concept is similar to that of a Java static variable. An application-scope object is stored in the implicitapplication servlet context object. The application scope ends when the application itself terminates, or when the JSP container or servlet container shuts down.

[링크 : http://docs.oracle.com/cd/B14099_19/web.1012/b14014/genlovw.htm

Scope is nothing but lifetime object 

1.page - only in the particular jsp
2.request- only in the jsp to which you forward your request object
3.session- it is available until the session is invalidate(you can access it from any jsp)
4.application-it is available until the web application or server shutdown(you can access it from any jsp).available through whole application
 
[링크 : http://www.coderanch.com/.../certification/Page-Scope-request-Scope-session

[링크 : http://docs.oracle.com/javaee/1.4/api/javax/servlet/jsp/PageContext.html]
[링크 : http://www.java-samples.com/showtutorial.php?tutorialid=1009]

'Programming > jsp' 카테고리의 다른 글

jsp error 페이지 사이즈 제한(IE)  (0) 2014.03.27
jsp buffer  (0) 2014.03.27
JSP에서 euc-kr로 할 경우 저장이 안되는 한글이 있다?  (0) 2014.03.26
JSP 기본 문법  (0) 2014.03.26
웹 서버 및 서비스 개요(java/jsp)  (0) 2014.03.26
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2014. 3. 27. 00:25
될지 안될지는 좀 찾아 봐야 하니 일단
공개된 sed1520 122x32 GLCD 소스를 찾아 보는중 ㅠㅠ

[링크 : http://en.pudn.com/downloads65/sourcecode/embed/detail234623_en.html]
    [링크 : http://read.pudn.com/downloads65/sourcecode/embed/234623/AVREW12A03GLY/sed1520.c__.htm

[링크 : http://sunge.awardspace.com/glcd-sd/]
    [링크 : http://sunge.awardspace.com/glcd-sd/node7.html]
    [링크 : http://sunge.awardspace.com/glcd-sd/node8.html]
Posted by 구차니
Programming/jsp2014. 3. 26. 21:34


이 녀석.. 아마도 완성형 코드인 euc-kr 에서 인식하지 못하기에
유니코드인 utf-8로 해야지 저장이 가능한 듯

이클립스에서 JSP 로 작업후 저장시 아래와 같이 UTF-8로 변환하길 권장한다.


[링크 : http://tapito.tistory.com/173] 완성형 문자표
[링크 : http://ko.wikipedia.org/wiki/EUC-KR ]

'Programming > jsp' 카테고리의 다른 글

jsp buffer  (0) 2014.03.27
jsp - page / request / session / applicaton  (0) 2014.03.27
JSP 기본 문법  (0) 2014.03.26
웹 서버 및 서비스 개요(java/jsp)  (0) 2014.03.26
Apache tomcat  (0) 2014.03.25
Posted by 구차니
Programming/jsp2014. 3. 26. 20:12
문법이라고 하기에도 애매하지만..
아무튼 치환자의 종료는 4가지가 있다.

 디렉티브 (Directive)  <%@ %> (import)
 스크립트릿 (Scriptlet)  <% %> (코드 영역 / 메소드 선언 불가)
 표현식 (Expression)  <%= %>(웹페이지로 출력)
 선언부 (Declaration)  <%! %> (메소드 선언 영역)
 
 
JSP는 jsp 파일이 내부적으로 WAS를 통해 *.java로 변경되며 *.class로 컴파일 된다. 
eclipse와 연동시 아래의 경로에 해당 class 파일과 java 파일이 생성된다.

workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost 


<%= %>의 경우는
out.print()와 동일하게 작동한다.
System.out.print()는 WAS의 콘솔로 출력하게 되니 주의!!!
[링크 : http://www.jsptut.com/Scriptlets.jsp]

out은 JspWriter의 out이다 ㄷㄷㄷ
public void _jspService(HttpServletRequest request, HttpServletResponse response)
    throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
 
[링크 : http://stackoverflow.com/questions/10396347] 
[링크 : http://docs.oracle.com/javaee/7/api/javax/servlet/jsp/JspWriter.html]

'Programming > jsp' 카테고리의 다른 글

jsp buffer  (0) 2014.03.27
jsp - page / request / session / applicaton  (0) 2014.03.27
JSP에서 euc-kr로 할 경우 저장이 안되는 한글이 있다?  (0) 2014.03.26
웹 서버 및 서비스 개요(java/jsp)  (0) 2014.03.26
Apache tomcat  (0) 2014.03.25
Posted by 구차니
Programming/jsp2014. 3. 26. 20:07
WAS - Web Application Server (Apache Tomcat)

tomcat 수동으로 구동시 반드시 설정해야 할 환경변수
JAVA_HOME
JRE_HOME
CATALINA_HOME
[링크 : http://tomcat.apache.org/]

컴파일 된 파일들 삭제하는 방법

 

JSTL/EL - javaEE의 기술 중 하나
JSP Standard Tag Library/Expression Language

'Programming > jsp' 카테고리의 다른 글

jsp buffer  (0) 2014.03.27
jsp - page / request / session / applicaton  (0) 2014.03.27
JSP에서 euc-kr로 할 경우 저장이 안되는 한글이 있다?  (0) 2014.03.26
JSP 기본 문법  (0) 2014.03.26
Apache tomcat  (0) 2014.03.25
Posted by 구차니
개소리 왈왈/컴퓨터2014. 3. 26. 16:51
에라이 모르겠다 하고
확 잘라버렸는데 의외로 잘 된 듯

각도가 잘 안펴져서 키보드 치면서 화면이 잘 안보이는
아쉬운점이 있었는데 이렇게 펼쳐버리니 확실히 잘 보여서 좋다.




[링크 : http://kimhyunchul.co.kr/]
    [링크 : http://kimhyunchul.co.kr/20099999783]

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

heartbleed bug!!  (0) 2014.04.09
umid mbook m1 랜카드(marvell sd868)  (0) 2014.03.28
umid mbook m1 배터리 교체  (2) 2014.03.19
umid mbook 관련 파일방  (2) 2014.03.14
umid mbook m1 lcd 구매 + 분해기  (0) 2014.03.12
Posted by 구차니
지하철 정기권이 남아서 어디론가 돌아다녀 보겠다고 막상 나가지만
학원으로 인해 멀리 가지 못했다.

충정로역에서 나오자 마자




고가도로 철거한다는데.. 이 녀석은 언제쯤 철거 당할까?


서대문역에서 종로3가로 돌아와 다시 서울역으로 궈궈!
참.. 오랫만에 오는 서울역
하지만 서울역에서는 노숙자의 소변냄새로 진동을 하고 있었다..


무료관람 중이니 일단 궈궈!


빔프로젝터를 이용해서 벽을 길~게 전시해 놓은게 인상적


술먹고 개가 된?




5월 7일 까지라고 하니 다시 한번 들러봐야겠다.

 

'개소리 왈왈 > 사진과 수다' 카테고리의 다른 글

370번 타요버스!  (0) 2014.04.04
서울역 - 여가의 기술 2번째 방문  (0) 2014.03.28
DDP - 동대문 디자인 플라자  (0) 2014.03.25
뭘 보냐 닝겐  (2) 2014.03.19
여호와의 증인교가 업그레이드!  (2) 2014.01.05
Posted by 구차니
오세훈의 푸짐한 셋트 중에 하나인 동대문 유에프오 건물
이렇게 넓었던가? 싶을 정도로 엄청난 규모를 자랑한다.

건물 자체는 신기하고 사람들이 넘쳐나 나름 들인돈이 아깝지 않을 휴식 공간이 되겠지만
그럼에도 불구하고 미묘하게 주변과 어울리지 않는 은색의 금속 건물은 홀로 붕 뜬 느낌을 지울수 없게 한다.











Posted by 구차니
Programming/Java2014. 3. 25. 21:33
JNI(Java Native Interface)
[링크 : http://docs.oracle.com/javase/6/docs/technotes/guides/jni/]
[링크 : http://en.wikipedia.org/wiki/Java_Native_Interface]

JNI를 통해 자바를 다른 언어에서
혹은 다른 언어에서 자바를 호출할 수 있다.

[링크 : http://deguls.tistory.com/entry/JNI-HelloWorld자바에서-C함수-호출] java에서 c 호출
[링크 : http://scotthan.tistory.com/129]  c에서 java 호출

'Programming > Java' 카테고리의 다른 글

JDNI - Java Directory & Naming Interface  (0) 2014.05.09
jdk 1.5 - annotation / @  (0) 2014.05.08
java TCP/UCP socket  (0) 2014.03.25
java object serializable / ObjectInputStream + ObjectOutputStream  (0) 2014.03.24
Java Input/OutputStream 관련  (0) 2014.03.21
Posted by 구차니