2011년 12월 29일 목요일
[JavaScript] undefined 값 확인하기
xxx == "undefined"
잘 사용한 예
document.getElementById("xxx").value = xxx == undefined ? "0" : xxx
[아데설구] 스토리14 - 트랜잭션관리의 실무적용
2011년 12월 28일 수요일
톰캣 에러... 해결 할 것
s
INFO: Character decoding failed. Parameter [orderDt] with value [<=order_dt%>] h
as been ignored. Note that the name and value quoted here may be corrupted due t
o the failed decoding. Use debug level logging to see the original, non-corrupte
d values.
java.io.CharConversionException: EOF
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:80)
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:46)
at org.apache.tomcat.util.http.Parameters.urlDecode(Parameters.java:410)
at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.j
ava:370)
at org.apache.tomcat.util.http.Parameters.processParameters(Parameters.j
ava:420)
at org.apache.tomcat.util.http.Parameters.handleQueryParameters(Paramete
rs.java:186)
at org.apache.catalina.connector.Request.parseParameters(Request.java:25
94)
at org.apache.catalina.connector.Request.getParameterNames(Request.java:
1148)
at org.apache.catalina.connector.RequestFacade.getParameterNames(Request
Facade.java:371)
at wdf.control.BaseController.getParameterValues(BaseController.java:347
)
at com.wj.ariba.common.control.ProductSubController.getSubProductCodeLis
t(ProductSubController.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at wdf.servlets.FCHttpServlet.invokeRequest(FCHttpServlet.java:312)
at wdf.servlets.FCHttpServlet.processRequest(FCHttpServlet.java:542)
at wdf.servlets.FCHttpServlet.doGet(FCHttpServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
===================================================================
dataUrl="/common/getSubProductCodeList.do?orderNo=&goodsCd=&orderDt=<%=order_dt%>"
여기서 <=order_dt%> %가 누락되어서 발생되는 문제였음
2011년 11월 20일 일요일
[JAVA] 스트링 배열선언
예를들어
- (잘못된 예)
s = {"aaa","aab","aac"};
- (옳은 사용방법)
2011년 11월 19일 토요일
[android] SimpleCursorAdapter 사용하기
SimpleCursorAdapter
SimpleCursorAdapter는 커서를 XML 파일에 정의된 TextViews 혹은 ImageViews로 컬럼을 맵핑시키는 쉬운 어댑터이다. 당신은 어떤 컬럼을 원하는지 어떤 뷰에 컬럼을 보여주고 싶은지 명시할 수 있다. 그리고 이러한 뷰의 모습을 정의하는 XML파일은 두가지 형태로 바인딩된다. 첫째로 만약 SimpleCursorAdapter.ViewBinder가 가능하다면, setViewValue(android.view.View, android.database.Cursor, int)가 호출된다. 만약 리턴값이 참이면 바인딩이 실행된다. 만약 리턴값이 거짓이고 바인딩 되는 뷰는 TextView 라면 setViewText(TextView, String)가 호출된다. 만약 리턴 값이 거짓이고 바인딩되는 뷰가 ImageView라면 setViewImage(ImageView, String)이 호출된다. 만약 적절한 바인딩이 발견되지 않으면 IllegalStateException이 던져진다. 만약 이 어댑터가 필터링과 함께 사용되면 예를들어 AutoCompleteTextView와 같은 당신은 SimpleCursorAdapter.CursorToStringConverter와 FilterQueryProvider 인터페이스가 필터링프로세스를 컨트롤한다. 자세한 내용은 convertToString(adnroid.database.Cursor) 그리고 runQueryOnBackgroundThread(CharSequence)에 대해서 내용을 참조할 수 있다.
(원문)
An easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file. You can specify which columns you want, which views you want to display the columns, and the XML file that defines the appearance of these views. Binding occurs in two phases. First, if a SimpleCursorAdapter.ViewBinder is available, setViewValue(android.view.View, android.database.Cursor, int) is invoked. If the returned value is true, binding has occured. If the returned value is false and the view to bind is a TextView, setViewText(TextView, String) is invoked. If the returned value is false and the view to bind is an ImageView,setViewImage(ImageView, String) is invoked. If no appropriate binding can be found, an IllegalStateException is thrown. If this adapter is used with filtering, for instance in an AutoCompleteTextView, you can use the SimpleCursorAdapter.CursorToStringConverter and the FilterQueryProviderinterfaces to get control over the filtering process. You can refer to convertToString(android.database.Cursor) andrunQueryOnBackgroundThread(CharSequence) for more information.
2011년 11월 3일 목요일
[JAVA] ResultSet의 결과수에 따라 로직을 만들려고 할때...
conn = DBHandler.getConnection()
pstmt = conn.prepareStatement(Query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
rs = pstmt.executeQuery();
rs.last();
int vFetchedRow = rs.getRow();
rs.beforeFirst();
이후 다시
while(rs.next){
/// codes
}
해도 에러가 나지 않는다.