JUST install maven integration!!!!

Posted by Engineer135
,

/*--------------------------------------
 * 이미지 팝업 새창 보기
 * -------------------------------------*/
//첨부파일 이미지 새창
function popImg(img){
    var imgTmp = new Image();
    imgTmp.src = img;

    var imgWin = window.open("","_blank","width="+imgTmp.width+",height="+imgTmp.height+",status=no,toolbar=no,scrollbars=no,resizable=no");
    imgWin.document.write("<html><title>미리보기</title>"
            +"<body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>"
            +"<a href='javascript:self.close()'><img src='"+img+"' border=0/></a>"
            +"</body></html>");
}

Posted by Engineer135
,

jsp 버전...

카테고리 없음 2013. 12. 13. 11:08

JSP is a Java technology that aims at helping developers to dynamically generate web pages that are based on HTML, XML or any different types of documents. The first stable version of JSP specification was JSP 1.2 and then JSP 2.0, JSP 2.1 got released. Now the latest version of JSP is JSP 2.2 specification.

This new version of JSP namely JSP 2.2 is a maintenance release of JSR 245. Earlier JSP 2.1 was released under the specification JSR 245 as part of the Java EE 5. For this JSP 2.1, a maintenance release called JSP 2.2 is released on 10th December 2009. This is the latest release of JSP.

Though JSP 2.2 is the latest version update of JSP specification, the JSP 2.1 is the widely used and highly recognized version of JSP. JSP 2.1 is equipped with an Expression Language that gives scope for developers for the velocity style template creation. JSP 2.1 has many other enhancements and bug fixes when compared to JSP 2.0 and other earlier versions. 

 

위에 글을 보고 java 버전과 jsp가 상관이 있는가 싶었는데...

아래 글을 보니 web.xml에서 편집하는 거에 따라서 달라지는 가보다..

복사하니 깨지네 아래가 원문

http://stackoverflow.com/questions/17388175/how-to-know-which-servlet-and-jsp-version-i-am-using

 

Can you tell me how to know which servlet and JSP version I am using ? I use NetBeans IDE 7.1.2 for creating Servlets and JSP.

share|improve this question
1  
That should be specified in your web.xml file. –  JB Nizet Jun 30 at 7:31
 
The IDE doesn't have anything to do with the JSP and Servlet version of your application. That's declared in the web.xml. –  Luiggi Mendoza Jun 30 at 7:32
 
Check the declarations in your xml files. Also, if you can, check the jars in the classpath of your project. –  acdcjunior Jun 30 at 7:32
1  
 
@acdcjunior the jars are not the best reference here, since a web application server could handle more than one version of servlets thus accepting wars that use old servlet versions. –  Luiggi Mendoza Jun 30 at 7:35
show 4 more comments

You can get the details programatically using ServletContext #getMajorVersion() and #getMinorVersion().

For knowing the JSP version corresponding to the Servlet, you can get details from this Tomcat page

Below is the summary,

Servlet 2.5 uses JSP 2.1 
Servlet 2.4 uses JSP 2.0 
Servlet 2.3 uses JSP 1.2 
Servlet 2.2 uses JSP 1.1 
Servlet 2.1 uses JSP 1.0
share|improve this answer
1  
This only returns the max version as supported by the servletcontainer. This doesn't return the version currently used by the running webapp. This is dictated by web.xml. –  BalusC Jun 30 at 17:15
 
@BalusC Thank you BalusC.. You are always "The One" guy.. –  Vikas V Jun 30 at 17:58
add comment

The version is declared in the web.xml file - compare http://wiki.metawerx.net/wiki/Web.xml

share|improve this answer
add comment

You can easily check the JSP,SERVER and SERVLET version. Add the following code in your jsp page after that run using any IDE Tools.

Server Version: <%= application.getServerInfo() %><br> Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %> JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %> <br>

share|improve this answer
add comment

I got it. According to Vikas V ,I am using Servlet 2.3 uses JSP 1.2 version

share|improve this answer
add comment
Posted by Engineer135
,

http://springsource.tistory.com/

여기 정리 잘해놨네 본받자

Posted by Engineer135
,

URL url = new URL(urlStr);
     
     HttpURLConnection urlRequest = (HttpURLConnection) url.openConnection();
     urlRequest.setRequestMethod("POST");
     
     // request를 서명합니다.
     testConsumer.sign(urlRequest);  

     urlRequest.connect();
     
     BufferedReader br = new BufferedReader(new InputStreamReader(urlRequest.getInputStream()));
     String tmpStr = "";
     while( (tmpStr = br.readLine()) != null) {
      System.out.println("텍스트만 등록 후 메시지==========="+tmpStr);
     }

I don't see anywhere in the code where you specify that this is a POST request. Then again, you need a java.net.HttpURLConnection to do that.

In fact, I highly recommend using HttpURLConnection instead of URLConnection, with conn.setRequestMethod("POST"); and see if it still gives you problems.

기본은 get 인가보다..... 이거때문에 한참 삽질했네. 트위터 덕분에 많이 배운다.

Posted by Engineer135
,

<input type="text" id="title"/>

일단 내가 focus를 주고 싶은 input box는 요놈.

$('#myModal').on('shown', function () {
   setCaretAtEnd($("#title"));
  })

bootstrap의 modal은 좀 특이(?)해서 저렇게 shown 됐을때 포커스를 먹여야 먹힌다. 그냥 document.ready 상태에서 focus() 하면 소용이 없었음. 그냥 팝업에 쓰려면 바로  setCaretAtEnd($("#title")); 로 실행해도 상관 없음.

 //input text에 focus
 function setCaretAtEnd(elem) {
        var elemLen = elem.val().length;
        if(elemLen == 0){
         elem.focus();
         return;
        }
        // For IE Only
        if (document.selection) {
            // Set focus
            elem.focus();
            // Use IE Ranges
            var oSel = document.selection.createRange();
            // Reset position to 0 & then set at end
            oSel.moveStart('character', -elemLen);
            oSel.moveStart('character', elemLen);
            oSel.moveEnd('character', 0);
            oSel.select();
        }
        else if (document.selection == undefined || elem.selectionStart || elem.selectionStart == '0') {
            // Firefox/Chrome
            elem.focus().val(elem.val());
        } // if
    } // SetCaretAtEnd()

이렇게 하면 ie에서도, 크롬에서도 잘 된다. 파폭은 안 해봐서 모름. 출처는 구글링 후 약간 수정..

Posted by Engineer135
,

But the EL can be used to help create the JavaScript markup.

For example: var x = '${someValue}';
is perfectly valid. So if someValue has the toString() value of whatever, the statement that will be sent to the browser is:
var x = 'whatever';

Posted by Engineer135
,

휴휴 그동안 바쁘기도 하고 쪼금 해이해져서 포스팅을 안 했다.

근데 오늘부터는 하기 싫어도 해야한다. 왜냐고? 복습차원에서 아주 간단한 게시판을 만드려고 하는데

그동안 배운 플랫폼 사용법 위주로 포스팅을 하려고 한다.

기초적인 거는 그래도 기억이 나는데 플랫폼은 안쓰다 보니까 자꾸 까먹는 것 같아서 확실하게 블로그에 기록을 남겨놔야

할 것 같다. 이 방법이 정답도 아니고, 참고용으로 쓰기에도 허접할지 모른다. 거의 개인공부 목적으로 포스팅을 하는 거라서

많이 부실하더라도 이해해주길 바란다 ㅋ

시간이 없으니 바로 들어간다. 

1. DB 설계

 가장 먼저 DB 설계를 한다. 프로젝트 하나 해봤더니 DB 설계단계가 굉장히 중요한 것 같다. 나중에 추가하기도 애매하고 지우기도 뭣한 일이 좀 있었다. DB 수정하면 이래저래 코드..음 SQL 문도 수정이 불가피할 것이기 때문에 초반에 확실히 설계하고 넘어가는 게 중요할 듯. 물론 실무에서는 바꾸는 일도 많겠지? 뭐 아무튼 DB 설계가 첫단추라고 생각하고 잘 끼우자!

2. 클래스 만들기

Board.java Qa.java Reply.java... 등등 클래스 파일을 만들어 준다. DB에 입력하거나 DB에서 받은 정보를 저장해야하므로 컬럼이름과 같은 속성을 만들어주고, Getter와 Setter를 만든다. 확인하기 쉽게 toString메서드도 추가시킨다.

3단계는 Mybatis를 이용해야하므로 다음 카테고리로~

 

Posted by Engineer135
,
요새 쇼핑몰 비스무리한 거 만들기 배우고 있는데 쉽지 않다.
특히 세션 나오니까 너무 헛갈림!
세션 부분 공부하고.. 수업 따라가려면 블로그업뎃이 늦어질지도 모르지만..
그래도 꾸준히 올리려고 노력해야지! 아자!아자!!!
Posted by Engineer135
,
시퀀스도 테이블과 마찬가지로 변경과 삭제가 가능하다.

1. 변경

 시퀀스 정의 변경이란 시퀀스를 생성한 후에 증가치나 최소값, 최대값등을 수정할 때 사용한다.
시퀀스를 변경하는 방법은 ALTER를 사용하면 되는데 아주 간단하다. 시퀀스 변경의 몇가지 특징을 살펴보면

 ① 변경된 시퀀스 정의는 새로 생성되는 시퀀스 값부터 적용된다!
 ② START WITH절은 생성 직후의 시작 값을 의미하기 때문에, 변경이 불가능하다!

이 두가지만 기억하면 된다.

alter sequence s_seq
maxvalue 200;

변경하는 법은 생성할 때랑 거의 똑같다.
alter sequence 시퀀스명 써주고
maxvalue 200 변경하고 싶은 값을 재정의해주면 된다.

위와 같은 명령문은 s_seq라는 시퀀스의 최고값을 200으로 변경시킨다.
참 간단하지 않은가? ㅋ

2. 삭제 

 시퀀스를 삭제할 때는 DROP을 사용한다.

 drop sequence s_seq;

요렇게 하면 s_seq라는 시퀀스가 삭제된다.

참고로, 지금까지 쓴 create, alter, drop은 autocommit 속성을 가지고 있다.
이 말은 rollback으로 돌릴 수 없다는 얘기이고, 바로 데이터베이스, 디스크에 저장된다는 말이니 신중하게 쓰길 바란다.

p.s 오늘 수업 듣는데 느낀 것이..
앞으로 포스팅할 것들이 정말 무궁무진하고.. 내용은 점점 더 어려워질게 뻔하다! 엉엉 ㅠㅠ
그래도 포기하지 말고 열심히 하자. 화이팅! ㅋ

'SQL 언어 > 시퀀스(SEQUENCE)' 카테고리의 다른 글

SEQUENCE-① 생성, 조회  (0) 2012.03.08
Posted by Engineer135
,