Working example

DEPRECATED! This page has not been updated for a long time. Still, it may contain some valid and valuable information.

Let's modify our webapp example. Instead of passing the name, we will pass the user id, then find it in the database, and print it in the jsp.


    public class IndexAction {

        FooService fooService;

        Long id;

        User user;

        public void view() {
            if (id != null) {
                user = fooService.findUserById(id);


    ...hello ${}...


    public class FooService {

        AppDao appDao;

        @Transaction(propagation = PROPAGATION_SUPPORTS, readOnly = false)
        public void storeUser(User user) {

        @Transaction(propagation = PROPAGATION_SUPPORTS)
        public User findUserById(long id) {
            return appDao.findById(User.class, Long.valueOf(id));

Final words

This tutorial ends here, but it is just a beginning for your quest through Jodd! Enjoy!