0
@RequestMapping("/toTicketRuleSetting/{ticketTypeId}")
public String goToAssistSecretary(@PathVariable("ticketTypeId") long ticketTypeId, ModelMap model) {
    model.put("ticketTypeId", ticketTypeId);
    model.put("tabId", 0); 
    return "backend/basic/ticketRuleSetting";
}

在spring mvc中,模型中的tabId会返回jsp页面,我想通过javascript获取jsp页面中的tabId,我该怎么办?这是我的jsp页面中的javascript代码:

  window.onload = function (){ 
   <c:set var="tabId" value="${tabId}"/> 
   <c:if test = "{tabId.value==5}"> 
         $("#tabs").tabs( "option", "active", 5 );
   </c:if >

};

请帮我 !

4

1 回答 1

0

尝试在方法参数中使用模型,这里是代码:

@RequestMapping("/toTicketRuleSetting/{ticketTypeId}")
public String goToAssistSecretary(@PathVariable("ticketTypeId") long ticketTypeId, Model model) {
    model.addAttribute("ticketTypeId", ticketTypeId);
    model.addAttribute("tabId", 0); 
    return "backend/basic/ticketRuleSetting";
}

然后,像你一样在你的函数中调用它。CCMIIW :)

于 2013-08-21T09:38:12.427 回答