Java&Jsp&Servlet2015. 2. 23. 19:03

import java.util.regex.Pattern;

public class ServerInfo {

public static void main(String[] args) {
    String osName = System.getProperty("os.name");
    boolean osBoolean = Pattern.matches("Windows.*",osName);
    System.out.println(osName);
    System.out.println(osBoolean);

 
}

OS 가 Windows 이면 true 끝

 

Posted by 비니미니파파
Framework2015. 2. 17. 11:08

Error setting null for parameter #3 with JdbcType OTHER

Mybatis 로 넘어오는 3번째 파라미터가 null 이여서 나는 오류.

mybatis-config.xml 설정 해주면 끝

 


<setting name="jdbcTypeForNull" value="NULL" /> 

Posted by 비니미니파파
WEB 표준(HTML,CSS)2015. 2. 13. 11:43
<style>
.news_text {
  background:#cdcdcd;
  opacity: 0.5;
}

.news_text:hover {
  opacity: 1.0;
}
</style>

<div class=".news_text">
오늘의 뉴스는....
</div>

div 에 투명도가 있음.

마우스 hover 되었을 때 text 가독성을 높이려고 투명도를 없애는 

효과가 필요해서 해봄....  잘됨.....

opacity 유효값이 궁금하여 검색 해봄...

http://www.w3schools.com/cssref/css3_pr_opacity.asp

Specifies the opacity. From 0.0 (fully transparent) to 1.0 (fully opaque)

0.0~1.0 까지 값을 사용.... 끝....

Posted by 비니미니파파
Database/Oracle2015. 2. 11. 16:45

오늘 날짜 기준으로 1주일 날짜를 가져와야 함.

원하는 결과 ( 오름 차순 )

2015-02-05
2015-02-06
2015-02-07
2015-02-08
2015-02-09
2015-02-10
2015-02-11

SELECT
to_char(sysdate-7 + LEVEL,'YYYY-MM-DD') AS rdate
FROM dual
CONNECT BY LEVEL <= 7  

원하는 결과 ( 내림차순 )

2015-02-11
2015-02-10
2015-02-09
2015-02-08
2015-02-07
2015-02-06
2015-02-05

SELECT
to_char(SYSDATE + 1 - LEVEL,'YYYY-MM-DD') AS rdate
FROM dual
CONNECT BY LEVEL <= 7  
  

Posted by 비니미니파파
UI ( UX )/Websquare2015. 2. 9. 18:21

Websquare 에서는 jquery 의 animate 가 동작하지 않기 때문에 Javascript 로 만들어 보았다.

obj.setLabel(obj); 이 부분만 javascript document.getElementById( objName ).innerHTML(val) 로
바꾸면 html+javasciprt 에서도 동작한다.

   // 숫자 자동증가  ( interval 1/1000 초 )
   // ex)  autoIncrementVal( obj, val, interval );
   //      autoIncrementVal( "#indexVal", 95, 20 );
   var autoIncrementVal = function(obj, val, interval)
   {
    var i = 0; 
          var ai = setInterval(function(){
           obj.setLabel(i);          
           if ( i == val ) {
            clearInterval(ai);
           }
           i++;
           
          }, 20);
   }
         
  autoIncrementVal(textbox3, 80);

Posted by 비니미니파파
Framework2015. 1. 27. 11:57
[Spring] Error creating bean with name 'sampleBean': Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sampleBean' is defined

@resource 어노테이션 sampleBean 이 생성되지 않아서 오류가 났다.

---- 소스 일부 --
@Resource(name = "sampleBean")
private SampleBean sampleBean;
---- 소스 일부 --

삽질 끝에 설정을 추가 하여 해결은 하였으나 좀 더 찾아봐야 한다.

spring 설정 ( servlet-context ) 에 Bean 설정 확인.
없다면 정의해서 해결 ( 이렇게 하면 되는건지 확신이 없다! ㅠ.ㅠ)

<bean id="sampleBean" class="sample.model.SampleBean" />

-- 여기서 --
@resurce 어노테이션 구체적 학습필요

Posted by 비니미니파파
UI ( UX )/Websquare2015. 1. 27. 10:02

~/websquare/websquare.html?w2xPath=/w2/spring/sample_spring2.xml

웹스퀘어 + 스프링 연동 샘플예제 오류

MediaType : json 선택 시 조회 오류

1월 27, 2015 9:09:36 오전 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [sample] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to sample.beans.BaseBean] with root cause
java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to sample.beans.BaseBean
 at sample.spring.adapter.CustomWqArgumentResolver.resolveArgument(CustomWqArgumentResolver.java:50)
--- 생략 ---

 2) MediaType : xml 시 조회 오류

 [request] org.apache.catalina.connector.RequestFacade@5dbef3d2
[beanDef] @websquare.system.adapter.annotation.BEAN_DEF(beans=[root=sample.beans.SelectBean, infoList=sample.beans.InfoBean, codeList=sample.beans.CodeBean])
1월 27, 2015 9:15:24 오전 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [sample] in context with path [] threw exception [Request processing failed; nested exception is Unexpected character (<) at position 0.] with root cause
Unexpected character (<) at position 0.
--- 생략 ---

위의 오류 시 websquare.xml (환경설정 파일)을 확인 후 수정 해야 한다.

Websquare 에서는 convertType  server : map/bean client : xml/json 둘 중 하나만 선택 가능하다.

bean, json 을 사용한다면 request, response 설정을 바꿔야 한다.

수정전 :
<convertType server="map" client="json" />

수정후 :
<convertType server="bean" client="json" />

권장은 map , json 이라고 한다.

Posted by 비니미니파파
Java&Jsp&Servlet2015. 1. 11. 12:03

PC 작업하던 환경을 노트북에 세팅하기 귀찮아서 eclipse 폴더 통째로 복사했더니

failed to load the jni shared library

오류가 난다.

삽질하다 원인을 찾았다.

PC Java 64bit

노트북 Java 32bit

eclipse 32bit 버전을 다운받아 설정해야 겠다.

ㅠ.ㅠ

 

 

Posted by 비니미니파파
Server(Windows&Linux)2014. 12. 26. 10:22

예전 블로그 정리중... 예전 작성글....

ext3 에서 Quota 설정하기

Test 환경....

Linux : Hancomsoftlinux 2005

1. /etc/fstab 설정

/home 과 /var에 쿼터 설정을 하려한다.

설정전
LABEL=/home             /home            ext3    defaults  1 2
LABEL=/var              /var             ext3    defaults  1 2

설정 후
LABEL=/home             /home            ext3    defaults,usrquota  1 2
LABEL=/var              /var             ext3    defaults,usrquota  1 2

2. aquota.user 파일 만들기 / 퍼미션 설정

touch /home/aquota.user
chmod 600 /home/aquota.user
touch /home/aquota.user
chmod 600 /var/aquota.user

3. 리부팅 또는 리마운트 한다.
mount -o remount /home
mount -o remount /var

 4. 쿼터체크 실행
~]# quotacheck -augvm -F vfsv0
quotacheck: WARNING -  Quotafile /home/aquota.user was probably truncated. Can't save quota settings...
quotacheck: Scanning /dev/sda7 [/home] quotacheck: Old group file not found. Usage will not be substrac
ted.
done
quotacheck: Checked 12 directories and 19 files
quotacheck: WARNING -  Quotafile /var/aquota.user was probably truncated. Can't save quota settings...
quotacheck: Scanning /dev/sda6 [/var] quotacheck: Old group file not found. Usage will not be substract
ed.
done
quotacheck: Checked 129 directories and 913 files

 5. 쿼터 실행
~]# quotaon -a

 6. 쿼터 상태 보기
~]# repquota -a
*** Report for user quotas on device /dev/sda7
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --   32828       0       0              3     0     0

*** Report for user quotas on device /dev/sda6
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --   40464       0       0           1003     0     0
daemon    --       8       0       0              3     0     0

7. 쿼터 설정하기
~]# eduquota -u [username]

쿼터설정은 다른 문서 참조하세요~

http://wiki.kldp.org/wiki.php/QuotaMiniHOWTO


잡담)

쿼터가 이렇게 말썽을 부릴줄은 몰랐다~
국내 사이트 검색해서는 답을 찾을수가 없었다~

결국, 안되는 영어실력으로 redhat.com에서 답을 찾을 수가 있었다...
역시~ 영어공부를 해야한단 말인가~ ㅠ.ㅠ

 ext3에서 쿼터설정때문에 헤매었던분들에게 도움이 되길.... ^^

Posted by 비니미니파파
Server(Windows&Linux)2014. 12. 26. 10:09

예전 작성한 블로그 정리중....

1. yum 을 통한 설치

* yum 을 사용하기 전...

rpmfind.net 이란 사이트에서 rpm 패키지를 찾고 wget 으로 다운받아 rpm 을 설치하였다.

 * yum을 사용하면...

이제 그럴 필요가 없다.

설치할 패키지명만 안다면 뭐든지 설치를 바로 한다.

예를 들어 xinetd 를 설치를 해본다고 하자....

 ]# yum install xinetd

 끝이다. rpmfind 로 찾을 필요없고, 다운받아 설치할 필요도 없다. 그냥 끝이다.

 

2. yum 을 통한 업데이트

예를 들어 vsftpd 를 업데이트 하여 보자

 ]# yum update vsftpd

 끝이다. 그냥 yum update 패키지명 하면 끝이다.

 그럼 모든 패키지를 업데이트 한다고 해보자

 ]# yum update

 그냥 끝이다. 중간에 y 만 눌러주면 다 업데이트 시켜준다. 그냥  yum update 해버려라...

 중간에 y 도 귀찮다... 그럼

 ]# yum -y update

 해버려라. 그럼 그냥 지가 다 업데이트 해버린다...

 

보너스로 yum 매뉴얼...

 yum(8)                                                                  yum(8)

NAME
       yum - Yellowdog Updater Modified

SYNOPSIS
       yum [options] [command] [package ...]

DESCRIPTION
       yum is an interactive, automated update program which can be used for maintaining systems using rpm

       command is one of:
        * install package1 [package2] [...]
        * update [package1] [package2] [...]
        * check-update
        * upgrade [package1] [package2] [...]
        * remove | erase package1 [package2] [...]
        * list [...]
        * info [...]
        * provides | whatprovides feature1 [feature2] [...]
        * clean [ packages | headers | metadata | cache | dbcache | all ]
        * makecache
        * groupinstall group1 [group2] [...]
        * groupupdate group1 [group2] [...]
        * grouplist [hidden]
        * groupremove group1 [group2] [...]
        * groupinfo group1 [...]
        * search string1 [string2] [...]
        * shell [filename]
        * resolvedep dep1 [dep2] [...]
        * localinstall rpmfile1 [rpmfile2] [...]
        * localupdate rpmfile1 [rpmfile2] [...]
        * deplist package1 [package2] [...]

       Unless the --help or -h option is given, one of the above commands must be present.

       Repository configuration is honored in all operations.

       install
              Is  used to install the latest version of a package or group of packages while ensuring that all depen-
              dencies are satisfied.  If no package matches the given package name(s), they are assumed to be a shell
              glob and any matches are then installed.

       update If  run  without  any  packages,  update will update every currently installed package.  If one or more
              packages are specified, Yum will only update the listed packages.  While updating  packages,  yum  will
              ensure  that all dependencies are satisfied.  If no package matches the given package name(s), they are
              assumed to be a shell glob and any matches are then installed.

              If the --obsoletes flag is present yum will include package obsoletes in its calculations - this  makes
              it better for distro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.


       check-update
              Implemented so you could know if your machine had any updates that needed to be applied without running
              it interactively. Returns exit value of 100 if there are packages available for an update. Also returns
              a list of the pkgs to be updated in list format. Returns 0 and no packages are available for update.

       upgrade
              Is the same as the update command with the --obsoletes flag set. See update for more details.

       remove or erase
              Are used to remove the specified packages from the system as well as removing any packages which depend
              on the package being removed.

       list   Is used to list various information about available packages; more complete details  are  available  in
              the List Options section below.

       provides or whatprovides
              Is  used  to  find out which package provides some feature or file. Just use a specific name or a file-
              glob-syntax wildcards to list the packages available or installed that provide that feature or file.

       search Is used to find any packages matching a string in the description, summary, packager and  package  name
              fields of an rpm. Useful for finding a package you do not know by name but know by some word related to
              it.

       info   Is used to list a description and summary information about available packages; takes  the  same  argu-
              ments as in the List Options section below.

       clean  Is  used  to  clean up various things which accumulate in the yum cache directory over time.  More com-
              plete details can be found in the Clean Options section below.

       shell  Is used to enter the ’yum shell’, when a filename is specified the contents of that file is executed in
              yum shell mode. See yum-shell(8) for more info

       resolvedep
              Is used to list packages providing the specified dependencies, at most one package is listed per depen-
              dency.

       localinstall
              Is used to install a set of local rpm files. If required the  enabled  repositories  will  be  used  to
              resolve dependencies.

       localupdate
              Is  used  to  update the system by specifying local rpm files. Only the specified rpm files of which an
              older version is already installed will be installed, the remaining specified packages will be ignored.
              If required the enabled repositories will be used to resolve dependencies.

       deplist
              Produces  a  list  of all dependencies and what packages provide those dependencies for the given pack-
              ages.

GENERAL OPTIONS
       Most command line options can be set using the configuration file as well and the  descriptions  indicate  the
       necessary configuration option to set.

       -h, --help
              Help; display a help message and then quit.

       -y     Assume yes; assume that the answer to any question which would be asked is yes.
              Configuration Option: assume-yes

       -c [config file]
              Specifies the config file location - can take http, ftp urls and local file paths.

       -d [number]
              Sets  the debugging level to [number] - turns up or down the amount of things that are printed. Practi-
              cal range: 0 - 10
              Configuration Option: debuglevel

       -e [number]
              Sets the error level to [number] Practical range 0 - 10. 0 means print only critical errors about which
              you  must  be  told.  1 means print all errors, even ones that are not overly important. 1+ means print
              more errors (if any) -e 0 is good for cron jobs.
              Configuration Option: errorlevel

       -R [time in minutes]
              Sets the maximum amount of time yum will wait before performing a command  -  it  randomizes  over  the
              time.

       -C     Tells yum to run entirely from cache - does not download or update any headers unless it has to to per-
              form the requested action.

       --version
              Reports the yum version number and exits.

       --installroot=root
              Specifies an alternative installroot, relative to which all packages will be installed.
              Configuration Option: installroot

       --enablerepo=repoidglob
              Enables specific repositories by id or glob that have been disabled in the configuration file using the
              enabled=0 option.
              Configuration Option: enabled

       --disablerepo=repoidglob
              Disables specific repositories by id or glob.
              Configuration Option: enabled

       --obsoletes
              This option only has affect for an update, it enables yum´s obsoletes processing logic. For more infor-
              mation see the update command above.
              Configuration Option: obsoletes

       --exclude=package
              Exclude a specific package by name or glob from updates on all repositories.
              Configuration Option: exclude

       --noplugins
              Run with all plugins disabled.
              Configuration Option: plugins

LIST OPTIONS
       The following are the ways which you can invoke yum in list mode.  Note that all list commands include  infor-
       mation on the version of the package.

       yum list [all | glob_exp1] [glob_exp2] [...]
              List all available and installed packages.

       yum list available [glob_exp1] [...]
              List all packages in the yum repositories available to be installed.

       yum list updates [glob_exp1] [...]
              List all packages with updates available in the yum repositories.

       yum list installed [glob_exp1] [...]
              List  the  packages specified by args.  If an argument does not match the name of an available package,
              it is assumed to be a shell-style glob and any matches are printed.

       yum list extras [glob_exp1] [...]
              List the packages installed on the system that are not available in any yum repository  listed  in  the
              config file.

       yum list obsoletes [glob_exp1] [...]
              List  the  packages installed on the system that are obsoleted by packages in any yum repository listed
              in the config file.

       yum list recent
              List packages recently added into the repositories.

       Specifying package names
              All the list options mentioned above take file-glob-syntax wildcards or package names as arguments, for
              example  yum  list  available   칏oo* ? will  list all available packages that match ’foo*’. (The single
              quotes will keep your shell from expanding the globs.)

CLEAN OPTIONS
       The following are the ways which you can invoke yum in clean mode. Note that "all files" in the commands below
       means  "all  files  in  currently enabled repositories".  If you want to also clean any (temporarily) disabled
       repositories you need to use --enablerepo= ? ?option.

       yum clean packages
              Eliminate any cached packages from the system.  Note that packages are not automatically deleted  after
              they are downloaded.

       yum clean headers
              Eliminate all of the header files which yum uses for dependency resolution.

       yum clean metadata
              Eliminate  all of the files which yum uses to determine the remote availability of packages. Using this
              option will force yum to download all the metadata the next time it is run.

       yum clean dbcache
              Eliminate the sqlite cache used for faster access to metadata.  Using this option  will  force  yum  to
              recreate the cache the next time it is run.

       yum clean all
              Runs yum clean packages and yum clean headers as above.

MISC
       Specifying package names
              A package can be referred to for install,update,list,remove etc with any of the following:

              name
              name.arch
              name-ver
              name-ver-rel
              name-ver-rel.arch
              name-epoch:ver-rel.arch
              epoch:name-ver-rel.arch

              For example: yum remove kernel-2.4.1-10.i686

PLUGINS
       Yum  can  be extended through the use of plugins. A plugin is a Python ".py" file which is installed in one of
       the directories specified by the pluginpath option in yum.conf. For a plugin to work, the following conditions
       must be met:

       1. The plugin module file must be installed in the plugin path as just described.

       2. The global plugins option in /etc/yum.conf must be set to ‘1’.

       3.  A configuration file for the plugin must exist in /etc/yum/pluginconf.d/<plugin_name>.conf and the enabled
       setting in this file must set to ‘1’. The minimal content for such a configuration file is:

              [main]
              enabled = 1

       See the yum.conf(5) man page for more information on plugin related configuration options.

FILES
       /etc/yum.conf
       /etc/yum/repos.d/
       /etc/yum/pluginconf.d/
       /var/cache/yum/

SEE ALSO
       yum.conf (5)
       http://linux.duke.edu/yum/
       http://wiki.linux.duke.edu/YumFaq

AUTHORS
       See the Authors file included with this program.

BUGS
       There of course aren’t any bugs, but if you find any, you should first consult the  Faq  mentioned  above  and
       then email the mailing list: yum@lists.linux.duke.edu or filed in bugzilla.

Seth Vidal                        2005 Aug 05                           yum(8)

 

 

Posted by 비니미니파파
WEB 표준(HTML,CSS)2014. 12. 15. 09:35

HTML 5에서는 HTML 4 중에서 CSS로 이용 가능한 표현 속성을 더 이상 사용하지 않습니다.

align 속성: caption, iframe, img, input, object, legend, table, hr, div, h1, h2, h3, h4, h5, h6, p, col, colgroup, tbody, td, tfoot, th, thead 및 tr.
alink, link, text and vlink 속성: body.
background 속성: body.
bgcolor 속성: table, tr, td, th 및 body.
border 속성: table and object.
cellpadding 및 cellspacing 속성: table.
char 및 charoff 속성: col, colgroup, tbody, td, tfoot, th, thead 및 tr.
clear 속성: br.
compact 속성: dl, menu, ol 및 ul.
frame 속성: table.
frameborder 속성: iframe.
height 속성: td 및 th.
hspace 및 vspace 속성: img 및 object.
marginheight 및 marginwidth 속성: iframe.
noshade 속성: hr.
nowrap 속성: td 및 th.
rules 속성: table.
scrolling 속성: iframe.
size 속성: hr.
type 속성: li, ol and ul.
valign 속성: col, colgroup, tbody, td, tfoot, th, thead and tr.
width 속성: hr, table, td, th, col, colgroup 및 pre.

Posted by 비니미니파파
JavaScript&Platform/jQuery2014. 12. 12. 12:01


<script>
       // table row background-color change
        $(function(){
        $('tr:odd').css('background-color','#FFFFFF');  // 홀수
        $('tr:even').css('background-color','#f6f6f6');   // 짝수
        $('tr:first').css('background-color','#cdcdcd');  // 테이블 헤드
        });        
 </script>

Posted by 비니미니파파
JavaScript&Platform/jQuery2014. 12. 11. 09:50

구글링으로 찾은 예제를 조금 수정하였다.

다음에 재활용하기 위해 function 으로 만들어 보았다.

// 숫자 자동증가
// ex)  autoIncrementVal( obj, val, durationVal );
//      autoIncrementVal( "#testVal", 95, 2500 );
var autoIncrementVal = function(obj, val, durationVal)
{
 $({someValue: 0}).animate({someValue: val}, {
     duration: durationVal,
     easing:'swing', // can be anything
     step: function() { // called on every step
      // Update the element's text with rounded-up value:
      $(obj).text(Math.ceil(this.someValue));
     }         
    });
}

Posted by 비니미니파파
Framework2014. 12. 10. 10:51

servlet-context.xml 설정 추가

    
    <interceptors>
        <interceptor>
            <mapping path="/**/*" />
            <exclude-mapping path="/main/*"/>
            <exclude-mapping path="/login/*"/>
            <beans:bean class="com.d4emon.interceptor.SessionInterceptor"></beans:bean>            
        </interceptor>        
    </interceptors>
    
    

*** exclude-maping 은 Spring 3.2 부터 지원한다. ****

SessionInterceptor.java 파일 생성

 

package com.d4emon.interceptor;

 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;  
 import javax.servlet.http.HttpSession;

 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
  
 public class SessionInterceptor extends HandlerInterceptorAdapter {
  
  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

   System.out.println("Interceptor : PreHandle");
   
   // Session userid check
   HttpSession session = request.getSession();   
   String userid = (String) session.getAttribute("userid");

   // Login false
   if(null==userid) {
    System.out.println("Interceptor : Session Check Fail");
    // main page 로 이동
    response.sendRedirect("/main/main.do");
    return false;
   } 
   // Login true
   else { 
    System.out.println("Interceptor : Session Check true");
    return super.preHandle(request, response, handler);
   }
  }
 }

Posted by 비니미니파파
Framework2014. 12. 10. 10:41

환경 : eclipse + sts + maven

pom.xml 을 열어보면

<properties>
  <java-version>1.6</java-version>
  <org.springframework-version>3.1.1.RELEASE</org.springframework-version>
  <org.aspectj-version>1.6.10</org.aspectj-version>
  <org.slf4j-version>1.6.6</org.slf4j-version>
 </properties>

3.1.1 을 3.2.8 로 변경하면 끝

<properties>
  <java-version>1.6</java-version>
  <org.springframework-version>3.2.8.RELEASE</org.springframework-version>
  <org.aspectj-version>1.6.10</org.aspectj-version>
  <org.slf4j-version>1.6.6</org.slf4j-version>
 </properties>

**** Interceptor 를 설정 하다 exclude-mapping 이 Spring 3.2 부터 지원해서 변경이 필요하게 됨 *****

 

Posted by 비니미니파파