我正在尝试在两个页面之间进行简单导航,但出现错误,我无法解决
第一页是我home.jsp
在这里我做一个链接
<a href="/timecard/NewAccount"><FONT COLOR="#40C0FF">Create New Account</FONT></a>
然后我创建帐户文件夹,我必须保存文件createAccount.jsp
-这是我的目标页面,并views.xml
带有此源
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
<definition extends="default" name="createNew">
<put-attribute name="body" value="/WEB-INF/views/accounts/createAccount.jsp"/>
</definition>
</tiles-definitions>
和我的AccountsController
@Controller
@RequestMapping(value="/timecard/newAccounts")
public class AccountsController {
@RequestMapping(method=RequestMethod.GET)
public String accountForm(Model model){
return "createNew";
}
}
所以当我点击home.jsp
页面中的链接时找不到,这是消息
WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/timecard/NewAccount] in DispatcherServlet with name 'appServlet'
我真的很困惑。你能告诉我我做错了什么吗?提前致谢