왕초보벗어나자
92
2019-12-30 16:13:08
8
354

스프링 인터셉트


<?xml version="1.0" encoding="UTF-8"?>

<beans:beans xmlns="http://www.springframework.org/schema/mvc"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:beans="http://www.springframework.org/schema/beans"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:mvc="http://www.springframework.org/schema/mvc"
 xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">


 <mvc:interceptors>
  <mvc:interceptor>
     <bean class="com.freehoon.web.user.service.interceptor.LoginInterceptor"></bean>
    <mvc:mapping path="/login/loginCheck"/>
  </mvc:interceptor>


error :

cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://www.springframework.org/schema/mvc":mapping}' is expected.


안녕하세요 

상기에 개속 애러가 납니다. 왜 bean 에서 애러가 날까여? 부분 발취했습니다.


0
0
  • 답변 8

  • aksjm2
    1k
    2019-12-30 16:19:39 작성 2019-12-30 16:25:46 수정됨

    순서를 바꿔보세요..

    <mvc:mapping path="/login/loginCheck"/>
    <bean class="com.freehoon.web.user.service.interceptor.LoginInterceptor"></bean>
    


    ## 추가 ##
    아래 구문으로도 시도해보세요.

    <beans:bean class="com.freehoon.web.user.service.interceptor.LoginInterceptor"/>
    0
  • 왕초보벗어나자
    92
    2019-12-30 16:25:12

    똑같습니다......ㅠ.

    0
  • spoon
    1k
    2019-12-30 16:25:55

    <beans:beans xmlns="http://www.springframework.org/schema/mvc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:beans="http://www.springframework.org/schema/beans"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd 
      http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans.xsd 
      http://www.springframework.org/schema/context  https://www.springframework.org/schema/context/spring-context.xsd" >


    여기서 /mvc가 2개가 있는데 그래서 그럴수도 있을듯한?

    0
  • 왕초보벗어나자
    92
    2019-12-30 16:32:57

    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/mvc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:beans="http://www.springframework.org/schema/beans"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">

    <interceptors>
      <interceptor>
       <mapping path="/login/loginCheck"/>
       <bean class="com.freehoon.web.user.service.interceptor.LoginInterceptor"></bean>
      </interceptor> 
     </interceptors>

    error:

    cvc-complex-type.2.4.a: Invalid content was found starting with element 'bean'. One of '{"http://www.springframework.org/schema/mvc":mapping, "http://www.springframework.org/schema/mvc":exclude-mapping, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/beans":ref}' is expected.

    지워도 똑같네요



    0
  • spoon
    1k
    2019-12-30 16:35:08

     xmlns:mvc 를 지우셨으면 mvc: 태그를 사용한 것도 수정하신건가요?

    0
  • 왕초보벗어나자
    92
    2019-12-30 16:39:47

     <beans:bean id="loginInerceptor" class="com.freehoon.web.user.service.interceptor.LoginInterceptor"/>
     <interceptors>
      <interceptor>
       <mapping path="/login/loginCheck"/>
       <beans:ref bean="loginInerceptor"/>
      </interceptor> 
     </interceptors>


    이렇게 바꿔서 해야겟네요 이렇게하니 애러 나지 않네요

    0
  • 왕초보벗어나자
    92
    2019-12-30 16:40:40

    ac_spoon

    >>넹 다지웠어여 애러가 네요 


    0
  • 왕초보벗어나자
    92
    2019-12-30 16:42:14
    bean -> beans 로 바꾸니 애러 안나네요 왜 그렇지 --
    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.