Bahar MVC ve apache çinileri ile bir web uygulaması yapıyorum ve ben gelecek vardır:Bahar MVC: Apache Çini kodunda çalışması
Projesi
| __WebContent
|__WEB-INF
|___ spring
|__app-config.xml
|___ views
|__footer.jsp
|__header.jsp
|__home.jsp
|__layout.jsp
|__menu.jsp
|___ tiles.xml
|___ web.xml
| __index
: app-config.xml olarak.jsp
Benim layout.jsp:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><tiles:insertAttribute name="title" ignore="true" /></title>
</head>
<body>
<div><tiles:insertAttribute name="header" /></div>
<div style="float:left;padding:10px;width:15%;"><tiles:insertAttribute
name="menu" /></div>
<div style="float:left;padding:10px;width:80%;border-left:1px solid pink;">
<tiles:insertAttribute name="body" /></div>
<div style="clear:both"><tiles:insertAttribute name="footer" /></div>
</body>
</html>
Benim tiles.xml:
<tiles-definitions>
<definition name="base.definition" template="/WEB-INF/view/layout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/WEB-INF/view/header.jsp" />
<put-attribute name="menu" value="/WEB-INF/view/menu.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/view/footer.jsp" />
</definition>
<definition name="home" extends="base.definition">
<put-attribute name="title" value="Home" />
<put-attribute name="body" value="/WEB-INF/view/home.jsp" />
</definition>
</tiles-definitions>
Ve denetleyicisi:
@Controller
public class HomeController {
@RequestMapping(value="/home")
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
return new ModelAndView("home");
}
O bana verir i http://localhost:8080/unqui.tip.vista/home.html için girmek hatası:
http 404 /unqui.tip.vista/WEB-INF/view/layout.jsp
Ty.