S
slowlearner
I'm making a http requset to a file movie.txt which is located in the
same folder as Hangman.html. But I just get this error from the server
:<Sun Java System Application Server 9.1_02 - Error report
HTTP Status 404 - Status report
message description
The requested resource () is not available
Is the problem with my code or should I be putting movie.txt in a
different location?
my code is
HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {
public void onCompletion(String responseText) {
if (responseText.indexOf("Error")>0)
{
// ***** returns the resource not found 404 error here *****
status.setText("OnCompletion:"+responseText);
return;
}
else
{
words = responseText.split("\n");
}
startGame();
}
the responseText always returns the 404 resource not found error.
I've put the file in the same folder as my hangman.html
I'm using netbeans 6.1 and gwt1.5
the movies.txt is definitely there in the war file next to the
hangman.html file.
the hangman.html file looks like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name='gwt:module'
content='org.hangman.Main=org.hangman.Main'>
<title>Hangman</title>
<style>
body,td,a,div,.p{font-family:arial,sans-serif}
div,td{color:#000000}
a:link,.w a:link{color:#0000cc}
a:visited{color:#551a8b}
a:active{color:#ff0000}
</style>
</head>
<body>
<script language="javascript" src="org.hangman.Main/
org.hangman.Main.nocache.js"></script>
<iframe src="javascript:''" id="__gwr_historyFrame"
style="width:0;height:0;border:0"></iframe>
<h1>Hangman</h1>
<div id="hangman"></div>
</body>
</html>
All help appreciated
same folder as Hangman.html. But I just get this error from the server
:<Sun Java System Application Server 9.1_02 - Error report
HTTP Status 404 - Status report
message description
The requested resource () is not available
Is the problem with my code or should I be putting movie.txt in a
different location?
my code is
HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {
public void onCompletion(String responseText) {
if (responseText.indexOf("Error")>0)
{
// ***** returns the resource not found 404 error here *****
status.setText("OnCompletion:"+responseText);
return;
}
else
{
words = responseText.split("\n");
}
startGame();
}
the responseText always returns the 404 resource not found error.
I've put the file in the same folder as my hangman.html
I'm using netbeans 6.1 and gwt1.5
the movies.txt is definitely there in the war file next to the
hangman.html file.
the hangman.html file looks like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name='gwt:module'
content='org.hangman.Main=org.hangman.Main'>
<title>Hangman</title>
<style>
body,td,a,div,.p{font-family:arial,sans-serif}
div,td{color:#000000}
a:link,.w a:link{color:#0000cc}
a:visited{color:#551a8b}
a:active{color:#ff0000}
</style>
</head>
<body>
<script language="javascript" src="org.hangman.Main/
org.hangman.Main.nocache.js"></script>
<iframe src="javascript:''" id="__gwr_historyFrame"
style="width:0;height:0;border:0"></iframe>
<h1>Hangman</h1>
<div id="hangman"></div>
</body>
</html>
All help appreciated