JSP EL和autoCompletion [英] JSP EL and autoCompletion

查看:390
本文介绍了JSP EL和autoCompletion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的servlet中,
request.setAttribute(list,myList);

在我的Jsp中:

In my servlet
request.setAttribute("list", myList);
In my Jsp:

<c:forEach var="item" items="${list}">
   ${item.name} and ${item.address}
</c:forEach>

如何获得 item.name的autoCompletion item.address ?$
我可以使用< jsp:useBean> 获取任何其他功能来制作类型'item'显式?

How do I get autoCompletion for item.name an item.address in IDE (IntelliJ)?
Can I use <jsp:useBean> for any other feature to make the type of 'item' explicit?

推荐答案

对于IntelliJ,您可以使用注释注释,例如:

For IntelliJ, you can use comment annotations, such as this:

<%--@elvariable id="list" type="java.util.List<your.item.class.Here>"--%>

要自动获取此信息,IntelliJ应着色 $ {items} 作为警告,因为它不知道它是什么。单击它,当灯泡弹出时,单击在注释注释中声明外部变量选项。这将生成一个注释注释,例如上面列出的注释注释。

To get this automatically, IntelliJ should be coloring ${items} as a warning, since it wont have any idea what it is. Click on it and when the lightbulb pops up, click the option "Declare external variable in comment annotation." That will generate a comment annotation such as the one listed above.

这篇关于JSP EL和autoCompletion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆