Java&Jsp&Servlet2019. 4. 19. 16:56

Servlet SpecJSP SpecEL SpecWebSocket SpecAuthentication (JASIC) SpecApache Tomcat VersionLatest Released VersionSupported Java Versions

6.0 3.1 5.0 TBD TBD 10.1.x 10.1.0-M6 (alpha) 11 and later
5.0 3.0 4.0 2.0 2.0 10.0.x 10.0.12 8 and later
4.0 2.3 3.0 1.1 1.1 9.0.x 9.0.54 8 and later
3.1 2.3 3.0 1.1 1.1 8.5.x 8.5.72 7 and later
3.1 2.3 3.0 1.1 N/A 8.0.x (superseded) 8.0.53 (superseded) 7 and later
3.0 2.2 2.2 1.1 N/A 7.0.x (archived) 7.0.109 (archived) 6 and later
(7 and later for WebSocket)
2.5 2.1 2.1 N/A N/A 6.0.x (archived) 6.0.53 (archived) 5 and later
2.4 2.0 N/A N/A N/A 5.5.x (archived) 5.5.36 (archived) 1.4 and later
2.3 1.2 N/A N/A N/A 4.1.x (archived) 4.1.40 (archived) 1.3 and later
2.2 1.1 N/A N/A N/A 3.3.x (archived) 3.3.2 (archived) 1.1 and later

 

http://tomcat.apache.org/whichversion.html

 

Apache Tomcat® - Which Version Do I Want?

Apache Tomcat® is an open source software implementation of a subset of the Jakarta EE (formally Java EE) technologies. Different versions of Apache Tomcat are available for different versions of the specifications. The mapping between the specifications

tomcat.apache.org

Posted by 비니미니파
Java&Jsp&Servlet2016. 3. 2. 13:09

이클립스 종료 후 sqlite 를 다운 받는다.

http://www.sqlite.org/download.html

윈도우일 경우 

Precompiled Binaries for Windows

sqlite-tools-win32-x86-3110000.zip 을 다운받고 압축을 푼다.

압축을 푼 폴더에서 sqlite3.exe 를 워크스페이스 프로젝트 폴더에다 복사한다.

ex) /workspace/testProject/

윈도우 콘솔창 ( 윈도우 실행창에서 cmd ) 을 실행한다.

> cd /workspace/testProject/

프로젝트 폴더로 이동 후 아래 명령어를 실행 한다.

> sqlite3.exe .svn/wc.db "select * from work_queue"

오류 리스트를 확인할 수 있다.

sqlite3.exe .svn/wc.db "delete from work_queue"

다시 이클립스 실행 후 cleanup 을 실행하면 잘 된다.

Posted by 비니미니파
Java&Jsp&Servlet2015. 9. 1. 18:18

파일 생성 시 복사 시 다음 오류가 나타난다면

a resource exists with a different case

파일명 대소문자를 확인 하면 된다.

aaaBbb.xml 파일이 있는데 aaabbb.xml 을 복사한다면 오류다.

이런 실수! ㅠ.ㅠ

Posted by 비니미니파
Java&Jsp&Servlet2015. 3. 11. 11:44

XML 을 찍어볼 수 있다.

doc // xml Document

XMLOutputter xo = new XMLOutputter();
String str = xo.outputString(doc);
System.out.println(str);

* Jdom 활용 org.jdom.output.XMLOutputter

잘 보인다. 끝!

Posted by 비니미니파
Java&Jsp&Servlet2015. 3. 6. 18:08

parameter param1 처리

JSP  일반적인 처리 방법

<% 
String param1 = request.getParameter("param1");
%>

<%=param1%>

 

JSTL 사용 시 에는

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:out value="${param.param1}" />

<!-- 간략 식 -->

${param.param1}

Posted by 비니미니파
Java&Jsp&Servlet2015. 3. 2. 11:45

java.math.BigDecimal cannot be cast to java.lang.String

Spring + Mybatis 연동 하여 HashMap 으로 받아 String 으로 변환했더니 오류가 난다.

구글링.....

String str = (String) hmap.get("col1");

col1 컬럼이 number 타입, Mybatis(Ibatis) 에서 BigDecimal 로 처리해서 나는 오류다.

타입을 맞춰 주던지

그냥  String.valueOf( ) 를 사용하여


String str = String.valueOf(hmap.get("col1"));



으로 처리

끝....

Posted by 비니미니파
Java&Jsp&Servlet2015. 2. 23. 19:03

import java.util.regex.Pattern;

public class ServerInfo {

public static void main(String[] args) {
    String osName = System.getProperty("os.name");
    boolean osBoolean = Pattern.matches("Windows.*",osName);
    System.out.println(osName);
    System.out.println(osBoolean);

 
}

OS 가 Windows 이면 true 끝

 

Posted by 비니미니파
Java&Jsp&Servlet2015. 1. 11. 12:03

PC 작업하던 환경을 노트북에 세팅하기 귀찮아서 eclipse 폴더 통째로 복사했더니

failed to load the jni shared library

오류가 난다.

삽질하다 원인을 찾았다.

PC Java 64bit

노트북 Java 32bit

eclipse 32bit 버전을 다운받아 설정해야 겠다.

ㅠ.ㅠ

 

 

Posted by 비니미니파
Java&Jsp&Servlet2014. 9. 25. 10:20
package studySample;

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

class DateAdd {

    public static void main(String args[]){
  
      String today = null;

      Date date = new Date();

      System.out.println(date);
  
      // 포맷변경 ( 년월일 시분초)
      SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 

      // Java 시간 더하기

      Calendar cal = Calendar.getInstance();

      cal.setTime(date);

      // 10분 더하기
      cal.add(Calendar.MINUTE, 10);

      today = sdformat.format(cal.getTime());  
      System.out.println("10분후 : " + today);

      cal.setTime(date);
      
      // 1시간 전
      cal.add(Calendar.HOUR, -1);

      today = sdformat.format(cal.getTime());  
      System.out.println("1시간 전 : " + today);

      cal.setTime(date);
      
      // 하루 전
      cal.add(Calendar.DATE, -1);
  
      today = sdformat.format(cal.getTime());  
      System.out.println("1일 전 : " + today);
 
    }

}
Posted by 비니미니파
Java&Jsp&Servlet2014. 9. 25. 10:18

package studySample;

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;

class Dateformat {
 public static void main(String args[]){
  
  Date date = new Date();
  
  System.out.println(date);  
  
  // 포맷 변경 (오늘일자)
  SimpleDateFormat sdformat = new SimpleDateFormat("YYYY-MM-dd");
  
  String today = sdformat.format(date);
  
  System.out.println("오늘 일자 : " + today);
  
  // 포맷변경 ( 년월일 시분초)
  sdformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  
  today = sdformat.format(date);
  
  System.out.println("현재시간 : " + today);
  

 }

}

Posted by 비니미니파
Java&Jsp&Servlet2013. 9. 6. 18:00
Posted by 비니미니파
Java&Jsp&Servlet2013. 9. 6. 10:35

심각: The web application [/] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

톰캣 구동 시 위의 오류가 나면

/WEB-INF/lib 에 있는 jdbc 라이브러리를 tomcat/lib 밑에다 옮겨준다.

 

 

Posted by 비니미니파
Java&Jsp&Servlet2013. 8. 5. 18:21


String str = "ABC:DEF";

String strArr[] = str.split(":");

-------------------------------------------------------

strArr[0]  --> ABC

strArr[1] --> DEF

Posted by 비니미니파
Java&Jsp&Servlet2011. 3. 22. 01:56

 


String a = "123";
int    b = 123;

if ( b == Integer.parseInt(a) ) {
   printf("a 는 int")
}

if ( a.equals(Integer.toString(b) ) {
    printf(" b 는 String ");
}

Posted by 비니미니파