[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-4311) vpe is broken in some cases

Denis Maliarevich (JIRA) jira-events at lists.jboss.org
Tue May 19 11:46:05 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBIDE-4311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12468239#action_12468239 ] 

Denis Maliarevich commented on JBIDE-4311:
------------------------------------------

After debugging I've found out that there was an exception while parsing <ui:param> inside <ui:composition>:

java.lang.NullPointerException
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.replacePattern(VpeDefineContainerTemplate.java:133)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.updateNodeValue(VpeDefineContainerTemplate.java:190)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.insertParam(VpeDefineContainerTemplate.java:220)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.insertParam(VpeDefineContainerTemplate.java:230)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.insertParam(VpeDefineContainerTemplate.java:230)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.insertParam(VpeDefineContainerTemplate.java:230)
	at org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate.validate(VpeDefineContainerTemplate.java:261)
	at org.jboss.tools.vpe.editor.VpeVisualDomBuilder.createNode(VpeVisualDomBuilder.java:582)
	at org.jboss.tools.vpe.editor.VpeVisualDomBuilder.addNode(VpeVisualDomBuilder.java:273)
	at org.jboss.tools.vpe.editor.VpeVisualDomBuilder.updateElement(VpeVisualDomBuilder.java:1034)
	at org.jboss.tools.vpe.editor.VpeVisualDomBuilder.updateNode(VpeVisualDomBuilder.java:964)
	at org.jboss.tools.vpe.editor.VpeController.notifyChangedInUiThread(VpeController.java:631)
	at org.jboss.tools.vpe.editor.VpeController$1.runInUIThread(VpeController.java:482)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3855)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


While getting <ui:params>'s "name" attribute null value was retrieved. The attribute was getting throug uppercase attribute name. But after changing to lowercase name attribute value was retrieved fine. So it seems that in new eclipse org.w3c.dom.Element.getAttribute(name) is case sensitive. 

W3C has following rules and recomendations:
HTML tags are not case sensitive. World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in future versions of (X)HTML.
World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation. Newer versions of (X)HTML will demand lowercase attributes.

So as a solution I'll change all our tags/attributes/attributes values into lowercase. I'll add additional null pointer check to ui:param processing also.


> vpe is broken in some cases
> ---------------------------
>
>                 Key: JBIDE-4311
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-4311
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Visual Page Editor core
>    Affects Versions: 3.1.0.M1
>         Environment: windows
>            Reporter: Sergey Dzmitrovich
>            Assignee: Denis Maliarevich
>             Fix For: 3.1.0.M1
>
>
> testTemplate.xhtml :
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:ui="http://java.sun.com/jsf/facelets"
>       xmlns:h="http://java.sun.com/jsf/html"
>       xmlns:f="http://java.sun.com/jsf/core">
> <body>
> <div style="background-image: url(${facesContext.externalContext.requestContextPath}/images/#{env.skinPic}) !imp
> ortant;padding-left: 10px">
> 	
> </div>
> 	<ui:insert name="content>
> 	<h:commandButton action="" value="Some button" />
> 	</ui:insert>
> </body>
> </html>	
> testPage.xhtml :
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:ui="http://java.sun.com/jsf/facelets"
>       xmlns:h="http://java.sun.com/jsf/html"
>       xmlns:f="http://java.sun.com/jsf/core">
> 	<ui:composition template="testTemplate.xhtml">
> 	<ui:param name="icon" value="system171.ico" />
> 		<ui:define name="content">
> 			<h:commandButton action="" value=button A" />
> 			<h:inputText value="aaa" />
> 		</ui:define>
> 	
> 	</ui:composition>
> </html>	

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosstools-issues mailing list