2014-04-24 3 views
1
I want to build an application using Spring MVC with front end as HTML, CSS and Jquery. 

이것이 가능한지 알고 싶습니다. Spring MVC는 UI에서 액세스하여 서버 측 데이터에 액세스 할 수있는 Model 객체를 가지고있다.스프링 MVC에서 프론트 엔드로 HTML을 사용할 수 있습니까?

나는

@Override 
protected ModelAndView handleRequestInternal(HttpServletRequest request, 
    HttpServletResponse response) throws Exception { 

    ModelAndView model = new ModelAndView("HelloWorldPage"); 
    model.addObject("msg", "hello world"); 

    return model; 
} 

내 HTML 코드는 예 당신이 할 수있는

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"> 
    <body> 

    <c:out value="${msg}"/> 

    </body> 
</html> 

답변

1

을 다음과 같이 할 내 컨트롤러에합니다 다음있다.

http://spring.io/guides - 개별 Spring 프로젝트 및 indepth 자습서에 대한 모든 정보가 있습니다.

Velocity 및 Thymeleaf와 같은 다른 템플릿 엔진을 활용하여보다 유창하고 유동적 인 HTML5 페이지를 활용할 수도 있습니다. 질문에 대한 답변을 한 경우 http://www.thymeleaf.org/documentation.html

+0

그래서 그것을 표시하시기 바랍니다 :) -

개인적으로 나는 Thymeleaf http://www.thymeleaf.org/ 봄 3 MVC + Thymeleaf 자습서를 사용 – Aeseir

관련 문제