1

This code:

<cfimage action="info" structName="imageInfo" source="#imagePath#">

is giving this error:

The attribute 'structName' is required for the tag. (Found: [source, structname, action])

When I run this code in CFBuilder - everything is OK, but I must use CFEclipse. What should I do (I use CF9)? Thank you for your answers!

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
Wolandello
  • 127
  • 4
  • 15

2 Answers2

4

Of course this problem won't prevent you from running your application on ColdFusion. It is just an IDE warning that something is wrong.

You have a few options.

  1. Try using a lowercase N in structName. i.e. structname. ColdFusion is not case-sensitive, but Java is, and CFEclipse is a Java application.

  2. If that does not work, then it probably means that the dictionary file that drives the code assist is not correct. You can go earch forthose XML files and update them to include that attribute.

  3. You can use CFBuilder. I know you said you can't, but I have to question why. You know there is a free version that is just as good as CFEclipse, right?

Jason Dean
  • 9,585
  • 27
  • 36
  • For #2, I'm not entirely sure what you meant with "You can go earch forthose XML files...", but just to be clear there is only one XML file to edit (per CFML server), so Wolandello only needs to edit the `cf9.xml` one - which is located at `/path/to/eclipse/plugins/org.cfeclipse.cfml_1.2.34567890/dictionary/` (where the 1.2.345 bit depends on which version of CFE you're running). – Peter Boughton Oct 27 '11 at 21:53
  • I meant search for the dictionary files. Yes, there is only one for CF9. I was referring to the dictionary files as a group. If cfimage supported that attribute in other version he may want to edit the appropriate dictionary files and submit the changes back to the CFE project. – Jason Dean Oct 27 '11 at 22:07
  • Ah, it's obvious now you say it. My version did appear to have the attribute from a quick look, so two further suggestions would be upgrade to latest version of CFE, and also make sure the project is actually set to CF9. – Peter Boughton Oct 27 '11 at 23:28
  • I also mentioned that it could be a case sensitivity issue. Perhaps you could try that Peter. Does CFE care if it is structname vs structName? I do not have CFE installed so I cannot test it. – Jason Dean Oct 28 '11 at 03:09
  • I opened cf9.xml, but I don't know what should I change there. – Wolandello Oct 28 '11 at 09:39
  • Well first, as Peter said, make sure you are running the most current version of CFE. If you are, then search in the XML file for "structName", if you find it, then your issue is probably something else. If you don't find it, then you should find the section for "cfimage" and figure out where it needs to be added. – Jason Dean Oct 28 '11 at 13:50
  • Or simply overwrite the contents of cf9.xml with this version (make a back up first). http://svn.cfeclipse.org/org.cfeclipse.cfml/trunk/dictionary/cf9.xml. Then you need to reload the dictionary files, which I believe you can do from within the Eclipse preferences. – Jason Dean Oct 28 '11 at 13:52
1

The problem is that there's a casing glitch in that file Peter mentions. There's one reference to "structName" to define the attribute itself, and another "structname" which is in the list defining which attributes are needed for action="info". If you make them both the same, then restart Eclipse, you should be OK (that's I've needed to do to make the error indicator go away).

Adam Cameron
  • 29,677
  • 4
  • 37
  • 78