如何用springMVC 返回一个指定的HTML页面

2024-12-18 16:43:57
推荐回答(2个)
回答1:

springMVC 返回一个指定的HTML页面的写法如下:
@RequestMapping(value="/html", method=RequestMethod.GET)
public String prepare(Model model) {
model.addAttribute("foo", "bar");
model.addAttribute("fruit", "apple");
return "views/html"; //view name
}

回答2:

static void Main(string[] args)
{
Console.WriteLine(XmlConfig.Value("system.user"));
Console.WriteLine(XmlConfig.Value("system.sex"));

Console.WriteLine(XmlConfig.Value("message.add.ok"));
Console.WriteLine(XmlConfig.Value("message.add.error"));
}