Spring 공부2020. 12. 11. 13:48

jsp

   - params.planMM = new Array('0','1','2');

 

java <String 은 파라미터에 따라 다름 >

  - @SuppressWarnings("unchecked")   : 함수위에 

  - List<String> lit = (List<String>)params.get("planMM")

'Spring 공부' 카테고리의 다른 글

[batch] 설명 및 정리  (0) 2014.03.18
[batch] parameter 전달방법  (0) 2014.02.03
spring java source  (0) 2013.10.25
어노테이션에서 타입이라는 용어  (0) 2013.07.25
mysql key Holder  (0) 2013.05.13
Posted by 선한열심
카테고리 없음2020. 11. 9. 14:15

ex) "첫번째메세지,두번째메세지,세번째메세지" 와 같은 내용이 있는데 쉼표(,)를 구분자로 하여 자르고 싶다면..

 

 

 

select   b.seq  
             , regexp_substr(a.CHGR_IDS,'[^,]+', 1, b.seq) as CHGR_ID 
        from (select  '첫번째메세지,두번째메세지,세번째메세지' CHGR_IDS, nvl(LENGTH(regexp_REPLACE('첫번째메세지,두번째메세지,세번째메세지' ,'[^,]+')), 0) + 1 cnt
                from  dual A) a 
             , (select rownum seq from dual CONNECT BY ROWNUM <= 200) b  
         where b.seq <= a.cnt  

 

Posted by 선한열심
자바스크립트2020. 10. 29. 09:39

autolink-js

autolink-js is a small (about half a kilobyte), simple, and tested JavaScript tool that takes a string of text, finds URLs within it, and hyperlinks them.

Why bother releasing such a tiny little method?

I recently needed to find and hyperlink URLs in user-submitted text and was surprised to find that doing what seemed like such a simple task wasn't already a Solved Problem. Different regex solutions led to different unwanted side effects, and other utilities were far, far more complex and feature rich than I needed.

Basic Usage

autolink-js adds an autoLink() method to JavaScript's String prototype, so you can use it on any JavaScript string. Take a look at the tests, but essentially, after including either autolink.js or autolink-min.js to your page, it works like this:

// Input "This is a link to Google http://google.com".autoLink() // Output "This is a link to Google http://google.com'>http://google.com"

Additional Options

You can pass any additional HTML attributes to the anchor tag with a JavaScript object, like this:

// Input "This is a link to Google http://google.com".autoLink({ target: "_blank", rel: "nofollow", id: "1" }) // Output "This is a link to Google http://google.com' target='_blank' rel='nofollow' id='1'>http://google.com"

Callback

Callback option can be used to redefine how links will be rendered.

// Input "This is a link to image http://example.com/logo.png".autoLink({ callback: function(url) { return /\.(gif|png|jpe?g)$/i.test(url) ? '<img src="' + url + '">' : null; } }); // Output "This is a link to image

http://example.com/logo.png'>"

Example

Open example/example.html in your web browser and view the source for a simple but full-featured example of using with jQuery.

Running the tests

After cloning this repository, simply open test/suite.html in your web browser. The tests will run automatically.

 

 

출처 - https://github.com/bryanwoods/autolink-js

 

 

 

보통 많은 종류의 게시판에서 url형태나 email 형태에 자동 링크를 걸어주는 정규식을 사용하고 있습니다.. 좀전에 친구가 jsp로 게시판을 만드는 과정에서 자동링크를 할 수 있는 방법을 물어오길래 클라이언트에서 할 수 있는 방법을 생각해봤습니다. 자바는 1.4부터 RegExp 패키지를 사용할 수 있거든요...

 

생각해보니.. 서버측 부하는 적게 걸리면서 같은 효과를 낼 수 있을꺼 같아 팁으로 올립니다.

 

<html>

<body>

<script>

function autolink(id) {

        var container = document.getElementById(id);

        var doc = container.innerHTML;

        var regURL = new RegExp("(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)","gi");

        var regEmail = new RegExp("([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\.[a-z0-9-]+)","gi");

        container.innerHTML = doc.replace(regURL,"<a href='$1://$2' target='_blank'>$1://$2</a>").replace(regEmail,"<a href='mailto:$1'>$1</a>");

}

</script>

<div id="test">

폼체크 스크립트 lib.validate.js의 사용법은 http://maniacamp.com/examples/validate_howto.html 을 참조하세요

거친마루의 이메일은 comfuture@studyfriend.net 입니다.<br>

php스쿨의 주소는 http://www.phpschool.com 입니다

</div>

<script>autolink('test');</script>

</body>

</html>

 

게시판등에 적용할때는 내용을 출력할 td에 id를 부여해주고 autolink('id'); 형태로 사용하면 되겠지요 : )

미리보기는 링크#1을 참조하세요

 

출처 - http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=14253&sca=&sfl=wr_subject&stx=%B8%B5%C5%A9&sop=and&page=4

 

 

 

 

function autoLink(content) {

    var regURL = new RegExp('(^|[^"])(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377()]+)', 'gi');

    var regURL2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;

    //var regEmail = new RegExp('([^:])([xA1-xFEa-z0-9_-]+@[xA1-xFEa-z0-9-]+\.[a-z0-9-]+\.[a-z0-9-]+)', 'gi');

    

    return content.replace(regURL, '$1<a class="autoLink" href="$2://$3" target="_blank">$2://$3</a>')

     .replace(regURL2, '$1<a class="autoLink" href="http://$2" target="_blank">$2</a>');

     //.replace(regEmail, '$1<a class="autoLink" href="mailto:$2">$2</a>');

}

 

 



출처: https://linuxism.ustd.ip.or.kr/1553?category=420916 [linuxism]

'자바스크립트' 카테고리의 다른 글

[javascript] 브라우져별 unload 이벤트 할당  (0) 2020.08.27
array deep copy  (0) 2020.06.22
IE 10 에서 form 객체 접근  (0) 2014.01.14
trim 구현  (0) 2013.09.25
구글 맵 API  (0) 2013.07.17
Posted by 선한열심
자바스크립트2020. 8. 27. 13:10

if (window.attachEvent) {

    /*IE and Opera*/

    window.attachEvent("onunload", function() {

        /* ......?!@# */

    });

} else if (document.addEventListener) {

    /*Chrome, FireFox*/

    window.onbeforeunload = function() {

        /* ......?!@# */

    };

    /*IE 6, Mobile Safari, Chrome Mobile*/

    window.addEventListener("unload", function() {

        /* ......?!@# */

    }, false);

} else {

    /*etc*/

    document.addEventListener("unload", function() {

        /* ......?!@# */

    }, false);

}

 

출 처 : http://plibet.blogspot.kr/2013/09/javascript-unload.html

'자바스크립트' 카테고리의 다른 글

javascript - url link 자동 인식(autoLink)  (0) 2020.10.29
array deep copy  (0) 2020.06.22
IE 10 에서 form 객체 접근  (0) 2014.01.14
trim 구현  (0) 2013.09.25
구글 맵 API  (0) 2013.07.17
Posted by 선한열심
자바스크립트2020. 6. 22. 13:21


function cloneObject(obj) {
var clone = {};
for(var i in obj) {
if(typeof(obj[i])=="object" &amp;&amp; obj[i] != null)
clone[i] = cloneObject(obj[i]);
else
clone[i] = obj[i];
}
return clone;
}

'자바스크립트' 카테고리의 다른 글

javascript - url link 자동 인식(autoLink)  (0) 2020.10.29
[javascript] 브라우져별 unload 이벤트 할당  (0) 2020.08.27
IE 10 에서 form 객체 접근  (0) 2014.01.14
trim 구현  (0) 2013.09.25
구글 맵 API  (0) 2013.07.17
Posted by 선한열심
카테고리 없음2020. 2. 14. 08:44
<c:set var="search"  value='"'   />
<c:set var="replace" value='\\"' />

var jParseData = JSON.parse('${fn:replace(partCorpDocList, search, replace) }');
Posted by 선한열심
이클립스2019. 9. 30. 10:33
-startup
plugin/org.eclipse.equinox.launcher~버전~ :
New - server 만들때 apache,basic등의 서버들 목록이 있다.( 버전에 따라 최신 server들 보임)


Posted by 선한열심
MySQL2017. 8. 25. 13:35
윈도우 폰트가커서
내용이 화면에 안나오는 오류로
폰트 작게 변경하면됨

[변경방법]
제어판-디스플레이-작게(s) 선택하면됨

PC재부팅 하고 다시 설치
윈도우키-MySQL-MySQL Installer Connector 클릭 - mysql sever 우측의 reconfigure 클릭하면 ☆Next☆버튼 나옴


'MySQL' 카테고리의 다른 글

mysql like 대소문자 구분  (0) 2013.12.17
id별로 구분해서 카운트하기  (0) 2013.12.11
[펌]mysql rownum 구현하기  (0) 2013.12.11
mysql datatime index 처리하기  (0) 2013.11.26
[펌]초보도 알아야 할 MySql 튜닝 18가지  (0) 2013.04.29
Posted by 선한열심
기타2017. 8. 22. 17:48
Download-community server-Previous Release 에서 32bit 다운로드하면 됨
Posted by 선한열심
카테고리 없음2017. 8. 14. 11:37
npm conif set registry="http://registry.npmjs.org"

명령어 실행하면됨
Posted by 선한열심