Hi,
I`m noob to S2 so be patient ;)
I`m writting simple S2 webapp - I`d like to create 'money transfer bank
system'. Theory: i have 3 accounts, and I`d like to transfer money between
them.
This`s my "Account" class:
***************
package test;
import com.opensymphony.xwork2.ActionSupport;
public class Account extends ActionSupport{
public Account() {
}
private static int currentAmount = 0;
public static void setCurrentAmount(int _currentAmount){
currentAmount = _currentAmount;
}
public static int getCurrentAmount(){
return currentAmount;
}
}
************
then, I create "Settings.Action" to prepare index.jsp page:
*************
package test;
public class Settings extends BankSupport{
Account ac1, ac2, ac3;
public Settings() {
}
public String execute(){
ac1.setCurrentAmount(500); //I would like to start app with
those values
ac2.setCurrentAmount(300);
ac3.setCurrentAmount(0);
return SUCCESS;
}
}
**************
And this is my index.jsp page:
**************
<%@ taglib uri="/struts-tags" prefix="s" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><s:text name = "page.title"/></title>
</head>
<body>
<s:form>
<h1><center><s:text name = "index.hello"/></center></h1>
<p><s:text name = "index.account1"/>
<!--here i would like to display accounts amount.-->
</s:form>
</body>
</html>
**************
My question is: how could I dynamic display in index.jsp starting accounts
amount? (ac1 = 500, ac2 = 300, ac3 = 0)? Which tag i must use?
Thanks for reply!
--
View this message in context:
http://www.nabble.com/-S2--sending-multiple-%27bank-account%27-objects-to-view-page-tf3693561.html#a10327890
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]