<img src="adasdada.jpg" alt=""/>

다음과 같은 태그는 html validator에서 이런 에러를 낸다.

 

NET-enabling start-tag requires SHORTTAG YES .

 

The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

 

------------구글 번역 ------------------

<foo />의 순서에 적어도 두 개의 서로 다른 방법으로 해석할 수에 따라 문서의 doctype합니다. html 4.01에 대한 엄격한, '/'이 종료 (with의 태그 <foo에서는 묵시적 '> '). 그러나,이 방법이 많은 브라우저를하지 해석하는 경우에도 엄격한 4.01 doctype html의 존재를, 완전하게 그것을 피하는 것이 좋습니다 순수 html 문서와 예약을 위해서만 이들을 사용 xhtml로 작성된합니다.
 
대충 html문서에서는 slefclose 하지 말고
xhtml 에서만 하라는 뜻..
난 그것도 모르고 죄다  <br />이렇게 죄다 닫아버렸다..
보는 족족..
Posted by 삽지리
,

request.setCharacterEncoding("UTF-8");
 String contents = request.getParameter("contents");               

 

이렇게 해주면 ㅇㅋㅂㄹ
예전에 한번 해놓고 까먹어서 지난 소스 뒤적뒤적

'개인적인 프로그램 > JAVA/JSP' 카테고리의 다른 글

간단한 UTF-8 파일 생성  (0) 2011.10.26
한글파라미터 문제  (0) 2011.10.26
request 라인단위로 읽기  (0) 2011.10.26
java 썸네일 thumbnail  (0) 2011.10.26
흠 static{} 이걸 왜 쓰는걸가?  (0) 2011.10.26
Posted by 삽지리
,

ff에서는 잘돌아가는데 ie에서는 잘안된다.

왜일까..

response.contentType도 xml로 했는데

ie에서 responseTEXT를 찍으면 잘나오지만

xml을 가져오면 제대로 못가져온다.

그런데..

문서의 상단에 <?xml version="1.0" encoding="euc-kr;" ?>을

정의하니까 잘되더라.

그때그떄마다 경우가 달라서 혼란스럽다..

 

갑자기 안돼서 삽펐다

 

<?xml version="1.0" encoding="euc-kr;" ?> 알고보니

euc-kr뒤에 ;붙어서 안됐네 하놔.

 

<?xml version="1.0" encoding="euc-kr" ?>  이걸로 다시 수정

Posted by 삽지리
,

ajax에서 xml 문서를 컨트롤할때 문서에 정의된것과 상관없이 문서의 contentType이 xml 이어야한다

문서안에 백날 정의해봤자 말짱꽝

 

response.setContentType("text/xml;charset=utf-8");

Posted by 삽지리
,

function selectSort(sortMethod) {
 formSel = document.categoryForm.CatItem;

 if(!formSel.value) return;

 thisIndex = formSel.selectedIndex;

 if(sortMethod == "down") { //다운일때
  if(thisIndex+1 >= formSel.length) return;
  formSel.value = null;
  prevIndex = thisIndex + 1;
 }
 else { //업일때
  if(!thisIndex) return; 
  formSel.value = null;
  prevIndex = thisIndex-1;
 }

 tempText = formSel.options[prevIndex].text;
 tempValue = formSel.options[prevIndex].value;

 formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value);

 formSel.options[thisIndex] = new Option(tempText,tempValue);

 formSel.value = formSel.options[prevIndex].value; 
}

function updateSort() {
 var oForm = document.categoryForm;

 formSel = document.categoryForm.CatItem;

 res = new Array();

    for(var i=0;i<formSel.length;i++) {
  arrayValue = formSel.options[i].value.split("||");

     res[i] = arrayValue[0];
    }

 res = res.join("@");
 oForm.sortItem.value = res;

 if (confirm('카테고리 출력순서를 재정렬 하시겠습니까?')) {
  oForm.runMode.value = "sort";  
  oForm.action="inCateFrame1.asp";
  oForm.submit();
 }
 else {
  return;
 }
}

 

 

대략이런식 키포인트는 updateSort()에서 데이터를 가공해서 보낸다는게 되것다~

 

Posted by 삽지리
,

참조사이트 :

http://tagin.net/bbs/view.php?id=js5&page=5&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=63

 

뭐 참조랄것도 없이 거의 다 배꼈지만..

 

<code>

 

var x,y,w,h;
   var flag=false;
   var obj;
   function table_resize_start(e,target_id){
    flag=true;
    obj=document.getElementById(target_id);
    if(document.all){
     
     
      x=e.clientX;
      y=e.clientY;
      w = obj.style.pixelWidth;
      h = obj.style.pixelHeight;     
    }else if(document.getElementById){    
      x=e.pageX;
      y=e.pageY;
      w = parseInt((obj.style.width).replace("px",""),10);
      h = parseInt((obj.style.height).replace("px",""),10);     
    }  
    obj.style.cursor= "n-resize";      
   }
   function table_resize(e){
   if(flag){
     if(document.all){
      xx=e.clientX-x
      yy=e.clientY-y     
      obj.style.pixelWidth=w + xx;
      obj.style.pixelHeight=h +yy;     
      }
     else if(document.getElementById){
      xx=e.pageX-x
      yy=e.pageY-y     
      objWidth = w+xx;
      objHeight = h+yy;
      obj.style.width=objWidth+"px"
      obj.style.height=objHeight+"px"
      }
     }
   }
   
   function table_resize_end(){
    flag=false;
    obj.style.cursor= "";
   }

 

</code>

Posted by 삽지리
,

//addec by mj.chong 2006.12.06
//tag 금칙 문자 (%, &, +, <, >, ?, /, \, ', ", =,  \n)
//comma는 별로도 제외하는 로직이 있음
var restrictedTagChars = /[\x25\x26\x2b\x3c\x3e\x3f\x2f\x5c\x27\x22\x3d]|(\x5c\x6e)/g;

 

function validTag(tagObj, e)
{
 var tagVal = tagObj.value;
 var commacnt = 0;
 var key = window.event ? e.keyCode : e.which;
 
 if(tagVal.charAt(tagVal.length-1) == ',' && (key == 44 || key == 32))
  return false;
 for(var i=0; i < tagVal.length; i++) {
  if(tagVal.charAt(i) == ',') {
   commacnt++;
  }
  if(commacnt >= 9) {
   alert("태그는 최대 10개까지 입력할 수 있습니다.");
    return false;
   }
 }
 
 if (key != 0x2C && (key > 32 && key < 48) || (key > 57 && key < 65) || (key > 90 && key < 97))
  return false;
}

 function check_tagvalidate(aEvent, input)
 {
  
  var keynum;
  if(typeof aEvent=="undefined") aEvent=window.event;
  if(IE)
  {
   keynum = aEvent.keyCode;
  }
  else
  {
   keynum = aEvent.which;
  }
  //edited by mj.chong 20061206
  //if(keynum == 188 ) {
  // input.value = BlogTag.validateTagString(input.value);
  //}
  //  %, &, +, -, ., /, <, >, ?, \n, \ |
  var ret = input.value;
  if(ret.match(restrictedTagChars) != null ) {
    ret = ret.replace(restrictedTagChars, "");
    input.value=ret;
  }
  //콤마가 연속으로 있으면 하나로 만든다.
  re = /[\x2c][\x2c]+/g;
  if(ret.match(re) != null ){
   ret = ret.replace(re, ",");
   input.value=ret;
  }
  highlightMyTag();  

 }

 function check_tagsvalidate(input)
 {
  input.value = BlogTag.validateTagString(input.value);

  //중복되는 태그 제거
  input.value = BlogTag.eliminateDuplicate(input.value);

  var tagcount = BlogTag.length(input.value);
  highlightMyTag();
  //태그 수 제한
  if(tagcount > 10)
  {
   alert("태그는 최대 10개 까지 입력이 가능합니다.");
   input.value = BlogTag.absoluteTagString(input.value, 10);   
   input.focus();
   
   return;
  }
  

  //태그의 길이 제한
  var bvalidate;
  var tagmaxlength = 100;
  bvalidate = BlogTag.isValidateTagLength(input.value, tagmaxlength);

  if(!bvalidate)
  {
   alert("태그는  100자 이상 입력할 수 없습니다.");
   input.focus();
   return;
  }
 }

var BlogTag =
{
 //유효한 태그명인지 확인.
 isTagname : function(tagname)
 {
  return tagname.match(restrictedTagChars)==null;
 }
 ,

 //태그 문자열을 유효하게 만든다.( 금지문자 제거, 연속되는 컴마 제거 )
 validateTagString : function(tagstring)
 {
  var ret = tagstring.replace(restrictedTagChars, "");

  //콤마가 연속으로 있으면 하나로 만든다.
  re = /[\x2c]+/g;
  return ret.replace(re, ",");
 }
 ,
 
 absoluteTagString : function(tagstring, maxcnt)
 {
  var valitags = BlogTag.validateTagString(tagstring);
 
  var arraytag = valitags.split(",");
  
  var tagnames = "";

  var absolutecnt = arraytag.length;
  if(absolutecnt > maxcnt)
   absolutecnt = maxcnt;
   
  for(var i=0; i< absolutecnt; i++)
  {
   tagnames = tagnames + arraytag[i] + ",";
  }
  tagnames = BlogTag.validateTagString(tagnames);
  
  tagnames = tagnames.substring(0, tagnames.length-1);

  return tagnames; 
 }
 ,

 //중복되는 태그를 없앤다.
 eliminateDuplicate : function(tagstring)
 {
  var valitags = BlogTag.validateTagString(tagstring);
 
  var arraytag = valitags.split(",");
  
  var tagnames = "";
  
  for(var i=0; i<arraytag.length; i++)
  {
   for(var j=0; j<i; j++)
   {
    //이미 존재 하는 태그라면 없앰.
    if(arraytag[j]==arraytag[i])
    {
     arraytag[i]="";
    }
   }

   tagnames = tagnames + arraytag[i] + ",";
   
  }
  tagnames = BlogTag.validateTagString(tagnames);
  
  tagnames = tagnames.substring(0, tagnames.length-1);

  return tagnames;

 }
 ,

 //태그수 를 계산 한다.
 length : function(tagstring)
 {
  var arraytag = tagstring.split(",");
 
  return arraytag.length;
 }
 ,

 //각 태그의 길이를 특정 크기 이하로 제한한다.
 validateTagLength : function(tagstring, maxlen)
 {
  var arraytag = tagstring.split(",");
  var tagnames = '';

  for(var i=0; i<arraytag.length; i++)
  {
   if(arraytag[i].length > maxlen)
   {
    arraytag[i] = arraytag[i].substring(0, maxlen);
   }
   tagnames = tagnames + arraytag[i] + ",";
  }

  tagnames = tagnames.substring(0, tagnames.length-1);

  tagnames = BlogTag.eliminateDuplicate(tagnames);

  return tagnames;
 }
 ,

 //각 태그의 길이가 유효한지 확인한다.
 isValidateTagLength : function(tagstring, maxlen)
 {
  var arraytag = tagstring.split(",");

  for(var i=0; i<arraytag.length; i++)
  {
   if(arraytag[i].length > maxlen)
   {
    return false;
   }
  }

  return true;
 }
}

Posted by 삽지리
,

ServletInputStream in =  request.getInputStream();
  byte[] buf = new byte[8 * 1024];
  int result = 0;
  do {
            result = in.readLine(buf, 0, buf.length);  // this.readLine() does +=
            if (result != -1) {
             logger.debug("1:"+new String(buf, 0, result, "utf-8"));
            }
        } while (result == buf.length);  // loop only if the buffer was filled

 

대략 이런식..

Posted by 삽지리
,

https://jai.dev.java.net/binary-builds.html#Release_builds

 

여기에서

jai-1_1_3-lib.zip

다운받아서

tomcat5.5의 common/lib에 넣고

이클립스에서 라이브러리 추가하고

http://blog.naver.com/saviola23?Redirect=Log&logNo=80045562229

 

를 참조해서 해봣다.

 

결과는 잘된다.

Posted by 삽지리
,

http://xquared.springbook.playmaru.net/pages/522191

 

var xed;
    
      window.onload = function() {
          xed = new xq.Editor("content_l");
          ## 추후 inclue를 시켜셔 css부분은 별도로 적용하는 방향으로 할 예정
          xed.config.contentCssList = ["/js/editor/stylesheets/xq_contents.css","/css/common_design.css","/css/base.css","/css/common.css","layout.css"];         
          xed.config.imagePathForDefaultToolbar = '/js/editor/images/toolbar/';
          xed.config.imagePathForContent = '/js/editor/images/content/';
          xed.setEditMode('wysiwyg');
          xed.setWidth("100%");             
    xed.setHeight("400px");
      }

이런식으로 호출

 

높이 넓이는 xed.setEditMode('wysiwyg');
다음에 해야 적용된다. 아니면 객체를 찾지 못한다.

config 설정은 내부에 디폴트로 상대경로로 잡혀있기때문에 저렇게 해주어야한다.

Posted by 삽지리
,