ビュー名の読み込みに失敗するタグがあります。私のサーブレットコンテキストはテストです。URLを定義します:
<spring:url var="editContactUrl" value="/next" />
そして以下がタグです。
<a href="${editContactUrl}">Try Again</a>
以下のように、spring:url の値 ("/next") が無視されたサーブレット コンテキストだけが得られます。
http://localhost:8080/test
誰かが私を啓発できますか?ありがとう。そうそう、spring:url と同じ結果でコンテキストを指定しようとしました。
編集:私がやろうとしているのは、単に次のコントローラーへの参照をルーティングすることです:
@Controller
@RequestMapping("/*")
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
@RequestMapping(value = "/next", method = RequestMethod.GET)
public String next(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "next";
}