Related question I am having similar problems to what that guy had in his. My upload server returns a redirect.
Specifically, I am not sure what FormPanel.SubmitCompleteEvent.getResults() returns. Sometimes, I get html of an img:
<img style="cursor: -moz-zoom-in;"
alt="http://<myapp>.appspot.com/servePic?blob-key=abcdef"
src="http://<myapp>.appspot.com/servePic?blob-abcdef"
height="1" width="1">
Sometimes I get the image data in bytes. Behavior varies on I dunno what. I get the first in development, and the second in production.
Does anyone know anything about this?
Here's a pretty good example of how to save/load/resize images with gwt & app engine.
http://code.google.com/p/swagswap/source/browse/#svn/trunk/src/main/java/com/swagswap/dao%3Fstate%3Dclosed
Have a look in the dao implemenations and also the gwt interface packages.
Does the project in this link still exists?
http://code.google.com/p/swagswap/source/browse/#svn/trunk/src/main/java/com/swagswap/dao%3Fstate%3Dclosed
I tried to checked it out through eclipse but looks like it does not exist anymore.
Related
I´m trying to get a simple Tapestry sample working, but I´m getting stuck at the very beginning.
I want to declare my first tml page, which I have from the official tapestry site (not yet allowed to post links).
<html t:type="layout" t:id="index" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tapestry.apache.org/schema/tapestry_5_3.xsd ">
<h1>Welcome to the Nifty Web Application!</h1>
<p>
Would you like to
<t:pagelink page="login">Log In</t:pagelink>
?
</p>
</html>
It says "cannot resolve symbol layout" and "cannot resolve symbol login" and I also tried commonLayout which can´t be found too, but there are many other types showing up in the auto completion, which means that in general there is everything okay with the library stuff.
I´ve added every dependency from the sample.
Is layout kind of deprecated or am I missing something?
You are more likely to get help on the Tapestry mailing list.
And you are more likely to get help by reporting the exact error that Tapestry produces. Trust me, a lot of work has gone into making that information valuable, please include it. For example, I can pretty much guarantee that the errors you cite are not the actual error messages Tapestry produced.
That being said, Tapestry does not include a Layout component, since it is one of the most application specific parts of any application. It is something you build yourself. There are tutorials, or the Tapestry Maven archetype includes a basic one.
Likewise, there is no built-in Login page. That's a pretty standard thing you build in yourself as well.
Tapestry is infrastructure, not magic.
I'm sure this question has been asked a million times, but no matter how many Google searches I do I cannot get this working. I'm basically trying to get a project with multiple packages in it to be embedded in a webpage. I made a test program which just made some balls bounce around the screen and was able to get that running. I put the main class in one package and the ball class in another just to test it and it seems to be running fine. But the program that I actually need in a web page (just called FinalProject) refuses to do it.
The best thing I can get it to do is give me a blank screen, without giving an error but just white. If I try clicking where it should be nothing happens, I think because the applet is there but is just showing white so I can't see it. I did use the applet tag, which from my understanding is now depreciated but I need to turn this project in on a webpage just so the teacher can see it. We've already tested that other people's projects (which used the applet tag) work, so I was trying to stick with that for now and worry about getting it working on every browser afterwards. Though that could very well be the problem. Maybe it would work on his browser but not mine here. I've tried running my program on Google Chrome, Mozilla Firefox, and Internet Explorer with no luck.
Here is the HTML code:
<html>
<head>
</head>
<body>
<applet code = "main.FinalProject.class" width = "700px" height = "500px"></applet>
</body>
</html>
The HTML file this is written in is in [Eclipse Workspace]/FinalProject/bin/test.htm. The FinalProject.class file referenced in the HTML exists in [Eclipse Workspace]/FinalProject/bin/ main/FinalProject.class. The FinalProject.class file acts as the main class, so I'm pretty sure that's the one I need to run. It's the one with the init(), actionPerformed(), paint() methods and all that good stuff.
Currently I'm trying to run this offline on my computer, so there shouldn't be any net URL's I would think. I used Eclipse to write the Java code, dunno if that makes any difference. Unfortunately, the Java code is rather large, too much to reproduce here, if there's something specific you think is the problem I can look and post that small section.
A few of my friends managed to get theirs working, however they said they had to remove all their .png files (annoying but doable for my project). They also said had to remove all their mouse movement code. My program is kind of dependent on that, I need that for it to work at all. I know there MUST be a way to use all the MouseListener and MouseMoveListener code online, maybe it's a little different though. I dunno if that has something to do with this, but I figured I'd point it out just to be safe.
Any help here would be greatly appreciated.
Basically you're asking something like: How to deploy a java applet for today's browsers (applet, embed, object)?
Based on that, I think what you want is:
<object
classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
style="height: 500px; width: 700px;">
<param name="code" value="FinalProject.class">
<comment>
<embed code="FinalProject.class"
type="application/x-java-applet"
height="500" width="700">
<noembed>
This browser appears to lack support for Java Applets.
</noembed>
</embed>
</comment>
</object>
Now, you have a filename of main.FinalProject.class in your code. It seems like FinalProject.class would be more likely. But yours could be right. In any case, this html file needs to be in the same folder as main.FinalProject.class or FinalProject.class and whatever classes may also be required.
Now, you may also need to make sure your browsers can actually run an applet. See: How do I enable Java in my web browser?
Update
Based on feedback from Andrew Thompson, the preferred solution is to use JavaScript from Oracle, like this:
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {
code:'FinalProject.class',
width:700, height:500} ;
var parameters = {}; // does the Applet take parameters?
var version = '1.6' ; // does the Applet require a minimum version of Java
deployJava.runApplet(attributes, parameters, version);
</script>
This requires the ability to load arbitrary JavaScript, but you could also capture that deployJava.js and have that be local as well. Might be worth a look.
I'm using PHP to scrape some information off webpages, however, I've discovered that the info I'm trying to scrape from the pages is loading through some manner of AJAX/javascript. I thought I remembered that Curl could iterate through the javascript, but I've found that that's not the case.
I seem to remember some sort of backend "web browser" library/function that could trace through javascript and AJAX, to get at a final page result of what a full-functioned browser would arrive at.
Is there a library or function that can do this? Any ideas on how to go about this, other than having to manually trace through the scripts/redirects myself? It doesn't have to be pretty -- I'm just looking to scrape the resulting text.
Maybe not in php but in other languages there's: Watir/WatiN, selenium, watir/selenium-webdriver, capybara-webkit, celerity, node.js runs js directly, as well as phantomjs. There's also iMacros and similar commercial options.
But I usually find that I can get the data I want without any of these by just looking at the requests the page is making and recreate them/parsing the response.
I don't think there is such a library. If you're really desperate and you have lots of time on your hands, then you can, of course, download source code of Firefox, for example, and build yourself something useful. However I don't think this is going to be the best use of yours or anybody else's resources.
Note that even google's indexing bot does not process ajax. Here is what Google has to say about it. It's quite possible that the site you're dealing with does support this, in which case you can try using this google's technique, but on the whole, unfortunately, you're out of luck.
I am having a problem putting a java applet on a website using Dreamweaver CS5.
This is the page where I am having the problem:
http://www.typingsquad.com/employment.html
This is a picture of what I see in dreamweaver:
http://i895.photobucket.com/albums/ac157/daltonward1/javaAppletProblem.png
Based on what I have read on the internet, I have tried the three following methods, but only one has worked.
First, I tried putting the applet on the webpage by using media-applet. The picture posted shows how I tried to implement that. However, as you can see on the website when viewing the first box, it states that there is an error.
"java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file Calculator/html"
I've done some reading on this error, but I cannot find a solution.
The second thing I tried is using an IFrame using the direct link of the html file on the server. As you can see, all that appears is a blank box.
The third thing I tried using was a hyperlink, which actually did work. No errors, but its not the effect I was going for.
Does anyone see anything wrong with my use of Iframe and/or applet on dreamweaver?
Could it be that my files aren't grouped together right on the server?
I'm really into writing Java applications and applets, but my friend just got into web development and has asked me to write some simple programs for him. Any help will be greatly appreciated and sorry if my questions could have been simply found else where as I am still new to computer programming as well.
Thanks,
James Ward
java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file Calculator/html
This means the JRE is asking for a class but getting an HTML page (probably stating '404, resource/page not found') that starts with <htm. More details on the answer at the OTN.
Now I look at the source and see:
<applet code="Calculator.html" codebase = "Java Applets/Calculator/bin" width="500" height="300">
</applet>
I realize it is because the page is specifying an HTML instead of a class in the code attribute. These things do not work by magic, you need to have some idea of what you're doing if you hope to deploy an applet successfully.
If http://www.typingsquad.com/Calculator.html works as you expect, the fix will be to change the applet element in the original page to..
<applet code="Calculator.class" width="500" height="300">
</applet>
I am guessing the codebase listed in the original HTML is an artifact of your development environment. If not, you will need to add that, but if that is the case, I would strongly recommend using only directories names with:
All lower case letters.
No spaces.
i saw the html from the site.. you are saying
<applet code="Calculator.html" codebase = "Java Applets/Calculator/bin" width="500" height="300">
</applet>
you should be saying
code="Calculator.class"
the issue is that the system is getting a HTML document which is not parsable as a java class file.. just change the applet tag and things will work properly.
I'd recommend you creating a jar file and using the JAR as the codebase.. its simpler and better than having a class file
Native ancient solution in ColdFusion that used to work with HTML 3.x...
<cfhttp url="#targetUrl#" resolveurl="yes">
<cfdocument format="pdf" name="pdfVar">
#cfhttp.filecontent#
</cfdocument>
<cfpdf action="thumbnail" source="#pdfVar#" pages="1" destination="image">
<cfimage action="writeToBrowser" source="#image#">
Super slow, even with cache, many CSS styles missing or broken.
Any good server-side solution to capture a rendered webpage into a thumbnail? like service provided by http://www.shrinktheweb.com/ ?
Any ColdFusion, Java or Command line utility solution?
This website has a script that does what I think your looking for, I haven’t tried using it for any server-side project though.
http://khtml2png.sourceforge.net/
Doesn’t make thumbnails though, but you could render the image created with cfimage.
If you have ColdFusion version 8 or better, you can simply use CFDOCUMENT to create a thumbnail.
From Ray's post:
<cfdocument src="http://www.coldfusionjedi.com" name="pdfdata" format="pdf" />
<cfpdf source="pdfdata" pages="1" action="thumbnail" destination="." format="jpg" overwrite="true" resolution="high" scale="25">
We ended up using SiteShoter which uses IE as the renderering engine. http://www.nirsoft.net/utils/web_site_screenshot.html