HttpServletResponse response)
throws IOException, ServletException {
// Extract attributes and parameters we will need
Locale locale = getLocale(request);
MessageResources messages = getResources();
HttpSession session = request.getSession();
SubscriptionForm subform = (SubscriptionForm) form;
String action = request.getParameter("action");
if (action == null)
action = "?";
if (servlet.getDebug() >= 1)
servlet.log("SaveSubscriptionAction: Processing " + action +
" action");
// Is there a currently logged on user?
User user = (User) session.getAttribute(Constants.USER_KEY);
if (user == null) {
if (servlet.getDebug() >= 1)
servlet.log(" User is not logged on in session "
+ session.getId());
return (servlet.findForward("logon"));
}
// Is there a related Subscription object?
Subscription subscription =
(Subscription) session.getAttribute(Constants.SUBSCRIPTION_KEY);
if (subscription == null) {
servlet.log(" Missing subscription for user '" +
user.getUsername() + "'");
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
messages.getMessage("error.noSubscription"));
return (null);
}
// Was this transaction cancelled?
if (isCancelled(request)) {