Can we call the pure java variable into the struts action class?

Hi Everybody,
I have created the binary tree data structure in java,Could I use the value of the variable called value in the struts action class?,pls help me thro ur reply.I have attached the java code here.Thanks in Advance
package com.recipes.wizard.common;
public class BinaryTreeTest {
  public static void main(String[] args) {
    new BinaryTreeTest().run();
  static class Node {
    Node left;
    Node right;
    int value;
    public Node(int value) {
      this.value = value;
  public void run() {
    Node root = new Node(5);
    System.out.println("Binary Tree Example");
    System.out.println("Building tree with root value " + root.value);
    insert(root, 1);
    insert(root, 8);
    insert(root, 6);
    insert(root, 3);
    insert(root, 9);
  public void insert(Node node, int value) {
    if (value < node.value) {
      if (node.left != null) {
        insert(node.left, value);
      } else {
        System.out.println("  Inserted " + *value* + " to left of "
            + node.value);
        node.left = new Node(value);
    else if (value > node.value) {
      if (node.right != null) {
        insert(node.right, value);
      } else {
        System.out.println("  Inserted " + *value* + " to right of "
            + node.value);
        node.right = new Node(value);
      if(node.value==1)
           System.out.println("The value is one");
         int output=node.value;
           System.out.println(output);
}

Hi,
You can change the filter with the new cost element variable,Or you can assign the value of the new variable(if of same type)to old cost element ,but for that assignment again u have to change  planning function which you don't want.
Regards,
Indu

Similar Messages

  • HT5312 Forgot my security question that I made 5 years years ago, I can't call the apple people. Is there any way to reset it?

    I have forgotten my security questions. I can't call the apple people becuase my phone line is down for a while. If you anyone could have a way to reset it becuase I really want to buy stuff.

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address then see if the instructions on this user tip helps : https://discussions.apple.com/docs/DOC-4551

  • Can we call simple a java application from any one of this AS adapters

    Can we call a simple java application from any one of this AS adapters?
    Prakash
    Message was edited by:
    user629857

    You can achieve this using LiveCycle PDF Generator JAVA API. You can find required code here:
    Adobe LiveCycle * Quick Start (SOAP mode): Converting a Microsoft Word document to a PDF document using the Java API
    In parameters:
    //Set createPDF2 parameter values
    String adobePDFSettings = "Standard";
    String securitySettings = "No Security";
    String fileTypeSettings = "Standard OCR";
    "Standard OCR" file type setting will run OCR on input pdf. In the code, instead of doc file provide a pdf file. Resultant pdf will be searchable PDF i.e OCRed PDF.
    Feel feel to ask any further questions.

  • How can I call the jFreeChart to plot graph and get the result in Servlet?

    I want to use jFreeChart to plot time series graph, and then output the result in Servlet. How can I call the jFreeChart to plot graph and get back the result? Any source code for example? Thanks a lot!!

    Dave,
    ServletDemo1 and others were not in the distribution that I got (jfreechart-0.9.4). I found them under the premium demos somewhere in com/refinery/chart/demo/premium, but could not compile. They're complaining, among other things, about missing classes/packages com.refinery.date.SerialDate and com.refinery.ui. Am I using a wrong version of jfreechart?
    Thanks,
    -Alla
    There is a very simple servlet demo in the JFreeChart
    distribution:
    src/com/jrefinery/chart/demo/ServletDemo1.java
    This simply sends back an image to the browser.
    A second demo, which embeds the chart in an HTML page
    is:
    src/com/jrefinery/chart/demo/ServletDemo2.java
    src/com/jrefinery/chart/demo/ServletDemo2ChartGenerator
    java
    ...includes a time series chart as one of three
    options.
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    http://www.object-refinery.com/jfreechart/index.html

  • How can i call the Buttons which made in flash

    Sir
    i design some Flash buttons but it is save as .swf extension
    if i save as jpg or gif then animation not working as well as
    effects.
    sir
    how can i call the flash buttons in java plz guide me
    JButton mybutton=new JButton(how can i pass swf extension button);

    of course, anything's possible, but to do this means first getting a bridge from flash to javascript or com or something, and then a bridge from javascript to Java. So in short,
    It's not possible.

  • How many times can i call the start()

    Hi All:
    I would like to know how many time you can actually call the start(),
    cuz my app is doing some really strange things,
    here is a fragament of my code:
    private void spawnThreads()
    ListIterator it = _vWorker.listIterator();
    while ( it.hasNext() ) {
    ClientWorker client_worker = (ClientWorker) it.next();
    client_worker.start();
    ClientWorker is another Thread, and in the run() of the ClientWorker, I have
    public void run() {
    Runtime rt = Runtime.getRuntime();
         try {
         // Start the timer
         Process child = rt.exec(_fileName);
         // gobble any error or output streams
    StreamGobbler errorGobbler = new
    StreamGobbler(child.getErrorStream(), "ERROR");
    StreamGobbler outputGobbler = new
    StreamGobbler(child.getInputStream(), "OUTPUT");
    errorGobbler.start();
    outputGobbler.start();
    child.waitFor();
                                            } catch (IOException e) {
                   System.err.println("IOException starting process!");
              } catch (InterruptedException e) {
                   System.err.println("Interrupted waiting for process!");
    I have a couple of cmd files to execute, so This spawnThreads() will be called a couple of times,and the funny thing is , it will execute the first cmd files, and that is it, it won't execute the 2nd or the 3rd cmd files, it will start the thread, but then the run()won't actually gets invoked,,,so I am just wondering if anyone of you has encountered this problem, perhaps you could lend me some insight on this?
    thanks,

    Yes, you can run the start() of a Thread more than once,
    here is my Test App,
    public static void main(String[] args) throws Exception {
    Vector vec = new Vector();
    for (int i=0;i<4;i++){
    ClientThread ct = new ClientThread();
    vec.add(ct);
    ListIterator it = vec.listIterator();
    while(it.hasNext()){
    ClientThread ct = (ClientThread)it.next();
    ct.start();
    and as you have already guessed it the run() of ClientThread simply does system.out.println()
    and here is the output
    run started
    run started
    run started
    run started
    so..yeah..I don't really have any idea what is happening to my app and why it is not executing any cmd files after executing the very first cmd file

  • Can we call the window in runtime in SAP Scripts  ?

    Hi
    Can we call the window (without placing the window in the layout at design time) in runtime in SAP Scripts 
    Thank You

    Hello,
    Calling a window at runtime is not posible.
    Let me know what u want to do exactly.
    Regards

  • Can we call the procedure which contain commit  in trigger

    can we call the procedure which contain commit in trigger

    Well, what i've noticed from op's past post - whenever op post - he/she posts multiple short questions here. This may be indication of some sort of assignment or any kind of online exam's ...... :?)
    Regards.
    Satyaki De.

  • How can we call the method of used controller?

    Hi All,
       i created two WDA Applications.( like YWDA1,YWDA2 ) . i am using the component WDA2 in WDA 1.and displaying the one view of WDA2 as popup window in WDA1 on action of one of the input element in the view of WDA1 by using the method l_window_manager->create_window_for_cmp_usage
    I have a button on the view of WDA2 which has appear in the popup window...how can i call the method which has binded to that button....and where should i code that...and i need to assign selected value in the popup window to input elemetn of view  WDA1
    Please help me to resolve this....
    Regards,
    Ravi

    You can not directly call view's event handler from other component.
    create a method in component controller of the second component and in the button click call the component controller method. ( also make the method as interface so that you can call it from other components )
    Now, you can call the interfacecontroller's method
    DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI__VSTX_REBATE_REQ_WD .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_<comp usage name>( ).
      l_ref_INTERFACECONTROLLER->Save_Rr(
        STATUS = '01'                       " Zvstxrrstatus
    save_rr is the method of second component controller

  • Can we call the Human Task operations and the Rule Designer, etc. from outs

    Hi,
    I just had one of my customers ask me -
    Can we call the Human Task operations and the Rule Designer, etc. from outside the SOA Suite ??
    Since these are independent applications, and that they are based on Service Oriented Architecture, I should be able to call these services from outside Oracle SOA Suite (SCA) for reuse.
    In case you have any idea about the possibilities, could you share some real world examples / URLs please ?
    Thanks & Regards

    Hi Vaibhav,
    Yes, you are right. We are using Oracle SOA suite 11g.
    My question is, can these Web Services be directly accessed from, say a .NET application without using BPEL PM, or is using BPEL a must to invoke these services in Human Task operations, Rule Designer, etc ?
    Regards

  • Why tuxedo7.1 or Tuxedo6.5 can not call the service on Tuxedo8.0 server

    Why tuxedo7.1 or Tuxedo6.5 can not call the service on Tuxedo8.0 server.
    I wrote the Server Application with Tuxedo version 8.0.
    And used tuxedo71 WS client to call the service.
    The client application displayd tpinit fail.
    ULog told me "prv7.1 not allowed,use -t option on wsl".
    Is there any way to solve this problem?
    thanks!

    risen,
    Yes there is a way to solve this. As the error message suggests, use the -t
    option on your WSL server. Look at
    http://edocs.bea.com/tuxedo/tux80/atmi/secadm10.htm#1284650
    [ I know this documentation is astonishingly well hidden! ]
    Peter.
    risen wrote:
    Why tuxedo7.1 or Tuxedo6.5 can not call the service on Tuxedo8.0 server.
    I wrote the Server Application with Tuxedo version 8.0.
    And used tuxedo71 WS client to call the service.
    The client application displayd tpinit fail.
    ULog told me "prv7.1 not allowed,use -t option on wsl".
    Is there any way to solve this problem?
    thanks!

  • How can i call the certificate selection dialog box from source code?

    How can i call the certificate selection dialog box from source code?
    NB: Of course if i have more than one certificate in the Microsoft Keystore 'My'.
    Thank You in advance

    I found an example of the "TestStand UI Expression Control.ctl" and it works just the way I need it. (check the link)
    Proper use of "TestStand UI ExpressionEdit Control" in LabVIEW http://forums.ni.com/ni/board/message?board.id=330&requireLogin=False&thread.id=10609 
    The "Expression Browser Dialog Box Button" F(x) stays disable while editing the VI, however it become available when the VI is called from TestStand.
    Thank you,
    Hecuba
    Mfg. Test Engineer
    Certified LabVIEW Associate Developer

  • How can I call the create method in BO from Application Service

    Hello!
    When I create a Business Object, CAF generates some methods automatically.
    How can I call the create method in the BO from Application Service logic?
    When i call the method then the entityManager and the sessionContext is NULL.
    How can I initialize this?
    Can anybody help me?
    Thanks, Thomas

    If you are using CE 7.11...
    1) In the Application Services, add the BO as dependant object in dependencies tab.
    2) In the implemention, add the following codes to call create method of the BO:
    this.get<BO>.createMethod();
    julius

  • How can I Call the MainVI from its SubVI, and this happen recursively?

    Hi All,
    How can I Call the MainVI from its SubVI, and this happen recursively?
    Actually, LAbView 7.1 doesn't support recurssion?
    Plz help me out!

    Dear GerdW,
    Thanks a lot 2 all of u guys,for all the brilliant responses.
    Actually, my basic aim is to call the Main VI, containing a SubVI.....
    Now, I want to call my main VI from this SubVI...recursively!!!!!..but whenever I tried to put the MainVI in this SubVI..an error message pops out saying recursive calling is not possible.
    I also tried using "Call by reference" but tht also didn't worked...an d error is somewat like...VI is invalid..or type matching..or state matching error.
    Here, Im attaching the snapshot of the MainVI... Im calling the SUBvi from it... It is running GOOD n FINE...
    But prob arrives when I call the Main from the SUBvi, which looks like same as MainVI(with little differences).
    I hope, Im clear in my words n not being ambigous.
    Plz, correct me where ever  im wrong.
    Thank You.
    Mishra_RnD
    Attachments:
    ScrShot.JPG ‏272 KB

  • HT5312 Every time i try to buy something from the Itunes i cant because i most answer the security question but I don't remember my security question answer help plzzz, note: I can't call the apple support because I live in Saudi Arabi

    Every time i try to buy something from the AppStore  on my iPad or iPhone 4S i cant because i most answer the security question but I don't remember my security question answer, when I try to go change it from my Apple account he ask me the security questions agin and I don't know the answer help plzzz, note: I can't call the apple support because I live in Saudi Arabia

    If you don't see the 'send reset info' button on the page where you can change them then I assume that you don't have a rescue email address (which is not the same thing as an alternate email address) set up on your account. As you won't be able to add one until you can answer 2 of your questions, you will need to contact iTunes Support or Apple to get the questions reset. You could try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security

Maybe you are looking for