OCJWCD

Oracle Certified Java Web Component Developer

Oracle Certified Java Web Component Developer


M. I.
Diese Lernkarten decken fortgeschrittene Themen der JavaServer Pages (JSP) und Servlet-Technologie ab, die für Universitätsstudenten relevant sind. Sie behandeln Farben, Methoden, EL-Objekte, Standardaktionen und Sicherheitskonfigurationen in JSP, einschließlich der Verwendung von Annotationen und XML-Dateien. Die Karteikarten sind besonders nützlich für Entwickler, die sich auf Webanwendungen spezialisieren und ein tiefes Verständnis der JSP- und Servlet-Sicherheitskonzepte benötigen.
Cartes-fiches
106
Utilisateurs
1
Langue
Allemand
Catégorie
Informatique
Niveau
Université
Créé / Mis à jour
20.10.2017 / 21.10.2017

Cartes-fiches

Return values for int doEndTag()?

  1. SKIP_PAGE
  2. EVAL_PAGE

RequestDispatcher types for filters

  1. REQUEST
  2. FORWARD
  3. ASYNC
  4. INCLUDE
  5. 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

  1. empty
  2. tagdependent
  3. 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

  1. request                  javax.servlet.ServletRequest
  2. reponse                 javax.servlet.ServletResponse
  3. session                  javax.servlet.http.HttpSession
                                     if session="false" this will be <null>
  4. jspContext           javax.servlet.jsp.JspContext
  5. application          javax.servlet.ServletContext
  6. config                    javax.servlet.ServletConfig
  7. out                          javax.servlet.jsp.JspWriter

List methods of authentication?

  1. BASIC
  2. DIGEST
  3. FORM
  4. 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?

  1. NONE (default)
  2. INTEGRAL (Digest)
  3. 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?

  1. pageContext
  2. pageScope               JspContext.getAttribute()
  3. requestScope          ServletRequest.getAttribute()
  4. sessionScope           HttpSession.getAttribute()
  5. applicationScope     ServletContext.getAttribute()
  6. param                      ServletRequest.getParameter()
  7. paramValues            ServletRequest.getParameterValues()
  8. header                     ServletRequest.getHeader()
  9. headerValues           ServletRequest.getHeaders()
  10. cookie                      HttpServletRequest.getCookies()
  11. initParam                 ServletContext.getInitParameter()

All are of type Map except pageContext: PageContext 

Classic Tag hierarchy?

Simple Tag hierarchy?

Étudier