이클립스2013. 4. 18. 17:47

 

java.lang.NoSuchMethodError  :

org.springframework.core.GenericTypeResolver.resolveTypeArguments

Posted by 선한열심
Spring 공부2013. 4. 16. 13:54

[출처]spring 웹 어플리케이션 기반의 web.xml 설정 정리

프로젝트에서는 web.xml의 listener와 context, filter 를 필히 파악해야 한다

 

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>springProject</display-name>
<description>incross spring3.1 sample project</description>
<!-- ============================================================= -->
<!-- log4j setting -->
<!-- ============================================================= -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.xml</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>incross.spring</param-value>
</context-param>
<!-- ============================================================= -->
<!-- root application context -->
<!-- ============================================================= -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/root-context.xml
</param-value>
</context-param>
<!-- ============================================================= -->
<!-- spring dispatcher servlet -->
<!-- ============================================================= -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.kyu</url-pattern>
</servlet-mapping>
<!-- ============================================================= -->
<!-- welcome file list -->
<!-- ============================================================= -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
view rawweb.xmlThis Gist brought to you by GitHub.



spring 기반으로 되어 잇는 웹 어플리케이션의 web.xml에 대한 정리

정리의 목적은 곧 있을 스프링 3.1 교육을 위해 머리로 알고 있는 것들을 기록으로 남겨 좀더 자세하게 정보를 전달하기 위함이다.


일단 web.xml은 서블릿 배포 서술자 (DD) 라고 부른다.

영어로는 Deployment Descriptor


DD의 용도는 WAS 구동 시 /WEB-INF 디렉토리에 존재하는 web.xml 파일을 읽어 들여 웹 어플리케이션 설정을 구성하기 위함이다.


가령 스프링, 스트럿츠 등 다양한 프레임워크를 사용하여 웹 어플리케이션을 구성하거나 로그, 인코딩 설정 등 초기 셋팅을 위한 설정 파일이라고 생각하면 된다.

결국 설정을 위한 설정 파일이라고 정리되는 것인가? ㅋ


<display-name>

DD 파일의 title 정도라고 생각하면 좋겠다.

우리는 project name을 추가하여 사용하고 있다.


<description>

어떤 프로젝트를 위한 배포 서술자인지 상세하게 기록한다.

incross spring3.1 sample project


주석 log4j setting 아래 xml element

listener-class에 등록되어 있는 Log4jConfigListener는 log4j라는 로깅 프레임워크를 초기화 하는 클래스이다.

이 클래스를 초기화 할 때 log4jConfigLocation, webAppRootkey context-param을 넘겨준다.


log4jConfigLocation은 log4j 설정 파일의 위치를 지정하는 param이고, webAppRootKey는 다음과 같은 환경에서는 꼭 값을 지정해 줘야 한다.

tomcat

- context1 (log4j 설정 추가)

- context2 (log4j 설정 추가)


즉, 하나의 tomcat에 context가 두 개 이상 적재되어 있고, 각 context가 log4j 프레임워크를 사용하고 있다면 webAppRootKey param에 값을 꼭 지정해 줘야 한다.

만약 지정하지 않았을 경우 default 값인 webapp.root 중복 에러가 발생한다.


주석 root application context 아래 xml element

본격적으로 스프링 웹 어플리케이션을 위한 설정 부분이다.


ContextLoaderListener 초기화를 통해 스프링의 root context를 얻을 수 있다.

여기서 말하는 context는 contextConfigLocation param을 이용하여 찾은 bean 설정 메타 파일을 로드하여 세부 설정에 맞게 bean 객체를 생성 또는 관리하는 주체를 말한다.

이게 맞나?

토비 스프링3.1 한번 더 정독하면 확실히 개념이 잡힐 것 같으니 나중에 책 읽고 부족한 내용이다 싶으면 보충하도록 하자.


주석 spring dispatcher servlet 아래 xml element

DispatcherServlet 클래스를 초기화하여 spring의 servlet context를 생성한다.

초기화 param으로 bean 메타 설정 파일의 위치를 넘겨 준다.


load-on-startup 은 servlet 구동 순서를 의미하며 빠른 순서부터 로딩한다.

아래와 같이 3개의 서블릿이 DD에 등록되어 있고 load-on-startup이 각각 지정되어 있다면 순번이 빠른 것부터 초기화를 진행한다는 의미다.

initServlet1 (load-on-startup = 1)

initServlet2 (load-on-startup = 2)

dispatherServlet (load-on-startup = 3)


servlet-mapping은 url pattern으로 지정된 값으로 웹 요청이 들어왔을 때 servlet-name에 지정되어 있는 이름의 servlet을 호출하겠다는 의미이다.

spring에서는 DispatcherServlet이 모든 요청을 받고, 요청의 URL과 맵핑하는 Controller에 위임한다.

가령 Controller class에 @RequestMapping("/list") 애노테이션으로 지정되어 잇는 메소드가 존재하면 http://localhost:8080/list.do 요청 시 DispatcherServlet이 해당하는 URL과 매핑되는 정보를 찾은 후 연결되는 메소드에 요청을 위임한다.


<welcome-file-list>

/ 웹 요청 시 지정되어 있는 리소스 call

즉, http://localhost:8080 요청 시 index.jsp의 content를 보여준다.


아직은 spring 3.1 샘플 프로젝트를 만드는 중이라 완전하지 않은 DD 파일이므로 샘플 프로젝트 구성을 완료하면 추가적으로 다시 작성하도록 하자.

 

 

 


  <!-- spring frame -->
 <servlet-mapping>
  <servlet-name>appServlet</servlet-name>
  <url-pattern>/</url-pattern>
 </servlet-mapping>
 
 <!-- spring 외 -->
  <servlet-mapping>
   <servlet-name>default</servlet-name>
   <url-pattern>*.js</url-pattern>
   <url-pattern>*.gif</url-pattern>
   <url-pattern>*.jpg</url-pattern>
   <url-pattern>*.png</url-pattern>
   <url-pattern>*.css</url-pattern>
   <url-pattern>*.ico</url-pattern>
  </servlet-mapping>

 

Posted by 선한열심
Spring 공부2013. 4. 12. 14:00

강좌가 아주 쉽고 코드까지 제공 : http://expert0226.tistory.com/category/강좌/Spring%203.0

Posted by 선한열심
Spring 공부2013. 4. 10. 14:22

~-servlet.xml 에

1. 네임스페이스 3군데 추가

xmlns:aop="http://www.springframework.org/schema/aop"

xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/aop
         http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

 

2. 필요한 jar 파일

@Aspect 를 사용하기 위해 : aspectjweaver-1.6.5.jar

 

 

 

Posted by 선한열심
Spring 공부2013. 4. 10. 14:04

 

jstl.jar

 

standard.jar

 JSTL 사용하려면 두개 jar파일이 필요함 없을때 ( jstl.jar과 standard.jar )

- 오류 메시지 http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml

- invalidAbsoluteTypeName  : annotiation 셋팅 잘못 예: execution(public * net.ucware..*(..))"   ..이 두개인데 하나만 찍었을때

 

 cglib-nodep-2.2.jar

 -  AOP 를 인터페이스를 구현하고 있지 않다면 스프링은 CGLIB를 이용하여 클래스에 대한 프록시 객체를 생성한다

 

HTTP Status 405 - Request method 'GET' not supported : 말 그대로 GET을 지원이 안되는 것이다. POST만 가능하게 구현했을 수 있음

Posted by 선한열심
교육2013. 4. 10. 13:27

아이의 영어교육 관련 자료가 많이 있다  http://leesun4134.egloos.com/1461717

'교육' 카테고리의 다른 글

영어공부  (0) 2013.07.18
남자아이, 따뜻한 스킨십이 필요한 이유  (0) 2013.07.18
[펌]세계에 유례없는 선행교육  (0) 2013.07.15
독일을 넘어 미래 한국으로  (0) 2013.02.04
Posted by 선한열심
JQuery2013. 4. 4. 09:54

'JQuery' 카테고리의 다른 글

on 함수  (0) 2013.07.18
jquery 그래프  (0) 2013.07.16
이벤트 생성 및 발생  (0) 2013.07.16
[펌]TR 이동시키기  (0) 2013.06.25
자주사용하는 것들 정리  (0) 2013.05.14
Posted by 선한열심

eclipse에서 phonegap 플러그인이 설치되면 깔끔한데 오류가 나서 

수동으로 하는 것을 찾아봄

생성한 java 파일과 AndroidManifest.xml 등을 수정해 주면 될 거 같다

PhoneGap 설치하고 예제 실행하기

http://coronasdk.tistory.com/219



Posted by 선한열심
자바스크립트2013. 4. 2. 16:19

간단히 가능한거만 확인

<link rel="stylesheet" type="text/css" href="css/main1.css" id=style1 />

<link rel="stylesheet" type="text/css" href="css/main2.css" id=style2 />

<link rel="stylesheet" type="text/css" href="css/main3.css" id=style3 />


<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>



// 스타일시트를 disalbed함

$("#style1").attr("disabled", "disabled"); 

$("#style2").attr("disabled", "disabled"); 

$("#style3").attr("disabled", "disabled"); 


function funTest(state){ 

$("#style1").attr("disabled", "disabled"); 

$("#style2").attr("disabled", "disabled"); 

        $("#style3").attr("disabled", "disabled"); 

 

$("#style"+ state).removeAttr("disabled");   // 스타일을 적용함 (즉 스타일시트 disabled한 것을 제거함 

}


</script>

<a href=javascript:funTest('1')>1111111111</a>

<a href=javascript:funTest('2')>2222222222</a>

<a href=javascript:funTest('3')>3333333333</a>

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

[JS API] prototype.js ajax method  (0) 2013.06.20
[JS api] AjaxUpload 사용하기  (0) 2013.06.13
웹표준, 웹접근성 및 Tree 구현  (0) 2013.04.02
new Person(), Person()의 차이  (0) 2013.02.19
addEventListener, attachEvent  (0) 2013.02.19
Posted by 선한열심
자바스크립트2013. 4. 2. 11:08
Posted by 선한열심