[JAVAEETUTORIAL-225] Typos and syntax errors in the security chapters Created: 30/Jul/13  Updated: 30/Jul/13  Due: 31/Jul/13  Resolved: 30/Jul/13

Status: Resolved
Project: javaeetutorial
Component/s: doc
Affects Version/s: 7.0.1
Fix Version/s: 7.0.2

Type: Bug Priority: Minor
Reporter: jendrock Assignee: jendrock
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by jendrock [ 30/Jul/13 ]

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

Generated at Sun Apr 19 16:30:19 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.