Hi guys,
Having a problem, my table does not get displayed, when i load the page it gives me the following error(p.s-the codes below): -
-
<%@ page import="java.util.*,java.io.*" %>
-
<%@ page import="testBean.TestBean" %>
-
-
-
<html>
-
<head>
-
-
<LINK REL="stylesheet" TYPE="text/css" HREF="stylesheet1.css">
-
-
</head>
-
-
<body>
-
-
<hr></hr>
-
-
<center>
-
-
<h1>
-
-
Weather Forecast</h1>
-
-
<table>
-
<tr><th>Todays Forecast</th></tr>
-
-
<tr>
-
<th>Temperature</th>
-
<th>Light</th>
-
</tr>
-
-
<%
-
-
String valString;
-
BufferedReader dataFile = null;
-
try {
-
String[] temp = {"Temperature", "Light"};
-
int recCount = 0;
-
FileReader dFile = new FileReader("w:/www/DataFile.txt");
-
dataFile = new BufferedReader(dFile);
-
valString = dataFile.readLine();
-
while(valString != null){
-
%>
-
-
-
<tr>
-
<td><%=temp[recCount]%></td>
-
<td><%=valString%></td>
-
</tr>
-
<%
-
recCount++;
-
//out.println(valString);
-
valString = dataFile.readLine();
-
}
-
}
-
catch (FileNotFoundException e) {
-
System.err.println("FileStreamsTest: " + e);
-
}
-
catch(IOException iOE) {
-
iOE.printStackTrace();
-
}
-
finally {
-
dataFile.close();
-
}
-
-
%>
-
-
</table>
-
-
-
<jsp:useBean id="temp" class="TestBean" />
-
-
<br><br><br>
-
-
<a href="test.html"> Local Five day forecast </a>
-
-
<br><br><br><br><br><br><br>
-
<table>
-
<tr><TD><IMG SRC="sunny.gif" ALT="S" BORDER=0 WIDTH=100 HEIGHT=100 ></TD><TD><h4> <%= temp.post() %> </h4></TD> </tr>
-
</table>
-
-
<br><br><br><br><br><br><br>
-
-
<hr></hr>
-
-
</body>
-
</html>
-
-
15 1549
Hi there,
i made alterations to the code, whereby i have created to separate tables for light and temperature, which reads two different files, although both the tables and data gets displayed, each table has two addtional empty rows printed to it, like below. How do I stop this from happening?? -
-
Todays Temperature
-
-
Outlook: image1.gif
-
Temperature: Todays temperature is: 90 degrees
-
Temperature :
-
Temperature :
-
-
Todays Light Intensity
-
-
Outlook: image2.gif
-
Light: Todays temperature is: 90 degrees
-
Light :
-
Light :
-
-
Hi there,
i made alterations to the code, whereby i have created to separate tables for light and temperature, which reads two different files, although both the tables and data gets displayed, each table has two addtional empty rows printed to it, like below. How do I stop this from happening?? -
-
Todays Temperature
-
-
Outlook: image1.gif
-
Temperature: Todays temperature is: 90 degrees
-
Temperature :
-
Temperature :
-
-
Todays Light Intensity
-
-
Outlook: image2.gif
-
Light: Todays temperature is: 90 degrees
-
Light :
-
Light :
-
-
You could exclude the empty string with -
-
while(tempString != null){
-
if(!tempString.equals("") ) {
-
//..........
I added the if statement but the page does not load up.
I added the if statement but the page does not load up.
You mean nothing shows? Any error messages, exceptions etc
no nothing, its like the screens frozen.
no nothing, its like the screens frozen.
It must be something else then. That if statement does not cause the computer to freeze.
The computer does not freeze, but it does not load up, however when i take the if statement away it loads up fine.
The computer does not freeze, but it does not load up, however when i take the if statement away it loads up fine.
- <%int recCount = 0;
-
FileReader dFile = new FileReader("w:/www/DataFile2.txt");
-
dataFile = new BufferedReader(dFile);
-
valString = dataFile.readLine();
-
while(valString != null){
-
if(!tempString.equals("") ) {
-
%>
Here shouldn' t you be saying if(valString.equals("")) ?
- <%int recCount = 0;
-
FileReader dFile = new FileReader("w:/www/DataFile2.txt");
-
dataFile = new BufferedReader(dFile);
-
valString = dataFile.readLine();
-
while(valString != null){
-
if(!tempString.equals("") ) {
-
%>
Here shouldn' t you be saying if(valString.equals("")) ?
Indeed, abtech. That should have been - if(!valString.equals("") ) {
I wonder where I got tempString from.
Indeed, abtech. That should have been - if(!valString.equals("") ) {
I wonder where I got tempString from.
There were 2 different files to work with. Naha's code for the first file was - - <%
-
-
String tempString;
-
BufferedReader dataFile1 = null;
-
try {
-
//String[] temp = {"Temperature", "Light"};
-
int recCount1 = 0;
-
FileReader dFile1 = new FileReader("w:/www/DataFile1.txt");
-
dataFile1 = new BufferedReader(dFile1);
-
tempString = dataFile1.readLine();
-
while(tempString!= null){
-
if(!tempString.equals("") ) {
-
-
%>
Here he made the appropriate change as you suggested, but must have missed it somehow in the code for the second file - - <%
-
-
String valString;
-
BufferedReader dataFile = null;
-
try {
-
//String[] temp = {"Temperature", "Light"};
-
int recCount = 0;
-
FileReader dFile = new FileReader("w:/www/DataFile2.txt");
-
dataFile = new BufferedReader(dFile);
-
valString = dataFile.readLine();
-
while(valString != null){
-
if(!tempString.equals("") ) {
-
%>
There were 2 different files to work with. Naha's code for the first file was - - <%
-
-
String tempString;
-
BufferedReader dataFile1 = null;
-
try {
-
//String[] temp = {"Temperature", "Light"};
-
int recCount1 = 0;
-
FileReader dFile1 = new FileReader("w:/www/DataFile1.txt");
-
dataFile1 = new BufferedReader(dFile1);
-
tempString = dataFile1.readLine();
-
while(tempString!= null){
-
if(!tempString.equals("") ) {
-
-
%>
Here he made the appropriate change as you suggested, but must have missed it somehow in the code for the second file - - <%
-
-
String valString;
-
BufferedReader dataFile = null;
-
try {
-
//String[] temp = {"Temperature", "Light"};
-
int recCount = 0;
-
FileReader dFile = new FileReader("w:/www/DataFile2.txt");
-
dataFile = new BufferedReader(dFile);
-
valString = dataFile.readLine();
-
while(valString != null){
-
if(!tempString.equals("") ) {
-
%>
The program should have given a nullpointer exception because then tempString was null in the secong if statement. I wonder why he/she failed to see that on the stacktrace
The program should have given a nullpointer exception because then tempString was null in the secong if statement. I wonder why he/she failed to see that on the stacktrace
Indeed, it did throw a nullpointer exception , thats how I located the error.
no nothing, its like the screens frozen.
I'm not running it on my computer so when Naha said the above after I had asked if there were any exceptions, I had really become stumped.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: python-help-bounces |
last post by:
Your message for python-help@python.org, the Python programming
language assistance line, has been received and is being delivered.
This automated response is sent to those of you new to...
|
by: Sarir Khamsi |
last post by:
Is there a way to get help the way you get it from the Python
interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the
module cmd.Cmd? I know how to add commands and help text to...
|
by: tbatwork828 |
last post by:
If you were like me trying to figure out how to launch context
sensitive help topic by the context id, here is the link:
http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx
and if...
|
by: Colin J. Williams |
last post by:
Python advertises some basic service:
C:\Python24>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
With...
|
by: Bruce Dodds |
last post by:
I recently started using Access 2003 for the first time. I wanted to
pass on some comments about the Help system to Access MVPs who frequent
this board. I'm doing this in the hope that some of...
|
by: Steve Teeples |
last post by:
Can someone point me to a document that clearly identifies the steps of
creating a good help system for an application? I have a test tool that I'd
like to add help to so that others will know how...
|
by: Yabedabe |
last post by:
Hello there,
I have a strange problem (possible bug?) to display two HTML Help
files at the same time.
To reproduce this problem. Create a new VB.Net solution. Place two
buttons on the form....
|
by: JonathanOrlev |
last post by:
Hello everybody,
I wrote this comment in another message of mine, but decided to post it
again as a standalone message.
I think that Microsoft's Office 2003 help system is horrible, probably...
|
by: PaulS |
last post by:
new to Fedora7, typed python in interactive interpreter, then help(). Then
modules to get a list of modules. Then module name to get info on a module
but no help file. What is the help file...
|
by: priyajohal |
last post by:
#include<fstream.h>
#include<process.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<ctype.h>
#include<stdio.h>
void setup()
void help();
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |