javaeetutorial
  1. javaeetutorial
  2. JAVAEETUTORIAL-225

Typos and syntax errors in the security chapters

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: doc
    • Labels:
      None

      Description

      A tutorial user points out 2 errors in http://docs.oracle.com/javaee/7/tutorial/doc/security-advanced003.htm#BABIFJGI.

      1. Typo. The HttpServetRequest classes shown below should be HttpServletRequest.

      public String login () {
      FacesContext context = FacesContext.getCurrentInstance();
      HttpServetRequest request = (HttpServletRequest)
      context.getExternalContext().getRequest();
      try

      { request.login(this.username, this.password); }

      catch (ServletException e)

      { ... context.addMessage(null, new FacesMessage("Login failed.")); return "error"; }

      return "admin/index";
      }

      public void logout() {
      FacesContext context = FacesContext.getCurrentInstance();
      HttpServetRequest request = (HttpServletRequest)
      context.getExternalContext().getRequest();
      try

      { request.logout(); }

      catch (ServletException e)

      { ... context.addMessage(null, new FacesMessage("Logout failed.")); }

      }

      2. Syntax errors in XML due to missing single quotes (one occurrence) and curly closing braces (3 occurrences) are indicated with an asterisk per occurrence in the XML code below.

      <h:form>
      <h:outputLabel for="usernameInput">

      • # {bundle['login.username']}

        :
        </h:outputLabel>
        <h:inputText id="usernameInput" value="#

        {loginBean.username}

        "
        required="true" />
        <br />
        <h:outputLabel for="passwordInput">

      • # {bundle['login.password']}

        :
        </h:outputLabel>
        <h:inputSecret id="passwordInput" value="#

        {loginBean.password}

        "
        required="true" />
        <br />

      • <h:commandButton value="$ {bundle['login.submit']}

        "
        action="#

        {loginBean.login}

        " />
        </h:form>

      Lines indicated with an asterisk include the corrections.

        Activity

        jendrock created issue -
        Hide
        jendrock added a comment -

        Both sets of errors have been fixed in source and will appear in the next tutorial update.

        Show
        jendrock added a comment - Both sets of errors have been fixed in source and will appear in the next tutorial update.
        jendrock made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            jendrock
            Reporter:
            jendrock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: