Java Reference
In-Depth Information
String query = "select from " +
Opportunity.class.getName() + " where accountId ==
List<Opportunity> opportunities = (List<Opportunity>)
// pass the list to the jsp
request.setAttribute("account", a);
// pass the list to the jsp
request.setAttribute("opportunities", opportunities);
// forward the request to the jsp
RequestDispatcher dispatcher =
dispatcher.forward(request, response);
// display the create new opportunity form
} else
if(request.getParameter("action").equals("opportunityCreate")) {
Key k =
KeyFactory.createKey(Account.class.getSimpleName(), new
Account a = pm.getObjectById(Account.class, k);
// pass the account name to the jsp
request.setAttribute("accountName", a.getName());
// forward the request to the jsp
RequestDispatcher dispatcher =
dispatcher.forward(request, response);
// process the new opportunity creation and send the user to
the account display page
} else
if(request.getParameter("action").equals("opportunityCreateDo")) {
Date closeDate = new Date();
// try to parse the date
try {
DateFormat df = DateFormat.getDateInstance(3);
Search WWH ::

Custom Search