如何使用Spring表单标记包含jsp页面?

问题描述 投票:4回答:1

我正在使用Spring,因为我有user.jsp

qazxsw poi有三个独立的部门:1。个人,2。教育,3。奖项。每个部分都有我创建的不同形式.jsp。

现在我想将这三种形式包含在user.jsp中并使用一个Controller显示模型。

这是我的控制器类代码:

user.jsp

这是我的Personal.jsp文件(所有剩余文件都相同,但名称不同)

那么如何将这三个jsp包含在@Controller @RequestMapping(value="profile") public class UserProfileController { @RequestMapping(value="user", method=RequestMethod.GET) public String user(Model model) throws Exception { model.addAttribute("profile", new PersonalForm()); return "profile/user"; } 中呢?其实我正在尝试,但Eclipse显示错误。以下是我在user.jsp中的错误代码:

在预期的路径/ EClass / WebContent / WEB-INF / pages / profile / profile / professional.jsp中找不到片段“profile / professional.jsp”

那么请帮助我如何包含以及如何使用单个控制器?

java spring jsp spring-annotations
1个回答
7
投票

在你的User.jsp中编写以下代码......

user.jsp
© www.soinside.com 2019 - 2024. All rights reserved.