Can't rename gwt-module - gwt

I've read this and decided to rename my gwt-module, but got a fault. IDEA automaticaly generates test.gwt.xml when I create GWT-module project. It put:
<module rename-to="test">
inside test.gw.xml. If I remove "rename-to ..." and run app, GWT-plugin gives me an error. It seems to be nesessary in gwt.xml. It is contradictional with "Renaming Modules" part of article. Why can't I remove or rename?
Here is test.gwt.xml:
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="test2">
<inherits name='com.google.gwt.user.User'/>
<entry-point class='com.ibm.temp.client.test'/>
<servlet path='/testService' class='com.ibm.temp.server.testServiceImpl'/>
</module>
And test.html:
<html>
<head>
<title>Wrapper HTML for App</title>
<link type="text/css" rel="stylesheet" href="test.css">
<script type="text/javascript" language="javascript" src="com.ibm.temp.test/com.ibm.temp.test.nocache.js"></script>
</head>
<body>
<h1>Simple Application</h1>
<div id="input-container"/>
</body>
</html>

Change script tag like this.The problem is that ur browser cannot find the nocache.js file.
If module rename to abc , nocache.js will be in war/abc/abc.noacache.js
If module not renamed,it will be in war/full package name of gwt.xml/full package name.nocache.js
For your case it will be as,
<script type="text/javascript" language="javascript" src="test2/test2.nocache.js"></script>

Related

Reference error when bootrapping with data-sap-ui-oninit="module:..."

I wrote a simple SAPUI5 application and deployed it on our ABAP server with help of this blog entry.
It's working fine when the application is running on Tomcat. When I try to launch the application from the ABAP server, however, I get the following error:
I guess it has something to do with the name for the resources but I don't really understand it. The debugger points to the line where I call the index.js file:
data-sap-ui-oninit="module:hendrik/odatabench/index"
Here is the code of my index.html:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-compatVersion="edge"
data-sap-ui-async="true"
data-sap-ui-resourceroots='{
"hendrik.odatabench" : "./"
}'
data-sap-ui-oninit="module:hendrik/odatabench/index">
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
Bootstrapping with the attribute sap-ui-oninit='module:...' is supported only as of UI5 1.54 (commit).
UI5 1.28 is quite an ancient version which is out of maintenance. Either update SAPUI5 library in your ABAP system or bootstrap the application by getting the UI5 resources from the CDN:
<script id="sap-ui-bootstrap"
src="https://ui5.sap.com/<version>/resources/sap-ui-core.js"
data-...
></script>
List of currently supported versions can be found here: https://ui5.sap.com/versionoverview.html

Ionic serve does not load angular js and ionic css

I am new in this Ionic field. I created a new app in my localhost folder(C:\xampp\htdocs). When I go to "http://localhost/ionapp/www/" everything works fine but when I run the app from "ionic serve" command I get the blank page.
When I viewed the page source I found that ionic.css and ionic.bundle.js file are not loaded during ionic serve. And in the console I get the error like "angular is not defined". Can anyone please help me fix this?
Here is my index.html which should load css and js files
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="starter">
<!--
The nav bar that will be updated as we navigate between views.
-->
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<!--
The views will be rendered in the <ion-nav-view> directive below
Templates are in the /templates folder (but you could also
have templates inline in this html file if you'd like).
-->
<ion-nav-view></ion-nav-view>
</body>
</html>
So it was not the issue with my ionic but with my browser. Turns out I was getting ERR_CONNECTION_RESET in my console. So basically what I did was
Open cmd prompt as administrator.
Run the command netsh winsock reset.
Restart my computer.
I don't know how it happened but it solved all my problems.

MySampleApplication clickme button does not appear when deployed to container

I have built a new project using GWT. If I run the project from the Intellij IDEA IDE after a few seconds the 'clickme' control appears in the browser and everything works as expected.
I have created an artifact for a application war file, which is created in the expected ../out/artifact folder.
When I deploy the .war file to apache tomcat, and click on the webapp in the apache tomcat manager I just get the list of files under the webapps/MySampleApplication file location.
If I select the MySampleAppliacation.html file I see the text in that html file but the 'clickme' button never appears.
I have done a lot of googling but have not solved the problem. I checked and the gwt-user.jar file is in the lib folder of the webapp.
This is the GWT control file
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src /gwt-module.dtd">
<module rename-to="MySampleApplication">
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Specify the app entry point class. -->
<entry-point class='com.mySampleApplication.client.MySampleApplication'/>
<!-- Specify the app servlets. -->
<servlet path='/MySampleApplicationService' class='com.mySampleApplication.server.MySampleApplicationServiceImpl'/>
</module>
This is the project html page
<html>
<head>
<title>Wrapper HTML for App</title>
<link type="text/css" rel="stylesheet" href="MySampleApplication.css">
<!-- -->
<!-- This script is required bootstrap stuff. -->
<!-- -->
<script type="text/javascript" language="javascript"
src="MySampleApplication/MySampleApplication.nocache.js"></script>
</head>
<body>
<h1>Sample Application</h1>
<p>
This is an example of a host page for the App application.
You can attach a Web Toolkit module to any HTML page you like,
making it easy to add bits of AJAX functionality to existing pages
without starting from scratch.
</p>
<table align="center">
<tr>
<td id="slot1"></td>
<td id="slot2"></td>
</tr>
</table>
</body>
</html>
For good measure, here are all the files under webapps for this project
MySampleApplication\index.html
MySampleApplication\MySampleApplication
MySampleApplication\MySampleApplication.css
MySampleApplication\MySampleApplication.html
MySampleApplication\WEB-INF
MySampleApplication\MySampleApplication\0651E8A6D149EEF5E6386F087426CF0A.cache.html
MySampleApplication\MySampleApplication\0CE0D511D927FEB65BA6F6D96F24D2D4.cache.html
MySampleApplication\MySampleApplication\3C8C88AE707243315A0D688BD60B8CCA.cache.html
MySampleApplication\MySampleApplication\4A4AEE91A97252CBA376B9B27863F6ED.cache.html
MySampleApplication\MySampleApplication\644584634D68B773C08A73FA726669A5.gwt.rpc
MySampleApplication\MySampleApplication\clear.cache.gif
MySampleApplication\MySampleApplication\D003F7646BFEF3B8BE562132E77EFE59.cache.html
MySampleApplication\MySampleApplication\hosted.html
MySampleApplication\MySampleApplication\MySampleApplication.nocache.js
MySampleApplication\WEB-INF\classes
MySampleApplication\WEB-INF\web.xml
MySampleApplication\WEB-INF\classes\com
MySampleApplication\WEB-INF\classes\com\mySampleApplication
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client
MySampleApplication\WEB-INF\classes\com\mySampleApplication\MySampleApplication.gwt.xml
MySampleApplication\WEB-INF\classes\com\mySampleApplication\server
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication$1.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication$MyAsyncCallback.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplication.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationService$App.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationService.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\client\MySampleApplicationServiceAsync.class
MySampleApplication\WEB-INF\classes\com\mySampleApplication\server\MySampleApplicationServiceImpl.class
About the only other thing would be the IDEA project module settings......
I am VERY appreciative or your help Andy.

On the eclipse welcome page, is it possible to link to resources located in a different plugin?

I am working on an eclipse RCP application. In the main (app) plugin I have defined a welcome or intro page. This is an XHTML file containing links to interesting resources.
There is a separate help plugin which contains the help in html and also as a PDF.
Is it possible to link from the welcome page in the app plugin to the PDF in the help plugin? I was thinking of something like this (but it didn't work)
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<link rel="stylesheet" href="shared.css" type="text/css" />
<link rel="stylesheet" href="root.css" type="text/css" />
</head>
<body>
<h1>Welcome to the Test Framework</h1>
<div class="page-style">
<div id="content">
<!-- app plugin -->
<a href="presentation.pdf">
<img border="0" src="file_powerpoint.png" alt="Presentation" />Präsentation</a>
<!-- help plugin -->
<a href="platform:/com.acme.atf.help/pdf/handbook_de.pdf">
<img border="0" src="file_pdf.png" alt="Handbuch" />Handbuch</a>
</div>
</div>
</body>
You need to register your XHTML page as a config extension at your plugin.
Add the extension at the plugin.xml:
<extension point="org.eclipse.ui.intro.configExtension">
<configExtension
configId="org.eclipse.ui.intro.universalConfig"
content="path/yourFile.xhtml" />
</extension>
Then, add it to the welcome page (via editing configuration, or using the Help/Welcome/Customize menu).
Link: A short tutorial on this topic
You can also use command to open some resource (you will implement opening of the resource in handler):
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="yourHandler"
id="openResource">
</command>
</extension>
and then execute the command in xml file where you have welcome page content:
<introContent>
<extensionContent id="openPdf" style="css/welcome.css"
name="SomeName" path="overview/#">
<group style-id="content-group" id="overview-default-group">
<link label="Open PDF"
url='http://org.eclipse.ui.intro/execute?command=openResource'
id="introLink" style-id="content-link">
<text>Open PDF resource</text>
</link>
</group>
</extensionContent>

Resource not found under webapp folder

I'm using eclipse Juno with Spring and Maven, I created a pkeditor folder under webapp and then copied files into it. My jsp is not finding the pkeditor files (404ing). I have the following at the top of my jsp:
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%# taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%# taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%# page session="false" %>
<html>
<head>
<script type="text/javascript" src="/resources/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/resources/ckeditor/adapters/jquery.js"> script>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/adapters/jquery.js"></script>
<title>Home</title>
</head>
<body>
Note: in my servlet-context.xml I have tried both
and
<resources location="/, classpath:/META-INF/web-resources/" mapping="/resources/**"/>
and still not found.
There must be a simple answer to this.
For your source path use the following for example.
<script type="text/javascript" src="${pageContext.servletContext.contextPath}/resources/ckeditor/ckeditor.js"></script>
you could use spring:url
<spring:url value="/resources/ckeditor/ckeditor.js" var="script_url" />
<script src="${script_url}" type="text/javascript"><!-- required for FF3 and Opera --></script>