Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363671 - Rich UI Console View is not disabled in deployed applications
Summary: Rich UI Console View is not disabled in deployed applications
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-14 01:18 EST by Thomas Wu CLA
Modified: 2017-02-23 14:17 EST (History)
6 users (show)

See Also:


Attachments
error page (67.54 KB, image/pjpeg)
2011-11-14 01:19 EST, Thomas Wu CLA
no flags Details
error_src_location (89.33 KB, image/pjpeg)
2011-11-14 08:51 EST, Thomas Wu CLA
no flags Details
Error message displaying in preview mode (22.96 KB, image/pjpeg)
2011-11-15 20:16 EST, Thomas Wu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wu CLA 2011-11-14 01:18:14 EST
Build Identifier: 20111113

There is the similar issue within RBD. RBD also could not get info from src location, but there is no error reporting. EDT not only could not get info from src, but also has errors reporting in deployed page.

Reproducible: Always

Steps to Reproduce:
1.DD a HTML widget into a handler.
2.New a html file named myTest.html and put it into test project's WebContent folder.
3.Just add some text into html page, such as "ABC".
4.Select and open properties view of the HTML widget in step 1. Set the value of its src property as "WebContent/myTest.html"
5.Preview the handler, the HTML widget shows "ABC" as the content of src location.
6.Deploy the handler into a project, and run as the handler page.

Actual results: The deployed page couldn't show the src content and reporting some errors. Please refer to screenshot.
Comment 1 Thomas Wu CLA 2011-11-14 01:19:49 EST
Created attachment 206914 [details]
error page
Comment 2 Xiao Bin Chen CLA 2011-11-14 02:20:24 EST
This is a EVServer problem, whatever you set in src the ev server will ignore string before the first "/". But those will be applied after deployed.
Comment 3 Tony Chen CLA 2011-11-14 03:17:45 EST
Why do you include WebContent in src value? I believe the src is supposed to take a relative or absolute URL, in either of them, there should not be WebContent unless you have a WebContent in you WebContent directory.
Comment 4 Thomas Wu CLA 2011-11-14 04:01:48 EST
I have discussed with Xiaobin about this. Yes, I should not include "WebContent/" here. But just like Xiaobin's comments, we found whatever we input before the first "/", such as "XXX/" there is no error reported in preview. The defect title should be changed here.
Comment 5 Tony Chen CLA 2011-11-14 04:20:11 EST
I'm not sure I understand the problem. Can you paste the code?
Comment 6 Thomas Wu CLA 2011-11-14 08:50:53 EST
There is the same issue for Image widget. Please refer to screenshot error_src_location.jpg. The image is located in "WebContent/1/cerfification.bmp"; but src is set as "uuu/d/1/certification.bmp" instead. The preview page could display the image successfully within the error location setting.
Comment 7 Thomas Wu CLA 2011-11-14 08:51:57 EST
Created attachment 206944 [details]
error_src_location
Comment 8 Brian Svihovec CLA 2011-11-14 15:35:52 EST
So, in RBD, if a URl is invalid for an HTML widget, no error message is displayed, but in EDT an error message is displayed?

It would be interesting to know why an error message is displayed in RBD and not EDT, but the HTML and Image widgets should not be changed to support, or adjust, invalid URLs.
Comment 9 Thomas Wu CLA 2011-11-15 02:41:56 EST
Yes, Brian. Just like your comments, for invalid src path inputing. In deployment mode, EDT report the folloiwng errors.
[CRRUI1071E] No exception handler found for service call. Add an exception handler for service call.
An exception occurred while communicating with the service. URL:http://localhost:8080/myTest/a/ddd/1/myTest.html

[CRRUI1071E] No exception handler found for service call. Add an exception handler for service call.
[CRRUI3660E] Exception occurred, could not handle response for 'http://localhost:8080/myTest/a/ddd/1/myTest.html', reason: '[CRRUI1071E] No exception handler found for service call. Add an exception handler for service call.'
[CRRUI2095E] Could not find the EGL function calls leading to this error

But in RBD, there is no error message displaying.
In preview mode, both RBD and EDT could display and redirect to correct src path.
Comment 10 Brian Svihovec CLA 2011-11-15 10:50:26 EST
Thanks for the additional details.

If you try to use the HTML widget in Preview mode with RBD and EDT, what message is displayed when the source location cannot be reached?  I would expect it to be the same message we are seeing in the deployed version for EDT.

The message being displayed in EDT for the deployed application is valid, since the call is failing and there is no error handler.  I am guessing RBD is trying to report the same message, but the console view (egl.println) is disabled for a deployed application in RBD.  It seems that the console view is not being disabled for EDT, which is something we should fix for the .7 release.

In a future release, we could also add an error handler to the HTML widget's call statement, but I'm not sure if we would be able to predict the proper behavior in all cases.  Maybe we could allow the user to register a delegate function to be invoked when the HTML invocation fails.  Please open an enhancement to look at this after .7 and mark it as 'future'.

To be clear, the only thing we should fix for this defect is to disable the console view in deployed applications.  We can add features to the HTML widget in the future.
Comment 11 Thomas Wu CLA 2011-11-15 20:15:06 EST
Hi, Brian. To answer your question, the following message is displayed in HTML wighet when the source location cannot be reached in Preview mode with RBD and EDT.
document.write("Could not open/testEGLWidget/a/add/1/my.html");

In addition, I have created another enhancement bug 363885 to track what you mentioned to do in future.
Comment 12 Thomas Wu CLA 2011-11-15 20:16:29 EST
Created attachment 207074 [details]
Error message displaying in preview mode
Comment 13 Brian Svihovec CLA 2011-11-16 22:04:24 EST
Deferring to Future.  If you have a fix, you can still attach it as a patch for review, otherwise we will look at this later.
Comment 14 Yun Feng Ma CLA 2011-12-14 22:16:45 EST
Fixed, error messages are not printed in deployed application. Thanks.
Comment 15 Tony Chen CLA 2011-12-30 03:27:43 EST
VE is not working for me now. Seemed to be cause by the fix for this bug, two problems: 

1. document.head is not valid when I run VE with IE, probably only valid for html5. I changed it to below code to make it work for me, but there might be existing better ways to do it in our runtime
	var head = document.head || document.getElementsByTagName('head')[0];
    var objCSS = head.appendChild(document.createElement('link'));

2. console.error(msg) also does not work for me (with IE). I googled it and seems this only work for FireFox.


(In reply to comment #14)
> Fixed, error messages are not printed in deployed application. Thanks.
Comment 16 Brian Svihovec CLA 2012-01-03 13:37:56 EST
Changing to Major as this needs to be fixed.
Comment 17 Yun Feng Ma CLA 2012-01-04 01:29:22 EST
Updated the patch. I've tested it with FF, IE, Chrome. Thanks a lot.
Comment 18 Thomas Wu CLA 2012-01-21 01:31:00 EST
Verified in build 20120117