I've ported a previously designed applet to GWT and it runs fine in
hosted mode. I am unable however how to get this running on my
website. I selected 'Deploy Module' and successfully built the war
file.
I have unsuccessfully tried to add this application to my website by doing
the following.
1. I uploaded the .war file to my Web Server. (location /files/jar/
ImageViewer.war)
2. I edited the
- Code: Select all
<HEAD>
- Code: Select all
<meta name="gwt:module" content="/files/
jar=com.mycompany.project.client.ImageViewer"/>
3. I am using a Homestead SiteBuilder (http://www.homestead.com) to build/
maintain my site. To edit the body I tried the two options provided by
the builder. Method (a) below worked successfully when adding the applet. It's just a shortcut to add HTML to any part of the page.
(a) I inserted a HTML snippet to the page as follows:
- Code: Select all
<body>
<script language="JavaScript" src="/files/jar/gwt.js"></script>
</body>
I assume the gwt.js file is inside the .war file?
(b) I also tried the following option:
there is also a section for javascript to select the onload/onunload options. IN this section I
was unsure what to add. I tried adding the full <script lang.... ....>
but this caused the page to error.
I also tried just adding src="files/jar/gwt.js" to the onload option
but to no avail.
When I had the applet working I had the jar stored in the same
location as the .war file is now stored and the following HTML code
worked:
<applet ARCHIVE="/files/jar/myapp.jar" CODE="optiontwo.MyApplet"
WIDTH = 1400 HEIGHT = 300>
Your browser is not Java enabled.
</applet>
Can anyone help please?
Cheers,
Will