Sreejobs Logo
   For Latest Job Updates  
sreenutech.com Online Exams
Home Govt Jobs IT Fresher Jobs IT Exp Jobs IT Walk-Ins MBA Jobs BPO Jobs Register FAQ’s Post Job Contact Us
Search:
SreeJob Fees   Feeds
Hot Jobs
Welcome Guest
Login | Register
Total No Of Questions: 100.
1)

Given:

3. class MyServlet extends HttpServlet {

4. public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,

IOException {

5. // servlet code here ...

26. }

27. }

If the DD contains a single security constraint associated with MyServlet and its only <http-method> tags

and <auth-constraint> tags are:

<http-method>GET</http-method>

<http-method>PUT</http-method>

<auth-constraint>Admin</auth-constraint>

Which four requests would be allowed by the container? (Choose four.)


2)

In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored as a List object in the catalog attribute of the webapp's ServletContext object.

Which scriptlet code snippet gives you access to the catalog object?



3)

Given:

11. public class MyServlet extends HttpServlet {

12. public void service(HttpServletRequest request,

13. HttpServletResponse response)

14. throws ServletException, IOException {

15. // insert code here

16. }

17. }

and this element in the web application's deployment descriptor:

 

<error-page>

<error-code>302</error-code>

<location>/html/error.html</location>

</error-page>

Which, inserted at line 15, causes the container to redirect control to the error.html resource?



4) Which JSP standard action can be used to import content from a resource called foo.jsp?


5) You have built a web application that you license to small businesses. The webapp uses a context parameter, called licenseExtension, which enables certain advanced features based on your client's license package. When a client pays for a specific service, you provide them with a license extension key that they insert into the <context-param> of the deployment descriptor. Not every client will have this context parameter so you need to create a context listener to set up a default value in the licenseExtension parameter. Which code snippet will accomplish this goal?


6)

You are creating a JSP page to display a collection of data. This data can be displayed in several different ways so the architect on your project decided to create a generic servlet that generates a comma-delimited string so that various pages can render the data in different ways. This servlet takes on request parameter: objectID. Assume that this servlet is mapped to the URL pattern:/WEB-INF/data.

In the JSP you are creating, you need to split this string into its elements separated by commas and generate an HTML <ul> list from the data.

Which JSTL code snippet will accomplish this goal?


7)

Given the JSP code:

10. <html>

11. <body>

12. <jsp:useBean id='customer' class='com.example.Customer' />

13. Hello, ${customer.title} ${customer.lastName}, welcome

14. to Squeaky Beans, Inc.

15. </body>

16. </html>

Which three types of JSP code are used? (Choose three.)


8)

Given the definition of MyObject and that an instance of MyObject is

bound as a session attribute:

8. package com.example;

9. public class MyObject implements

10. javax.servlet.http.HttpSessionBindingListener {

11. // class body code here

12. }

Which is true?


9) You have built a collection of custom tags for your web application. The TLD file is located in the file: /WEB-INF/myTags.xml. You refer to these tags in your JSPs using the symbolic name: myTags. Which deployment descriptor element must you use to make this link between the symbolic name and the TLD file name?


10)

Developer has used this code within a servlet:

62. if(request.isUserInRole("vip")) {

63. // VIP-related logic here

64. }

What else must the developer do to ensure that the intended security goal is achieved?