How to customize the syntax for EL completion on JSPs, like elvariable
Answered
IntelliJ currently provides support for the following syntax elements for declaring the type of a JSP variable:
- <%--@elvariable id="varname" type="com.example.PageModel"--%>
- <jsp:useBean id="varname" type="com.example.PageModel"/>
I don't want to use either of them, since I have developed a custom JSP tag that validates the type at runtime. It looks like this:
- <i:instance attr="pageModel" nullable="true" comment="is null for /admin/ URLs" />
- <i:instance attr="customerName" type="String" />
- <i:instance attr="price" type="double|MonetaryAmount|SpecialPrice" />
It seems unlikely that I can configure IntelliJ to recognize my custom JSP tag. So I'm thinking about writing an IntelliJ plugin to do that.
Is that possible at all? Where would I start, and what are the relevant classes for implementing it?
Please sign in to leave a comment.
Hi, do you use those variables in EL expressions, or somewhere else?
Yes, I use those variables in EL expressions. I don't use them anywhere else.
Sorry for delay, take a look at