Coding assistance not working for Struts tag property attribute

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

If you drag the slider at the bottom to about 85/161 and play from there, you'll see that the editor will suggest values for the 'property' attributes of struts tags. ( will attach a screenshot of the exact coding assist dialog I don't get).

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. When I type <html: it will pop up all the right entries there, etc, etc. But nothing comes up for the struts properties.

Does that seem familiar to anyone?



Attachment(s):
noassist.jpg
8 comments
Comment actions Permalink

Please post the relevant parts of your struts-config.xml, that is the -definition you're using in

as well as the referenced ]]> .

0
Comment actions Permalink

struts-config.xml:


    

]]>

page-definitions.xml:

]]>


And PrinterStatus.jsp:


The action attribute also didn't have any code assist, I had to type in "/printerStatusLoad" myself.

Also, I tried switching the form bean to:

        
    
]]>

My thinking was that IntelliJ was only reading struts-config and not using introspection to "find out" what the properties would be. This didn't work either.

0
Comment actions Permalink

Hello,

does your struts-config.xml and its actions etc. appear in Struts Assistant toolwindow? Do you have proper ]]> definition in the header of struts-config.xml?

- Yann

0
Comment actions Permalink

.
.
.

]]>


the struts assistant appears to be working (all my stuff is there).

Also, when defining the form beans, hitting ctrl-space inside of the 'type' attribute, it brings up a listing of all my classes. I can also ctrl-click everything in struts-config.xml and page-definitions.xml and it all navigates where it should.

0
Comment actions Permalink

try replacing the <%@taglib> directive in your JSP with the following:

<%@taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %>

If this doesn't help: where does struts-form.tld come from? Please post the first 20 lines of this file.

0
Comment actions Permalink

huh. that did the trick.

I inherited this project, and when I checked it out from CVS and first saw the JSP pages, they were full of red squiggles. Hundreds and hundreds of pages all have uri="/WEB-INF/struts-logic.tld" so I just went into settings and "configure external resources" to point /WEB-INF/struts-*.tld to local versions. Those files, I would have downloaded at some point in the recent past.

Since I don't feel like and (far more importantly) won't be allowed to check in all those hundreds of changes without doing user acceptance testing all over again, on a deployed and working project... is there a way to "get this working"?

My first 20 or so lines from the local DTD:









1.0
1.1
html
http://jakarta.apache.org/struts/tags-html-1.0.2

base
org.apache.struts.taglib.html.BaseTag
empty

target
false
true



button
org.apache.struts.taglib.html.ButtonTag

accesskey
false
true


disabled
false
true


onblur
false
true


]]>

0
Comment actions Permalink

IMHO you'll have to replace each and every single <%@taglib%> definition pointing to these obsolete Struts-1.0.2 TLDs. One might refactor this to a central <%@include file="tlds.jsp"%> to prevent going through this pain again in the future.

0
Comment actions Permalink

all that was necessary was updating the TLDs in the one "external resource" location.

I will leave aside the religious differences between absolute and relative URIs in taglibs (which I don't understand anyways, but I understand is a 'debate').

thanks for your help, this will (hopefully) be a bigtime productivity boon for me.

0

Please sign in to leave a comment.