我在jsp頁面寫了一個a標簽:
<a style="text-decoration: none;color:black " href="https://bbs.csdn.net/topics/shopdetail">${shop.sname}</a>我想要通過controller跳到另一個頁面
@RequestMapping("/shopdetail")
public String shopDetail(Model model,@RequestParam("sid") int sid){
Shop shopintro= shopService.selectBySid(sid);
model.addAttribute("shopintro",shopintro);
return "shopDetail";
}但是,我是通過shop.sid去資料庫取資料的,如果在a標簽里加name=”sid“傳的是shop.name,取不到sid,有沒有大神能幫我看看怎么寫
uj5u.com熱心網友回復:
解決了
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/118819.html
標籤:Web 開發
下一篇:畢設
