Sreejobs Logo
   For Latest Job Updates 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
SreeJob Fees   Feeds
Hot Jobs
Welcome Guest
Login | Register
Total No Of Questions: 100.
1) Which two statements are true about the security-related tags in a valid Java EE deployment descriptor? (Choose two.)

2) Which statement is true about web container session management?


Given a portion of a valid Java EE web application's directory structure:



|-- Directory1

|       |-- File1.html



|            |-- File2.html



         |-- File3.html

 You want to know whether File1.html, File2.html, and/or File3.html is protected from direct access by your web client's browsers.

What statement is true?


Your web application views all have the same header, which includes the <title> tag in the <head> element of the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put it into a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you have decided to use a variable called pageTitle to parameterize this in the header JSP, like this:

10. <title>${param.pageTitle}<title>

Which JSP code snippet should you use in your main view JSPs to insert the header and pass the pageTitle variable?

5) A developer has created a special servlet that is responsible for generating XML content that is sent to a data warehousing subsystem. This subsystem uses HTTP to request these large data files, which are compressed by the servlet to save internal network bandwidth. The developer has received a request from management to create several more of these data warehousing servlets. The developer is about to copy and paste the compression code into each new servlet. Which design pattern can consolidate this compression code to be used by all of the data warehousing servlets?


Given the definition of MyServlet:

11. public class MyServlet extends HttpServlet {

12. public void service(HttpServletRequest request,

13. HttpServletResponse response)

14. throws ServletException, IOException {

15. HttpSession session = request.getSession();

16 session.setAttribute("myAttribute","myAttributeValue");

17. session.invalidate();

18. response.getWriter().println("value=" +

19. session.getAttribute("myAttribute"));

20. }

21. }

What is the result when a request is sent to MyServlet?


You web application uses a lot of Java enumerated types in the domain model of the application. Built into each enum type is a method, getDisplay(), which returns a localized, user-oriented string. There are many uses for presenting enums within the web application, so your manager has asked you to create a custom tag that iterates over the set of enum values and processes the body of the tag once for each value; setting the value into a page-scoped attribute called, enumValue.

Here is an example of how this tag is used:

10. <select name='season'>

11. <t:everyEnum type='com.example.Season'>

12. <option value='${enumValue}'>${enumValue.display}</option>

13. </t:everyEnum>

14. </select>

You have decided to use the Simple tag model to create this tag handler.

Which tag handler method will accomplish this goal?



10. public void service(ServletRequest request,

11. ServletResponse response) {

12. ServletInputStream sis =

13. // insert code here

14. }

 Which retrieves the binary input stream on line 13?


Given an HttpServletRequest request:

22. String id = request.getParameter("jsessionid");

23. // insert code here

24. String name = (String) session.getAttribute("name");

Which three can be placed at line 23 to retrieve an existing HttpSession object? (Choose three.)

10) Which three are true about TLD files? (Choose three.)