Passing data to a method

I would like to pass a string
String st = "word" [\code]
from a void method to another
code] void useful(String a) [\code]
What kind of statement shall I use in the first method?
Thanks for any help.                                                                                                                                                                                                                                                                                                                                                                                                                                           

Well, there is a "New to Java" forum.
But if you're asking questions on this level...you need an introduction to computer programming textbook. Every language is about the same with respect to your question.
Please don't feel discouraged from asking questions, but at this point it's going to be a lot slower to ask questions like that on forums than it would be just to work through a good introductory text.

Similar Messages

  • Calling a new browser window with WD Abap and passing data via POST

    Hi there,
    does anybody know whether passing data via POST method is possible when opening a new browser window from within a Web Dynpro Component? In my case I use method IF_WD_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW for opening a new browser window. Now I want to pass a big amount of data which is only possible via POST method. How can I achieve that or is it not considered inside the Web Dynpro Framework?
    Kind regards,
    Albert

    Hi Priya,
    can you please explain a little bit more what you mean? I didn't get it..
    Kind regards,
    Albert

  • Best method for passing data between nested components

    I have a fairly good sized Flex application (if it was
    stuffed all into one file--which it used to be--it would be about
    3-4k lines of code). I have since started breaking it up into
    components and abstracting logic to make it easier to write,
    manage, and develop.
    The biggest thing that I'm running into is figuring out a way
    to pass data between components. Now, I know how to write and use
    custom events, so that you dispatch events up the chain of
    components, but it seems like that only works one way (bottom-up).
    I also know how to make public variables/functions inside the
    component and then the caller can just assign that variable or call
    that function.
    Let's say that I have the following chain of components:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    What is the best way to pass data between A and D (in both
    directions)?
    If I use an event to pass from D to A, it seems as though I
    have to write event code in each of the components and do the
    bubbling up manually. What I'm really stuck on though, is how to
    get data from A to D.
    I have a remote object in Component A that goes out and gets
    some data from the server, and most all of the other components all
    rely on whatever was returned -- so what is the best way to be able
    to "share" data between all components? I don't want to have to
    pass a variable through B and C just so that D can get it, but I
    also don't want to make D go and request the information itself. B
    and C might not need the data, so it seems stupid to have to make
    it be aware of it.
    Any ideas? I hope that my explanation is clear enough...
    Thanks.
    -Jake

    Peter (or anyone else)...
    To take this example to the next (albeit parallel) level, how
    would you go about creating a class that will let you just
    capture/dispatch local data changes? Following along my original
    example (Components A-D),let's say that we have this component
    architecture:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    -- -- Component E
    -- -- Comonnent F
    How would we go about creating a dispatch scheme for getting
    data between Component C and E/F? Maybe in Component C the user
    picks a username from a combo box. That selection will drive some
    changes in Component E (like triggering a new screen to appear
    based on the user). There are no remote methods at play with this
    example, just a simple update of a username that's all contained
    within the Flex app.
    I tried mimicking the technique that we used for the
    RemoteObject methods, but things are a bit different this time
    around because we're not making a trip to the server. I just want
    to be able to register Component E to listen for an event that
    would indicate that some data has changed.
    Now, once again, I know that I can bubble that information up
    to A and then back down to E, but that's sloppy... There has to be
    a similar approach to broadcasting events across the entire
    application, right?
    Here's what I started to come up with so far:
    [Event(name="selectUsername", type="CustomEvent")]
    public class LocalData extends EventDispatcher
    private static var _self:LocalData;
    // Constructor
    public function LocalData() {
    // ?? does anything go here ??
    // Returns the singleton instance of this class.
    public static function getInstance():LocalData {
    if( _self == null ) {
    _self = new LocalData();
    return _self;
    // public method that can be called to dispatch the event.
    public static function selectUsername(userObj:Object):void {
    dispatchEvent(new CustomEvent(userObj, "selectUsername"));
    Then, in the component that wants to dispatch the event, we
    do this:
    LocalData.selectUsername([some object]);
    And in the component that wants to listen for the event:
    LocalData.getInstance().addEventListener("selectUsername",
    selectUsername_Result);
    public function selectUsername_Result(e:CustomEvent):void {
    // handle results here
    The problem with this is that when I go to compile it, it
    doesn't like my use of "dispatchEvent" inside that public static
    method. Tells me, "Call to possibly undefined method
    "dispatchEvent". Huh? Why would it be undefined?
    Does it make sense with where I'm going?
    Any help is greatly appreciated.
    Thanks!
    -Jacob

  • Pass current row data from table and pass it to a method in AM

    Hi All,
    I have a table with row selection enabled. Also for each row I have a select image which on selection should pass the data from one of the columns of the current row selected to a method in AM.
    Can anybody let me know on "How on selection of the image in any row, can I pass the column data to the method in AM?".
    Thanks,
    Vijay

    Hi,
    the most easiest and straight forward approach is
    - Ckick the "Binding" tab at the bottom of the Visual Editor
    - In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
    - point the iterator selection to the iterator used by the table
    - choose the column's attribute name from the list of attributes
    - Create a method on the ApplicatioNModule IMPL class (should take single argument)
    - expose it as a client interfaces so it shows in the Data Controls panel
    - In the "Binding" tab, create a method binding for this exposed method
    - point the method binding argument to #{bindings.column-attribute-name.inptValue}
    So whenever you need to pass the value on to the AM, you just call the method binding
    OperationBinding oper = (OperationBinding) bindings.get("name of method");
    oper.execute();
    Frank

  • How many method can pass data from Database to front-end(aspx)?

    How many method can pass data from Database to front-end(aspx)?
    By using ajax, I want show some data to aspx or html
    Here is one of these method,
    HTTP Handler(ashx):
    we can json data, use HTTP Handler pass data to front-end
    And can we do this by other method? Web API? or some fancy way?
    Thanks for any reply

    Hello TaiwanWei,
    Try forums.asp.net.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Passing Data to a Paint Method

    Total newbie here just learning the basics of Java on my own. Working a little application that will display a filled polygon which shows the correct heading of ship based on previously input Ship Heading, length and width. I have the application working fine to generate the 5 points, and then it will display correctly when I enter the points in the paint method by hand. Thing is I want to have the coords passed to the paint method. and am having some trouble doing this. All the examples I have seen show the points to be displayed already being declared in the paint method. Here is the Paint Method I have come up with based on examples I have seen. Still pretty new and trying to read through the APIs and other books, but haven't broken the code on understanding them.
    import java.awt.*;
    import javax.swing.*;
    public class DrawShip5
       public static void main(String[] a)
        JFrame f = new JFrame();
        f.setTitle("Ship Heading");
        f.setSize(700,700);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setContentPane(new DrawShip2());
        f.setVisible(true);
       static class DrawShip2 extends JComponent
           static public void paintData(int [] finalCoordsArray )
        int finalBowACoordX = finalCoordsArray[0];
        int finalBowACoordY = finalCoordsArray[1];
        int finalPortMidACoordX = finalCoordsArray[2];
        int finalPortMidACoordY = finalCoordsArray[3];
        int finalPortSternACoordX = finalCoordsArray[4];
        int finalPortSternACoordY = finalCoordsArray[5];
        int finalStarSternACoordX = finalCoordsArray[6]; 
        int finalStarSternACoordY = finalCoordsArray[7]; 
        int finalStarMidACoordX = finalCoordsArray[8];
        int finalStarMidACoordY = finalCoordsArray[9];       
        public void paint(Graphics g )
             // Am sure my problem lies in here
            int finalBowACoordX = paintData.finalBowACoordX;
            int finalBowACoordY = paintData.finalBowACoordY;
            int finalPortMidACoordX = paintData.finalPortMidACoordX;
            int finalPortMidACoordY = paintData.finalPortMidACoordY;
            int finalPortSternACoordX = paintData.finalPortSternACoordX;
            int finalPortSternACoordY = paintData.finalPortSternACoordY;
            int finalStarSternACoordX = paintData.finalStarSternACoordX; 
            int finalStarSternACoordY = paintData.finalStarSternACoordY; 
            int finalStarMidACoordX = paintData.finalStarMidACoordX;
            int finalStarMidACoordY = paintData.finalStarMidACoordY;    
             g.setColor(Color.black);
             g.drawLine(350, 0, 350, 700);
             g.drawLine(0, 350, 700, 350);
             g.setColor(Color.blue);
             Polygon shipPic = new Polygon();
             shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
             shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
             shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
             shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
             shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
             g.fillPolygon( shipPic );
    } Thanks for any help

    Looks like I was typing as Malcom was responding....where would I add that bit of code?
    import java.awt.*;
    import javax.swing.*;
    public class DrawShip5
       public static void main(String[] a)
        JFrame f = new JFrame();
        f.setTitle("Ship Heading");
        f.setSize(700,700);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setContentPane(new DrawShip2());
        f.setVisible(true);    
        // Place the code here? Get an error for the finalCoordsArray not recognized
       static class DrawShip2 extends JComponent
                private int finalBowACoordX;
             private int finalBowACoordY;
             private int finalPortMidACoordX;
             private int finalPortMidACoordY;
             private int finalPortSternACoordX;
             private int finalPortSternACoordY;
             private int finalStarSternACoordX; 
             private int finalStarSternACoordY; 
             private int finalStarMidACoordX;
             private int finalStarMidACoordY; 
              static public void setCoords(int [] finalCoordsArray)
                 int finalBowACoordX = finalCoordsArray[0];
                 int finalBowACoordY = finalCoordsArray[1];
                 int finalPortMidACoordX = finalCoordsArray[2];
                 int finalPortMidACoordY = finalCoordsArray[3];
                 int finalPortSternACoordX = finalCoordsArray[4];
                 int finalPortSternACoordY = finalCoordsArray[5];
                 int finalStarSternACoordX = finalCoordsArray[6]; 
                 int finalStarSternACoordY = finalCoordsArray[7]; 
                 int finalStarMidACoordX = finalCoordsArray[8];
                 int finalStarMidACoordY = finalCoordsArray[9];
              // Print final coords after array passed and parsed
                 System.out.println("Paint Final Bow Coords: (" + finalBowACoordX + ", " + finalBowACoordY + ")");
                 System.out.println("Paint Final Port Midship Coords: (" + finalPortMidACoordX + ", " + finalPortMidACoordY + ")");
                 System.out.println("Paint Final Port Stern Coords: (" + finalPortSternACoordX + ", " + finalPortSternACoordY + ")");
                 System.out.println("Paint Final Starboard Stern Coords: (" + finalStarSternACoordX + ", " + finalStarSternACoordY + ")");
                 System.out.println("Paint Final Starboard Midship Coords: (" + finalStarMidACoordX + ", " + finalStarMidACoordY + ")");
          public void paintComponent(Graphics g )
            g.setColor(Color.black);
             g.drawLine(350, 0, 350, 700);
             g.drawLine(0, 350, 700, 350);
             g.setColor(Color.blue);
             Polygon shipPic = new Polygon();
             shipPic.addPoint( finalBowACoordX, finalBowACoordY ); // Bow Coords
             shipPic.addPoint( finalPortMidACoordX, finalPortMidACoordY ); // Port Midship Coords
             shipPic.addPoint( finalPortSternACoordX, finalPortSternACoordY ); // Port Aft Coords
             shipPic.addPoint( finalStarSternACoordX, finalStarSternACoordY ); // Starboard Aft Coords
             shipPic.addPoint( finalStarMidACoordX, finalStarMidACoordY ); // Starboard Midship Coords
             g.fillPolygon( shipPic );
    }Tried placing that code in a few spots and got errors.
    Appreciate the help, These are my first attempts at actually getting away from a single method program. Am getting it ...slowly, but I am getting it.

  • What are the methods available for passing data between Labview 6.0 VI and another custom windows program

    The big picture is that I'm trying to use labview to interface to a DSP board.
    I already have a small windows application "app" which communicates with the dsp. Now I want Labview to grab data from the "app" and plot/analyze ... etc.
    I'm a novice at this 'interprocess communication stuff", what can I use to pass data back and forth between between the "app" and LV?
    use ActiveX, DMA, streams, etc.?
    In a crude sense I could just have the "app" write the data to a file and then have LV read the file. (can two applications read the file at the same time?), but
    this seems very slow and clumsy. I'd rather have a RAM based FIFO which both could access.
    Thanks!
    G
    Details:
    Pentium120 Windows 95 Host
    Spectrum TMSC30 DSP
    VC++6
    LV6

    It depends on what 'interprocess communication' your "app" program has available.
    I regulary use DDE to control a PLL App which controls our PLL via the LPT Port. This is only a write process, but works very easily. The read is equaly easy. You need to know the various "keywords" like service, topic and instruction which the "app" will respond to.
    Generaly I found ActieX to be more extensive, meaning its probably going to take longer and more steps to achive similar simple results.
    The file does not seem to be the best way.
    Hope that helps a bit.

  • Passing data b/w applet and apache server

    Hi all,
    I have an application that runs in the JApplet.I have to pass data b/w server and applet.The
    datas are brought from the server using php to the browser and passed to applet using param
    tags.
    1.Is it possible to set value for the param tag from applet?
    2.How to retrieve data from the param tag to the applet in the form of an array.
    In the getParameter it is required to specify the param name.
    Is it possible to retrieve data from param tag similar to that of getting data from command
    line arguments array.

    Hi all,
    I have an application that runs in the JApplet.I have
    to pass data b/w server and applet.The
    datas are brought from the server using php to the
    browser and passed to applet using param
    tags.
    1.Is it possible to set value for the param tag from
    applet?Why do you ever want to do it? It sounds like setting arguments passed to a program's main method from command line after the main method has been invoked. It is possible though to dynamically set any values for any applet params using php before the applet gets loaded to the browser window as you generate an html file on the server side.
    2.How to retrieve data from the param tag to the
    applet in the form of an array.
    In the getParameter it is required to specify the
    param name.
    Is it possible to retrieve data from param tag similar
    to that of getting data from command
    line arguments array.You can use some naming/numbering convention for your params. For example settings1, settings2 ... Then you can loop in your code retrieving the values like getParameter("settings" + i) checking to see that it is not null or empty.
    However, if you don't want to reload the applet (together with the page) just to get some new data from the server, you can establish a tcp/ip connection as elchaschab recommended.
    Cheers!

  • Passing data from one frame to another frame

    hello all, i am having a problem with passing data from one frame from another. I have a main frame when you click on connect button it display the second frame(class) that has 2 text fields and 2 buttons. When i click on connect it check if the data is correct. If the data is correct i want that frame to close and pass the data back to main frame. How can i do that.
    thank you

    hello all, i am having a problem with passing data
    from one frame from another. I have a main frame when
    you click on connect button it display the second
    frame(class) that has 2 text fields and 2 buttons.
    When i click on connect it check if the data is
    correct. If the data is correct i want that frame to
    close and pass the data back to main frame. How can
    i do that.
    thank you
    the original problem sounded like an ideal opportunity to use Modal Dialog. if you want one frame to display another to get user input then you need to stop the method in the main frame from executing until you recieve a valid input.
    you can use your own class and keep all of the components that you have in the connect frame but you would have to extend JDialog instead of JFrame.
    there is a way around it!
    if you must use JFrame for both, then you need to have access to the main frame in the connect frame, maybe pass the pointer to the constructor??
    anyway, when the connect frame is done with its duties, you have to use the pointer to call another method in the main frame that will continue the process. otherwise main frame doesn't know when connect frame is done and by that time, the method in main frame that instantiated the connect frame has long since died.
    also, it allows things to happen in the other window that you may not want to happen until the connect frame is done
    typically users of software start clicking around on things and you could have three or four connect frames going at the same time
    it's really best to use a Modal Dialog, it really can look just like a JFrame!!!!!!!!!!!!!!

  • Problem in passing data from 1 screen to another using BBP_DOC_CHANGE_BADI.

    Hi Experts,
    i am new to the SRM, i am facing problem in passing data from one screen to another.
    my requirement is that when we select one shopping cart and press the PROPOSE SOURCES OF SUPPLY button, we will fetch all the contracts that are attached to the shopping cart.
    we have implemented a BADI implementation of BBP_SOS_BADI (method BBP_SOS_CHECK) for passing some changed values to the contracts of the shopping cart into the popup screen that is displayed when we press PROPOSE SOURCES OF SUPPLY button and when we select any contract and press ASSIGN ONLY button in the popup screen the badi BBP_DOC_CHANGE_BADI is triggered.
    i have implemented another BADI implementation of BBP_DOC_CHANGE_BADI for fetching the selected contract and pass the values to another screen, but the problem is that when we select one contract and press the assign only button we are fetching the wrong contract number ( that is in the BADI method BB_SC_CHANGE parameter IT_ITEM we are fetching the wrong contract), if we again do the same procedure for the second time we are getting the correct contract.
    i am unable to understand why we are getting the wrong contract in the first time( that is we are getting contract other than the selected one).
    as per my understanding i think when we are passing data to the popup screen using BBP_DOC_CHANGE_BADI we are not updating the shopping cart with the changed data.
    can anyone tell me how we can update the SHOPPING CART with the changed contracts data, i have used BBP_PD_SC_UPDATE, BBP_PD_SC_SAVE and other shopping cart FM but nothing is happening.
    Thanks
    Tanveer

    Hello,
    What version of SRM are you on?  Have you check for OSS Notes?  I have had trouble with BBP_DOC_CHANGE_BADI but it was because of other issues.  The BADI works pretty well and it is called almost every time something happens to the shopping cart.
    I have noticed that sometimes that values are not changed til the second calling of the BADI.  I have yet understand why but I think it has to do with prompt processing. Usually, we train our requisitioners to click the 'Check'  button to flush things out.
    I don't know if I was helpful.... another thought.... could there be an error caught by BBP_DOC_CHECK_BADI that is preventing change in BBP_DOC_CHANGE_BADI?
    Regards, Dean.

  • Passing data from one bsp application to another

    Hi,
    I have few queries that most of you would have done in ur projects:
    1. I want to pass data from one bsp application to another:
    eg based upon selected row of table view which populates material no and descriprion to another application which open the entire material master data.
    Now, i have both the pages in diff bsp applications in place but unable to pass the selected material code to the second bsp application.
    Had it been two different pages of same application I was able to achieve it with set parameter()
    2. To stop the application from reprcessing the data:
    eg: Suppose I have a bsp page where user fill details of a customer and on submitinng the details a customer is created in background and the entire page is disabled by my code. Even now if the user press refresh (F5) button then another customer gets created in the background. So basically i want to avoid the reprocess of the onSubmit event
    Few lines of sample code would be very helpful.
    Best Regards,
    Saurabh Tripathi

    Hi,
    When I am writing the following code in appl1/page1:
            export abc from transactionID
            to data buffer lv_page_data.
            CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
              EXPORTING
                NAME                  = 'TRANSACTIONID'
                APPLICATION_NAME      = RUNTIME->application_name
                APPLICATION_NAMESPACE = RUNTIME->application_namespace
                USERNAME              = ls_name
                SESSION_ID            = runtime->session_id
                DATA_VALUE            = lv_page_data
                DATA_NAME             = 'lv_page_data'
    and following code in appl2/page2:
      CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE
        EXPORTING
          NAME                  = 'TRANSACTIONID'
          APPLICATION_NAME      = RUNTIME->application_name
          APPLICATION_NAMESPACE = RUNTIME->application_namespace
          USERNAME              = ls_name
          SESSION_ID            = runtime->session_id
          DATA_NAME             = 'lv_page_data'
        CHANGING
          DATA_VALUE            = lv_page_data
       IF lv_page_data IS NOT INITIAL.
         IMPORT abc to transactionid
           FROM data buffer lv_page_data.
       ENDIF.
    still the code doesn't work. Please explain and guide
    Best Regards,
    Saurabh Tripathi

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • Passing data from one screen to another(web-dynpro) in SRM sourcing cockpit

    HI Experts,
    i am facing problem in passing data from one web-dynpro screen and assigning the data it to another web-dynpro screen.
    my requirement is that when ever user selects a contract in PROPOSE SOURCES OF SUPPLY screen popup and press only assign only button, the data of the contract should be copied to the shopping cart.
    i have already used the BADI BBP_DOC_CHANGE_BADI, but unfortunately it was not working.
    so i tried to use the context, element and other web-dynpro fields to pass the data, i am able to pass the data from the popup to the second screen and able to assign it.
    but when ever i deselect the shoppping cart which has been assigned with the data of the popup and select another shopping cart the data of the above shopping cart is cgetting changed.
    i am unable to figure out the exact reason why this is happeing.i have written code in the ASSIGN ONLY button method to fetch the popup data and in the WDONMODIFYVIEW method of the second screen to assign the popup data to the shopping cart.
    i have tried to bind the elements using the BIND_TABLE, BIND_STRUCTURE, BIND_ELEMENT, BIND_ELEMENTS methods, but nothing is working.
    can anyone suggest me where i am making mistake and try to solve the issue.
    Thanks
    Tanveer

    Dear Poster
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Jason Boggans
    SAP SRM SDN Moderator

  • How to specify a date in a method signature

    How do I specify a date as a method parameter of a bean that will be used to generate
    a SOAP service? If I specify java.util.Date, I get NullPointerExceptions, perhaps
    because the internal structure of Date is not compatible with SOAP supported types.

    Hi,
    There are few simple ways for date validation as follow,
    1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
    For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
    If in case the format miss-matched then it will create the exception.
    You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
    2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
    CONVERT_DATE_FORMAT
    ISU_DATE_FORMAT_CHECK
    Thanks
    Swarup

  • How to send recomposed data in post method.

    Currently, i try to build up MVC user authentication. I used login.html as View, servletA as controller to invoked Model and servletB as Model. The servletB will return queried result to servletA then servletA will decide redirected to specific url.
    I has successful use the RequestDispatcher.forward(request, response) to post data from servletA to servletB. whereas i faced a trouble to post data back from servletB to servletA, which i unable put the queried result into request obj before post it back to servletA.
    Any genius recommendation about this? or Any method composed data to send via post method?

    Here's a quick rundown that might help:
    Use request.setAttribute() to put an item in request scope in a servlet before dispatching to another servlet or JSP.
    Use <useBean> tag in a JSP to read the data on the JSP that the servlet put in request scope.
    Alternatively, you can use request.getAttribute(), but the useBean is preferred.
    Use request.getParameter() in a servlet to read data that the <form> tag on the JSP page put in request scope.
    Use request.setAttribute() and request.getAttribute() to get send/get data between servlets (it could be request.getParameter(), but I dont think so).
    There is a RequestDispatcher.forward() and a RequestDispatcher.include(). I'm not sure what the differences are (you'll have to research it.
    In MVC, I have a single servlet for the controller (receive all url's, and dispatch to the appropriate JSP). I dont hava a separate servlet for the model. Instead, I instansiate a business object on the servlet, pass data to it, and let it do the calcuations. Then I have it return the data to the servlet which puts it in request scope for the JSP page when I dispatch to it. My MVC usuallyconsists of:
    JSP -presentation layer
    servlet - control layer
    business logic layer
    database layer (DAO).
    Each layer does not contain the functionality of one of the other layers (clean separation of concerns).
    Last note: Whereas you can use a servlet for the controller, a framework such as Spring or Struts is often used instead.

Maybe you are looking for

  • How to manage files in ipad

    How can we manage files in ipad?

  • Unity Connection 8.5.1 ES 16 web admin account recovery

    Hello, I have a client with a Unity Connection 8.5.1 ES16 version and they lost access to the Unity Admin web page. I tried the steps to recover the password but it is failing, and the account doesn't seem to exist anymore.. I did a SQL query I found

  • Failed to retrieve file via FileDescriptor URL

    Hi, I'm trying to retrieve and display image file uploaded to FilePublisher example provided in the SDK using FileDescriptor url property. It doesn't seem to work - How can I actually retrieve the file uploaded in AFCS for further processing (instead

  • Printer stopped working after upgrade

    After the last upgrade yesterday I try to print and I get this message: Waiting for printer to become available... but no printing. what do I need to do to get the printer working again? And the HP Device Manager no longer works. Do I reinstall hplip

  • I've moved house but maps continues to use old address

    Having moved house my iMac and iPads continue to show old address as 'current location' in Maps