Sunday, March 04, 2007

JAVA 認證心得 -- SCWCD 1.4 (5)

  • Form Based Authentication

Username -> j_username

Password -> j_password

##CONTINUE##

  • jsp:useBean id=”name” scope=”page|request|session|application”

beandetail are :

type=”typeName”

class =”className”

class =”className” type=”typeName”

beanName=”beanName” type=”typeName”

  • The session management implementation in the servlet API revolves around the HttpSession interface
  • attribute

    name

    required

    rtexprvalue

    type

  • security-constraint

    web-resource-collection

    web-resource-name

    url-pattern

    http-method

    /web-resource-collection

    auth-constraint

    role-name

    /auth-constraint

    login-config

    auth-method

    realm-name

    /login-config

  • The setHeader() method of the HttpServletResponse interface is used to set headers of an Http response

  • jsp:declaration
  • SingleThreadModel

JAVA 認證心得 -- SCWCD 1.4 (4)

  • jspInit() _jspService jspDestory()
##CONTINUE##
  • body-element empty , JSP , tagdependent
  • 301 Moved permanently , 302 Moved temporarily
  • web-app

    listener

    listener-class></listener-class

    /listener

    /web-app

  • RequestDispatcher è using getRequestDispathcher method of ServletContext ingerface
  • When a JSP custom tag is read, and an action started, the pageContext object is passed to the tag object so that its environment can be initialized
  • Web application servlet initialization param

    web-app

    context-param

    param-name></param-name

    param-value></param-value

    /context-param

    /web-app

  • The implicit JSP arguments are only visible in the jspService() method
  • The object implementing the ServletContextAttributeListener interface is notified of changes to the attributes list on the servlet context of a web application
  • Init-param

    param-name

    param-value

JAVA 認證心得 -- SCWCD 1.4 (3)

  • SKIP_BODY EVAL_BODY_INCLUDE
##CONTINUE##
  • SKIP_PAGE EVAL_PAGE
  • String username = (String) request.getSession().getAttribute(“ttt”);
  • %@page isTreadSafe=”false”%
  • the three type of JSP directive type are include , taglib , page
  • In JSP , the default import list is

    java.lang.*

    java.servlet.http.*

    java.servlet.*

    java.servlet.jsp.*

  • login-config (auth-method?,realm-name?,form-login-config?)
  • servlet-mapping(servlet-name,url-pattern)
  • setContentType() belong to ServletResponse
  • res.sendRedirect(“dd”); req.getParameter(“dd”)
  • ServletContext interface and GenericServlet class provide log method
  • ServletOutputStream out = response.getOutputStream()

    OutputStream out = response.getOutputStream()

  • GenericServlet is abstract class , so must implement service(req,res)
  • getIntHeader(“xxx”) of HttpServletRequest
  • all the sub element of web-app are optional
  • HttpSessionActivationListener === session migrated

    HttpSessionAttributeListener === notify whether add remove replace method attributes in HttpSession objects

  • Notified change attr in ServletContext. Must implement ServletContextAttributeListener

  • HttpServletResponse setStatus(int c) sendError(int c)
  • This.getServletContext().log() log()
  • Notify objects add remove form session must implement HttpSessionBindingListener interface
  • HttpSessionListener notify a session is created or destroyed

    sessionCreated(HttpSessionEvent se)

    sessionDestroyed(HttpSessionEvent se)

JAVA 認證心得 -- SCWCD 1.4 (2)

  • getAuthType() method of HttpServletRequest returns name of the authenticating scheme used to protect the servlet
##CONTINUE##
  • invalidate() is used to expunge or invalidate a session object
  • The sendError method causes the server to generate and send an appropriate server-specific page describing the error

  • UnavailableException exception indicates to the web container that the servlet is either temporarily or permanently available

  • getLastModified method belongs to which HttpServlet interface
  • sessionCreated and sessionDestroyed are the valid methods of HttpSessionListener
  • HttpSessionActivationListener interface is designed to handle sessions that migrate from one server to another
  • getInitParameterNames returns names of the context's initialization parameters as Enumeration of String objects
  • taglib

    taglib-uri></taglib-uri

    taglib-location></taglib-location

    /taglib

    ! taglib id

  • The getResource() and getResourceAsStream() belong to ServletContext interface
  • session-config

    session-timeout1/session-timeout 1 min

    /session-config

    session-timeout0/session-timeout never expire

JAVA 認證心得 -- SCWCD 1.4 (1)

  • HttpServletResponse.encodeURL()
##CONTINUE##
  • findAttribute method Searches for the named attribute in page, request, session and application scope(s)
  • The Valid return types for doAfterBody are EVAL_BODY_AGAIN or SKIP_BODY
  • Fa~de pattern provides a layer between clients and subsystems of a complex system; shields clients from subsystem components, making the subsystems easier to use
  • The Default value for body-content element of tag library descriptor is JSP
  • Write the tag library descriptor element name that specifies that the value of attribute may be dynamically calculated at request time rtexprvalue
  • The two sub elements of taglib element are taglib-uri and taglib-location
  • Application jsp implicit object provides access to resources of the servlet engine (resources, attributes, init context parms, request dispatcher, server info, URL & MIME resources)
  • Instance variables are thread-safe if the servlet implements SingleThreadModel
  • isRequestedSessionIdFromCookie method checks whether the requested session id came in as cookie
  • The Valid values of transport-guarantee of user-data-constraint element of Deployment Descriptor are None, INTEGRAL or CONFIDENTIAL
  • transport-guaranteeNONE or INTEGRAL or CONFIDENTIAL/transport-guarantee

    /user-data-constraint

JAVA 認證心得 -- SCWCD 1.4

我當初參加的是 Beta Exam, (Sun Certified Web Component Developer for J2EE 1.4 beta exam)
也就是只要考過的話, 不但不用繳考試費, 而且是全世界第一批取得該證照的人.
這也是我在考取SCJP後第二張JAVA認證. 當時尚未以系統化的方式準備考試
所以所寄的筆記皆為重點是摘要, 不像其他認證心得有根據其考試章節分類紀錄重點.
不過應該也具參考價值, 有興趣的就參考參考囉

接下幾篇是我當初準備 SCWCD 認證的心得筆記~~~