레이블이 트러블슈팅인 게시물을 표시합니다. 모든 게시물 표시
레이블이 트러블슈팅인 게시물을 표시합니다. 모든 게시물 표시

2013년 4월 19일 금요일

[ Java ] Linux Graphic setFont 한글 깨짐

Linux랑 Window가 지원하는 폰트가 틀리고,

그중에서 한글을 지원하는게 틀리다.

한글 지원하는 폰트 찾기.

아래소스로 찾은 폰트를 가지고 쓰면 깨지지 않을 것.



       ArrayList fontList = new ArrayList();
       for(int i = 0; i < fonts.length; i++){
           if(fonts[i].canDisplay('한')){
               fontList.add(fonts[i]);
           }
       }

2013년 4월 11일 목요일

[ Java ] split . 에러

String test="aaa.bbb.ccc";

test.split(".");

에러난다.

아래처럼 하믄 된다.
test.split("\\.");

2013년 4월 3일 수요일

[ Servlet ][ eclipse ] Wrapper cannot find servlet ....오류 해결

eclipse 에서
.classpath파일을 연다

output이라 되있는 부분을 아래와 같이 변경
<classpathentry kind="output" path="WebContent/WEB-INF/classes"/>

2013년 3월 15일 금요일

[ Jsp ] Cannot return from outside a function or method. 에러 메세지

<form method="post" name="fmlot" onkeydown="return captureReturnKey(event);">

이렇게 했더만 eclipse에서 뻘겋게 에러가 뜬다.
Cannot return from outside a function or method. 

아무래도 eclipse의 버그란듯 한데, 내 영어 수준이 갓난애기 수준이니....
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353209

[ Jsp ] input text enter 엔터 키

출처:http://www.okjsp.pe.kr/seq/132953

input type=text 가 하나일 경우에 엔터키를 누르면 submit()이 되버린다.

출처에서 따온대로 아래와 같이 하니 문제 없다.

< script language="javascript"> 

//ENTER 안먹게 하는것 
function captureReturnKey(e) { 
if(e.keyCode==13 && e.srcElement.type != 'textarea') 
return false; 
} 

< /script> 

< form name="F" method="post" onkeydown="return captureReturnKey(event)"> 

< input type="text" name="test"> 

< /form>

2013년 2월 19일 화요일

[ jsp ][ servlet ] getServletContext().getInitParameter() null

null 일경우

request.getSession().getServletContext().getInitParameter("PARAM");

원인과 이유는?
공부하자.

2013년 2월 14일 목요일

[ Jsp ] 톰캣 기동시 에러 메세지 트러블슈팅

eclipse tomcat 구동시에 아래 에러 떴다

The web application [/ProjectName] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

구글링해보니 무시하란다.톰캣6.0.24버전이상이라면.

2012년 1월 4일 수요일

[Jsp] Get 방식 파라미터 한글깨짐


Get방식으로 보내는데 한글깨짐 현상이 발생하여, 밑에방식으로 인코딩해서 보내봤더니 된다.

String lotNo = lotPlus(request);
String lotNo_En = java.net.URLEncoder.encode(lotNo, "UTF-8");
String URL = "test-run?LOT_NO=" + lotNo_En;

response.sendRedirect(URL);

아님 이거
encodeURIComponent(testname)

2011년 11월 8일 화요일

[Jsp] 파라미터 한글깨짐

톰캣의 server.xml을 열어서
8080포트 써있는 <>안에
 URIEncoding="UTF-8"를 추가 기입한다.

2011년 10월 3일 월요일

[Jsp]Can not issue data manipulation statements with executeQuery()

update 쿼리를 실행시키는데

stmt.executeQuery(sql)를 사용했더니 나온 에러

stmt.executeUpdate(query)를 사용하자.

100억