}
String[] categorynames = new String[categories.length];
String[] categoryDescriptions = new String[categories.length];
long[] categoryIds = new long[categories.length];
for (int i = 0; i < categories.length; i++) {
Category category = categories[i];
categorynames[i] = category.getCategoryname();
categoryDescriptions[i] = category.getDescription();
categoryIds[i] = category.getId();
}
req.getSession().setAttribute(ATTR_CATEGORYNAMES, categorynames);
req.getSession().setAttribute(ATTR_CATEGORY_DESCRIPTIONS, categoryDescriptions);
req.getSession().setAttribute(ATTR_CATEGORY_IDS, categoryIds);