Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IntelliJ 7 - Struts Taglib completion not working

 
Mike Fourier
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm not getting quite as much assistance as I think I should be able to get, from my IDE.

On this page:
http://www.jetbrains.com/idea/training/demos/struts.html

If you drag the slider at the bottom to about 80/161 and play from there, you'll see that the editor will suggest values for the 'property' attributes of struts tags.

I'm getting virtually everything except that. The other 'helps' in the video, like importing taglib declarations, and all the auto-completes/suggestion lists on *.xml files work.

Does that seem familiar to anyone?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely you don't have the Struts DTD registered with the IDE. Probably if you look at a Struts JSP, the DTD or xml schema reference is highlighted, meaning its URL could not be resolved. You DID include the Struts DTD in your JSP, didn't you???

If your URL for the Struts schema is correct, there's a simple way to register it locally (so the IDE doesn't have to hit the Internet every time a schema validation is required). However, it's more complicated than I can explain here. Fortunately, the IntelliJ docs on the subject are pretty good.
 
Mike Fourier
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts DTD?

Sorry, not sure what you mean. Not the taglib tlds?

I have these in the file and they are not underlined or otherwise highlighted (because I've already setup that local mapping you spoke of):


And when I type in the IDE "<bean:" it will popup the correct possible values, and autocomplete the rest of the tag. And then inside, I can begin typing "prop" and it will popup "property=""", but then when I put the cursor inside the property attribute, nothing comes up. well... when I force it, it will say "No suggestions"
[ April 04, 2008: Message edited by: Mike Fourier ]
 
Mike Fourier
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just an update on this. The URI turned out to be the problem, in a round-about way.

It's not that it wasn't mapped: it was that it was mapped to an obsolete TLD. Once I updated the TLDs the "external resource mapping" actually pointed to, my code assist started working.

This was quite puzzling, because after all, if it could identify that "write" was a valid value to put after "bean:", and recognized that "property" was an attribute *of* that tag... why then not the code assist for valid javabean methods? I'm still puzzled as to what that has to do with the TLD, but whatever, I'm just happy it's fixed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic