Kathy OConnell

Greenhorn
+ Follow
since Dec 03, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kathy OConnell

We have written an application that prints to a windows printer (LPT1). The code for the print method is below. It is written in java 1.3.
When running on a windows 2000 machine, if the printer is offline (eg not connected, run out of paper etc) then a message is displayed - eg "device is not connected". However, when running on a Windows 98 machine, no message comes back when the printer is offline. The machine just locks up and has to be turned off before anything can happen.
Is there a way I can capture the fact that the printer is not available and handle it in my program?
Any help would be greatly appreciated!
Thanks
public void printDocket(ReceivalDocketEditAnchor anchor) throws ApplicationException {

try {
FileOutputStream fos = new FileOutputStream(ConfigurationManager.getValue("printer.windows.portname"));
PrintStream ps = new PrintStream(fos);
ps.flush();

DocketObject docketData = new DocketObject(anchor);
ps.print(docketData.createDocket());
ps.write((byte)0xC);
ps.flush();
ps.close();
} catch (Exception e)
{
System.out.println("Exception occurred during printing: " + e);
e.printStackTrace();
}
return;
}
15 years ago
Does anyone know if you can access an ADABAS Database from Websphere using jdbc?
15 years ago
I am fairly new to EJBs
Is it possible to use EJBs to retrieve data from a database (eg db2) when you don't have the primary key. From what I can see, to create a remote interface you always need to have the primary key.
I want to access the database using a non-primary key and return 2 or more results that the session bean can handle and manipulate. Is it possible to do this and if so, could you tell me how.
I would really appreciate some help here
Thanks
Kathy
Hiya
I am looking for a good freeware java embedded database.
The main requirements are:
- able to access large quantities of data at reasonable speed
- reliable
The ones I am looking at are:
- Instant DB
- PointBase
- HSQL
- First SQL
- Hypersonic SQL
- McKoi SQL
- QED
- Smyle
- Tiny SQL
- Informix Cloudscape
- JGrinder
- StoredObjects
I would appreciate any comments on any of these.
Thanks
Kathy
Thanks for that - its working now
Kathy
15 years ago
I am tryign to use classes from a Web Project in my EJB project. When I try to do an import on the package I require, I get an error message: "the import .... cannot be resolved".

I have included the Web Project in my Build Path for the EJB project. I have tried placing this in different positions in the order, but to no avail.
I am working on WSAD 4.02
Am I missing something?
I would really appreciate some help here
Thanks
Kathy
15 years ago
Hi
Thanks for the corrections on questions 25 and 50. I agree with both of them.
25 : Ans = b (page). On this Usebean question, I was looking in the wrong area in Online help. I found the correct answer in the JSP1.2 Spec Section JSP.4.1.
50: Ans = d. On this executing operation on a .sql file question, I tried the process out and found d to be the correct answer.
I am very happy to be corrected on my answers and then I will learn from my mistakes. If you find any other wrong answers, I would really appreciate if you would let me know
Thanks
Kathy
Thanks Glenn and Paolo for those answers - it really helps with studying.
Here are a couple of other answers I have found which I am fairly confident of:
25.When using the Insert Bean option to insert a < jsp:useBean > tag in order to declare a JavaBean from within Application Developer Page Designer, the default value of the Scope attribute is “(Default)”. This default value represents:
a)request
b)page
c)session
d)application
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a
Source:Online help
Scope field specifies the lifetime of the Bean. This attribute is optional and the default value is request. The valid values are:
request: The Bean is set as a context in the request by a servlet that invokes the JSP file. If the Bean is not present, it is created and stored in the request context unless the create attribute is set to no.
session: If the Bean is present in the current session, the Bean is reused. If the Bean is not present, it is created and stored as part of the session if the create attribute is set to yes.
50.The execute operation on a .sql file in Application Developer allows a developer to apply a DDL script to which of the following entities?
a)A remote database
b)A local database
c)Imported tables within Application Developer
d)A database or schema model within Application Developer
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:c
Source:Online help
To apply an SQL DDL script, follow these steps:
1.Switch to the Data Perspective's Data view.
2.Locate the SQL DDL script you want to apply. If the script is not showing up in the Data view, check your preferences to make sure it is not being filtered out.
3.From the script's pop-up menu, click Execute.
4.Select the database or schema that you want to apply the script to.
5.Click Finish.
The statements in the script are applied to your local database model.

Please let me know if you disagree with any of my answers and any other answers you come up with
Kathy
I would be interested to know how the real 157 exam compares to the sample exam. Any study tips would be greatly appreciated too.
Here are the questions and answers

1. A web developer wants to ensure that HTML and JSP files contain no spelling errors. The web components are being developed in a language other than the default Application Developer installation. How would the developer configure Application Developer to use the correct language?
a) Use the Web Tools- >Dictionary option of the “Preferences” dialog to select the “Language” used in the files.
b) Use the Workbench- >Dictionary option of the “Preferences” dialog to select the appropriate “Dictionary” file for the language used in the files.
c) Set the “Dictionary” option in the “Properties” dialog of the Web project.
d) The correct dictionary language is automatically selected from the Operating System’s “Locale” setting.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a ?
b:There is no Workbench->Dictionary option of the “Preferences” dialog
c:There is no Properties dialog – just a Properties view.
2. A developer who is just beginning to use Application Developer wants to learn how to use the tool to develop and test servlets. What is the BEST help view to use for retrieving this information?
a) Tasks view
b) By feature view
c) J2EE View
d) Search view
e) By type view
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b
Help has 3 views –
“By type view” (organizes the online help into cross-component development scenarios)
“By feature view” (organizes the online help by component)
“Search View” (allows searching on key words)
3. A web developer wants to work with multiple Application Developer workspaces. The developer would like to start Application Developer by dragging a selected workspace folder on to the Application Developer desktop icon. How should the properties of the desktop shortcut be configured to support this behavior?
a) Configure the “Start in” entry to the folder containing the workspace.
b) Replace the default contents of the “Target” to point to the root directory containing the workspaces for your projects.
c) Add the “-data” parameter to the end of the default “Target” properties.
d) Associate the “.WAD” file extension with the wsappdev.exe executable file.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a

4. When Action Sets are added to a perspective from the Perspective - > Customize menu item, they may be visible as:
a) Workbench level menu items
b) Workbench level toolbar buttons
c) View specific menu items
d) Editor specific toolbar buttons
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:b, a??
Each perspective includes a predefined set of actions that are accessible from the menu bar and workbench toolbar.
There are 4 Custom sets you can adjust by going to Perspective->Customize. These are:
New Wizards; Perspectives; Views; Other. Other is the icons at the top.
The first three (New Wizards, Perspectives, Views) control which actions appear in as top level items in their respective menus. The last category (Other) controls which action sets are visible in the perspective.

eg in Perspectives, if you have J2EE and Data ticked, when you select Perspectives choice, only J2EE and Data will show up. There is also an “Other” choice where all the perspectives may be chosen from (inc J2EE and Data).
These 4 Custom sets will have different choices ticked depending on the perspective you are in.
5. Which of the following views BEST supports understanding the structure of an Enterprise Application?
a) Navigator
b) Package
c) J2EE
d) Data
e) Application
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a (I think, otherwise c – a bit subjective!!)
6. A developer needs to deploy the web pages from a Web project to a local web server (not to an application server). The BEST way to deploy these files directly to the web server is to:
a) configure the web server in the Server perspective, associate the Web project with the server instance, then publish to the server
b) use the WAR Export utility to export the Web project to the web server
c) use the FTP Export utility to export the webApplication folder to the web server
d) use the File system Export utility to export the webApplication folder to the web server
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a? or b?
b:A Web archive (WAR) file is a packaged Web application that can be exported to test, publish, nd deploy the resources developed within a Web project.
c:You can export a Web project to a URL using the Export resources to an FTP Server wizard.
d:You can use the export wizard to export from the workbench to the file system.
7. A web application is stress tested and found to have very poor performance when persistent sessions are enabled. The MOST likely cause of this behavior is:
a) having many direct references stored in the HttpSession
b) mapping an HttpSession to a single database row
c) disabling the session cache
d) having large object graphs stored in the HttpSession
Single Select - Please select the best answer (one and only one choice must be selected).

8. A web application with extensive connectivity to back-end relational data is performing very poorly. Which of the following application architecture changes will MOST likely lead to the best throughput improvement?
a) Use JDBC 2.0 DataSource(s) to access connection pooling services from the web container.
b) Use EJBs instead of JDBC to access the relational data.
c) Use more distinct servlets to control access to the relational data
d) Use fewer distinct servlets to control access to relational data.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a?
a:As defined in the Sun JDBC 2.0 Standard Extension specification, data source objects allow you to manage a pool of connections to a database. Using connection pools provide you with the following advantages:
 It improves performance. Creating connections is expensive; a data source object creates a connection as soon as it is instantiated.
9. If a JavaBean contains a particular user’s information and will be used by multiple servlets and JSPs, under which context should the JavaBean be placed?
a) Application
b) Page
c) Session
d) Request
e) Response
Single Select - Please select the best answer (one and only one choice must be selected).

10. After completing a Java search to find the occurrences of the constructor of a given class, several matches are listed in the Search view. Possible ways to view where the constructor is being used are:
a) Use the Show Previous Match and Show Next Match buttons on the Search View toolbar.
b) Use the Show Previous and Show Next buttons on the Workbench toolbar.
c) Open the file to the method listed in the Location column.
d) Right-click on a match and select Go To File.
e) Double-click on the match.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
Ans:a, d, e

11. After opening the Type Hierarchy of the LoginServlet, which extends SimpleServlet(which extends HttpServlet), the doPost() method is selected. The best way to determine whether the LoginServlet’s doPost() overrides any of the superclasses’ doPost() methods is for the developer to click:
a) Show Inherited Members
b) Show Overridden Methods
c) Show Supertype Hierarchy
d) Lock View and Show Members in Hierarchy
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:c, d
To reach this, you go to Perpective>show view>Java Packages. Then, click on class you want to look at hierarchy of and context>Open Type Hierarchy.
By pressing button for “Show Supertype Hierarchy” (on top frame) and pressing button for “Lock View and Show Members in Hierarchy” (on bottom frame), and clicking on a particular method, you can see if a method such as doPost() is being overridden.
There are 2 frames for this view. The top one shows the hierarchys. The bottom one shows the methods and (fields??) of the class being highlighted in the top frame.
The options from the Type Hierarchy view are:
Top Pane
 “Show the Type Hierarchy” which displays the hierarchy of a class, right back to Object. This includes both superclasses and subclasses. This just shows classes.
 “Show Supertype Hierarchy” which displays the hierarchy of a class and its superclases, right back to Object. This shows both classes and interfaces
 “Show Subrtype Hierarchy” which displays the hierarchy of a class which is a subtype of the class clicked on. This shows both classes and interfaces
Bottom (Method) Pane
 “Lock View and Show Members in Hierarchy” which allows you to see different views in the top pane.
 When “Show the Type Hierarchy” is pressed in top pane, the top view now shows all the classes implementing the selected method or field.
 When “Show the Supertype Hierarchy” is pressed in top pane, the top view now displays the places where this method is overridden.
12. While creating the following simple Java class, which of the following constructs COULD content assist complete successfully?
public class ClassA {
boolean variable = false;
public void setCompleted(){
variable = true;
}
public boolean isCompleted() {
return variable;
}
}
a) public, void, true, false, variable
b) public, void, boolean, true, false
c) class, variable, return
d) boolean, void, variable
e) class, true, false, return
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:d
yes:booleanvariablevoid
no:classfalsepublicreturntrue
Content Assist is a service provided by WSAD for helping to code. When Content Assist is called upon, it offers a list of possibilities that you may use. eg if you use Content Assist on boolean, it will bring up a number of possibilities eg Boolean – java.lang; BooleanControl etc. If you like, you can choose from one of these.
There are 3 ways to call on Content Assist – cntl spacebar; context>content assist; edit>content assist.
Note:Make sure you have the cursor at the end of the word you are checking on
13. When editing the Properties dialog of a Java project, the purpose of setting the “Build output folder” field on the Source page of the Java Build Path section is to specify the:
a) default folder into which JAR files for that project will be exported
b) default folder into which an entire Java project will be exported
c) folder where the class files are placed when Java source code is compiled
d) where resources specified in the build path are kept within the tool before deployment
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:c
c:Java Settings Page: At the bottom of this page, the Build output folder field allows you to type or browse to select a folder where the compilation output for this project will reside. The default for this field is the new project.
14. How is the priority of a Task set?
a) Double-click a Task to launch the Tasks Property dialog and choose the priority from the “Priority” dropdown list.
b) Right-click a Task and select Properties to launch the Tasks Property dialog and choose the priority from the “Priority” dropdown list.
c) Right-click a Task and select Set Priority and then High, Normal, or Low.
d) Click the “!” column of a Task and select High, Normal, or Low from the dropdown list.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:d
There are 3 types of Tasks:Task (like a to do list)
Error
Warning
Information
aouble clicking an error task brings you to the place where the error resides. Double clicking your own task does nothing.
b& c:Right clicking a task gives a drop down box with 3 options – new task; delete; delete completed tasks
d:The ! stands for priority, and clicking this brings up a choice of High, Normal, or Low from the dropdown list.
The columns are:
Type:Task (like a to do list); Error; Warning; Information
Completed:Only for Tasks.
Priority:The priorities (& symbol) are: High:exclamation mark (!)
Normal: no symbol
Low:downward arrow
Only for Tasks
Description:
Resource:This column contains the name of the resource with which the task is associated. For global tasks, this column is blank

In Folder:This column indicates the folding containing the resource with which the task is associated. For global tasks, this column is blank
Location:This column indicates the line number in the associated file where the task marker is located, if there is an associated file.
15. Due to strict coding standards imposed by a corporate standards book, import statements must be organized in a particular order. The MOST efficient way to do this would be to:
a) Use Organize Imports from the context menu, then reorder them in the Outline view. Application Developer “remembers” your ordering preferences as you set them.
b) Use Organize Imports from the context menu, after altering the order of the package types on the Order tab of the Project’s Java Build Path.
c) Use Organize Imports from the context menu, after altering the order of the package types in the Window - > Preferences - > Java - > Organize Imports.
d) Use Format from the context menu, after altering the order of the package types on the Order tab of the Project’s Java Build Path.
e) Use Format from the context menu, after altering the order of the package types in the Window - > Preferences - > Java - > Code Formatter.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:c
a:From the editor, by choosing “Organize Imports” from the context menu will do the organising for you – not allowing you to then reorder them in the Outline view.
b:Java Build Path is the classpath, not the imports. (This is reached by -click the project and select Properties > Java Build Path where you reach 4 tabs – Source, Projects, Libraries, Order)
d& e: Format organizes the code (brackets, line spacing etc). This is set up in Window - > Preferences - > Java - > Code Formatter
16. Refactoring a class in the Outline view allows a developer to:
a) rename the class
b) rename the class and change the package it is in
c) change the package it is in and edit its import statements
d) change it from a public class to a private class and visa versa
Single Select - Please select the best answer (one and only one choice must be selected).
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b
c:you do not edit the import statements, they are automatically updated
d:Refactoring is nothing to do with privacy of methods
Refactoring means behavior-preserving program transformations
ElementAvailable Refactoring Commands
PackageRenameUpdates all import statements of any affected compilation units
Compilation unitRename Renaming a compilation unit will also rename (and update all references to) the top-level type that has the same name as the compilation unit. For example, renaming a compilation unit A.java in which a class A is declared will also rename class A and update all references to it.
Compilation unitMove to another packageYou can move a compilation unit to a different package. Imports and references are automatically updated.
TypeRename Interface, Class, or Field : You can rename an interface, class, or field by modifying its declaration in the compilation unit in which it is declared. You can also update all references to the class, field, or interface.
MethodRename Renaming a method declared in an interface will also rename (and update all references to) all methods that are abstract and non-abstract implementations of that method. All such methods in all subclasses of the interface in which the method is declared will be renamed.
 When renaming a non-static method declared as public, package visible, or protected, all methods overriding it will also be renamed and all references to them updated.
 Renaming a static method or a private method will update references only to that method, since it cannot be overridden.
 You can rename a method by modifying its declaration in the compilation unit in which it is declared. You can also update all references to the method.
MethodRename parametersYou can rename the parameters of a method by renaming the parameter's declaration as well as all references to the parameters inside the method body. Use the Rename Parameters command to rename the parameters of a method as well as all references to these parameters. On the refactoring parameters page, you can click in the New Parameter Names column on the row containing the parameter you want to change and type a new name for the parameter.
17. Which of the following CAN be hidden from view in the Outline view of the Java perspective?
a) Private methods
b) Public fields
c) Public methods
d) Import Statements
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a, b.
You can hide non public methods, fields and static methods from the Outline view of the Java perspecitive.

18. After successfully searching for a reference to a method, the file containing the method is opened in a Java editor. There are errors in the method. In most situations, in order to determine the nature of the errors without switching from the Search view to the Tasks view, the developer could:
a) Hover over an Error icon.
b) Double-click on an Error icon.
c) Right-click on an Error icon and select Show Error.
d) Place the cursor in the line above an error and click the Go to Next Problem button on the toolbar. The error will be highlighted and hovering over it will give you the description.
e) Place the cursor in the line above an error and click the Go to Next Problem button on the toolbar. The error will be highlighted and the description will display in red in the status bar at the bottom.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a, e (maybe d??)

19. The ONLY types of methods that can be “automatically generated” through the context menu or wizards within the Java perspective are:
a) Public methods
b) Private methods
c) “main” methods
d) Getters and setters
e) Inherited abstract methods
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
Ans:c, d, e

20. When creating a Java Project, resources that can be added to the build path via the Libraries tab are:
a) Projects
b) Folders
c) Packages
d) JAR files
e) Classpath Variables
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
Ans:b, d, e
Libraries Tab:On this page, you can add libraries to the build path. You can add:
 Workbench-managed (i.e., internal) JAR files
 External (i.e., file system) JAR files
 Folders containing CLASS files
All three kinds of libraries can also be added indirectly as classpath variables (on the Libraries tab).

21. A web developer creates a Web Project, and a Java Project as a Utility Project. During the early development stages when the code in both projects change frequently, what actions are necessary in order to make the Utility Project available to the Web Project in both the development and testing stages?
a) Select the Utility Project as a required project in Web Project properties.
b) Add the Utility Project into the classpath in the server instance configuration.
c) Modify the web.xml to include the utility project.
d) Modify the associated Enterprise Application Project to include the Utility Project as a module.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a? & c?
What is a Utility Project? Is this just the name of the project, or an actual project type??

22. While developing a web application, it is required that certain portions of a dynamic web page (a JSP) should be displayed only to persons with a certain role (for example, manager). Which of the following is the BEST way of implementing this requirement?
a) Write simple scriptlets that perform a check before displaying the section
<% if(userRole.equals(“manager” )
{ %>
Total Sales = <%=salesNum%>
<% } %>
b) Use tag libraries to perform the check
<x:checkAccess role=”manager”>
Total Sales = <%=salesNum%>
</x:checkAccess>
c) Perform the verification in the controller and redirect accordingly
if(userRole.equals(“manager” )
{
// Forward to JSP A
}
else
{
// Forward to JSP B
}
d) Create a small helper JSP that can be included in any JSP using jsp:include
<jsp:include
<jsp:include page=”checkAccessPage.jsp”/>
e) Create a role called manager and configure access to the JSP using the Security features of the web.xml file
Single Select - Please select the best answer (one and only one choice must be selected).
23. Warning messages are added to the Tasks view while editing a web.xml file using the web.xml editor in Application Developer. This happens when the developer specifies:
a) A non-existent file in the < welcome-file-list >
b) A non-existent file in the < error-page >
c) A non-existent class in the < servlet-class > element
d) An invalid value for the < error-code > element
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:c & ?
web.xml is located in the web folder>webApplication>WEB-INF.
a:When a non-existent file is in the < welcome-file-list >, this does not produce a warning message
b:Could not find < error-page >
d:Could not find < error-code > element

24. When adding a JAR file to a Web Project’s manifest classpath via the Edit Module Dependencies context menu, which of the following statements are TRUE?
a) The dependent JAR file must be in the Web Project’s associated Enterprise Application Project.
b) The dependent JAR file must be in the Web Project.
c) The dependent JAR file is included in EAR file.
d) A Java Project can be directly added as a dependency module.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a?, c

25. When using the Insert Bean option to insert a < jsp:useBean > tag in order to declare a JavaBean from within Application Developer Page Designer, the default value of the Scope attribute is “(Default)”. This default value represents:
a) request
b) page
c) session
d) application
Single Select - Please select the best answer (one and only one choice must be selected).

26. A developer wants to import image files to an enterprise application from an external file system. All the image files will be deployed to a J2EE application server. In Application Developer, where should the developer create the folder to hold the image files?
a) Under the root folder of the Web Project
b) Under the root folder of the Enterprise Application Project
c) Under the root folder of the Java Project
d) Under the webApplication folder in the Web Project
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:d
There are 2 folders under the Web Project –
source:classes, beans and servlets
webApplication:contents of the WAR file that will be deployed to the server. It contains all the Web resources, including HTML files, JSP files, and graphics needed for the application. Any files not under webApplication are considered development resources (for example .java and .sql files) and will not be deployed when the project is unit tested or published.

27. After entering Load Orders of 2,4 and 6 for three servlets using the web.xml editor, a developer observes that these values are not reflected in the web.xml file. A possible reason for this behavior is that:
a) The servlet classes could not be found.
b) The Load-On-Startup checkbox was not selected.
c) The web.xml file is marked read-only.
d) The numbering for the load orders is incorrect.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b
Initialization: Specifies the initialization parameters of the servlet. The Load on startup option specifies that the servlet or JSP file will be loaded when the Web application is started. If a JSP file is specified with the Load on startup parameter, then the JSP will be precompiled and loaded. The optional Load order option is a positive integer that indicates the order that the servlet should be loaded in the case that more than one servlet should be loaded on startup. Lower-numbered servlets are loaded before higher-numbered servlets. Add or delete initialization parameters as name/value pairs. To update parameters and values, type in the table cells.
28. In Application Developer, a web developer uses the Page Designer Heading Editor tool to change the:
a) heading level only
b) heading text only
c) heading level and heading text
d) heading into another paragraph style
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a
To use this, have the design tab of the html/jsp etc set on and press Tools>Heading Editor. This shows up all the headings and you can change the levels using the >> or << buttons.

29. While writing a scriptlet in a JSP, a web developer realizes that the same scriptlet is likely to be used frequently in other JSPs. The scriptlet contains many lines and is included inline in the JSPs. In this situation, a developer can leverage the Content Assist features of Application Developer by:
a) customizing the JSP scriptlet macro
b) using the Quick-Copy Feature to duplicate the scriptlet
c) creating a new macro with the required content
d) adding it to the Favorites Page in the Tasks View.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
30. Which file or property must be modified in order to create (or add) a new Java source file folder associated with a Web project?
a) application.xml
b) web.xml
c) Web Project properties
d) Web Project classpath
Single Select - Please select the best answer (one and only one choice must be selected).

31. Which of the following directory structures reflects the structure of a newly created Web project when the “Create CSS File” checkbox was checked?
a) webApplication/source /webApplication/classes /webApplication/lib /webApplication/css
b) /source /webApplication/WEB-INF/classes /webApplication/WEB-INF/lib /webApplication/theme
c) source /webApplication/WEB-INF/classes /webApplication/WEB-INF/lib /webApplication/css
d) webApplication/source /webApplication/WEB-INF/classes /webApplication/lib /webApplication/WEB-INF/theme
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b
32. If a Web Project references a JAR file that is located outside of Application Developer, which of the following actions will make the JAR file available to both the Web Project during development and the application server during testing?
a) Add this JAR file as an external JAR in Web Project properties.
b) Add a classpath variable pointing to the JAR file.
c) Import the JAR file into Application Developer workbench as a Java Project.
d) Import the JAR file into the Web Project webApplication/WEB-INF/lib folder.
e) Import the JAR file into an associated Enterprise Application Project.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b?
33. Which of the following patterns of Java classes are created as a result of using the Create Database Web Pages Wizard?
a) Front Controller - Class that invokes calls on the model, and displays an appropriate view
b) View Helper - wrapper Classes that provide more control over how data is displayed
c) Factory - Classes that create the necessary JavaBeans given the type
d) Singleton - Class for which only a single instance exists and provides access to the database
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a, b
When using the Create Database Web Pages Wizard, you reach the Specify Front Controller and View Bean Choices page. Here you have the option of including or removed processing layers from the model used to generate Web pages. View Beans are wrappers that allow you to have more control over how data is displayed when it is rendered in generated Web pages. If you deselect this option, the wizard accesses data using the underlying connection beans directly.
34. It is required that the content listing for a directory on the web server can never be viewed through the browser. It is also required that whenever a requested file is not found, a generic error page (called error.jsp) be displayed to the user.
Which of the following actions must the web developer perform to fulfill these requirements?
a) Set the directoryBrowsingEnabled attribute to false in the ibm-web-ext.xmi file.
b) Set the fileServingEnabled attribute to false in the ibm-web-ext.xmi file.
c) Add the following entry to the web.xml file
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
d) Add the following entry to the web.xml
<error-page>
<exception-type>java.io.FileNotFoundException</exception-type>
<location>/error.jsp</location>
</error-page>
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
35. A WebSphere Remote Server instance and configuration were created using the appropriate information about the remote WebSphere Application Server. During the creation process the FTP file transfer mechanism was selected. What is the sequence of steps that would successfully start the remote server from Application Developer?
a) Start the Agent Controller on the remote machine, start the FTP server on the remote machine, and start the remote server instance from Application Developer.
b) Start the Agent Controller on the remote machine, start the FTP server on the local machine, and start the remote server instance from Application Developer.
c) Start the FTP server on the local machine, start the remote server instance from Application Developer, and start the Agent Controller on the remote machine.
d) Start the FTP server on the local machine, start the Agent Controller on the local machine, and start the remote server instance from Application Developer.
Single Select - Please select the best answer (one and only one choice must be selected).
36. Which of the following are Server preferences in the Workbench that can be turned on or off?
a) Run on Server action starts the server in debug mode.
b) Switch to the Server perspective when a server starts.
c) Save all open resources before starting servers.
d) Automatically publish before starting servers.
e) Only publish modified resources to the server.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
Ans:a, b, d
The other 3 preferences are:
- Switch to the Server perspective during Run on Server action
- Keep publishing dialog open after publishing
- Automatically restart servers where necessary
37. What is the purpose of defining a classpath variable?
a) To add libraries to the Workspace
b) To provide an easy method of adding the locations of JAR files to a project’s Java Build Path
c) define configuration information about the classpath such as order and preference
d) To use individual classes as libraries that are not packaged in JAR files
Single Select - Please select the best answer (one and only one choice must be selected).
38. Which of the following are ways to export an EAR file?
a) Right-click an Enterprise Application in the Navigator view on ANY perspective and select Export EAR File.
b) Right-click an Enterprise Application associated with a specific server through the Server Configuration view and select Export EAR File.
c) Select File - > Export - > Ear File and choose the Enterprise Application from the dropdown list of enterprise applications.
d) Enterprise Application in the J2EE view and click the Export EAR File button from the toolbar.
e) click an Enterprise Application in the Repository view and select Export EAR File.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:a, c
39. While debugging a JSP, which of the following statements is TRUE about variable and stack information?
a) No variable or stack trace information is available.
b) Variable and stack trace information correspond to the generated HTML stream.
c) Variable and stack trace information correspond to generated Java servlet.
d) Variable and stack trace information correspond to the JSP source.
Single Select - Please select the best answer (one and only one choice must be selected).
40. During a local debugging session, a developer makes changes to an application and the test environment. Which of the following will require a restart of the WebSphere Application Server?
a) Modifying the servlet to use a different Data Source object
b) Modifying the JNDI name of the Data Source object used for connection pooling
c) Modifying the usebean tag in a JSP to use a different Java class
d) Changing Session Tracking from URL Rewrite to Cookies
e) Changing the mechanism for storing user information from the HttpSession object to the database
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
41. While stepping over a method call, a breakpoint is encountered and the debugger suspends execution. The following information about the current thread is displayed in the Debug view:
Thread [main] (Suspended)
---> ArrayIndexOutOfBoundsException.() line: 35
---> Stepping.testMethod() line: 11
---> Stepping.main(String[]) line: 4
What caused the breakpoint to trigger?
a) A Java exception breakpoint was set for “java.lang.ArrayIndexOutOfBoundsException” with the “Caught” option selected.
b) A Java exception breakpoint was set for “java.lang.ArrayIndexOutOfBoundsException” with the “Uncaught” option selected.
c) A method entry breakpoint was added to “java.lang.ArrayIndexOutOfBoundsException”
d) A line entry breakpoint was added to “java.lang.ArrayIndexOutOfBoundsException”
Single Select - Please select the best answer (one and only one choice must be selected).
42. Execution is suspended at a method entry breakpoint to which a hit count has been applied. In this situation, a developer can:
a) Modify existing breakpoints in the Display view.
b) Examine the stack trace in the Log view.
c) Examine variable values from past iterations.
d) Re-enable the method entry breakpoint.
Single Select - Please select the best answer (one and only one choice must be selected).
43. A developer starts the test server in debug mode. In which cases will the Debugger be automatically triggered?
a) A “System.out.println” statement is executed.
b) A statement with a breakpoint is reached.
c) The program requires user input.
d) The program terminates without any runtime errors.
Single Select - Please select the best answer (one and only one choice must be selected).
44. When using Application Developer as a remote debugging client, which of the following statements accurately reflect the debugging configuration?
a) The debugger is run on the remote machine.
b) The program is run on the local machine
c) Program control is done from the local machine.
d) Internal program behavior is observed from the local machine.
e) The debugger daemon runs on the local machine.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).

45. The New Java Scrapbook Page wizard prompts the user to specify:
a) an existing Server Project
b) an existing Java or Web Project
c) a filename
d) dependent projects
e) the name of the Test Server
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:b, c
You can only create a scrapbook page in a Java or Web project (EJB or Web)

46. A web application uses a customized logging class to perform status tracing. Tracing can be turned on or off using this class. This class uses “System.out.println” statements to output status messages. While the web application is running under Application Developer’s WebSphere Test Environment, where would these status messages be logged?
a) .log
b) stderr.txt
c) trace.log
d) stdout.txt
e) LogingUtil.log
Single Select - Please select the best answer (one and only one choice must be selected).
47. The principal use of the Object References view of the Profiler in Application Developer is to determine:
a) possible problems with concurrency
b) possible problems with memory leaks
c) the calling sequence between classes and methods
d) the timing relationships between classes and methods
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:b
To display information, the Object References view requires profiling data that contains object reference information. The Object Reference view depicts references to or from a set of objects. This is useful for locating objects that still have references to them, which might explain why garbage collection cannot occur for those objects. This view also enables you to study data structures, and find memory leaks.

48. When applying Profiling Filters, which of the following are TRUE?
a) Default filters take precedence over an individual profiling agent’s filter settings.
b) An individual profiling agent’s filter settings take precedence over the Default filters.
c) To include a subset of classes, you must first specify the subset to be included, and only then specify the larger set to be excluded.
d) To include a subset of classes, you must first specify the larger set to be included, and only then specify the subset set to be excluded.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).

49. A developer is attempting to collect performance data from an Enterprise Application that is running on a remote Application Server. What steps are required in order to properly setup the environment so this task can be performed?
a) Run Application Developer on the local machine.
b) Run Application Developer on the remote machine.
c) Run the IBM Agent Controller on the local machine.
d) Run the IBM Agent Controller on the remote machine.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
50. The execute operation on a .sql file in Application Developer allows a developer to apply a DDL script to which of the following entities?
a) A remote database
b) A local database
c) Imported tables within Application Developer
d) A database or schema model within Application Developer
Single Select - Please select the best answer (one and only one choice must be selected).

51. Filters can be applied to a data connection for what purpose?
a) Restricting tables included in the generated data model
b) Restricting the data that is returned by any SQL statement executed against the connection
c) Setting limits on the maximum result set size returned via the connection
d) Setting limits on the number of concurrent queries that can be executed against the connection
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:a
You can apply filters to exclude schemas and tables from a connection, or exclude databases, schemas and tables from your view of the Data perspective.
You can apply filters to a connection when you create it, and you can apply filters to your view in the Data perspective preferences.
52. Which of the following artifacts can be generated by the SQL to XML wizard against a SQL select statement?
a) XML
b) HTML
c) XML Schema
d) JSP
e) XSL
f) XSD
Multiple Select - Please select all of the correct answers (this question has 4 correct choices).

Ans:a, b, e, f
When you are satisfied with your statement, you can use the SQL to XML wizard to create an XML document as well as XSL, DTD, XSD, HTML files, and other related artifacts, then use the files to implement your query in other applications, for example, a servlet or JSP.
53. How can a developer who has set up multiple repositories in Application Developer ensure that, prior to synchronizing with the Stream, the correct Stream will be used?
a) Select Team-- >Show in Resource History to display Stream information for the selected project.
b) Select the Team page of the associated Project Properties, and change the stream if necessary.
c) Select the Team page of the associated Resource Properties, and change the stream if necessary.
d) Highlight the appropriate Stream in the Repositories pane just prior to starting the synchronization.
Single Select - Please select the best answer (one and only one choice must be selected).
54. The primary purpose of performing a “Catch up” operation with the Stream is to:
a) load new resources from the local file system into the workspace
b) obtain versioned resources from the Stream
c) add changes from the Workspace to the Stream
d) obtain changes that others have made to the resources
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:d
A Steam is a snapshot of the current state of all of the elements in a project. Project files stored in a stream can be shared (updated/copied) by all team members as the project evolves.
A Version is a immutable snapshot of a Stream. Once versioned, a project can only be accessed in read-only mode. In Application Developer, both Projects and can be versioned.
Catch up is the transfer from Stream to Project.
While you are working in the workbench, others may be releasing changes to the stream. To update the resources in your workbench, you may "catch up" with the stream.
55. A developer finds no available versions when attempting to perform a Compare With - > Local History on a project file. What are the likely causes?
a) The date when file was last saved was before the number of days specified to maintain local history in the Local History Preferences.
b) The file has been edited more times than the maximum number specified in the Workbench Local History Preferences.
c) The maximum file size specified in the Workbench Local History Preferences has been exceeded.
d) A connection to the repository associated with the file’s project cannot be established.
e) The file has been Synchronized with the Stream, and no subsequent saved changes have occurred.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
Ans:a, b, c
 From the workbench, select the Window > Preferences menu item.
 In the preferences dialog, expand the Workbench category and select the Local History page in the left pane.
 In the Days To Keep Files field, type the number of days that you want to keep change records for any one workbench resource.
For example, if you type 7, then a history of saved states from the last seven days will be kept.
 In the Entries Per File field, type the number of states to keep for any one workbench resource.
Note: When you exceed the number of entries per file, the oldest changes are discarded to make room for the newer changes.
 In the Maximum File Size (MB) field, type the maximum file size (in MB) of a resource for which a local history should be kept. If the size of the resource exceeds the maximum amount of file size allocated, no local history is kept for that resource.

56. A developer is ready to release code changes related to a new feature for the next product release. The current Stream contents have not yet been versioned, and bug fixes are still needed. Which of the following are necessary to avoid pollution of the development Stream?
a) Before releasing new changes, perform a Catch up operation with the current Stream.
b) Release to a new Stream.
c) Perform a three-way compare and merge the changes in the workspace; then Release to the Stream.
d) Version the Stream contents, then Release to the Stream.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
Ans:b? & d?

57. At which level may workspace resources be explicitly versioned?
a) file
b) folder
c) project
d) workspace
e) any level
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:c
Resources other than projects (i.e. files and folders) cannot be explicitly versioned. However during synchronization these types of resources are implicitly versioned when they are released to the stream.
I had problems working through the online help to enable the Show Version Info... ??

58. Team members are using different drive letters or directories for their Application Developer installations. In this situation, what is the MOST effective method of referring to external JAR files in the Build Path?
a) Move the JAR files to a specific location agreed to by the team.
b) Add the location to the Project References for each project using the JAR files.
c) Keep the JAR files in the repository and refer to them there.
d) Create a classpath variable containing the location of the Workspace, and use the variable when specifying the path to the JAR files.
Single Select - Please select the best answer (one and only one choice must be selected).
Ans:d
A workbench external JAR does not have to be imported to the workbench and can simply be referenced in the file system. However, the resulting build class path cannot be easily shared with a team, since it contains the absolute path to the JAR file. In order to avoid this problem, you can use a classpath variable instead of an absolute path to an JAR file outside the workbench. Classpath variables are stored global to your workbench.
I have been going through the 157 Sample exam and have answered about two thirds of questions.
Below are all the questions and the answers to the ones I have answered. On most of the questions I have answered, I have put some explanation (mainly copied from online help)
If anyone can help me with the ones I haven't answered, or the ones I am not sure of (marked with a ?), then I would really appreciate your help, especially if an explanation is also included.
Thanks
Matthew, could you tell us how close the real exam was to the sample exam?
Thanks for those replies - it will be great to be able to have people to discuss questions and answers with.
I agree that the product help and actually using the product is the best source of information for answering the questions.
Matthew, it would be great if you could post your writeup of 157 study materials/strategies.

I have copied all the questions from the sample exam below.
Sample Exam 157 Questions
1. A web developer wants to ensure that HTML and JSP files contain no spelling errors. The web components are being developed in a language other than the default Application Developer installation. How would the developer configure Application Developer to use the correct language?
a) Use the Web Tools- >Dictionary option of the “Preferences” dialog to select the “Language” used in the files.
b) Use the Workbench- >Dictionary option of the “Preferences” dialog to select the appropriate “Dictionary” file for the language used in the files.
c) Set the “Dictionary” option in the “Properties” dialog of the Web project.
d) The correct dictionary language is automatically selected from the Operating System’s “Locale” setting.
Single Select - Please select the best answer (one and only one choice must be selected).

2. A developer who is just beginning to use Application Developer wants to learn how to use the tool to develop and test servlets. What is the BEST help view to use for retrieving this information?
a) Tasks view
b) By feature view
c) J2EE View
d) Search view
e) By type view
Single Select - Please select the best answer (one and only one choice must be selected).
3. A web developer wants to work with multiple Application Developer workspaces. The developer would like to start Application Developer by dragging a selected workspace folder on to the Application Developer desktop icon. How should the properties of the desktop shortcut be configured to support this behavior?
a) Configure the “Start in” entry to the folder containing the workspace.
b) Replace the default contents of the “Target” to point to the root directory containing the workspaces for your projects.
c) Add the “-data” parameter to the end of the default “Target” properties.
d) Associate the “.WAD” file extension with the wsappdev.exe executable file.
Single Select - Please select the best answer (one and only one choice must be selected).
4. When Action Sets are added to a perspective from the Perspective - > Customize menu item, they may be visible as:
a) Workbench level menu items
b) Workbench level toolbar buttons
c) View specific menu items
d) Editor specific toolbar buttons
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).

5. Which of the following views BEST supports understanding the structure of an Enterprise Application?
a) Navigator
b) Package
c) J2EE
d) Data
e) Application
Single Select - Please select the best answer (one and only one choice must be selected).
6. A developer needs to deploy the web pages from a Web project to a local web server (not to an application server). The BEST way to deploy these files directly to the web server is to:
a) configure the web server in the Server perspective, associate the Web project with the server instance, then publish to the server
b) use the WAR Export utility to export the Web project to the web server
c) use the FTP Export utility to export the webApplication folder to the web server
d) use the File system Export utility to export the webApplication folder to the web server
Single Select - Please select the best answer (one and only one choice must be selected).
7. A web application is stress tested and found to have very poor performance when persistent sessions are enabled. The MOST likely cause of this behavior is:
a) having many direct references stored in the HttpSession
b) mapping an HttpSession to a single database row
c) disabling the session cache
d) having large object graphs stored in the HttpSession
Single Select - Please select the best answer (one and only one choice must be selected).
8. A web application with extensive connectivity to back-end relational data is performing very poorly. Which of the following application architecture changes will MOST likely lead to the best throughput improvement?
a) Use JDBC 2.0 DataSource(s) to access connection pooling services from the web container.
b) Use EJBs instead of JDBC to access the relational data.
c) Use more distinct servlets to control access to the relational data
d) Use fewer distinct servlets to control access to relational data.
Single Select - Please select the best answer (one and only one choice must be selected).
9. If a JavaBean contains a particular user’s information and will be used by multiple servlets and JSPs, under which context should the JavaBean be placed?
a) Application
b) Page
c) Session
d) Request
e) Response
Single Select - Please select the best answer (one and only one choice must be selected).
10. After completing a Java search to find the occurrences of the constructor of a given class, several matches are listed in the Search view. Possible ways to view where the constructor is being used are:
a) Use the Show Previous Match and Show Next Match buttons on the Search View toolbar.
b) Use the Show Previous and Show Next buttons on the Workbench toolbar.
c) Open the file to the method listed in the Location column.
d) Right-click on a match and select Go To File.
e) Double-click on the match.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
11. After opening the Type Hierarchy of the LoginServlet, which extends SimpleServlet(which extends HttpServlet), the doPost() method is selected. The best way to determine whether the LoginServlet’s doPost() overrides any of the superclasses’ doPost() methods is for the developer to click:
a) Show Inherited Members
b) Show Overridden Methods
c) Show Supertype Hierarchy
d) Lock View and Show Members in Hierarchy
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
12. While creating the following simple Java class, which of the following constructs COULD content assist complete successfully?
public class ClassA {
boolean variable = false;
public void setCompleted(){
variable = true;
}
public boolean isCompleted() {
return variable;
}
}
a) public, void, true, false, variable
b) public, void, boolean, true, false
c) class, variable, return
d) boolean, void, variable
e) class, true, false, return
Single Select - Please select the best answer (one and only one choice must be selected).
13. When editing the Properties dialog of a Java project, the purpose of setting the “Build output folder” field on the Source page of the Java Build Path section is to specify the:
a) default folder into which JAR files for that project will be exported
b) default folder into which an entire Java project will be exported
c) folder where the class files are placed when Java source code is compiled
d) where resources specified in the build path are kept within the tool before deployment
Single Select - Please select the best answer (one and only one choice must be selected).
14. How is the priority of a Task set?
a) Double-click a Task to launch the Tasks Property dialog and choose the priority from the “Priority” dropdown list.
b) Right-click a Task and select Properties to launch the Tasks Property dialog and choose the priority from the “Priority” dropdown list.
c) Right-click a Task and select Set Priority and then High, Normal, or Low.
d) Click the “!” column of a Task and select High, Normal, or Low from the dropdown list.
Single Select - Please select the best answer (one and only one choice must be selected).
15. Due to strict coding standards imposed by a corporate standards book, import statements must be organized in a particular order. The MOST efficient way to do this would be to:
a) Use Organize Imports from the context menu, then reorder them in the Outline view. Application Developer “remembers” your ordering preferences as you set them.
b) Use Organize Imports from the context menu, after altering the order of the package types on the Order tab of the Project’s Java Build Path.
c) Use Organize Imports from the context menu, after altering the order of the package types in the Window - > Preferences - > Java - > Organize Imports.
d) Use Format from the context menu, after altering the order of the package types on the Order tab of the Project’s Java Build Path.
e) Use Format from the context menu, after altering the order of the package types in the Window - > Preferences - > Java - > Code Formatter.
Single Select - Please select the best answer (one and only one choice must be selected).
16. Refactoring a class in the Outline view allows a developer to:
a) rename the class
b) rename the class and change the package it is in
c) change the package it is in and edit its import statements
d) change it from a public class to a private class and visa versa
Single Select - Please select the best answer (one and only one choice must be selected).
17. Which of the following CAN be hidden from view in the Outline view of the Java perspective?
a) Private methods
b) Public fields
c) Public methods
d) Import Statements
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
18. After successfully searching for a reference to a method, the file containing the method is opened in a Java editor. There are errors in the method. In most situations, in order to determine the nature of the errors without switching from the Search view to the Tasks view, the developer could:
a) Hover over an Error icon.
b) Double-click on an Error icon.
c) Right-click on an Error icon and select Show Error.
d) Place the cursor in the line above an error and click the Go to Next Problem button on the toolbar. The error will be highlighted and hovering over it will give you the description.
e) Place the cursor in the line above an error and click the Go to Next Problem button on the toolbar. The error will be highlighted and the description will display in red in the status bar at the bottom.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).

19. The ONLY types of methods that can be “automatically generated” through the context menu or wizards within the Java perspective are:
a) Public methods
b) Private methods
c) “main” methods
d) Getters and setters
e) Inherited abstract methods
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).

20. When creating a Java Project, resources that can be added to the build path via the Libraries tab are:
a) Projects
b) Folders
c) Packages
d) JAR files
e) Classpath Variables
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).

21. A web developer creates a Web Project, and a Java Project as a Utility Project. During the early development stages when the code in both projects change frequently, what actions are necessary in order to make the Utility Project available to the Web Project in both the development and testing stages?
a) Select the Utility Project as a required project in Web Project properties.
b) Add the Utility Project into the classpath in the server instance configuration.
c) Modify the web.xml to include the utility project.
d) Modify the associated Enterprise Application Project to include the Utility Project as a module.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
22. While developing a web application, it is required that certain portions of a dynamic web page (a JSP) should be displayed only to persons with a certain role (for example, manager). Which of the following is the BEST way of implementing this requirement?
a) Write simple scriptlets that perform a check before displaying the section
<% if(userRole.equals(“manager” )
{ %>
Total Sales = <%=salesNum%>
<% } %>
b) Use tag libraries to perform the check
<x:checkAccess role=”manager”>
Total Sales = <%=salesNum%>
</x:checkAccess>
c) Perform the verification in the controller and redirect accordingly
if(userRole.equals(“manager” )
{
// Forward to JSP A
}
else
{
// Forward to JSP B
}
d) Create a small helper JSP that can be included in any JSP using jsp:include
<jsp:include
<jsp:include page=”checkAccessPage.jsp”/>
e) Create a role called manager and configure access to the JSP using the Security features of the web.xml file
Single Select - Please select the best answer (one and only one choice must be selected).
23. Warning messages are added to the Tasks view while editing a web.xml file using the web.xml editor in Application Developer. This happens when the developer specifies:
a) A non-existent file in the < welcome-file-list >
b) A non-existent file in the < error-page >
c) A non-existent class in the < servlet-class > element
d) An invalid value for the < error-code > element
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
24. When adding a JAR file to a Web Project’s manifest classpath via the Edit Module Dependencies context menu, which of the following statements are TRUE?
a) The dependent JAR file must be in the Web Project’s associated Enterprise Application Project.
b) The dependent JAR file must be in the Web Project.
c) The dependent JAR file is included in EAR file.
d) A Java Project can be directly added as a dependency module.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
25. When using the Insert Bean option to insert a < jsp:useBean > tag in order to declare a JavaBean from within Application Developer Page Designer, the default value of the Scope attribute is “(Default)”. This default value represents:
a) request
b) page
c) session
d) application
Single Select - Please select the best answer (one and only one choice must be selected).
26. A developer wants to import image files to an enterprise application from an external file system. All the image files will be deployed to a J2EE application server. In Application Developer, where should the developer create the folder to hold the image files?
a) Under the root folder of the Web Project
b) Under the root folder of the Enterprise Application Project
c) Under the root folder of the Java Project
d) Under the webApplication folder in the Web Project
Single Select - Please select the best answer (one and only one choice must be selected).
27. After entering Load Orders of 2,4 and 6 for three servlets using the web.xml editor, a developer observes that these values are not reflected in the web.xml file. A possible reason for this behavior is that:
a) The servlet classes could not be found.
b) The Load-On-Startup checkbox was not selected.
c) The web.xml file is marked read-only.
d) The numbering for the load orders is incorrect.
Single Select - Please select the best answer (one and only one choice must be selected).
28. In Application Developer, a web developer uses the Page Designer Heading Editor tool to change the:
a) heading level only
b) heading text only
c) heading level and heading text
d) heading into another paragraph style
Single Select - Please select the best answer (one and only one choice must be selected).
29. While writing a scriptlet in a JSP, a web developer realizes that the same scriptlet is likely to be used frequently in other JSPs. The scriptlet contains many lines and is included inline in the JSPs. In this situation, a developer can leverage the Content Assist features of Application Developer by:
a) customizing the JSP scriptlet macro
b) using the Quick-Copy Feature to duplicate the scriptlet
c) creating a new macro with the required content
d) adding it to the Favorites Page in the Tasks View.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
30. Which file or property must be modified in order to create (or add) a new Java source file folder associated with a Web project?
a) application.xml
b) web.xml
c) Web Project properties
d) Web Project classpath
Single Select - Please select the best answer (one and only one choice must be selected).
31. Which of the following directory structures reflects the structure of a newly created Web project when the “Create CSS File” checkbox was checked?
a) webApplication/source /webApplication/classes /webApplication/lib /webApplication/css
b) /source /webApplication/WEB-INF/classes /webApplication/WEB-INF/lib /webApplication/theme
c) source /webApplication/WEB-INF/classes /webApplication/WEB-INF/lib /webApplication/css
d) webApplication/source /webApplication/WEB-INF/classes /webApplication/lib /webApplication/WEB-INF/theme
Single Select - Please select the best answer (one and only one choice must be selected).
32. If a Web Project references a JAR file that is located outside of Application Developer, which of the following actions will make the JAR file available to both the Web Project during development and the application server during testing?
a) Add this JAR file as an external JAR in Web Project properties.
b) Add a classpath variable pointing to the JAR file.
c) Import the JAR file into Application Developer workbench as a Java Project.
d) Import the JAR file into the Web Project webApplication/WEB-INF/lib folder.
e) Import the JAR file into an associated Enterprise Application Project.
Single Select - Please select the best answer (one and only one choice must be selected).
33. Which of the following patterns of Java classes are created as a result of using the Create Database Web Pages Wizard?
a) Front Controller - Class that invokes calls on the model, and displays an appropriate view
b) View Helper - wrapper Classes that provide more control over how data is displayed
c) Factory - Classes that create the necessary JavaBeans given the type
d) Singleton - Class for which only a single instance exists and provides access to the database
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
34. It is required that the content listing for a directory on the web server can never be viewed through the browser. It is also required that whenever a requested file is not found, a generic error page (called error.jsp) be displayed to the user.
Which of the following actions must the web developer perform to fulfill these requirements?
a) Set the directoryBrowsingEnabled attribute to false in the ibm-web-ext.xmi file.
b) Set the fileServingEnabled attribute to false in the ibm-web-ext.xmi file.
c) Add the following entry to the web.xml file
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
d) Add the following entry to the web.xml
<error-page>
<exception-type>java.io.FileNotFoundException</exception-type>
<location>/error.jsp</location>
</error-page>
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
35. A WebSphere Remote Server instance and configuration were created using the appropriate information about the remote WebSphere Application Server. During the creation process the FTP file transfer mechanism was selected. What is the sequence of steps that would successfully start the remote server from Application Developer?
a) Start the Agent Controller on the remote machine, start the FTP server on the remote machine, and start the remote server instance from Application Developer.
b) Start the Agent Controller on the remote machine, start the FTP server on the local machine, and start the remote server instance from Application Developer.
c) Start the FTP server on the local machine, start the remote server instance from Application Developer, and start the Agent Controller on the remote machine.
d) Start the FTP server on the local machine, start the Agent Controller on the local machine, and start the remote server instance from Application Developer.
Single Select - Please select the best answer (one and only one choice must be selected).
36. Which of the following are Server preferences in the Workbench that can be turned on or off?
a) Run on Server action starts the server in debug mode.
b) Switch to the Server perspective when a server starts.
c) Save all open resources before starting servers.
d) Automatically publish before starting servers.
e) Only publish modified resources to the server.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
37. What is the purpose of defining a classpath variable?
a) To add libraries to the Workspace
b) To provide an easy method of adding the locations of JAR files to a project’s Java Build Path
c) define configuration information about the classpath such as order and preference
d) To use individual classes as libraries that are not packaged in JAR files
Single Select - Please select the best answer (one and only one choice must be selected).
38. Which of the following are ways to export an EAR file?
a) Right-click an Enterprise Application in the Navigator view on ANY perspective and select Export EAR File.
b) Right-click an Enterprise Application associated with a specific server through the Server Configuration view and select Export EAR File.
c) Select File - > Export - > Ear File and choose the Enterprise Application from the dropdown list of enterprise applications.
d) Enterprise Application in the J2EE view and click the Export EAR File button from the toolbar.
e) click an Enterprise Application in the Repository view and select Export EAR File.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
39. While debugging a JSP, which of the following statements is TRUE about variable and stack information?
a) No variable or stack trace information is available.
b) Variable and stack trace information correspond to the generated HTML stream.
c) Variable and stack trace information correspond to generated Java servlet.
d) Variable and stack trace information correspond to the JSP source.
Single Select - Please select the best answer (one and only one choice must be selected).
40. During a local debugging session, a developer makes changes to an application and the test environment. Which of the following will require a restart of the WebSphere Application Server?
a) Modifying the servlet to use a different Data Source object
b) Modifying the JNDI name of the Data Source object used for connection pooling
c) Modifying the usebean tag in a JSP to use a different Java class
d) Changing Session Tracking from URL Rewrite to Cookies
e) Changing the mechanism for storing user information from the HttpSession object to the database
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
41. While stepping over a method call, a breakpoint is encountered and the debugger suspends execution. The following information about the current thread is displayed in the Debug view:
Thread [main] (Suspended)
---> ArrayIndexOutOfBoundsException.() line: 35
---> Stepping.testMethod() line: 11
---> Stepping.main(String[]) line: 4
What caused the breakpoint to trigger?
a) A Java exception breakpoint was set for “java.lang.ArrayIndexOutOfBoundsException” with the “Caught” option selected.
b) A Java exception breakpoint was set for “java.lang.ArrayIndexOutOfBoundsException” with the “Uncaught” option selected.
c) A method entry breakpoint was added to “java.lang.ArrayIndexOutOfBoundsException”
d) A line entry breakpoint was added to “java.lang.ArrayIndexOutOfBoundsException”
Single Select - Please select the best answer (one and only one choice must be selected).
42. Execution is suspended at a method entry breakpoint to which a hit count has been applied. In this situation, a developer can:
a) Modify existing breakpoints in the Display view.
b) Examine the stack trace in the Log view.
c) Examine variable values from past iterations.
d) Re-enable the method entry breakpoint.
Single Select - Please select the best answer (one and only one choice must be selected).
43. A developer starts the test server in debug mode. In which cases will the Debugger be automatically triggered?
a) A “System.out.println” statement is executed.
b) A statement with a breakpoint is reached.
c) The program requires user input.
d) The program terminates without any runtime errors.
Single Select - Please select the best answer (one and only one choice must be selected).
44. When using Application Developer as a remote debugging client, which of the following statements accurately reflect the debugging configuration?
a) The debugger is run on the remote machine.
b) The program is run on the local machine
c) Program control is done from the local machine.
d) Internal program behavior is observed from the local machine.
e) The debugger daemon runs on the local machine.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
45. The New Java Scrapbook Page wizard prompts the user to specify:
a) an existing Server Project
b) an existing Java or Web Project
c) a filename
d) dependent projects
e) the name of the Test Server
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
46. A web application uses a customized logging class to perform status tracing. Tracing can be turned on or off using this class. This class uses “System.out.println” statements to output status messages. While the web application is running under Application Developer’s WebSphere Test Environment, where would these status messages be logged?
a) .log
b) stderr.txt
c) trace.log
d) stdout.txt
e) LogingUtil.log
Single Select - Please select the best answer (one and only one choice must be selected).
47. The principal use of the Object References view of the Profiler in Application Developer is to determine:
a) possible problems with concurrency
b) possible problems with memory leaks
c) the calling sequence between classes and methods
d) the timing relationships between classes and methods
Single Select - Please select the best answer (one and only one choice must be selected).
48. When applying Profiling Filters, which of the following are TRUE?
a) Default filters take precedence over an individual profiling agent’s filter settings.
b) An individual profiling agent’s filter settings take precedence over the Default filters.
c) To include a subset of classes, you must first specify the subset to be included, and only then specify the larger set to be excluded.
d) To include a subset of classes, you must first specify the larger set to be included, and only then specify the subset set to be excluded.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
49. A developer is attempting to collect performance data from an Enterprise Application that is running on a remote Application Server. What steps are required in order to properly setup the environment so this task can be performed?
a) Run Application Developer on the local machine.
b) Run Application Developer on the remote machine.
c) Run the IBM Agent Controller on the local machine.
d) Run the IBM Agent Controller on the remote machine.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
50. The execute operation on a .sql file in Application Developer allows a developer to apply a DDL script to which of the following entities?
a) A remote database
b) A local database
c) Imported tables within Application Developer
d) A database or schema model within Application Developer
Single Select - Please select the best answer (one and only one choice must be selected).

51. Filters can be applied to a data connection for what purpose?
a) Restricting tables included in the generated data model
b) Restricting the data that is returned by any SQL statement executed against the connection
c) Setting limits on the maximum result set size returned via the connection
d) Setting limits on the number of concurrent queries that can be executed against the connection
Single Select - Please select the best answer (one and only one choice must be selected).
52. Which of the following artifacts can be generated by the SQL to XML wizard against a SQL select statement?
a) XML
b) HTML
c) XML Schema
d) JSP
e) XSL
f) XSD
Multiple Select - Please select all of the correct answers (this question has 4 correct choices).
53. How can a developer who has set up multiple repositories in Application Developer ensure that, prior to synchronizing with the Stream, the correct Stream will be used?
a) Select Team-- >Show in Resource History to display Stream information for the selected project.
b) Select the Team page of the associated Project Properties, and change the stream if necessary.
c) Select the Team page of the associated Resource Properties, and change the stream if necessary.
d) Highlight the appropriate Stream in the Repositories pane just prior to starting the synchronization.
Single Select - Please select the best answer (one and only one choice must be selected).
54. The primary purpose of performing a “Catch up” operation with the Stream is to:
a) load new resources from the local file system into the workspace
b) obtain versioned resources from the Stream
c) add changes from the Workspace to the Stream
d) obtain changes that others have made to the resources
Single Select - Please select the best answer (one and only one choice must be selected).
55. A developer finds no available versions when attempting to perform a Compare With - > Local History on a project file. What are the likely causes?
a) The date when file was last saved was before the number of days specified to maintain local history in the Local History Preferences.
b) The file has been edited more times than the maximum number specified in the Workbench Local History Preferences.
c) The maximum file size specified in the Workbench Local History Preferences has been exceeded.
d) A connection to the repository associated with the file’s project cannot be established.
e) The file has been Synchronized with the Stream, and no subsequent saved changes have occurred.
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
56. A developer is ready to release code changes related to a new feature for the next product release. The current Stream contents have not yet been versioned, and bug fixes are still needed. Which of the following are necessary to avoid pollution of the development Stream?
a) Before releasing new changes, perform a Catch up operation with the current Stream.
b) Release to a new Stream.
c) Perform a three-way compare and merge the changes in the workspace; then Release to the Stream.
d) Version the Stream contents, then Release to the Stream.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
57. At which level may workspace resources be explicitly versioned?
a) file
b) folder
c) project
d) workspace
e) any level
Single Select - Please select the best answer (one and only one choice must be selected).
58. Team members are using different drive letters or directories for their Application Developer installations. In this situation, what is the MOST effective method of referring to external JAR files in the Build Path?
a) Move the JAR files to a specific location agreed to by the team.
b) Add the location to the Project References for each project using the JAR files.
c) Keep the JAR files in the repository and refer to them there.
d) Create a classpath variable containing the location of the Workspace, and use the variable when specifying the path to the JAR files.
I am currently studying for the Websphere Studio Application Developer Specialist exam (157). Could anyone advise me on the best resourses available for studying for this exam.
I have been through the sample test and copied the questions to study from. Does anyone have the answers to these questions? I found the questions and answers to exam 486 on this site and would be interested in seeing the answers to exam 157.
Once I am sure of some answers, I will post them on this site.
I have just started learning JSPs and am running them from Tomcat version 4.
I have copied the examples folder to my own folder (called Kathy) and am trying to run the examples from within my own folder. I have changed the server.xml file to add the Kathy folder to the Context as shown below.
When I run simple JSPs from the Kathy folder, all works fine eg the date program. However when I run a jsp which imports a bean eg numguess, then I get a Tomcat 4.1 500 error.
I am guessing that I am missing some pointer to the folder where the source and class files exist. They are in the C:\jtomcat4\tomcat\webapps\kathy\WEB-INF\classes\num folder. Where do I set up this pointer??
I look forward to hearing from you
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0"
reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>

<!-- Kathy code Context -->
<Context path="/kathy" docBase="webapps/kathy" debug="0"
reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
</Context>
16 years ago
JSP