private void removeWidget(HttpServletRequest request, Configuration properties, IWidgetAdminManager manager) {
final String WIDGETFOLDER = getServletContext().getRealPath(properties.getString("widget.widgetfolder"));//$NON-NLS-1$
Messages localizedMessages = LocaleHandler.localizeMessages(request);
String widgetId = request.getParameter("widgetId"); //$NON-NLS-1$
IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
IWidget widget = persistenceManager.findById(IWidget.class, widgetId);
String guid = widget.getGuid();
if(WidgetFactory.destroy(widgetId)){
if(WidgetFileUtils.removeWidgetResources(WIDGETFOLDER, guid)){
request.setAttribute("message_value", localizedMessages.getString("WidgetAdminServlet.12")); //$NON-NLS-1$ //$NON-NLS-2$
}