Previous Topic Next topic Print topic


Run the JSP Application

Run the TemperatureConverterJsp application on JBoss 7.1.1.
  1. In the Project Explorer, right-click the TemperatureConverterPrj project; then select Run As > Run on Server from the context menu.
  2. On the Run On Server dialog box, be sure that JBoss AS 7.1 is selected; then click Finish.

    Eclipse generates an HTTP Status 404 message, indicating that it is unable to find the http://localhost:8080/TemperatureConverterPrj/ URL. This is expected because the application uses two different URLs to call the two conversion routines with arguments.

    Eclipse has a built-in browser window that opens when the server is started, but you can use any external browser to enter the URLs.

  3. In the Eclipse browser address field, enter the following to run the Fahrenheit to Celsius conversion:
    http://localhost:8080/TemperatureConverterPrj/RestApp1/getCelsius?fahrenheit=212

    Eclipse presents a .json file dialog box.

  4. Click Open to view the results of the method call.
  5. Repeat steps 3 and 4, substituting the following URL to test the Celsius to Fahrenheit conversion:
    http://localhost:8080/TemperatureConverterPrj/RestApp1/getFahrenheit?celsius=36.8
    Note: You can change the values of the fahrenheit and celsius arguments to see different results.
  6. To test in an external browser, open a browser of your choice; then enter each of the same URLs.

    Depending on your browser, the results are either returned in the browser or you are prompted to save the results to a text file.

Previous Topic Next topic Print topic