473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Applet class file cant be modified

Hi Bytes,

i did sample Applet program in linux environment in that place where my java is installed. when i execute the code it creates the .class file and browser shows the result when i load the page. then i have opened the same program again did some modification,made a compilation and run the program but changes didnt affect in the browser. is it the problem in .class regenration? or what could be the problem?. suggest me.

code i used..

<code>
samp.java


import java.applet.*;
import java.awt.*;

public class samp extends Applet{

public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",400,20);
g.drawString(" By PrastSystems",80,70);
g.drawString(" By Java",50,230);

}
}

samp.html

<HTML>
<HEAD><title>Applet In Jsp</title>
</HEAD>
<BODY>
<APPLET ALIGN="CENTER" CODE="samp.class" WIDTH="800" HEIGHT="500">
</APPLET>
</BODY>
</HTML>

</code>
Mar 16 '09 #1
4 2203
r035198x
13,262 8TB
If you are sure the old .class file was replaced then try clearing your browser's cache before running again.
Mar 16 '09 #2
hi thanks for reply.

i did what you have suggested.

But still i am getting the old information in the browser ,updated /modified changes cant be affected.

what cause the program to display the same data(rather than showing the updated information) when page loads in the Browser?

Please suggest me something to tackle this problem.
Mar 17 '09 #3
JosAH
11,448 Expert 8TB
@xtremebass
What happens when you quit your browser and restart it again? It this works you have to flush your cache as has been suggested. If it doesn't you haven't produced a new .class file or it can't be found while the old .class file is still reachable.

kind regards,

Jos
Mar 17 '09 #4
chaarmann
785 Expert 512MB
@xtremebass
It can have different reasons
1.) Maybe you are connecting through a proxy server which caches the old class file.
In this case, configure your browser to bypass the proxy for this hostname under LAN-settings.
2.) Or the webserver (for example Apache) caches the class-file, because you have not configured it to immediately reload changed class files. Try to restart the webserver. If it works afterwards, that was the reason.
3.) Or your browser caches it. Then simply restart of the browser won't work. You have to explicitly tell the browser under internet-option to clear whole cache first, and then restart. There is an option in the explorer to always check for new source and load it instead of getting it from cache. Activate it.

You can also set the expiry time to 1 millisecond with an HTML meta tag in your webpage. Some browsers and proxys listen to that.

Finally, if all doesn't work, just rename your class file. If you don't get an error, then it is still one of the points 1 to 3 that you didn't fix.If you get an error, then you know the cache can't be the reason.
Then try to change the name in the html-page to the new class file name. If the changed version shows up, all is ok. But if the old version shows up, then you know it has to do something with the compilation. In this case:

Did it really compile the new version? Maybe it's still the old class file (check date/size before and afterwards). Did you really save your changes in java file or are the changes only in editor? Does it grab the right java-file and libraries for compilation ? (check path).
Mar 18 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dB | last post by:
I want to load an applet locally from the client's hard drive from an html/jsp page served by Tomcat on the local machine or a remote server. The motivation is that I need to print to the local...
3
by: yogesh | last post by:
How to store the java applet emebedded in a web page for offline viewing? I saved the web page but it got saved without the applet.and also I searched for the corressponding .class file for the...
2
by: Christian Galbavy | last post by:
Hy! My next problem is to make an applet from my program. I have just add the "extend applet" to my class and removed the main-method by the start-method of the applet. I was thinking that this...
0
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ...
0
by: crispinternet | last post by:
hi there, well its been 3 days and still i cant find the solution to a problem i have, im on the last bot of a long project and cant seem to get this working. basically i have a signature applet...
0
by: shanmukhi | last post by:
Hi All I got a problem in running java programs. i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong...
0
by: shanmukhi | last post by:
Hi All I got a problem in running java Applet i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong name:...
1
by: dishal | last post by:
Can anyone help me please? How do I convert these codes to launch from a JFrame instead of a Java Applet? A simple program where the user can sketch curves and shapes in a variety of...
0
by: dhillarun | last post by:
Hi all, Problem (in short): Disabling the applet cache. Problem (in detail): I have developed an Applet application. I am creating the contents of the applet by reading a text file in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.