簡體   English   中英

Java @Model注釋,我導入哪個庫才能使用它?

[英]Java @Model Annotation, which library do I import to use it?

在此URL: 從Spring MVC控制器注入JSP

它們具有以下代碼段:

@RequestMapping(value = "/widgets.html", method = RequestMethod.POST)
public ModelAndView widgets(@Model Fruit fruit, @RequestParam("texture") String texture)

我的問題@Model注釋,需要導入哪個庫才能使用它?

預先感謝您,韋斯

我認為這是

import org.springframework.ui.Model;

@Model替換為@ModelAttribute Fruit fuit像網格一樣的@ModelAttribute Fruit fuit

並導入org.springframework.web.bind.annotation.ModelAttribute;

在這里看看: http : //docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html

我認為這是@ModelAttribute的錯字。

@Model是J2EE 6 CDI的類級別注釋

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM