Community
Participate
Working Groups
Created attachment 233993 [details] Snippet to reproduce the problemt RWT version taken from: http://download.eclipse.org/rt/rap/nightly/runtime/20130726-1307 Steps to reproduce: - launch the attached entry point snippet - open the browser and connect with an appropriate URL of the given entry point => The following Stacktrace shows up: java.lang.IllegalArgumentException : Failed to parse markup text at org.eclipse.swt.internal.widgets.MarkupValidator.validate( MarkupValidator.java:57 ) at org.eclipse.swt.widgets.TreeItem.setText( TreeItem.java:975 ) at org.eclipse.swt.widgets.TreeItem.setText( TreeItem.java:954 ) at tree.link.problem.LinkProblemEP.createUI( LinkProblemEP.java:26 ) at org.eclipse.rap.rwt.internal.lifecycle.PrepareUIRoot.execute( PrepareUIRoot.java:39 ) at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute( PhaseExecutor.java:35 ) at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute( SimpleLifeCycle.java:51 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle( LifeCycleServiceHandler.java:137 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest( LifeCycleServiceHandler.java:123 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService( LifeCycleServiceHandler.java:76 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service( LifeCycleServiceHandler.java:67 ) at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest( RWTServlet.java:119 ) at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest( RWTServlet.java:106 ) at org.eclipse.rap.rwt.engine.RWTServlet.doPost( RWTServlet.java:99 ) at javax.servlet.http.HttpServlet.service( HttpServlet.java:755 ) at javax.servlet.http.HttpServlet.service( HttpServlet.java:848 ) at org.eclipse.jetty.servlet.ServletHolder.handle( ServletHolder.java:669 ) at org.eclipse.jetty.servlet.ServletHandler.doHandle( ServletHandler.java:457 ) at org.eclipse.jetty.server.handler.ScopedHandler.handle( ScopedHandler.java:137 ) at org.eclipse.jetty.security.SecurityHandler.handle( SecurityHandler.java:557 ) at org.eclipse.jetty.server.session.SessionHandler.doHandle( SessionHandler.java:231 ) at org.eclipse.jetty.server.handler.ContextHandler.doHandle( ContextHandler.java:1075 ) at org.eclipse.jetty.servlet.ServletHandler.doScope( ServletHandler.java:384 ) at org.eclipse.jetty.server.session.SessionHandler.doScope( SessionHandler.java:193 ) at org.eclipse.jetty.server.handler.ContextHandler.doScope( ContextHandler.java:1009 ) at org.eclipse.jetty.server.handler.ScopedHandler.handle( ScopedHandler.java:135 ) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle( ContextHandlerCollection.java:255 ) at org.eclipse.jetty.server.handler.HandlerWrapper.handle( HandlerWrapper.java:116 ) at org.eclipse.jetty.server.Server.handle( Server.java:368 ) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest( AbstractHttpConnection.java:489 ) at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest( BlockingHttpConnection.java:53 ) at org.eclipse.jetty.server.AbstractHttpConnection.content( AbstractHttpConnection.java:953 ) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content( AbstractHttpConnection.java:1014 ) at org.eclipse.jetty.http.HttpParser.parseNext( HttpParser.java:861 ) at org.eclipse.jetty.http.HttpParser.parseAvailable( HttpParser.java:235 ) at org.eclipse.jetty.server.BlockingHttpConnection.handle( BlockingHttpConnection.java:72 ) at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run( SocketConnector.java:264 ) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( QueuedThreadPool.java:608 ) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run( QueuedThreadPool.java:543 ) at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 10; Auf "&" in der Entitätsreferenz muss umgehend der Entitätsname folgen. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source) at org.eclipse.swt.internal.widgets.MarkupValidator.validate( MarkupValidator.java:53 ) at org.eclipse.swt.widgets.TreeItem.setText( TreeItem.java:975 ) at org.eclipse.swt.widgets.TreeItem.setText( TreeItem.java:954 ) at tree.link.problem.LinkProblemEP.createUI( LinkProblemEP.java:26 ) at org.eclipse.rap.rwt.internal.lifecycle.PrepareUIRoot.execute( PrepareUIRoot.java:39 ) at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute( PhaseExecutor.java:35 ) at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute( SimpleLifeCycle.java:51 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle( LifeCycleServiceHandler.java:137 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest( LifeCycleServiceHandler.java:123 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService( LifeCycleServiceHandler.java:76 ) at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service( LifeCycleServiceHandler.java:67 ) at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest( RWTServlet.java:119 ) at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest( RWTServlet.java:106 ) at org.eclipse.rap.rwt.engine.RWTServlet.doPost( RWTServlet.java:99 ) at javax.servlet.http.HttpServlet.service( HttpServlet.java:755 ) at javax.servlet.http.HttpServlet.service( HttpServlet.java:848 ) at org.eclipse.jetty.servlet.ServletHolder.handle( ServletHolder.java:669 ) at org.eclipse.jetty.servlet.ServletHandler.doHandle( ServletHandler.java:457 ) at org.eclipse.jetty.server.handler.ScopedHandler.handle( ScopedHandler.java:137 ) at org.eclipse.jetty.security.SecurityHandler.handle( SecurityHandler.java:557 ) at org.eclipse.jetty.server.session.SessionHandler.doHandle( SessionHandler.java:231 ) at org.eclipse.jetty.server.handler.ContextHandler.doHandle( ContextHandler.java:1075 ) at org.eclipse.jetty.servlet.ServletHandler.doScope( ServletHandler.java:384 ) at org.eclipse.jetty.server.session.SessionHandler.doScope( SessionHandler.java:193 ) at org.eclipse.jetty.server.handler.ContextHandler.doScope( ContextHandler.java:1009 ) at org.eclipse.jetty.server.handler.ScopedHandler.handle( ScopedHandler.java:135 ) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle( ContextHandlerCollection.java:255 ) at org.eclipse.jetty.server.handler.HandlerWrapper.handle( HandlerWrapper.java:116 ) at org.eclipse.jetty.server.Server.handle( Server.java:368 ) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest( AbstractHttpConnection.java:489 ) at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest( BlockingHttpConnection.java:53 ) at org.eclipse.jetty.server.AbstractHttpConnection.content( AbstractHttpConnection.java:953 ) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content( AbstractHttpConnection.java:1014 ) at org.eclipse.jetty.http.HttpParser.parseNext( HttpParser.java:861 ) at org.eclipse.jetty.http.HttpParser.parseAvailable( HttpParser.java:235 ) at org.eclipse.jetty.server.BlockingHttpConnection.handle( BlockingHttpConnection.java:72 ) at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run( SocketConnector.java:264 ) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( QueuedThreadPool.java:608 ) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run( QueuedThreadPool.java:543 ) at java.lang.Thread.run(Unknown Source)
When markup is enabled the provided item text must be a valid HTML. '&' character marks beginning of HTML entity. HTML named entities are not yet supported in RAP (see bug 379088). As a workaround use HTML number ( http://www.ascii.cl/htmlcodes.htm ) for '&' -> &. Can we consider this bug as invalid?
(In reply to comment #1) > When markup is enabled the provided item text must be a valid HTML. '&' I guess you Meran XHTML? > character marks beginning of HTML entity. HTML named entities are not yet > supported in RAP (see bug 379088). As a workaround use HTML number ( > http://www.ascii.cl/htmlcodes.htm ) for '&' -> &. Can we consider this > bug as invalid? I consider this as a valid usecase so I think this issue is also valid. The values shown in the tree items come from RMI read by database requests. We do not have any influence of that values in the RMI. The label providers are generated item adapters and it would be very awkward to override each getText method of those. The latter is not really an option. In my opinion this issue might be a duplicate of 379088.
I had a discussion with Frank and understand their use case better now: some of their Tree items require markup, while other items are filled with plain text from a data source. Escaping the plain texts is problematic. So it's not about a bug in our implementation but about a use case that is not covered at the moment: mixing markup and plain text in a single Tree. We need a way to distinguish between markup and plain text. This is done by the MARKUP_ENABLED flag. Guessing based on the presence of angle brackets or entities in the text is not an option. We could think about support for setting the MARKUP_ENABLED flag on TreeItems as well. Would that help? As I understand it, implementing the entities as requested in bug 379088 would not solve this issue, because ampersands still need to be translated to & entities.
*** Bug 416451 has been marked as a duplicate of this bug. ***