Weekend Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

GIAC GSSP-Java - GIAC Secure Software Programmer – Java

Page: 8 / 9
Total 275 questions

Mark works as a Programmer for InfoTech Inc. He develops a RefreshFailed.jsp page for a servlet. He wants that the RefreshFailed.jsp page will be displayed when the

javax.security.auth.RefreshFailedException is thrown. Which of the following error-page deployment descriptor element declarations will be used?

A.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

B.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

408

C.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

D.

javax.security.auth.RefreshFailedException

RefreshFailed.jsp

Mark works as a Programmer for InfoTech Inc. He develops the following code snippet. class Auto

{public static void main(String args[])

{Character iob ='d';float i=iob;System.out.println(iob);}}

What will be the result when Mark tries to execute the code snippet?

A.

It will display d.

B.

It will show a runtime error.

C.

It will show a compile-time error.

D.

It will display 0.00.

Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application.

A JavaSecurity Application

...

Manager

Admin

Programmer

Admin

Employee

Which of the following will be the action of the container if the request is HttpServletRequest, and request.isUserInRole("Admin"); has been called in a servlet code?

A.

The container will throw a system exception.

B.

The container will return true.

C.

The container will throw an application exception.

D.

The container will return false.

Roger works as a Software Developer for Tech Mart Inc. He creates an application using Enterprise JavaBeans. In the bean class, he writes a code snippet as follows.

Boolean b = ctx.isCallerInRole("Administrator");

The Application Assembler named Bob declares the following entries within the element of the deployment descriptor.

1.

2. The HR-Manager will have permission to access all the methods.

3. HR-Manager

4.

5.

Bob wants to ensure that the HR-Manager declared in the deployment descriptor has all the privileges of an administrator. Which of the following elements should Bob declare in line 4 while deploying the bean?

A.

B.

C.

D.

Which of the following validates an HTML form at client-side before submitting it to the server?

A.

JNDI

B.

Java Applet

C.

JMS

D.

JavaScript

You work as a developer for PassGuide Inc. You have implemented a session bean with a method doPrint(), which behaves differently depending on the caller's security role. Only MANAGER in the security roles "ADMIN" and "MANAGER" are allowed to call the method. Which of the following actions are appropriate to accomplish if there is no security-related metadata in the deployment descriptor?

Each correct answer represents a complete solution. Choose all that apply.

A.

If EJBContext.getCallerPrincipal returns role "ADMIN", implement the behavior for MANAGER in role ADMIN.

B.

If EJBContext.isCallerInRole("ADMIN") returns true, implement the behavior defined for MANAGER in role "ADMIN".

C.

Annotate method doPrint() with @RolesAllowed({"ADMIN","MANAGER"}).

D.

Annotate method doPrint() with @PermitAll.

Which of the following statements about serialization are true?

Each correct answer represents a complete solution. Choose all that apply.

A.

Transient variables cannot be serialized.

B.

Externalizable is a marker interface and does not define any method.

C.

Serializable is a marker interface and does not define any method.

D.

Static variables cannot be serialized.

Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.

1. public class Garbage

2. {

3. public static void main(String args[])

4. {

5. String line;

6. String first="it is a program";

7. String last="last argument";

8. String arg1=new String((args.length>0) ? "'" + args[0] + "'" . "no arguments");

9. line=arg1;

10. arg1=null;

11. line=first + line + last;

12. first=null;

13. System.out.println("line");

14. line=null;

15. last=null;

16. args=null;

17. }

18. }

Which of the following statements about the code snippet is true when an object is initially referenced with arg1, and it is eligible for garbage collection?

A.

After line 10.

B.

After line 15.

C.

After line 12.

D.

After line 11.

Which of the following statements about the element are true?

Each correct answer represents a complete solution. Choose all that apply.

A.

It can have at the most one sub-element.

B.

It has as one of its sub-elements.

C.

If there is no sub-element, no HTTP method will be constrained.

D.

It is a sub-element of the element.

There are two threads defined in an application named "thread1" and "thread2". Which of the following options can be the direct cause of "thread1" becoming blocked?

Each correct answer represents a complete solution. Choose all that apply.

A.

thread1 attempt to read from a file

B.

thread1 executes thread2.sleep(3000)

C.

thread2 executes thread1 sleep(3000)

D.

thread1 raises its own priority

E.

thread1 executes new Thread (someRunnable)