SpringMVC (3.0.1) 스택을 기반으로 구축 된 기존 GUI 웹 애플리케이션의 경우 RESTful API를 공개하려고한다. 합리적인 선택을 무엇이라고 생각하십니까?SpringMVC 애플리케이션 용 RESTful API
- 저지와 같은 다른 프레임 워크와 통합됩니다 (처음부터 다시 시작하는 것처럼 보입니다)?
- JAXB/Jackson의 SpringMVC 통합을 사용합니까?
DispatchServlet
에 다른 서블릿 매핑/api/*
을 추가해야합니까?- 모든보기는 jsp로 코딩됩니다. 내 XML API에 jsp 템플릿을 사용해야합니까?
- 일반적인 의존성을 가진 별도의 새로운 webapp을 빌드 하시겠습니까?
- 다른 건 없나요?
<web-app 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" version="2.5"> <welcome-file-list> <welcome-file>home.html</welcome-file> </welcome-file-list> <servlet> <servlet-name>spring-mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring-mvc</servlet-name> <url-pattern>/web/*</url-pattern> </servlet-mapping> </web-app>
그리고 내 스프링 컨텍스트 설명 :
이하 내 web.xml 파일입니다 사전에
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context" xmlns:security="http://www.springframework.org/schema/security" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
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
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
>
<context:component-scan base-package="net.mycrub.poc.controllers" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/views/"
p:suffix=".jsp"
p:viewClass="org.springframework.web.servlet.view.JstlView" />
</beans>
감사합니다; 매핑 예 환영 :-)에게 있습니다