Beta-Test Struts Plugin V0.7
Find attached a preview beta version of Struts Plugin for build #3489.
Please uninstall previous version in plugin manager, shutdown IDEA,copy the JAR to your IDEA_HOME/plugins directory and restart.
See changelog for new features.
Thanks for your feedback,
Yann
Attachment(s):
strutsplugin_073beta.jar
请先登录再写评论。
Navigate from a <html:link action to struts config
No message
java.lang.NullPointerException
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getActionXmlTagForPath(StrutsConfigHelper.java:110)
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getFormBeanTagForPath(StrutsConfigHelper.java:206)
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getActionFormClassForPath(StrutsConfigHelper.java:186)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.getAllFields(FormBeanPropertyReferenceProvider.java:157)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.resolve(FormBeanPropertyReferenceProvider.java:113)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.a(XmlHighlightVisitor.java:45)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.visitXmlAttributeValue(XmlHighlightVisitor.java:124)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:368)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:560)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:16)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:7)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:111)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:153)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:5)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:0)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:42)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:52)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:8)
java.lang.NullPointerException
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getActionXmlTagForPath(StrutsConfigHelper.java:110)
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getFormBeanTagForPath(StrutsConfigHelper.java:206)
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getActionFormClassForPath(StrutsConfigHelper.java:186)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.getAllFields(FormBeanPropertyReferenceProvider.java:157)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.resolve(FormBeanPropertyReferenceProvider.java:113)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.a(XmlHighlightVisitor.java:45)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.visitXmlAttributeValue(XmlHighlightVisitor.java:124)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:368)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:560)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:16)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:7)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:111)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:153)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:5)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:0)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:42)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:52)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:8)
Brad,
does this happen for a specific action mapping or for any action mapping?
Thanks,
Yann
Actually, it's happening when I open a certain jsp and my guess is it's because the action of my form is an el statement i.e. - <html-el:form action="$">
I'm also getting the following when opening another jsp:
No message
java.lang.NullPointerException
at com.intellij.psi.impl.source.tree.TreeUtil.addChildren(TreeUtil.java:163)
at com.intellij.psi.impl.source.tree.ChangeUtil.a(ChangeUtil.java:331)
at com.intellij.psi.impl.source.tree.ChangeUtil.copyToElement(ChangeUtil.java:252)
at com.intellij.psi.impl.PsiElementFactoryImpl.createField(PsiElementFactoryImpl.java:380)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.getAllFields(FormBeanPropertyReferenceProvider.java:198)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.resolve(FormBeanPropertyReferenceProvider.java:113)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.a(XmlHighlightVisitor.java:45)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.visitXmlAttributeValue(XmlHighlightVisitor.java:124)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:368)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:560)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:16)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:7)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:111)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:153)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:5)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:0)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:42)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:52)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:8)
java.lang.NullPointerException
at com.intellij.psi.impl.source.tree.TreeUtil.addChildren(TreeUtil.java:163)
at com.intellij.psi.impl.source.tree.ChangeUtil.a(ChangeUtil.java:331)
at com.intellij.psi.impl.source.tree.ChangeUtil.copyToElement(ChangeUtil.java:252)
at com.intellij.psi.impl.PsiElementFactoryImpl.createField(PsiElementFactoryImpl.java:380)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.getAllFields(FormBeanPropertyReferenceProvider.java:198)
at de.lineas.lit.strutsplugin.navigation.jsp.FormBeanPropertyReferenceProvider$1.resolve(FormBeanPropertyReferenceProvider.java:113)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.a(XmlHighlightVisitor.java:45)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.visitXmlAttributeValue(XmlHighlightVisitor.java:124)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:368)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:1)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:560)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:16)
at com.intellij.psi.impl.PsiManagerImpl.performActionWithFormatterDisabled(PsiManagerImpl.java:7)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:111)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:153)
at com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:5)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:0)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:42)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:52)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:8)
Thanks for reporting, <html:form> action-attribute values starting/only with EL-expression were not properly ignored.
Second one: are you using a DynaForm on this JSP?
Greetings,
Yann
Yes, almost all of our forms use DynaForms.
"Yann Cebron" <no_mail@jetbrains.com> wrote in message
news:25088823.1127478175782.JavaMail.itn@is.intellij.net...
>
>
>
Could you post or mail me (yannc76@yahoo.de) the corresponding DynaForm-declaration from your struts-config.xml? Is anything marked red there?
Thanks,
Yann
]]>
All of my paths are marked red (they are all tiles). Also, all form-bean types that are Collection, List, String[], or Long[].
Also, here's another exception I get when opening an action:
No message
java.lang.NullPointerException
at de.lineas.lit.strutsplugin.util.WebXmlHelper.getStrutsConfigFilesForModule(WebXmlHelper.java:73)
at de.lineas.lit.strutsplugin.util.StrutsConfigHelper.getPossibleForwardPathsForAction(StrutsConfigHelper.java:249)
at de.lineas.lit.strutsplugin.inspections.code.action.InvalidForwardReferenceInspection.doCheckClass(InvalidForwardReferenceInspection.java:69)
at de.lineas.lit.strutsplugin.inspections.BaseInspection.checkClass(BaseInspection.java:131)
at com.intellij.codeInspection.ex.LocalInspectionToolWrapper$1.visitClass(LocalInspectionToolWrapper.java:51)
at com.intellij.psi.impl.source.PsiClassImpl.accept(PsiClassImpl.java:305)
at com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:50)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:32)
at com.intellij.psi.JavaElementVisitor.visitFile(JavaElementVisitor.java:142)
at com.intellij.codeInspection.ex.LocalInspectionToolWrapper$1.visitFile(LocalInspectionToolWrapper.java:30)
at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:350)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:6)
at com.intellij.codeInspection.ex.LocalInspectionToolWrapper.processFile(LocalInspectionToolWrapper.java:16)
at com.intellij.codeInspection.ex.InspectionManagerEx$11.visitFile(InspectionManagerEx.java:3)
at com.intellij.psi.JavaElementVisitor.visitJavaFile(JavaElementVisitor.java:350)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.accept(PsiJavaFileBaseImpl.java:6)
at com.intellij.analysis.AnalysisScope.accept(AnalysisScope.java:25)
at com.intellij.codeInspection.ex.InspectionManagerEx.a(InspectionManagerEx.java:4)
at com.intellij.codeInspection.ex.InspectionManagerEx.access$1300(InspectionManagerEx.java:219)
at com.intellij.codeInspection.ex.InspectionManagerEx$10.run(InspectionManagerEx.java:5)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:230)
at com.intellij.codeInspection.ex.InspectionManagerEx.b(InspectionManagerEx.java:83)
at com.intellij.codeInspection.ex.InspectionManagerEx.access$300(InspectionManagerEx.java:164)
at com.intellij.codeInspection.ex.InspectionManagerEx$9.run(InspectionManagerEx.java:1)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:52)
at com.intellij.openapi.application.impl.ApplicationImpl$1MyThread.run(ApplicationImpl.java:6)
Well I guess there's some confusion:
http://struts.apache.org/userGuide/building_controller.html#dyna_action_form_classes does not list Collection/List - but a few sentences later they talk about support for these types. I guess I'll have to add a few more known types here..
Furthermore, the DTD refers to the type-attribute as "Fully qualified Java class", but still "short", "int" etc. are allowed - now THAT's consistent ;)
The "[]" notation is not supported (yet), because you should (AFAIK from DTD) denote arrays via "size"-attribute (which is recognized already in Struts Plugin).
If I'm wrong with anything stated above, please feel free to correct me. I do not have too much of personal experience with DynaForms ;)
Red highlighted tiles definition names: that's a known problem with the current version of IDEA which is supposed to get fixed in 5.0.2.
Exception: Do you have Action-classes which are not located in a WebModule, but a normal JAVA-Module?!
Greetings,
Yann
"The "[]" notation is not supported (yet), because you should (AFAIK from
DTD) denote arrays via "size"-attribute (which is recognized already in
Struts Plugin)." - Hmm, according to "Programming Jakarta Struts", p.87 -
"type - The fully qualified Java class name of the implementation class of
this bean property, optionally followed by "[]" to indicate that this
property is indexed. This attribute is required."
"Exception: Do you have Action-classes which are not located in a WebModule,
but a normal JAVA-Module?! " - Yes, my actions classes are in java modules.
The only thing in my web modules are jsps, configs, images, etc...
"Yann Cebron" <no_mail@jetbrains.com> wrote in message
news:15350121.1127484791613.JavaMail.itn@is.intellij.net...
>
>
>
>
>
>
>
>
+according to "Programming Jakarta Struts", p.87 -
"type - The fully qualified Java class name of the implementation class of
this bean property, optionally followed by "[]" to indicate that this
property is indexed. This attribute is required."
+
well, the book is as right about this as is the DTD, since the text is more or less the same ;)
Note the little word "optionally" ;)
Anyway, I have just added proper support for the []-notation (which caused one of the exceptions you posted btw).
Regarding Action-classes not in WebModule: I have verified, this is indeed the reason for the exception.
Well, IMHO Action-classes must be part of a WebModule since they belong and work together with the JSPs, config-files etc. And how would I be able to determine to which WebModule I can refer from within an Action-class if it is not in a WebModule?! Do you have any proposals?
Greetings,
Yann
PS: Will post another beta later on with fixes mentioned above.
"Well, IMHO Action-classes must be part of a WebModule since they belong and
work together with the JSPs, config-files etc. And how would I be able to
determine to which WebModule I can refer from within an Action-class if it
is not in a WebModule?! Do you have any proposals? "
My web module has dependencies on the java modules it uses. Can't you use
the dependencies somehow?
"Yann Cebron" <no_mail@jetbrains.com> wrote in message
news:32087827.1127488819667.JavaMail.itn@is.intellij.net...
>
>
>
>
>
>
>
My web module has dependencies on the java modules it uses. Can't you use the dependencies somehow?
Yes, I can - and did it already ;) I had exactly the same idea after I posted my previous reply..
Cheers,
Yann