このように割り当てられたSpring MVCのモデルオブジェクトにアクセスしようとしています
@RequestMapping(value = "{id}", method = RequestMethod.GET)
public String getMethod(@PathVariable Long id, Model model) {
model.addAttribute("attrib", attribute);
}
カスタム タグ ライブラリの属性オブジェクトにアクセスしようとしています。コードは次のとおりです。
@Override
public void doTag() throws JspException {
final JspWriter writer = getJspContext().getOut();
try {
attribute = (Attribute)
getJspContext().getAttribute("attrib");
if (attribute != null) {
System.out.print(attribute.getId());
}
writer.println("sandeep");
} catch (IOException e) {
e.printStackTrace();
}
}
しかし、属性は常にnullになります。カスタムtaglibから属性オブジェクトにアクセスする方法を誰か教えてください