Sure I can do that.
This method gets called when push a button to delete a DomainWebsite
public ActionForward deleteConfirmedDomainWebsite(ActionMapping mapping,
ActionForm form, HttpServletRequest req, HttpServletResponse
res)
throws Exception {
RollerRequest rreq = RollerRequest.getRollerRequest(req);
DomainWebsiteForm domainWebsiteForm = (DomainWebsiteForm) form;
DomainManager domainMgr =
RollerFactory.getRoller().getDomainManager();
try {
if (!hasRequiredRights(rreq, rreq.getWebsite())) {
return mapping.findForward(ACCESS_DENIED_PAGE);
}
String domainWebsiteId = domainWebsiteForm.getId();
if (domainWebsiteId == null || domainWebsiteId.length() == 0) {
throw new RollerException("Missing domainwebsite id.");
}
domainMgr.removeDomainWebsite(domainMgr.retrieveDomainWebsite(domainWebsiteId));
RollerFactory.getRoller().commit();
return view(mapping, form, req, res, DOMAIN_ADMIN_EDIT_PAGE);
} catch (Exception e) {
getLogger().error("ERROR in action", e);
throw new ServletException(e);
}
}
Here I call on the view method so that I can return to the page I was in
previously
public ActionForward view(ActionMapping mapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response,
String forwardTo)
throws Exception {
ActionForward forward = mapping.findForward(forwardTo);
try {
RollerSession rollerSession =
RollerSession.getRollerSession(request);
request.setAttribute("domainWebsiteModel", new
DomainWebsiteAdminEditPageModel(
"domainWebsiteAdminEdit.title", request, response,
mapping, null, null));
if (request.getAttribute("domainWebsiteModel") == null) {
request.setAttribute("domainWebsiteModel", actionForm);
}
// Ensure user is authorized
if (rollerSession.isGlobalAdminUser()) {
return forward;
} else {
return mapping.findForward("access-denied");
}
} catch (Exception e) {
mLogger.error("Error in DomainWebsiteAdminAction.view()"+ e
+ "\n" + e.getMessage());
throw new ServletException(e);
}
}
My struts and xdoclet stuff
/**
* Administer Multiple DomainWebsites
*
* @struts.action name="domainWebsiteForm"
path="/admin/domainwebsiteAdmin" scope="request"
* parameter="method"
*
* @struts.action-forward name="domainwebsiteAdminEdit.page"
path=".domainwebsiteAdminEdit"
* @struts.action-forward name="domainAdminEdit" path=".domainAdminEdit"
* @struts.action-forward name="domainwebsiteAdminDeleteOK.page"
path=".domainwebsiteAdminDeleteOK"
*
* @author Shervin Asgari
*
*/
the DOMAIN_ADMIN_EDIT_PAGE refers to a String
protected static final String DOMAIN_ADMIN_EDIT_PAGE =
"domainAdminEdit.page";
In my tiles-def.xml I have defined .domainAdminEdit to point to the
correct jsp file.
<definition name=".domainAdminEdit" extends=".tiles-adminpage" >
<put name="content" value="/website/domainAdminEdit.jsp" />
</definition>
But this domainAdminEdit.jsp page never runs. I only get a blank page
with no exception errors. And nothing on view source.
I hope this was more clear.
Thank you for any help.
Shervin Asgari - System Consultant
M: +47 918 64 148, @: [EMAIL PROTECTED]
Linpro AS - Leading on Linux Tel: +47 21 54 41 00/02
Vitaminveien 1A Fax: +47 21 54 41 01
PB 4 Grefsen, 0409 Oslo WWW: http://www.linpro.no/
Dave Newton wrote:
Shervin Asgari wrote:
Alright here is all the code. Sorry for too much code, but better too
much rather then too little:
Not in this case.
In general, posting only RELEVENT code/configs is plenty.
Can you trim that and target the usecase that's actually failing?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]