Scroll to see replies
var myData = {
method: method,
username: username,
pw: pw
};
var myJsonData = JSON.stringify(myData);
type: "POST",
contentType: "application/json",
data: myJsonData,
<error-page>
<error-code>500</error-code>
<location>errorpage.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>errorpage.html</location>
</error-page>
<form action="LoginServlet" method="post">
Method: <br/> <input type="text" name="method"> <br/>
Username: <br/> <input type="text" name="username"> <br/>
Password: <br/> <input type="password" name="pw"> <br/>
<input type="submit" value="login">
</form>
<form action="LoginServlet" method="post">
Method: <br/> <input type="text" name="method"> <br/>
Username: <br/> <input type="text" name="username"> <br/>
Password: <br/> <input type="password" name="pw"> <br/>
<input type="submit" value="login">
</form>
public class AccountRepository {
public ArrayList<Account> getAll() { /* ... */ }
public Account getAccount(int accountNumber) { /* ... */ }
public int createAccount(Account newAccount) { /* ... */ }
public Account updateAccount(Account updatedAccount) { /* ... */ }
public void deleteAccount(int accountNumber) { /* ... */ }
}
public class AccountsServlet extends HttpServlet {
private static final AccountRepository accountRepository = new AccountRepository();
private static final CustomerRepository customerRepository = new CustomerRepository();
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO -- do something with accountRepository and/or customerRepository
}
}
public class AccountRepository {
public ArrayList<Account> getAll() { /* ... */ }
public Account getAccount(int accountNumber) { /* ... */ }
public int createAccount(Account newAccount) { /* ... */ }
public Account updateAccount(Account updatedAccount) { /* ... */ }
public void deleteAccount(int accountNumber) { /* ... */ }
}
public class AccountsServlet extends HttpServlet {
private static final AccountRepository accountRepository = new AccountRepository();
private static final CustomerRepository customerRepository = new CustomerRepository();
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO -- do something with accountRepository and/or customerRepository
}
}
public class AccountRepository {
public ArrayList<Account> getAll() { /* ... */ }
public Account getAccount(int accountNumber) { /* ... */ }
public int createAccount(Account newAccount) { /* ... */ }
public Account updateAccount(Account updatedAccount) { /* ... */ }
public void deleteAccount(int accountNumber) { /* ... */ }
}
public class AccountsServlet extends HttpServlet {
private static final AccountRepository accountRepository = new AccountRepository();
private static final CustomerRepository customerRepository = new CustomerRepository();
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO -- do something with accountRepository and/or customerRepository
}
}
Last reply 6 days ago
Hello .. I am looking for computer science program BSc/BEng 2024 entryLast reply 3 weeks ago
What A-Levels should i do if i wanna do a Bsc in Computer ScienceLast reply 4 weeks ago
Correlation between performance in UKMT and performance in TMUA/STEP?Last reply 4 weeks ago
Do top universities allow just 3 A levels including Further Maths?Last reply 6 days ago
Hello .. I am looking for computer science program BSc/BEng 2024 entryLast reply 3 weeks ago
What A-Levels should i do if i wanna do a Bsc in Computer ScienceLast reply 4 weeks ago
Correlation between performance in UKMT and performance in TMUA/STEP?Last reply 4 weeks ago
Do top universities allow just 3 A levels including Further Maths?