[인텔리J] <beans:beans>와 <beans>

2021. 4. 9. 23:39 Spring Framework/Spring 오류

필자가 공부하는 책에 다음과 같은 코드가 있었다.

그런데 문제가 되었던 부분은 <beans:beans>로 표시하면 아래 사진과 같은 오류가 발생해버린다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?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:mvc="http://www.springframework.org/schema/mvc"
    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 http://www.springframework.org/schema/context/spring-context.xsd">
 
    <!-- DispatcherServlet Context: defines this servlet's request-processing 
        infrastructure -->
 
    <!-- Enables the Spring MVC @Controller programming model -->
    <annotation-driven />
 
    <!-- Handles HTTP GET requests for /resources/** by efficiently serving 
        up static resources in the ${webappRoot}/resources directory -->
    <resources mapping="/resources/**" location="/resources/" />
 
    <!-- Resolves views selected for rendering by @Controllers to .jsp resources 
        in the /WEB-INF/views directory -->
    
    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
        <beans:property name="prefix" value="/WEB-INF/views/" /> 
        <beans:property name="suffix" value=".jsp" /> 
    </beans:bean>
  <context:component-scan    base-package="com.myspring.pro27" />
 
<!-- 타일즈 실습 설정 -->
 <!-- 
 
    <beans:bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
        <beans:property name="definitions">
            <beans:list>
                <beans:value>classpath:tiles/*.xml</beans:value>
            </beans:list>
        </beans:property>
        <beans:property name="preparerFactoryClass"
                      value="org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory" />
    </beans:bean>
    <beans:bean id="viewResolver"
        class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <beans:property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView" />
    </beans:bean>
-->
<!-- 인터셉터 실습 설정 -->
<!--     
    
   <mvc:interceptors>
        <mvc:interceptor>
          <mvc:mapping path="/*/*.do"/>
       <beans:bean class="com.myspring.pro27.member.interceptor.ViewNameInterceptor" />
    </mvc:interceptor>
</mvc:interceptors>
 -->
</beans:beans>
 
cs

 

 이클립스에서는 정상적으로 되는 코드일 수 있으나

인텔리 제이에서는 오류가 발생하므로 다음과 같이 사용하도록하자

다음과 같이 ctrl+r로 [태그명]:으로 설정된 것을 다음과 같이 공백으로 replace 처리해서 문제를 해결할 수 있다.

 

출처 : namubada.net/215?category=777141