When I put something in model in spring mvc like this:
@RequestMapping(method = RequestMethod.GET)
public String createForm(Model model) {
model.addAttribute("item", new Item());
return "item/new";
}
bean "item" is not resolved by IntelliJ in corresponding JSP pages. I mean, it works perfectly fine, but autocompletion doesn't :/
Is there any way to have autocompletion in such case?
IntelliJ's JSP support understands a special kind of comment annotation:
<%--@elvariable id="foo" type="com.yourcompany.YourClass"--%>
If you place this annotation at the top of your file, idea will provide auto completion for expressions starting with ${foo.
based on the properties of class com.yourcompany.YourClass
IntelliJ will also offer to create this annotation if you hover over the foo
part of an expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With