Version notes 1.9.0
method LocaleManager.setDir to change the default location of the i18n files. (Default = "/i18n")
So to set it to be inside the WEB-INF directory, you can do: LocaleManager.setDir("WEB-INF/i18n");
New I18nListData, now you can select what elements from i18n file you wanna show.
The ListManager is now able to convert a java 5 enumeration into a ListData.
Now you can add a filter specific to an action (ActionConfig) that will be executed BEFORE any global filter.
action("/Foo", FooAction.class)
.filterFirst(new ValidatorFilter(VAL_ERROR))
.on(SUCCESS, fwd("/cool.jsp")
.on(ERROR, fws("/nocool.jsp");
Improvement in the exceptions, in other words, now you will see the correct exception in your browser even when it happened through a reflection call
(and not the InvocationTargetException that does not tell you anything!)
Debug logs throughout the code, specially on DIFilter, so that you can turn on DEBUG and see how the filter is operating.
Paginator Tag improvements: http://paginator.mentaframework.org/
CollectionFilter to turn a list of html parameters into a collection.
Ex:
<input name="name1">
<input name="name2">
<input name="name3">
...
<input name="name10">
You can add:
filter(new CollectionFilter("name"));
and get a collection from the action input:
Collection coll = (Collection) input.getValue("name");
Note: They will be in order and if there is a gap in the sequence, the value of the gap will be null in the collection.
MultiApplicationManager to load different application managers for the same application.
public class ApplicationManager extends MultiApplicationManager {
public void registerManagers() {
register(ModuleOneApplicationManager.class);
register(ModuleTwoApplicationManager.class);
register(ModuleThreeApplicationManager.class);
}
}
New Ajaxtags inside the org.mentawai.ajaxtag package.
LocaleManager.setDefaultDateMask("dd/MM/yyyy") and LocaleManager.setDateMask(Locale loc, String mask) so that you can set the default date mask
and a date mask specific of that locale. Date mask will be used with a SimpleDateFormat to convert a date.
ApplicationManager.setViewDir to set up a directory where all JSPs will reside.
Ex:
setViewDir("/WEB-INF/jsp");
so a new Forward("/hello.jsp") will go to:
/WEB-INF/jsp/hello.jsp
!!!! - Now inner actions can also be defined as Java inner classes (static or non-static) !!! Check the HelloInnerActions example below:
package examples.inneractions;
import java.util.*;
import org.mentawai.core.*;
public class HelloInnerActions extends BaseAction {
public String execute() throws Exception {
output.setValue("speak", "Hello there!");
return SUCCESS;
}
public String sayBye() throws Exception {
output.setValue("speak", "Bye for now...");
return SUCCESS;
}
public class SayBye2 extends BaseAction {
public String execute() throws Exception {
output.setValue("speak", "Bye for now from SayBye2 inner action class!");
return SUCCESS;
}
}
public static class SayBye3 extends BaseAction {
public String execute() throws Exception {
output.setValue("speak", "Bye for now from SayBye3 static inner action class!");
return SUCCESS;
}
}
}
min and max for DateRule (validation)
add support to JPA through the JpaFilter and JpaTrasaction
new LocalizedListData (similar to SimpleListData but with support to internationalization)
new DBListData if you want to load your lists from your database easily
improvements in the ExceptionFilter + FAQ (http://forum.mentaframework.org/posts/list/1096.page)
FormatterManager.setFixedDateFormatter(Formatter f) so you can fix a date formatter to be used for all dates throughout your application (mtw:out and mtw:inputDate)