[Free] 2017(Sep) CollectDumps Testking GIAC GSSP-Java Dumps with VCE and PDF 141-150

CollectDumps 2017 Sep GIAC Official New Released GSSP-Java
100% Free Download! 100% Pass Guaranteed!
http://www.CollectDumps.com/GSSP-Java.html

GIAC Secure Software Programmer – Java

Question No: 141 – (Topic 2)

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(quot;Administratorquot;);

The Application Assembler named Bob declares the following entries within the lt;entitygt;

element of the deployment descriptor.

  1. lt;security-role-refgt;

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

  3. lt;role-namegt;HR-Managerlt;/role-namegt; 4.

  1. lt;/security-role-refgt;

    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?

    1. lt;security-rolegt;

    2. lt;role-linkgt;

    3. lt;method-permissiongt;

    4. lt;run-asgt;

Answer: B

Question No: 142 – (Topic 2)

Mark works as a Programmer for InfoTech Inc. He develops the following code snippet. package Mark.tutorial.javaee.ejb;

import java.util.logging.Logger; import javax.annotation.Resource; import javax.ejb.Stateless;

import javax.ejb.Timeout; import javax.ejb.Timer;

import javax.ejb.TimerService;

@Stateless

public class TimerBean implements TimerSessionBean {

@Resource

TimerService timerService;

private static final Logger logger = Logger.getLogger (quot;com.sun.tutorial.javaee.ejb.timersession.TimerSessionBeanquot;); public void createTimer(long intervalDuration) {

Timer timer = timerService.createTimer(intervalDuration, quot;New timer createdquot;);

}

@Timeout

public void timeout(Timer timer) { logger.info(quot;Timer Timeoutquot;);

}

}

which of the following statements are true about the code?

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

  1. The class Logger cannot be used with a stateless session bean.

  2. The EJB container will invoke the timeout method of TimerSessionBean when the timer expires.

  3. The class is using the createTimer method incorrectly because it creates a new timer.

  4. TimerBean is a stateless session bean that shows how to set a timer.

    Answer: B,D

    Question No: 143 – (Topic 2)

    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(quot;Administratorquot;);

    The application assembler named Bob declares the following entries within the lt;entitygt; element of the deployment descriptor.

    1. lt;security-role-refgt;

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

    3. lt;role-namegt;HR-Managerlt;/role-namegt; 4.

  1. lt;/security-role-refgt;

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

    1. lt;security-rolegt;

    2. lt;role-linkgt;

    3. lt;run-asgt;

    4. lt;method-intfgt;

Answer: B

Question No: 144 – (Topic 2)

Which of the following methods is defined by ObjectOutputStream?

  1. char readChar()

  2. int readInt()

  3. void write(byte buffer[])

  4. int available()

Answer: C

Question No: 145 – (Topic 2)

You work as a programmer for PassGuide.Inc. You want to create a servlet filter that stores all request headers to a database for all requests to the Web application#39;s home page quot;/work.jspquot;. Which of the following HttpServletRequest methods allows you to retrieve all of the request headers?

  1. java.util.Enumeration getRequestHeaders()

  2. java.util.Enumeration getHeaderNames()

  3. String[] getRequestHeaders()

  4. java.util.Iterator getRequestHeaders()

  5. java.util.Iterator getHeaderNames()

  6. String[] getHeaderNames()

Answer: B

Question No: 146 – (Topic 2)

Which of the following is a Permission class whose permissions have no actions, and allows suppressing the standard Java programming language access checks?

  1. java.awt.RuntimePermission

  2. java.security.SecurityPermission

  3. java.lang.reflect.ReflectPermission

  4. java.lang.AllPermission

Answer: C

Question No: 147 – (Topic 2)

Which of the following statements about a JAR file command are true? Each correct answer represents a complete solution. Choose all that apply.

  1. A JAR file can be created without even using the f command.

  2. The 0 command is used for no compression of a JAR file.

  3. The t command of a JAR file is used to update the contents of a file.

  4. A JAR file can be extracted using the e command.

Answer: A,B

Question No: 148 – (Topic 2)

Which of the following exceptions will be thrown if a program fails to implement the Serializable interface?

  1. UnableToImplementException

  2. NonSerializableException

  3. NotSerializableException

  4. IllegalSerializationError

Answer: C

Question No: 149 – (Topic 2)

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#39;s security role. Only MANAGER in the security roles quot;ADMINquot; and quot;MANAGERquot; 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.

  1. If EJBContext.getCallerPrincipal returns role quot;ADMINquot;, implement the behavior for MANAGER in role ADMIN.

  2. If EJBContext.isCallerInRole(quot;ADMINquot;) returns true, implement the behavior defined for MANAGER in role quot;ADMINquot;.

  3. Annotate method doPrint() with @RolesAllowed({quot;ADMINquot;,quot;MANAGERquot;}).

  4. Annotate method doPrint() with @PermitAll.

Answer: B,C

Question No: 150 – (Topic 2)

Mark develops an application using Java language. He writes the following code snippet in the application.

public class mClass{

public static void main(String args[]){ try{

return;

}

finally{System.out.print(quot;Finallyquot;);}}}

What will happen when Mark attempts to compile and execute the code snippet?

  1. The code snippet will compile successfully and the output will be displayed as quot;Finallyquot;.

  2. The code snippet will compile successfully, but an exception message will be displayed at runtime.

  3. A compile time error will occur because the catch block is not defined.

  4. The code snippet will compile successfully, but nothing will be displayed as output on execution.

Answer: A

100% Free Download!
Download Free Demo:GSSP-Java Demo PDF
100% Pass Guaranteed!
Download 2017 CollectDumps GSSP-Java Full Exam PDF and VCE

CollectDumps ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

2017 CollectDumps IT Certification PDF and VCE