Results 1 to 3 of 3
  1. #1
    Praetor is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Passing information to a web java program via web Java Console

    Hello

    I was asked by my teacher to do a simple MVC program where the vision was not necessary. I made the model, and the program is working correctly (Junit testing says it so ;). However i need to test it. As it is a web app, I would have to make a webpage with buttons and such to send information to the program in order to simulate it. But that would be costly and unecessary.

    I am using System.Out.println to see how the program is doing with the simulations, and its Ok too. The thing is that i would like to send information into the program with this much ease. I tried using scanner and system.in but it does not work.

    All i got is this screen
    http://windows.fyicenter.com/ie_sun_java_console.jpg
    where the results of my program are being shown, but i cant insert anything into it.

    Any thoughts on that?

    Thanks

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: Passing information to a web java program via web Java Console

    I tried using scanner and system.in but it does not work
    Define 'didn't work'. What did you try? Post an SSCCE.

  3. #3
    Praetor is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: Passing information to a web java program via web Java Console

    Quote Originally Posted by doWhile View Post
    Define 'didn't work'. What did you try? Post an SSCCE.
    It doesnt work because the console uses keystrokes as shortcuts, as stated on the image.

    the project is at http://projetos.edugraf.ufsc.br/2011...cadora.dix.xml

    the last bit of the program, after
    System.out.println("Valor de carros locados eh: "
    + Arquivo.retornarValorAbsTipoVeiculosLocadosCliente (cl));

    which in runtime shows
    Valor de carros locados eh: 20000.00

    is

    Scanner s = new Scanner(System.in);
    String stringa = s.next();

    System.out.println(stringa);


    which would write back what you write in. but it doesnt ;(

Similar Threads

  1. Replies: 6
    Last Post: 10-02-2011, 05:55 PM
  2. main not passing information to created class
    By Teclis in forum New To Java
    Replies: 2
    Last Post: 04-19-2011, 08:58 PM
  3. Replies: 5
    Last Post: 02-05-2011, 02:52 PM
  4. Replies: 1
    Last Post: 08-22-2009, 01:15 AM
  5. Passing variable information between classes
    By zen_to_go in forum New To Java
    Replies: 1
    Last Post: 10-30-2007, 08:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •