[ANN] Struts Assistant 0.97 released

- Action servlet mappings other than *.do recognized
- Path Chooser includes action, tile, and servlet paths
- Class module displayed in Class Chooser
- Enhanced auto-layout and undo/redo functions added to the Web Flow Diagram
- Minor enhancements and bugfixes

21 comments

I'm having trouble using Struts Assistant; my Struts stuff is in a bland 'Java' module, and after installing Struts Assistant I'm not able to edit struts-config.xml at all. Double-clicking on the file in the Project view does nothing, but there is an exception thrown in the console that points to not being able to load a particular class. (see attached file). If I uninstall the plugin, double-clicking on my Struts config brings it up as a typical XML file.

The screenshots for this plugin look great; I'd love to take advantage of it. My config is Mac OS X (10.4); Java 1.4.2; Intellij 5.0.2.


Thanks,

Peter



Attachment(s):
console-exception.txt
0

Hi Peter,

the reported exception is because of JRE version. 1.5 is required. Also, Struts Assistant is not designed for using in a not-web module. You can try to convert your module into a web one...

0

suggestion for code assistant:
1 ">]]> should give us assistant for resource lookup and navigation. This is very import for resource (picture) location.

Thanks.

0

Struts Assistant is good, but I have the following problems with it:

1. It does not recognizes forms if they are located in separate file, e.g.:
- struts-config.xml:
<form-beans>
<!-- see beans definitions in struts-beans-config.xml -->

</form-beans>

-web.xml:

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-beans-config.xml</param-value>
</init-param>

2. It does not work properly with source control system:
if struts-config.xml is read-only or under source control supervision, it cannot resolve it.

3. It copies tld files and creates lib directory with struts-related files, but I have them in another location and I want them there. I don't want to be forced by plugin about the locations.

Hope it will help you to make the product better.

Thanks,
Alexander Shvets (shvets_alexander@yahoo.com).

0

1) Struts Assistant displays structure of the currently opened (in the editor window) Struts configuration file. If you open your struts-beans-config.xml in the editor, you'll see its structure. The capability to see all Struts configs in the same tree will be added in the future. For now, you can see full form list in lookups (e.g. for the "name" property of "action" node).
2) Are you sure? Maybe you mean "cannot edit it"?
3) Struts Support Wizard does not recognize not-standard location for Struts files so far. The feature is planned though.

0

let me explain issues in more details:

1. the issue is that in struts-config.xml file all form names are in read - plugin cannot recognize them because they are in another file. It's not like 2 congif files - it's more like one configuration with separated form definitions:

'/> 6. it does not recognize property in html:optionsCollection tag: ]]>), but form tags are in outside tile, it will mark such control in red.

Hope my explanations are clear.

Alexander Shvets (shvets_alexander@yahoo.com)

0

8. It does not recognizes i18n resources in struts-config.xml, like this:

<message-resources parameter="labels" key="labels" null="false"/>

"labels" are marked as red.

Web module has notion of Web Resource Directories and labels.properties is inside this folder.

Alexander Shvets.

0

9). On each Configuration wizard invocation plugins add one more definition for tiles and another for validation plugins.

So, If you configure it 3 times, you will have 6 new defs plus whatever you have before.

Plugin should be smart enough to recognize that developer already has support for tiles/validation.

Alexander Shvets.

0

9). On each Configuration wizard invocation plugins add one more definition for tiles and another for validation plugins.

So, If you configure it 3 times, you will have 6 new defs plus whatever you have before.

Plugin should be smart enough to recognize that developer already has support for tiles/validation.

Alexander Shvets.

0

Thanks for detailed explanations. It seems most of the described problems are caused by project configuration. Probably Assistant does not see your Struts configuration files. Is your WEB-INF folder properly mapped as an IDEA Web Resource Directory? For example, if your struts-config.xml is located in /example/WEB-INF/struts-config.xml, the directory should be mapped as "/example -> /" or "/example/WEB-INF -> /WEB-INF".

Also, IDEA recognizes resource bundles if they are located under content (source or test) roots, not in Web Resource Directories.

0

1. In my web module I have 2 content roots:
- one is pointing to the folder with resources (../my_project/src/resources)
- another is pointing to the folder with jsp files (../my_project/src/web)

Under this roots I don't have declaration of source folders. I tried to declare them as source folders too,
but it does not help.

2. I have 2 declarations of "Web Resource Directory":

- ../my_project/src/resources -> /WEB-INF/classes

- ../my_project/src/web -> /

I use build # 4101

Best Regards,
Alexander Shvets.

0

Ok, and where your /WEB-INF/struts-config.xml, /WEB-INF/struts-beans-config.xml, and labels.properties are located?

0

/WEB-INF/struts-config.xml -> ../my_project/src/web/WEB-INF/struts-config.xml

/WEB-INF/struts-beans-config.xml -> ../my_project/src/web/WEB-INF/struts-beans-config.xml

0

properties ->
../my_project/src/resources/*.properties

0

properties ->
../my_project/src/resources/*.properties

0

It's strange. The configuration looks quite valid. I'll try to reproduce the problem under #4101 (I'm working on #3542).

0

Is there any way to account for wildcarded action paths in my forms?

for instance I have and action defined with a path of /user/*

but when I put "/user/list" in my html:form, it and all the properties show up in red.

0

Good work. The beginnings of a very nice plugin!

Here are a few issues I have.

1. In the struts-config.xml diagram view, the mouse scroll wheel causes the scrolling to move in way too small increments. Also you have to click in the window before the scroll wheel works (unlike all other edit windows.)

2. I have a problem with a very simple forward in a jsp:

The "welcome" is highlighted in red and it pops up "Cannot resolve Global Forward welcome" when I mouse over it. However the forward is clearly defined in my struts-config.xml. I can't figure out how to resolve this. 3. I keep getting a null pointer exception: No message java.lang.NullPointerException at anima.plugins.struts.A._.A(y:120) at anima.plugins.struts.A._.]]>(y:74)
at anima.plugins.struts.A.M.getReferencesByString(y:58)
at anima.plugins.struts.A.M.getReferencesByElement(y:41)
at anima.plugins.struts.A.M.getReferencesByElement(y:28)
at com.intellij.psi.impl.source.resolve.ResolveUtil.getReferencesFromProviders(ResolveUtil.java:18)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:2)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.a(XmlHighlightVisitor.java:254)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.visitXmlAttributeValue(XmlHighlightVisitor.java:171)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:10)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:217)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:10)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:433)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:6)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:134)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:138)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:164)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:0)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:170)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:16)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:25)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:0)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:30)

0

Thanks. Trying to make it better with your help :)

1) Increment adjusting added in 0.98 version
2) It seems Struts Assistant cannot detect your configuration. Do you have a valid IDEA web module? Is the folder with struts-config.xml properly mapped.
3) Hope it'll disappear with 0.98. If not, please let me know.

0

Please sign in to leave a comment.