xtext-services and iframe [message #1840947] |
Thu, 29 April 2021 07:39  |
Eclipse User |
|
|
|
Hi,
I have created a web application with a simple "hello world" DSL.
I run the project with gradle in localhost 8080.
When accessing the web app from any browser (firefox, chrome etc ) everything seems to work fine. The validation of the DSL, in case of syntactic errors, shows respectively the errors in each line of the text editor.
The thing is that, in case i embed inside another web page ( through an iframe) the "localhost:8080" , the validation errors and generally the xtext services, don't work.
In the console.log of each browser i use, i am getting the following error
GET http://localhost:8080/xtext-service/occurrences?resource=21769cf1.ddl&caretOffset=203&requiredStateId=-80000000 404 (Not Found) jquery.min.js:2
a snapshot of my index.html is presented below
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="en-us">
<title>Example Web Editor</title>
<link rel="stylesheet" type="text/css" href="xtext/2.20.0/xtext-ace.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script src="webjars/requirejs/2.3.6/require.min.js"></script>
<script type="text/javascript">
var baseUrl = window.location.pathname;
var fileIndex = baseUrl.indexOf("index.html");
if (fileIndex > 0)
baseUrl = baseUrl.slice(0, fileIndex);
require.config({
baseUrl: baseUrl,
paths: {
"jquery": "webjars/jquery/3.4.1/jquery.min",
"ace/ext/language_tools": "webjars/ace/1.3.3/src/ext-language_tools",
"xtext/xtext-ace": "xtext/2.20.0/xtext-ace"
}
});
require(["webjars/ace/1.3.3/src/ace"], function() {
require(["xtext/xtext-ace"], function(xtext) {
xtext.createEditor({
baseUrl: baseUrl,
syntaxDefinition: "xtext-resources/generated/mode-mydsl"
});
});
});
</script>
</head>
<body>
<div class="container">
<div class="header">
<h1>Example MyDsl Web Editor</h1>
</div>
<div class="content">
<div id="xtext-editor" data-editor-xtext-lang="mydsl"></div>
</div>
</div>
</body>
</html>
thanks in advance
[Updated on: Thu, 20 May 2021 10:54] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: xtext-services and iframe [message #1840998 is a reply to message #1840992] |
Fri, 30 April 2021 02:08  |
Eclipse User |
|
|
|
Hi Christian,
You are totally right. I used the send full text and it worked!!
Thank you very match for your support.
Have a nice day!!!
Best Regards
[Updated on: Thu, 20 May 2021 10:56] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.07450 seconds