Forums Register Login

EPractice Lab mock exam 5

+Pie Number of slices to send: Send
 


A developer wants to convert Arabic characters to Unicode in JSP page. This file is included in several JSP files to convert unicode functions and are included in these pages with the following statement:<head>
<script src='/js/unicodeHandler.jsp' language='javascript' type='application/javascript'>
</script>
</head>

Which JSP code snippet declares that unicodeHandler.js is a JavaScript file?

a. <%@ page contentType='application/javascript' %>
b. <jsp:page contentType='application/javascript' />
c. <jsp:document contentType='application/javascript' />
d. <jsp:directive.page contentType='application/javascript' />

Choice D is correct
Why
The <%@ page %> directive applies to an entire JSP file and any of its static include files, which together are called a translation unit. A static include file is a file whose content becomes part of the calling JSP file. The <%@ page %>directive does not apply to any dynamic include files.
The attribute contentType is used to specify the MIME type and character encoding the JSP file uses for the response it sends to the client. We can use any MIME type or character set that are valid for the JSP container. The default MIME type is text/html, and the default character set is ISO-8859-1.



But a and d are equivalent. So, I think both a and d are the options.
+Pie Number of slices to send: Send
I agree, both are the same one is the JSP syntax one is the XML syntax so behavior should be the same...
Always! Wait. Never. Shut up. Look at this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 421 times.
Similar Threads
Help me resolve the error: HTTP Status 500
Mistakenly changed web.xml
web.xml causes 404 error
Configuring Tomcat 5 on Win2K and Linux
Why File name is becoming null in action class ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:30:20.