2011-12-22 127 views
2

我想爲我的portlet RenderRequest@RequestMapping錯誤的RenderRequest

@RequestMapping("view.jsp", params="test") 
public void doSome(RenderRequest request, RenderResponse response){ 
    } 

RequestMapping但我得到多個錯誤,如

Multiple markers at this line 
- Syntax error on token ""view.jsp"", invalid MemberValuePairs 
- The attribute value is undefined for the annotation type 
RequestMapping 
- RequestMapping cannot be resolved to a type 

爲什麼?

回答

5

您需要使用value屬性。您還需要添加一個導入org.springframework.web.bind.annotation.RequestMapping

@RequestMapping(value="view.jsp", params="test") 
public void doSome(RenderRequest request, RenderResponse response){ 
}