• 고객센터
  • 교육
  • 매뉴얼
  • 데모
  • 제품소개
조회 수 : 1926
2011.08.11 (17:31:12)
해결 되었습니다.

확인해 보니 컬럼 정의하는 부분에 콤마(,)가 한개 더 있었네요... >.<



>게시판을 이용해 주셔서 감사합니다.
>다음양식에 맞게 입력해주세요.
>
>* 고객시스템명 : 한국수자원공사
>* GAUCE 버전 : 4.0
>* WAS 종류(WebLogic 등등) : Jeus
>* DB 종류 : Oracle10g
>* 문의 유형(질문/요청/참조) :
>* 내용 :
>
>붙임과 같이 [총사업비]라는 시트가 사업기간을 입력하면 년도별로 컬럼이 증가됩니다.
>
>사업기간을 입력하지 않고 전송하면 제대로 전송이 되는데, 사업기간을 입력하여 컬럼을 가변적으로
>
>늘리고 전송하려고 하면 String index out of range: -1 오류가 발생합니다.
>
>이 부분을 어떻게 처리해야 할지 문의드립니다.
>
>
>===(.. 소스  ==========================================
>        public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
>  {
>    String nextUrl = "";
>    String cmdStr  = req.getParameter("cmd") == null ? "" : req.getParameter("cmd");
>
>    ParameterHelper   param = new ParameterHelper();
>    ServletContext        sc  = this.getServletContext();
>    RequestDispatcher  rd  = null;
>    PrintWriter              out = res.getWriter();
>    HttpSession           hs  = req.getSession();
>
>    GauceInputStream   gis  = ((HttpGauceRequest) req).getGauceInputStream();     <<<====== 58 line
>    GauceOutputStream gos = ((HttpGauceResponse) res).getGauceOutputStream();
>
>    boolean result  = false;
>    String  empcode = hs.getAttribute("empcode") == null ? "" : (String)hs.getAttribute("empcode");
>    String  userId  = hs.getAttribute("userid")  == null ? "" : (String)hs.getAttribute("userid");
>
>    System.out.println("[CostCS-service] cmd ==> [" + cmdStr + "]");
>
>    try
>    {
>       .....
>
>=== (.. 오류내용   =============================================================
>[2011.08.11 14:57:15][1][0_481] [container1-65] fail to execute servlet : CostCS
><<__Exception__>>
>java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>        at java.lang.String.checkBounds(String.java:368)
>        at java.lang.String.<init>(String.java:404)
>        at com.gauce.io.bin.A.A(Unknown Source)
>        at com.gauce.io.bin.A.A(Unknown Source)
>        at com.gauce.filter.HttpGauceRequestWrapper.getGauceInputStream(Unknown Source)
>        at promate.cost.CostComp.servlet.CostCS.service(CostCS.java:58)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>        at jeus.servlet.engine.ServletWrapper.executeServlet(ServletWrapper.java:313)
>        at jeus.servlet.filter2.FilterChainImpl.internalDoFilter(FilterChainImpl.java:139)
>        at jeus.servlet.filter2.FilterChainImpl.doFilter(FilterChainImpl.java:91)
>        at com.gauce.filter.GauceFilter.doFilter(Unknown Source)
>        at jeus.servlet.filter2.FilterChainImpl.internalDoFilter(FilterChainImpl.java:122)
>        at jeus.servlet.filter2.FilterChainImpl.doFilter(FilterChainImpl.java:91)
>        at jeus.servlet.engine.ServletWrapper.execute(ServletWrapper.java:195)
>        at jeus.servlet.engine.WebtobRequestProcessor.run(WebtobRequestProcessor.java:181)
>
>
>===========================================
>  //Grid를 재정의 하고 속성을 지정해 준다.
>  var strGridFormat = "";  //Grid Format용 변수
>  var strGridHeader = "";  //Grid Header 재설정용 변수
>
>  //고정 Grid Column 정의(앞부분)
>  strGridFormat = strGridFormat + "<C> id=TERM_FR        name=시작년도    width=80   sort=true  show=false  HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','false')}</C>";
>  strGridFormat = strGridFormat + "<C> id=TERM_TO        name=종료년도    width=80   sort=true  show=false  HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','false')}</C>";
>  strGridFormat = strGridFormat + "<FG>                  name=구분        width=240  sort=true  show=true   HeadBgColor=#ACD7ED";
>  strGridFormat = strGridFormat + "    <C> id=L_PROC_CD  name=대공정코드  width=80   sort=true  show=false  HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','false')}</C>";
>  strGridFormat = strGridFormat + "    <C> id=L_PROC_NM  name=대공정      width=120  sort=true  show=true   HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','true')}  align={IF(Left(L_PROC_CD, 2)='00','center','left')}  EditStyle=Combo Data='<총사업비>,공사비,보상비,조사설계비,관리비 및 기타,운영관리비,시설개량비,EPC비용,개발비용,기타(총사업비),<재원분담>,국고(대행),국고(출자),국고(보조),자체자금,지자체,기타(재원분담)'</C>";
>  strGridFormat = strGridFormat + "    <C> id=S_PROC_CD  name=소공정코드  width=80   sort=true  show=false  HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','false')}</C>";
>  strGridFormat = strGridFormat + "    <C> id=S_PROC_NM  name=소공정      width=120  sort=true  show=true   HeadBgColor=#ACD7ED  edit={IF(Len(L_PROC_NM)>0,'false','true')}  HeadColor=#000000  align=left  bgcolor={decode(currow-(currow/2)*2,0,'#F1F1F1',1,'#FFFFFF')}  sumbgcolor='#f0f0f0'  color=#002759 </C>";
>  strGridFormat = strGridFormat + "</FG>";
>  strGridFormat = strGridFormat + "<FG>                  name=총사업비    width=100  sort=true  show=true  HeadBgColor=#ACD7ED";
>  strGridFormat = strGridFormat + "    <C> id=PROC_AMT   name=현행기준    width=100  sort=true  show=true  HeadBgColor=#ACD7ED  edit={IF(Len(S_PROC_NM)>0,'true','false')}  HeadColor=#000000  align=right bgcolor={decode(currow-(currow/2)*2,0,'#F1F1F1',1,'#FFFFFF')}  sumbgcolor='#f0f0f0'  color=#002759 </C>";
>  strGridFormat = strGridFormat + "</FG>";
>
>  //고정 Grid Column Header정의(앞부분)
>  strGridHeader = strGridHeader + ",TERM_FR:STRING(4):NORMALKEY";
>  strGridHeader = strGridHeader + ",TERM_TO:STRING(4):NORMALKEY";
>  strGridHeader = strGridHeader + ",L_PROC_CD:STRING(4):NORMALKEY";
>  strGridHeader = strGridHeader + ",L_PROC_NM:STRING(40):NORMALKEY";
>  strGridHeader = strGridHeader + ",S_PROC_CD:STRING(4):NORMALKEY";
>  strGridHeader = strGridHeader + ",S_PROC_NM:STRING(40)";
>  strGridHeader = strGridHeader + ",PROC_AMT:INT(16):NORMALKEY";
>
>  //동적 Grid Column 정의(사업기간별 예/결산 부분)
>  for ( var i = sStartYear; i <= sEndYear; i++ ) {
>    //Grid 정의
>    strGridFormat = strGridFormat + "<R>";
>    strGridFormat = strGridFormat + "    <G>                   name="+ i +"년도  width=200  sort=true  show=true  HeadBgColor=#ACD7ED";
>    strGridFormat = strGridFormat + "        <C> id="+ i +"_BUDG_AMT   name=예산금액  edit=numeric  width=100  sort=true  show=true  edit={IF(Len(S_PROC_NM)>0,'true','false')}  HeadBgColor=#ACD7ED  HeadColor=#000000  align=right  bgcolor={decode(currow-(currow/2)*2,0,'#F1F1F1',1,'#FFFFFF')}  sumbgcolor='#f0f0f0'  color=#002759 </C>";
>    strGridFormat = strGridFormat + "        <C> id="+ i +"_CLAC_AMT   name=결산금액  edit=numeric  width=100  sort=true  show=true  edit={IF(Len(S_PROC_NM)>0,'true','false')}  HeadBgColor=#ACD7ED  HeadColor=#000000  align=right  bgcolor={decode(currow-(currow/2)*2,0,'#F1F1F1',1,'#FFFFFF')}  sumbgcolor='#f0f0f0'  color=#002759 </C>";
>    strGridFormat = strGridFormat + "    </G>";
>    strGridFormat = strGridFormat + "</R>";
>    //Header 정의
>    strGridHeader = strGridHeader + "," + i + "_BUDG_AMT:INT(16)";
>    strGridHeader = strGridHeader + "," + i + "_CLAC_AMT:INT(16)";
>  }
>
>  //고정 Grid Column 정의(뒷부분)
>  strGridFormat = strGridFormat + "<C> id=RMD_BUDG_AMT  name=이후예산    width=100  sort=true  show=true  HeadBgColor=#ACD7ED  edit={IF(Left(L_PROC_CD, 2)='00','false','false')}  HeadColor=#000000  align=right  bgcolor={decode(currow-(currow/2)*2,0,'#F1F1F1',1,'#FFFFFF')}  sumbgcolor='#f0f0f0'  color=#002759 </C>";
>  strGridHeader = strGridHeader + ",RMD_BUDG_AMT:INT(16):NORMALKEY";
 
Tag List
XE Login