How to call a method in the servlet from an applet
I want to get the data for the applet from the servlet.
How to call a method that exits in the servlet from the applet? I want to use http protocol to do this.
Any suggestions? Please help.
thanks
Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same
Similar Messages
-
Is it possible to call a method in a servlet from a java script ?
I need to do a dynamic html page . In the page i select some things and then these things must communicate whit a servlet because the servlet will do some DB querys and update the same webpage.
So is it possible to actually call a method of a servlet from a java script? i want to do something that looks like this page:
http://www.hebdo.net/v5/search/search.asp?rubno=4000&cregion=1011&sid=69DHOTQ30307151
So when u select something in the first list the secodn list automaticly updates.
thank you very muchYou can
1. load all the options when loading the page and
set second selection options when user selected
the first; or
2. reload the page when user select first selection
by 'onChange' event; or
3. using iframe so you only need to reload part of
the page. -
How to call main method in one class from another class
Suppose i have a code like this
class Demo
public static void main(String args[])
System.out.println("We are in First class");
class Demo1
public static void main(String args[])
System.out.println("We are in second class");
In the above program how to call main method in demo calss from Demo1 class......???????No, i dont know how to call other than main methods from other classes
And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch)......... -
Call a method in the view from Component Controller
Hi Friends,
I have written the code for calling the RFC in Component Controller.
My requirement is to change the properties of UI elements in the view, if I get any exception while calling RFC.
Can Call a method in the view from Component Controller.
Regards,
Lakshmi Prasad.HI,
You can get the error message during the exception of calling RFC in view itself.
Any way you may call the RFC at some action in the view only.
Can you explain me what you are trying to do?
Kind Regards,
Mukesh -
Calling another method in the class from within the body of a method Im wri
Hello out there.
I have a question. I keep getting an error that reads as follows:
1 error found:
File: /Users/matthieubell/Academia/University of Waterloo/CS 125/L06/CreditCard.java [line: 80]
Error: double cannot be dereferenced
I think it is occuring because I am trying to call a method on an instance variable, which is not an object. But how do call a method I have already written, on another method I am writing in the general sense. I could make a particular object, but Im not shure that would get me the same result. I want to be able to call the method calcMinPayment on the instance variable currentBalance to wirte the method makePayment.
I have a class CreditCard
with the instance variables "private double currentBalance = 0; "
public double calcMinPayment()
// Add code here
double minimumPayment;
if (currentBalance < 50)
minimumPayment = currentBalance/10;
else
minimumPayment = 50;
return minimumPayment; // Replace this statement
* This method will decrease the current balance on the credit card if
* this payment meets or exceeds the minimum payment amount.
* pre: paymentAmt > 0
* post: The current balance should be decreased by paymentAmt if
* paymentAmt >= the minimum payment amount. Otherwise, the payment
* will not be recorded and an appropriate error message should be
* displayed.
public void makePayment(double paymentAmt)
// Add code here
double minimumPaymentAmount;
minimumPaymentAmount = currentBalance.calcMinPayment();
if (paymentAmt < minimumPaymentAmount)
System.out.println("Sorry, but your payment must exceed the minimum payment amount.");
System.out.println("This payment has not been recorded, please try again.");
else
this.currentBalance = currentBalance - paymentAmt;
thanks for youre help
-Matthieu'calcMinPayment' takes no arguments, uses a member variable (currentBalance) to compute a local variable 'minimumPayment' which it returns, ie, sends back to the caller. So you can call 'calcMinPayment' at any time.
minimumPaymentAmount = calcMinPayment(); -
How to call a method when the browser is closing
Hello,
In my application I need to execute a specific treatment when the WD4A application is closing. So how can we have a handle method for this specific event.
I've seen some documentation about the "exit plugs" , and about the doonclose method of the window.. but I don't think it can be useable for me in this case.
Can you please help me
Thanks in Advance
HamzaI wrote an insert into the method i set up a break point, the program never call this code and therefore, the new row is never inserted.
But i think, it's a misunderstand.
to summarize :
I have an application in WD4A
The application is running, and then I decide to close the browser (in my case internet explorer) and before the browser close I want to execute a piece of code.
If the method wddoonclose is to be used, is there any default handler or listener to trigger it automatically on the browser closing ?
If no, how to trigger a method base on this special event .
Thx
Hamza -
How can call a method incide the method in jsp
I wrote some statement inside the scriptlet(<% %>)
then i want call another method ,that one inside the same script let..please replay...please help How can write a function inside the JSP
-
How to call a method in one JSP from another JSP?
say that I have 2 JSPs.
JSP one has a button.
JSP two has some method that, say, find the square root of the number passed from JPS one.
How to - when click - the button on page one call the method on page two?
Please note that I can not use object binding, but I want passing the actual parameter and call the method on page two.
Please note that this is an update of a previous post on the same topic called "Object scope".
Thank you all very much.No, i dont know how to call other than main methods from other classes
And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch)......... -
How to call particular method in action class from Portlets StrutsContent
I am developing a web application which uses weblogic portlets and struts. This is what I have for now in the .portlet file.
+<netuix:strutsContent action="getStudentList" module = "people/students"+
refreshAction = "getStudentList" reqestAttrpersistence="none"/>
I want it to change something like this:
+<netuix:strutsContent action="getStudentList.do?method=allGrads" module = "people/students"+
refreshAction = "getStudentLis.do?method=allGrads" reqestAttrpersistence="none"/>
But this is not working. So how can I achieve something like that?
Thanks
Edited by: user13634949 on Jun 23, 2011 1:22 PM
Edited by: user13634949 on Jun 23, 2011 1:22 PMNo, i dont know how to call other than main methods from other classes
And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch)......... -
How to call a method in IMPL class from one context node
Hi, I´ve been only study the posibility to access a method in the IMPL class from one context node class...CN## without using events, is there a way to call it ??? I don´t have it as requierement just learning thanks !.
Hi,
Try this by following this you can get the custom controller instacne in the view context nodes, for your requirement you can keep the view implementation class instance instead of cuco..
To get the custom controller instance in Context node getter/setter method:
1. Declare Cuco instance reference variable in ctxt class..
2. Set this cuco ref. in the Create context node method of ctxt class:
try.
gr_cucoadminh ?= owner->get_custom_controller( 'ICCMP_BTSHEAD/cucoadminh' ). "#EC NOTEXT
catch cx_root.
endtry.
you can avoid this step as this is not needed in case of view isntance
3. Assign this instance to the respective context node Create method using:
BTStatusH->gr_cuco ?= gr_cucoadminh. " here assign the view implementation ref. " me" instead of gr_cucoadminh
Here gr_cuco is the ref. variable of custom controller in the respective context node for eg. BtstatusH
Sample implementation of this can be found in
ICCMP_BTSHEAD/BTSHeader ->context node BTACTIVITYH-> attr ->GR_CUCO(instance of cuco)
Cheers,
Sumit Mittal -
How to call a method of a class from another class
Hi,
Can some one explain me this? I want the label from the Label class to be displayed in the JFrame. I understand to do this, I have to call "label" to the ABC() and createAndShowGUI().
I am novice. It will be really helpful if you could explain me what you did.
class Label {
public Label() {
public JTextField label;
label = new JTextField("Hi");
public ABC() { //Constructor
Container c = getContentPane();
c.setLayout(new FlowLayout());
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(600, 400));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}Will it be some thing like this?
public ABC() { //Constructor
Container c = getContentPane();
c.setLayout(new FlowLayout());
Label label = new Label();
label.add
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(600, 400));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.add(new Label());
//Display the window.
frame.pack();
frame.setVisible(true);
}merit wrote:
Hi,
Can some one explain me this? I want the label from the Label class to be displayed in the JFrame. I understand to do this, I have to call "label" to the ABC() and createAndShowGUI().
I am novice. It will be really helpful if you could explain me what you did.
class Label {
public Label() {
public JTextField label;
label = new JTextField("Hi");
public ABC() { //Constructor
Container c = getContentPane();
c.setLayout(new FlowLayout());
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(600, 400));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}Will it be some thing like this?
public ABC() { //Constructor
Container c = getContentPane();
c.setLayout(new FlowLayout());
Label label = new Label();
label.add
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(600, 400));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.add(new Label());
//Display the window.
frame.pack();
frame.setVisible(true);
You know it maybe that it's just too late at night for me, but I see you complete Label class, but I don't see a class definition for ABC; you have a constructor for it, but not a class definition for it.
In any case, when you define a class, you use it in the same way any other class is used...
MyClass myObjectRef = new MyClass(); -
How to call javaScript function in the form from Action:Tab buttion in workspace
Hi,
I want to trigger JavaScript function that I have written in form from Action: buttons in workspace user's account.
Is there any way that if i hit a button on action bar, it fire a javascript function.
Reason is: I dont want to place button on the form to perform any action on the form. I want to take control of the form from these buttons. Like submit, edit a form, etc, etc..
Please let me know if i couldnt explain it properly.
regards
SunilSunil, you want to look at the "Customizing the LiveCycle® Workspace ES User Interface" document at http://help.adobe.com/en_US/livecycle/9.0/customizeworkspaceui.pdf. The workspace is a Flash component. For ES4 there's an option to run the workspace in HTML5 which might be more productive long-term.
-
How to call a method defined in AM when I select any value in LOV
Lets say there is a LOV. The scenario is as soon as I select any value in LOV, a method needs to be called which I have written in the AM. And the output of the method is displayed in a output text box.
I am not able to understand how to call a method when the user selects any value in LOV.
This is wht I did. I had created the binding for the method. Changed the autosubmit property of the LOV to True, and in the properties of the output box, in the partial submit trigger property, passed the ID of the LOV. But I didnt get any place where I need to call the method. I am also not able to drop an action listener on the LOVHi,
+"its showing an error(underlined in orange)."+
Any reason you don't share this error with us? Anyway, here is how it goes
1. LOV, set autosubmit="true" and configure a value change listener
2. Expose the AM method as a method binding in the PageDef file
3. In the value change listener:
BindingContext bctx = BindingContxt().getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
OperationBinding method = (OperationBinding) bindings.get("name of method binding in PageDef");
method.getParamsMap().put("argument name1", value1);
method.getParamsMap().put("argument name2", value2);
Object retVal = method.execute();
if(!method.getErrors().isEmpty()){
//handle errors
else{
//write retVal to the managed bean variable that is referenced by the outputText value property
//PPR output text component
ADFFacesContext.getCurrentInstance().addPartialTarget(outputTextRef);
}Note that you may have to set clientComponent = "true" on the output text component
Frank -
Need call a method of one iview from another iview
Hi,
There are 2 iviews in a component.
1) FirstView - contains abc() method & xyz() methods
2) SecondView (a popup) - asdf() method
i want to call abc() method from asdf() method. i.e. i want to call a method of the firstview from the secondview.
Note:
1) i couldn't able to copy the code of abc() method to component controller, as it has the code which uses (iview) local attributes (this can be done by context mapping) & main reason is from the method it calls the xyz() method of the same view (again i couldn't call a method of iview from component controller).
2) firstView contain 5 tabs, i want to be in the same tab from which secondview (popup) was called, if i use fire plugs between both view, the current tab will be chnaged (i suppose, not sure).
3) can we use event handlers, if yes how can we do that.
Please provide a better solution for calling a method of view from another view.
Thanks
Maha
Edited by: Maha Hussain on Jan 13, 2009 12:40 PMHi Maha,
It is better to have such methods in the component controller to make it reusable and avoid writing same code again and again.
You can have that method in component controller and call that method on click on a button from Iview1 and can pass the parameters in the mthgod only.
for example.
Say Method abc() which is currently in Iview1 and you are passing values from context say aa bb cc to the method now what i am suggesting is
have that method abc(String aa, String bb, String cc) ;
and call it on click on button in Iview1 and pass the required parameters.
Hope this will help
Regards
Narendra -
How to call a method in private section of a class in the public section
Hi Everybody,
i have written a method(meth1) in the private section of a class(C1).
it is as follows
class C1 definition.
private section.
methods: meth1 importing im_dt1 like tp1
im_dt2 like tp2
im_dt3 like tp3
im_dt4 like tp4
returning value(re_dt1) like tp5.
endclass.
i have the final data that has to be displayed in internal table re_dt1.
now my question is how to call this method present in private section into public section and display the data present in re_dt1.
Thanks,
learning.abap.Hi,
what you need is one public method being called at start-of-selection. Within this the private methods have to be called.
The question is, why has the method for reading the database tables to be private? If you have only one private method reading all database tables the public method being called at start-of-selection will only consist of a call-method statement.
This seems to be one call to much.
The logic for reading the different database tables is hidden inside the class anyway.
Is there any further logic reading the different database tables?
Have always all table to be read? If not another approach would be one private method for each database table being called by a public method deciding which table has to be read:
public section.
methods get_data returning value(re_Dt1).
private section.
methods:
get_table_a returning value(im_dt1),
get_table_b returning value(im_dt2),
get_table_c returning value(im_dt3),
get_table_d returning value(im_dt4),
combine_data importing im_dt1
im_dt2
im_dt3
im_dt4
returning value(re_dt1).
*- implementation of public method:
method get_data.
data: lt_dt1 ...
lt_dt2,
lt_dt3,
lt_dt4.
* here decide which tables have to be read:
lt_dt1 = get_table_a( ).
lt_dt2 = get_table_b( ).
lt_dt3 = get_table_c( ).
lt_dt4 = get_table_d( ).
re_dt1 = combine_data( i_dt1 = lt_dt1
i_dt2 = lt_dt2
i_dt3 = lt_dt3
i_dt4 = lt_dt4 ).
endmethod.
*- implementation of private methods
method get_table_a.
endmethod.
method get_table_b.
endmethod.
method get_table_c.
endmethod.
method get_table_d.
endmethod.
method combine_data.
endmethod.
Regards
Dirk
Maybe you are looking for
-
Unstable with last beta bios on z77 Mpower
hi all, I've just install the last beta bios, and i can't boot now with my last setting. pc was stable with it, now i've got problem. I run now with automatic OC but can run my ram @ 2600MHZ. In manual oc configuration, i can't run the base clock can
-
Why are changes in mail not synced or applied to other apple devices (iPhone 4S)?
If I delete an e-mail using mac's "mail", it would only make sense that that deleted e-mail shoud disappear if I manually log into my hotmail account using a web browser or check my e-mail using my iPhone 4S. Why is this thing not happening? Why is i
-
How do i restore a windows backup VHD?
I made a backup of a virtual machine running on Hyper-V. It's Windows Server 2008. The backup is a VHD. How do I do a full system restore on this? I've tried booting to a windows installation disc and doing a restore from a share, but that's resultin
-
Before posting a new topic about this, check the following link to see if it resolves your issue. http://www.adobe.com/support/techdocs/331596.html Thanks Shane Adobe Tech Support
-
HP Media smart won't stay open
I'm trying to upload video using HP Media Smart. When I click on the HP media smart icon the program opens and stays open for about two seconds and then closes itself. Several months ago I used it and it worked just fine. How can I get it to functio