1
이것은 사소한 일일 수 있습니다. 하지만 이것에 대한 정보는 얻지 못했습니다.Annotation을 사용하고 컨트롤러를 구현하는 스프링 MVC 컨트롤러 구현
Controller 인터페이스를 구현하거나 AbstractController를 확장하는 Controller 구현 클래스를 동일한 웹 애플리케이션에서 사용할 수 있습니까?
그렇다면 어떻게해야할까요?
나는 다음과 같은 스프링 컨텍스트를 작성했지만, 컨트롤러를 구현하는 클래스는 HomePageController가로드되지 않습니다 내 경우에는<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<bean name="/home.htm" class="com.dell.library.web.HomePageController">
<property name="library" ref="library" />
</bean>
<context:component-scan base-package="com.dell.library.web.anot" />
<mvc:annotation-driven />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
</beans>
로드되지 않았습니다. 이것이 올바른 방법입니까?
감사 다누시
감사합니다. 그것은 일했다. 이 두 항목은이 경우 무엇을합니까? –
@ dhanush : 업데이트되었습니다. – axtavt
내가 0 upvotes와 허용 대답을보고 싫어 :) – Bozho