Stripes

Stripes Framework on WebSphere 8.x application server fails with FileNotFoundException

// Catch FileNotFoundException, which some containers (e.g. GlassFish) throw instead of setting SC_NOT_FOUND boolean fileNotFoundExceptionThrown = false; try { chain.doFilter(request, wrapper); } catch (FileNotFoundException exc) { fileNotFoundExceptionThrown = true; } try { chain.doFilter(request, wrapper); } catch (FileNotFoundException exc) { fileNotFoundExceptionThrown = true; } catch (ServletException ex) { if (ex.getCause() instanceof FileNotFoundException) { fileNotFoundExceptionThrown = true; } else { throw ex; } } @Override public void setStatus(int sc) { this.errorCode = sc; } @Override public void setStatus(int sc, String sm) { this.

iBatis 3.0 preview - část druhá

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd"> <mapper namespace="domain.blog.mappers.AuthorMapper"> ... další definice ... SqlSession session = sqlMapper.openSession(); try { BlogMapper mapper = session.getMapper(BlogMapper.class); List posts = mapper.selectAllPosts(null, 0, 2); assertEquals(2, posts.size()); assertEquals(1, posts.get(0).get("ID")); assertEquals(2, posts.get(1).get("ID")); } finally { session.close(); } public interface BoundBlogMapper { @Select({"SELECT * FROM blog"}) List selectBlogs(); @Select({"SELECT * FROM blog"}) List selectBlogsAsMaps(); @Select("SELECT * FROM post ORDER BY id") @TypeDiscriminator( column = "draft", javaType = String.

Running AJAX with jQuery in Stripes Framework

<filter> <display-name>Stripes Filter</display-name> <filter-name>StripesFilter</filter-name> <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class> <init-param><param-name>ActionResolver.UrlFilters</param-name><param-value>WEB-INF/classes</param-value> </init-param> <init-param><param-name>LocalePicker.Locales</param-name><param-value>cs_CZ:windows-1250</param-value> </init-param> ... other configuration ... </filter> <filter> <display-name>Stripes Filter Ajax</display-name> <filter-name>StripesFilterAjax</filter-name> <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class> <init-param><param-name>ActionResolver.UrlFilters</param-name><param-value>WEB-INF/classes</param-value> </init-param> <init-param><param-name>LocalePicker.Locales</param-name><param-value>cs_CZ:UTF-8</param-value> </init-param> ... other configuration ... </filter> <filter-mapping> <filter-name>StripesFilter</filter-name> <url-pattern>*.x</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>StripesFilterAjax</filter-name> <url-pattern>*.ajax</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> @UrlBinding("/consultation/newQuery.x") @StrictBinding public class NewQueryAction extends AbstractAction implements ValidationErrorHandler { @SpringBean protected QueryManager queryManager; @ValidateNestedProperties({ @Validate(field = "idIssue", on = "createQuery", required = true), @Validate(field = "author", on = "createQuery", required = false), @Validate(field = "idUser", on = "createQuery", required = false), @Validate(field = "title", on = "createQuery", required = true), @Validate(field = "query", on = "createQuery", required = true) }) protected Query query = new Query(); @AllowBinding protected Integer idIssue; @AllowBinding .