Exforsys

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects

Ads


Home arrow Reviews arrow WebSphere Tutorials

WebSphere V5.0 : Debugging - Scrapbook Page

Author : Exforsys Inc.     Published on: 1st Jun 2006

WebSphere V5.0 : Debugging - Scrapbook Page

In this tutorial you will learn about WebSphere V5.0 : Debugging - Scrapbook Page, Create and run code in Scrapbook Page, Scrapbook, Creating a Java Scrapbook Page, Inspecting the result of evaluating an expression, Displaying the result of evaluating an expression and Running an expression

Ads

Create and run code in Scrapbook Page

Scrapbook

The JDT contributes a scrapbook facility that can be used to experiment and evaluate Java expressions (such as code snippets). Java scrapbook errors are reported in the editor. Snippets are edited and evaluated in the Scrapbook page editor. In the editor you can select a code snippet, evaluate it, and display the result as a string or show the result object in the debugger's expressions view.

Creating a Java Scrapbook Page

The scrapbook allows Java expressions, to be run, inspected, and displayed, under the control of the debugger. Breakpoints and exceptions are active as in a regular debug session.

A VM is launched for each scrapbook page in which expressions are being evaluated. The first time an expression is evaluated in a scrapbook page after it is opened, a VM is launched. The VM for a page will remain active until the page is closed, terminated explicitly (in the debugger or via the Stop the Evaluation button in the editor toolbar), or when a System.exit() is evaluated.

1. From the workbench window, do one of the following:

  • From the drop-down menu on the Open The New Wizard button in the workbench toolbar, select Other. Then select Java on the left, and on the right, select Scrapbook Page. Then click Next.
  • Click the Open The New Wizard button; then in the left pane, select Java, and in the right pane, select Scrapbook Page. Then click Next.
  • From the menu bar in the Java Perspective, select File > New > Scrapbook Page.
  • From the menu bar in any non-Java Perspective, select File > New > Other. Then select Java on the left, and on the right, select Scrapbook Page. Then click Next.
  • Click the Create a Scrapbook Page button in the workbench toolbar. The New Java Scrapbook Page wizard opens.

2. In the Enter or select the folder field, type or click Browse to select the container for the new page.

3. In the File name field, type a name for the new page. The .jpage extension will be added automatically if you do not type it yourself.

File name

4. Click Finish when you are done. The new scrapbook page opens in an editor.

New Scrapbook Page

Inspecting the result of evaluating an expression

Inspecting shows the result of evaluating an expression in the Expressions view.

1. In the scrapbook page, either type an expression or highlight an existing expression to be inspected. For example: System.getProperties()

2. Either click the Inspect button in the toolbar or select Inspect from the selection's pop-up menu.

Inspect

3. The result of the inspection appears in the Expressions view, which opens if it is not already visible.

The result can be inspected like a variable in the debugger (for example, children of the result can be expanded).

Expressions

Displaying the result of evaluating an expression

Displaying shows the result of evaluating an expression in the scrapbook editor.

1.  In the scrapbook page, either type an expression or highlight an existing expression to be displayed. For example: System.getProperties()

2.  Either click the Display button in the toolbar or select Display from the selection's pop-up menu.

Display

3.  The result of the evaluation appears highlighted in the scrapbook editor.

The result displayed is either:

  • the value obtained by sending toString() to the result of the evaluation, or
  • when evaluating a primitive data type (e.g., an int), the result is the simple value of the result.

Evaluation results

For example:

Type and highlight new java.util.Date() in the editor, and click Display. A result such as (java.util.Date) Tue Jun 12 14:03:17 CDT 2001 appears in the editor.

As another example, type and highlight 3 + 4 in the editor, and press Display. The result (int) 7 is displayed in the editor.

Running an expression

Ads


Running an expression evaluates an expression but does not display a result.

If you select the expression to run and click the Run button in the toolbar, no result is displayed, the code is simply run.

For example, if you type and highlight System.out.println("Hello World"), and click the Run button, Hello World appears in the Console view, but no result is displayed in the scrapbook editor or the Expressions view.

Running an expression

_________________

Author: Mikalai Zaikin. Please Click Here to visit Authors site for any updates and changes to the study notes.



 
This tutorial is part of a WebSphere Tutorials tutorial series. Read it from the beginning and learn yourself.

WebSphere Tutorials

  1. WebSphere V5.0 : Building Expressions
  2. WebSphere V5.0 : Creating SQL statements
  3. WebSphere V5.0 : Applying DDL scripts to a remote database
  4. WebSphere V5.0 : Deploying to the database
  5. WebSphere V5.0 : Defining a table
  6. WebSphere V5.0 : Defining a database
  7. Working with Data in WebSphere
  8. WebSphere V5.0 : Debugging - JSP debugging
  9. WebSphere V5.0 : Debugging - Scrapbook Page
  10. WebSphere V5.0 : Debugging - View variables
  11. WebSphere V5.0 : Debugging - Step-through code
  12. WebSphere V5.0 : Debugging - Set breakpoints
  13. WebSphere V5.0 : Running Applications - Export J2EE applications
  14. WebSphere V5.0 : Running Applications - Run/operate server
  15. WebSphere V5.0 : Running Applications - Understand Session Manager
  16. WebSphere V5.0 : Running Applications - Configure data sources
  17. WebSphere V5.0 : Running Applications - Create server instance and server configuration
  18. WebSphere V5.0 : Web Development - Use Web Page Wizards
  19. WebSphere V5.0 : Web Development - Work with Web Application Deployment Descriptor
  20. WebSphere V5.0 : Web Development - Use content assist
  21. WebSphere V5.0 : Web Development - Use Page Designer to add and modify HTML and JSP content
  22. WebSphere V5.0 : Web Development - Understand classpath and module dependencies
  23. WebSphere V5.0 : Web Development - Create resources in appropriate J2EE locations
  24. WebSphere V5.0 : Web Development - Create a web project
  25. WebSphere V5.0 : Java Development - Use property dialogues
  26. WebSphere V5.0 : Java Development - Use hierarchy view
  27. WebSphere V5.0 : Java Development - Use task view
  28. WebSphere V5.0 : Java Development - Use search function
  29. WebSphere V5.0 : Java Development - Use content assist function and declarations
  30. WebSphere V5.0 : Java Development - Use refactoring features
  31. WebSphere V5.0 : Java Development - Use Outline View and Browsing View
  32. WebSphere V5.0 : Java Development - Create Java project, packages, classes, methods
  33. WebSphere V5.0 : Workbench Basics - Use the Help feature to aid in development activities
  34. WebSphere V5.0 : Workbench Basics - Import to and export from the workbench
  35. WebSphere V5.0 : Workbench Basics - Work with Perspectives
  36. WebSphere V5.0 : Workbench Basics - Set workbench preferences
  37. WebSphere V5.0 : Workbench Basics - Create J2EE projects
 

Comments