Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
14Activity
0 of .
Results for:
No results containing your search query
P. 1
SCWCD HINTS

SCWCD HINTS

Ratings: (0)|Views: 454|Likes:
Published by api-3759996

More info:

Published by: api-3759996 on Oct 16, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

SCW CD H INTS
Here are some of the SCWCD related hints that I thought would be good to be written
somewhere.
Please let me know if I've made any mistakes. Most of them comes from several SCWCD books

like the HFSJ, David Bridgewater, Hanumanth Deshmuk.
Regards,
Jothi Shankar Kumar. S
1) Of the big 7 HTTP methods,
SAFE >> GET, HEAD, TRACE, OPTIONS
IDEMPOTENT* >> GET, HEAD, TRACE, OPTIONS, PUT, DELETE
NON-IDEMPOTENT >> POST
* yields the same result if the operation is applied multiple times

2) A <jsp:forward> effectively terminates the current page. Nothing before the <jsp:forward> or
after the <jsp:forward> is written to the response!
3) If a jsp page fails to translate, then any request to that page should return a 500(server error)
communicated back in the HTTP response.

4) The servlets created from the JSP page have to obey some special rules, a vendor will
typically have a specialized JSP base servlet-perhaps extending HttpServlet or GenericServlet In
Tomcat, this is called org.apache.jasper.runtime.HttpJspBase

5) Beware of the deprecated encodeUrl and encodeRedirectUrl methods. They have mixed casing for the Url instead of URL. So encodeUrl and encodeRedirectUrl won't work for 2.4 schema. Instead it should be encodeURL and encodeRedirectURL.

6) A value of 0 or a negative value in the session-timeout of the session-config in the web.xml file
(which is expressed in minutes) indicates that the session never expires. However, this can be
overridden using the setMaxInactiveInterval() in the code where the time is in expressed in
seconds. Always Remember web.xml in minutes and the code in seconds.

7) Don't be thrown by weird but legal variants for directive syntax. You don't need white space
after the opening marker or before the closing marker: <%@page import="java.util.*"%> You can
also put extra white space before or after the equal sign for the attribute: <%@ page import =
java.util.*"%> Single quotes are as acceptable as double quotes for attribute values: <%@ page
import="java.util.*" %>

8) There are 4 page directives required to be known for the exam. They are,
<%@ Page import...%> -- Can appear any number of times and anywhere in the JSP
And for the below ones - There shall be only one occurrence of any attribute/value pair defined by

this directive in a given translation unit, unless the values for the duplicate attributes are identical

for all occurrences.
<%@ Page session...%>
<%@ Page contentType...%>
<%@ Page isELIgnored...%>
Also note that "Only pageEncoding and contentType should appear at the beginning of the page"

while the rest can appear anywhere in your JSP page.
9) You have to keep java code (like scriptlets, expressions) free of EL, Always remember EL is not
java
The following won't work since it has EL inside an expression, <%=
request.getParameter(${name.value})%> >> This will never ever compile.
10) ${"Not a Number"+ 3.0}. You will get a javax.servlet.jsp.el.ELException, complaining thatN ot
a Number; cannot be converted to a java.lang.Double value. This example also goes to show that
the addition operator in EL -unlike Java- is not overloaded to handle string concatenation. There's
no operator overloading or string concatenation in EL.
11) The difference between jsp:include and @include...
<jsp:include> Standard Action
\u2022
Attributes: page (and flush)
\u2022
Page attribute accepts relative URLs.(*)
\u2022
Response from target page included at request time.
\u2022
Target page to include can be soft-coded as an expression.
\u2022
Can execute conditionally in the middle of page logic.
\u2022
Target page doesn't have to exist until request time.
<%@ include %> Directive
\u2022
Attribute: file
\u2022
File attribute accepts relative URLs.(*)
\u2022
Target file included during translation phase.
\u2022
Target file must be a hard-coded literal value.
\u2022
Will be processed unconditionally; can't be embedded in page logic.
\u2022
Target file must exist at translation time.
\u2022
Does not necessarily include the latest version of the target file: depends on your
container (not mandated by the JSP specification).
(*) relative urls are defined in the JSP specification : JSP.1.2.1 Relative URL Specifications

12) Having a directory called WEB-INF is a strong recommendation, but not an absolute
obligation. Look out for questions that ask you to say whether a web application must have
particular directories. The correct answer isno!

13) The deployment descriptor has, in fact, 27 top-level elements, shown in Figure below. These top-level elements each contain half a dozen or so elements, at various levels of nesting, ranging from the very simple (e.g., <distributable>, with no nested elements) to <servlet> (with 9 nested elements, some containing more nested elements). <web-app>

<description>
<display-name>
<icon>
<distributable>
<context-param>
<filter>
<filter-mapping>
<listener>
<servlet>
<servlet-mapping>
<session-config>
<mime-mapping>
<welcome-file-list>
<error-page>
<jsp-config>
<security-constraint>
<login-config>
<security-role>
<env-entry>
<ejb-ref>
<ejb-local-ref>
<service-ref>
<resource-ref>
<resource-env-ref>
<message-destination-ref>
<locale-encoding-mapping-list>

Activity (14)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Sunil Soni liked this
bharat210286 liked this
pt108108 liked this
Vinod Patidar liked this
Abhishek Bhatia liked this
quanheocon liked this
ebbookks liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->