This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hi, since I upgraded from 7.2 to 7.3 (and still in 7.3.1) Netbeans shows the red exclamation mark with "Error parsing File" in the Projects Tree on some (not all) JSP-Files contained in a Struts 2-Project. As far as I can tell it has something to do with a HTML-Script-Tag containing OGNL-Tags, because if I delete all script-tags the "error" disappears. The file itself doesn't contain any errors (green box in the top right saying "No errors". for example the code "<script> var prepareGMT = function (){ var mapSelector = "#xxx"; var shopConfig = { selected: true, icon: '<s:url value="/img/yyy.png" namespace="/"/>', icon_anchor_x: 20, icon_anchor_y: 30 }; if (GMT.xxx) { GMT.configure(mapSelector) .setStartLocation(GMT.xxx.lat, GMT.xxx.lon) .setStartZoomLevel(GMT.xxx.zoom); } else { GMT.configure(mapSelector) .setStartZoomLevel(6); } var xxxTemplateOptions = { processView : function(view) { view.xxx= false; view.yyy= false; if (view.availableLayers[0] && view.availableLayers[0].layer == 'ftth') { for (var i=0; i < GMT.xxx.length; i++) { var city = GMT.xxx[i]; if ((city.google_name || city.name) == view.address_components.city) { view.yyy= true; break; } } } return view; } }; GMT.configure(mapSelector) .setTrackingUrl('initialized' , 'https://www.xxx.de/lp/yyy/bbb-3') .setTrackingUrl('address_found', 'https://www.xxx.de/lp/yyy/bbb-3') .setTrackingUrl('popup_opened' , 'https://www.xxx.de/lp/yyy/bbb-3') .setTitle("blabla") .setExplanation("bla bla") .setGoButton("<s:url value="/img/xxx/yyy.png" namespace="/"/>") .addPolygonGroup("xxx", GMT.area("xxx", "xxx", {selected:true})) .setPointCheckboxes("xxx", GMT.point("xxx", "xxx" , shopConfig)) .setHomeMarkerOptions({ icon: '<s:url value="/img/zzz/yyy.png" namespace="/"/>', icon_anchor_x: 18, icon_anchor_y: 46 }) .setMapOptions({ mapTypeId: google.maps.MapTypeId.HYBRID, panControlOptions: {position: google.maps.ControlPosition.LEFT_CENTER}, zoomControlOptions: {position: google.maps.ControlPosition.LEFT_CENTER}, streetViewControl: false, scrollwheel: true, mapTypeControl: false}) .setTemplateOptions("homemarker", ftthTemplateOptions) .setPostInitCallback(ftthExtension); }; </script> <!-- WebTrekk --> <s:if test="statusBean.city == null"> <s:set var="page_content_id" value="%{'www.xxx.de.yyy.zzz.de'}" /> </s:if> <s:else> <s:set var="page_content_id" value="%{'www.xxx.de' + statusBean.city.geoIpName + '.yyy'}" /> </s:else> <script> var utag_data = { page_content_id : "<s:property value="page_content_id" />", shop_product_name: "", shop_product_status: "", shop_product_quantity: "", shop_order_value: "", shop_order_id: "" }; </script> <script> <s:include value="../../js/utag-call.js"/> </script> <script> <s:include value="../../js/piwik.js"/> trackPiwik(""); </script>" in a jsp-file gives me this error. If I delete it and save the file, it disappears. I tested it in a completely new JSP file where I added the code <script> <s:url action="blabla" /> </script> which also gives me the "error parsing file". (I had to disguise some names and urls because of privacy policy, sorry)
Reproducible, thank you for reporting. Please notice that you also have unescaped double quotes in 2 places, e.g.: .setGoButton("<s:url value="/img/xxx/yyy.png" namespace="/"/>") After fixing this, only case with <script> <s:url action="blabla" /> </script> remains.
Hi, thanks for the fast response! I'm sorry, but I don't see any double quotes which have to be escaped? .setGoButton("<s:url value="/img/xxx/yyy.png" namespace="/"/>") looks fine to me. The inner part is OGNL which insers an image-path into the javascript-string, e.g. it becomes .setGoButton("http://www.blabla.de/img/xxx/yyy.png") so I don't see why they had to be escaped? Could you help me out here?
If you have .setGoButton("<s:url value="/img/xxx/yyy.png" namespace="/"/>") then (afaik) editor doesn't know it will be replaced with something else (for instance plain old jQuery could look like $(document).html("<div class=\"test\"></div>") and escaping is necessary here). If escaping quotes breaks the code, what about using single quotes .setGoButton('<s:url value="/img/xxx/yyy.png" namespace="/"/>') that should be still valid for your code and it makes few errors go away.
Possibly a duplicate of/similar to issue 225538
Hi, I alreeady tried that, but it doesn't change anything. And I can't escape the double quotes because they have to be unescaped for the OGNl-Tag. They are not part of the String (like html tag-attributes).
I'm going to fix the issue #225538 as first. This issue possibly will required more fixes after fixing issue #225538.
Both cases described by the reporter seems to be ok now. Please verify.
How can I verify that? Where can I get the patch for this problem??
The easiest way is to try the daily build http://bits.netbeans.org/download/trunk/nightly/latest/