/**
* The default widgetset to use for the servlet. The default value is
- * <code>com.vaadin.DefaultWidgetSet</code>.
+ * <code>""</code>, which will cause
+ * <code>com.vaadin.DefaultWidgetSet</code> to be used unless overridden by
+ * an init parameter or unless an automatically generated
+ * <code>AppWidgetset</code> is used.
*
* @return the default widgetset name
*/
@InitParameterName(VaadinServlet.PARAMETER_WIDGETSET)
- public String widgetset() default VaadinServlet.DEFAULT_WIDGETSET;
+ public String widgetset() default "";
/**
* The legacy Property.toString() mode used. The default value is
return new WidgetsetInfoImpl(uiWidgetset.value());
}
+ // Second case: We might have an init parameter, use that
+ String initParameterWidgetSet = event.getService()
+ .getDeploymentConfiguration().getWidgetset(null);
+ if (initParameterWidgetSet != null) {
+ return new WidgetsetInfoImpl(initParameterWidgetSet);
+ }
+
// Find the class AppWidgetset in the default package if one exists
WidgetsetInfo info = getWidgetsetClassInfo();
- // Second case: we have a generated class called APP_WIDGETSET_NAME
+ // Third case: we have a generated class called APP_WIDGETSET_NAME
if (info != null) {
return info;
}
- // third case: we have an AppWidgetset.gwt.xml file
+ // Fourth case: we have an AppWidgetset.gwt.xml file
else {
InputStream resource = event.getUIClass()
.getResourceAsStream("/" + APP_WIDGETSET_NAME + ".gwt.xml");
stringValue = value.toString();
}
+ if (VaadinServlet.PARAMETER_WIDGETSET.equals(name.value())
+ && method.getDefaultValue().equals(stringValue)) {
+ // Do not set the widgetset to anything so that the
+ // framework can fallback to the default. Setting
+ // anything to the init parameter will force that into
+ // use and e.g. AppWidgetset will not be used even
+ // though it is found.
+ continue;
+ }
initParameters.setProperty(name.value(), stringValue);
} catch (Exception e) {
// This should never happen