473,385 Members | 1,930 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,385 software developers and data experts.

Invoke Servlet from Applet

I want a simple applet prog that has a button.

On click of that button it must invoke a servlet in IE window (simple hello world program) and close this applet window.

Pls send me the code for applet...

Its not any communication between applet and servlet, jus to show the servlet.

I tried this code...

public void actionPerformed(ActionEvent ae)
{
try{
AppletContext ac=getAppletContext();
URL url = new URL("http://127.0.0.1:8080/Manoj/Baba"); //my servlet address
ac.showDocument(url,"_blank"); //ac.showDocument(url);
}catch(Exception e)
{System.out.println("Error");
e.printStackTrace();}
}
}

but i didnt get the servlet window...:( pls help...
Sep 28 '07 #1
1 5429
r035198x
13,262 8TB
I want a simple applet prog that has a button.

On click of that button it must invoke a servlet in IE window (simple hello world program) and close this applet window.

Pls send me the code for applet...

Its not any communication between applet and servlet, jus to show the servlet.

I tried this code...

public void actionPerformed(ActionEvent ae)
{
try{
AppletContext ac=getAppletContext();
URL url = new URL("http://127.0.0.1:8080/Manoj/Baba"); //my servlet address
ac.showDocument(url,"_blank"); //ac.showDocument(url);
}catch(Exception e)
{System.out.println("Error");
e.printStackTrace();}
}
}

but i didnt get the servlet window...:( pls help...
You don't open servlets, you open JSPs.
Sep 28 '07 #2

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

Similar topics

0
by: BryarWoilf | last post by:
Hi all, I'm still somewhat new to servlet/JSP programming, but I want to my application to use the MVC model. I have some simple JSP pages that dynamically open an applet that the user uses...
0
by: alfredo | last post by:
Hello everybody I need an advice from some guru out there. I have imagined the following scenario: I have a servlet on my server. It starts and waits for incoming requests from clients on...
0
by: SubbaRao Karanam | last post by:
When I click the Button in Applet , I want it open a Dialog asking for the excel to open/save etc... It doesnt happen why... Now it doesnt create the excel file Why.... My Applet code is...
0
by: SPG | last post by:
Hi, I have implented my own Subscription based pushlet engine which is using a servlet to write data back to a HttpServletResponse object. This all appears to be working fine until I run it...
1
by: Miles Davenport | last post by:
I would like some advice on what Java server-side alternatives their are to an applet which is a shopping cart application which allows the user to drag-and-drop individual items into "an order"...
1
by: lauryn | last post by:
Hi everyone, it's been a LONG time since I've made an applet, and I was hoping to get some help. At my work, we have a $1mil+ database with a servlet interface. I know few details beyond that....
1
by: Nick Nygaard | last post by:
Hi everyone, I'm using O'Reilly's servlet API to make an object based HTTP communication between an Applet and a servlet. Following their own tutorial 10.2.3. Object-based HTTP Communication...
14
by: ramadeviirrigireddy | last post by:
Hi All, I have the following code for form and servlet. when the form is submitted the servlet will print the values passed by the form. i'm not getting the servlet o/p when i submit the...
2
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks 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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.