OCJWCD
Oracle Certified Java Web Component Developer
Oracle Certified Java Web Component Developer
-
- 1 / 106
-
Flashcards
Return values for int doEndTag()?
- SKIP_PAGE
- EVAL_PAGE
RequestDispatcher types for filters
- REQUEST
- FORWARD
- ASYNC
- INCLUDE
- ERROR
<filter-mapping>
<filter-name>Logging Filter</filter-name>
<servlet-name>ProductServlet</servlet-name>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
JSP tag directive example (JSP page and JSP document syntax)..
<%@ tag display-name="header.html" body-content="scriptless" dynamic-attributes="attributes" language="java" import="java.util.Calendar" pageEncoding="UTF-8" isELIgnored="false" %>
<jsp:directive.tag display-name="header.html" body-content="scriptless" dynamic-attributes="attributes" language="java" import="java.util.Calendar" pageEncoding="UTF-8" isELIgnored="false" />
List possible values of JSP tag directive body-content
- empty
- tagdependent
- scriptless (default)
JSP attribute directive example (JSP page and JSP document syntax)..
<%@ attribute name="varname" required="false" fragment="false" rtexprvalue="true" type="java.lang.String" description="" %>
<jsp:directive.attribute name="varname" required="false" fragment="false" rtexprvalue="true" type="java.lang.String" description="" />
JSP variable directive example (JSP page and JSP document syntax)..
<%@ variable name-given="output_name" name-from-attribute="action_attribute_name" alias="alias" variable-class="java.lang.String" scope="page" description="" %>
<jsp:directive.variable name-given="output_name" name-from-attribute="action_attribute_name" alias="alias" variable-class="java.lang.String" scope="page" description="" />
Standart action jsp:doBody Syntax?
<jsp:doBody varReader="mybody" var="mybodystr" scope="page"/>
Standart action jsp:invoke Syntax?
<jsp:invoke fragment="attrName" />
List implicit tag-files objects
- request javax.servlet.ServletRequest
- reponse javax.servlet.ServletResponse
- session javax.servlet.http.HttpSession
if session="false" this will be <null> - jspContext javax.servlet.jsp.JspContext
- application javax.servlet.ServletContext
- config javax.servlet.ServletConfig
- out javax.servlet.jsp.JspWriter
List methods of authentication?
- BASIC
- DIGEST
- FORM
- CLIENT-CERT
Form authentication action and fields?
<form method="POST" action="j_security_check">
<input type="text" name="j_username" />
<input type="password" name="j_password" />
</form>
Declare authentication method in web.xml?
<login-config>
<auth-method>BASIC, DIGEST, FORM or CLIENT-CERT</auth-method>
<realm-name>Human readable name</realm-name>
<form-login-page>
<form-login-page>/login.html</form-login-page>
<form-error-page>/errors/403.html</form-error-page>
</form-login-page>
</login-config>
<form-login-page> is only used for FORM authentication method.
Both childs <form-login-page> and <form-error-page> are mandatory
Declare server roles using web.xml.
<security-role>
<role-name>manager</role-name>
</security-role>
Zero or many are allowed.
Declare server roles using annotations.
@DeclareRoles({"admin", "user")
@DeclareRoles({"admin"})
@DeclareRoles("admin")
Declare security resources in web.xml.
<security-constraint>
<web-resource-collection>
<web-resource-name>shoppingbasket</web-resource-name>
<description>Shopping basket resources</description>
<url-pattern>/basket/*</url-pattern>
<http-method>PUT</http-method>
<http-method>POST</http-method>
</web-resource-collection>
</security-constraint>
Exactly ONE <web-resource-collection> for every <security-constraint>
Declare security authorization constraints in web.xml.
<security-constraint>
<auth-constraint>
<role-name>role1</role-name>
<role-name>role2</role-name>
</auth-constraint>
</security-constraint>
ZERO or ONE <auth-constraint> for every <security-constraint>
Declare security data constraints in web.xml.
<security-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
ZERO or ONE <user-data-constraint> for every <security-constraint>
List possible <transport-guarantee> values?
- NONE (default)
- INTEGRAL (Digest)
- CONFIDENTIAL (SSL)
Declare Security using Annotations?
@ServletSecurity {
value = @HttpConstraint(value=PERMIT | DENY, transportGuarantee=NONE | CONFIDENTIAL, rolesAllowed = { "admin" }),
httpMethodConstraints = {
@HttpMethodConstraints(value="HTTP-Method", emptyRoleSemantic=PERMIT | DENY, transportGuarantee= NONE | CONFIDENTIAL, rolesAllowed = { "admin" }
}
}
Declare security servlet role mappings in web.xml.
<servlet>
<security-role-ref>
<role-name>servlet_role</role-name>
<role-link>web_server_role<role-link>
</security-role-ref>
</servlet>
web_server_role must be defined with <security-role>
ONE or MANY <security-role-ref> are allowed.
Standard action jsp:include syntax?
<jsp:include page="page.jsp" flush="false" />
Standard action jsp:forward syntax?
<jsp:forward page="page.jsp" />
Standard action jsp:param syntax?
<jsp:param name="param_name" value="param_value" />
List implicit EL objects?
- pageContext
- pageScope JspContext.getAttribute()
- requestScope ServletRequest.getAttribute()
- sessionScope HttpSession.getAttribute()
- applicationScope ServletContext.getAttribute()
- param ServletRequest.getParameter()
- paramValues ServletRequest.getParameterValues()
- header ServletRequest.getHeader()
- headerValues ServletRequest.getHeaders()
- cookie HttpServletRequest.getCookies()
- initParam ServletContext.getInitParameter()
All are of type Map except pageContext: PageContext