Modified:
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java?view=diff&rev=453296&r1=453295&r2=453296
==============================================================================
---
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
(original)
+++
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java
Thu Oct 5 10:44:29 2006
@@ -42,11 +42,12 @@
// mContext = pCfg.getServletContext();
// }
+ @Override
public void doPost(HttpServletRequest pReq, HttpServletResponse pResp)
throws ServletException {
try {
final String action = pReq.getParameter("action");
-
+
CompositeContext moduleContext =
CurrentCompositeContext.getContext();
AccountService accountServices = (AccountService)
moduleContext.locateService(AccountService.class, "AccountServiceComponent");
if (accountServices == null) {
@@ -54,7 +55,7 @@
}
ProfileService profileServices = null;
if (!"createAccount".equals(action)) {
- profileServices = (ProfileService)
moduleContext.locateService(ProfileService.class, "ProfileServiceComponent");
+ profileServices =
moduleContext.locateService(ProfileService.class, "ProfileServiceComponent");
if (profileServices == null) {
throw new ServletException("ProfileServiceComponent not
found.");
}
@@ -126,10 +127,11 @@
if (!"cancel".equals(req.getParameter("cancel"))) {
String account = req.getParameter("account");
String amount = req.getParameter("Amount");
- if ("deposit".equals(req.getParameter("actionType")))
+ if ("deposit".equals(req.getParameter("actionType"))) {
accountServices.deposit(account, Float.parseFloat(amount));
- else
+ } else {
accountServices.withdraw(account,
Float.parseFloat(amount));
+ }
}
} catch (Exception e) {
throw new ServletException("accountTransaction " + e.getMessage(),
e);
Modified:
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java?view=diff&rev=453296&r1=453295&r2=453296
==============================================================================
---
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java
(original)
+++
incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java
Thu Oct 5 10:44:29 2006
@@ -35,16 +35,19 @@
public class LoginServlet extends HttpServlet {
+ @Override
public void init(ServletConfig pCfg) throws ServletException {
}
+ @Override
public void doPost(HttpServletRequest pReq, HttpServletResponse pResp)
throws ServletException {
if ("logout".equals(pReq.getParameter("logout")) ||
"logoutHIDDEN".equals(pReq.getParameter("logoutHIDDEN"))) {
HttpSession sess = pReq.getSession();
- if (sess != null)
+ if (sess != null) {
sess.invalidate();
+ }
try {
pResp.sendRedirect("login.html");
} catch (IOException e) {
@@ -54,7 +57,7 @@
}
} else {
- pReq.getSession(); //make sure session started.
+ pReq.getSession(); // make sure session started.
String login = pReq.getParameter("login");
String password = pReq.getParameter("password");
try {
@@ -75,7 +78,7 @@
static int login(final String login, final String password) throws
ServletException {
CompositeContext moduleContext = CurrentCompositeContext.getContext();
- LoginService loginMgr = (LoginService)
moduleContext.locateService(LoginService.class, "LoginServiceComponent");
+ LoginService loginMgr =
moduleContext.locateService(LoginService.class, "LoginServiceComponent");
if (loginMgr == null) {
throw new ServletException("LoginManager not found");
Modified:
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java?view=diff&rev=453296&r1=453295&r2=453296
==============================================================================
---
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java
(original)
+++
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestAccountService.java
Thu Oct 5 10:44:29 2006
@@ -28,12 +28,13 @@
import com.bigbank.account.AccountReport;
import com.bigbank.account.AccountService;
-
public class TestAccountService extends SCA {
+ @Override
public void start() {
}
+ @Override
public void stop() {
}
@@ -47,6 +48,5 @@
System.out.println("retrieved " + summaries.size() + " summaries");
-
}
}
Modified:
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java?view=diff&rev=453296&r1=453295&r2=453296
==============================================================================
---
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java
(original)
+++
incubator/tuscany/java/sampleapps/bigbank/webclient/src/test/java/bigbank/webclient/client/TestLoginService.java
Thu Oct 5 10:44:29 2006
@@ -24,25 +24,25 @@
import bigbank.webclient.services.profile.LoginService;
-
public class TestLoginService extends SCA {
+ @Override
public void start() {
}
+ @Override
public void stop() {
}
public static void main(String[] args) throws Exception {
-
CompositeContext moduleContext = CurrentCompositeContext.getContext();
- LoginService loginService = (LoginService)
- moduleContext.locateService(LoginService.class,
"LoginServiceComponent");
+ LoginService loginService =
moduleContext.locateService(LoginService.class, "LoginServiceComponent");
- if (loginService.login("test", "password") == LoginService.SUCCESS)
+ if (loginService.login("test", "password") == LoginService.SUCCESS) {
System.out.println("Success");
- else
+ } else {
System.out.println("Failure");
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]