Package org.slim3.util

Examples of org.slim3.util.RequestMap


    static {
        initialize();
    }

    private static void initialize() {
        Cleaner.add(new Cleanable() {
            public void clean() {
                modelMetaCache.clear();
                initialized = false;
            }
        });
View Full Code Here


    private TwitterService service = new TwitterService();
    private TweetMeta meta = TweetMeta.get();

    @Override
    public Navigation run() throws Exception {
        RequestMap requestMap = new RequestMap(request);
//        int index = Integer.parseInt(requestMap.get("index").toString());
//        String content = requestMap.get("content").toString();
//        List<Tweet> listTween = service.getTweetList();
//        int maxIndex = listTween.size();
//        if (index < maxIndex) {
//            service.updateTweet(listTween.get(index).getKey(), content);
//            listTween = service.getTweetList();
//            requestScope("tweetList", listTween);
//        }
        if (validate() && (!requestMap.get("content").toString().trim().equals(""))) {
            service.updateTweet(asKey(meta.key), asLong(meta.version), requestMap);
        } else {
            return forward ("edit.jsp");
        }
        return redirect(basePath);
View Full Code Here

    private TwitterService service = new TwitterService();
    private TweetMeta meta = TweetMeta.get();

    @Override
    public Navigation run() throws Exception {
        RequestMap requestMap = new RequestMap(request);
        if (validate() && (!requestMap.get("content").toString().trim().equals(""))) {
            service.tweet(requestMap);
        }
        return redirect(basePath);
    }
View Full Code Here

     *
     * @param request
     *            the request
     */
    public Validators(HttpServletRequest request) {
        this(new RequestMap(request));
    }
View Full Code Here

     * Returns the request attribute value as {@link Map}.
     *
     * @return the request attribute values as {@link Map}
     */
    protected RequestMap asMap() {
        return new RequestMap(request);
    }
View Full Code Here

     */
    @Before
    public void setUp() throws Exception {
        servletContext = new MockServletContext();
        request = new MockHttpServletRequest(servletContext);
        parameters = new RequestMap(request);
        parameters.put(ControllerConstants.ERRORS_KEY, new Errors());
        v = new Validators(parameters);
        ApplicationMessage.setBundle("test", Locale.ENGLISH);
    }
View Full Code Here

     *
     * @param request
     *            the request
     */
    public Validators(HttpServletRequest request) {
        this(new RequestMap(request));
    }
View Full Code Here

    @Override
    public Navigation run() throws Exception {
        if (!validate()) {
            return forward("edit.jsp");
        }
        service.update(asKey(meta.key), asLong(meta.version), new RequestMap(
            request));
        return redirect(basePath);
    }
View Full Code Here

     */
    @Test
    public void asMap() throws Exception {
        tester.request.setAttribute("aaa", "aiueo");
        tester.request.setAttribute("bbb", "12345");
        RequestMap map = controller.asMap();
        assertThat(map.keySet().size(), is(2));
        assertThat((String)map.get("aaa"), is("aiueo"));
        assertThat((String)map.get("bbb"), is("12345"));
    }
View Full Code Here

                encoding = "UTF-8";
            }
            try {
                return URLEncoder.encode(path, encoding);
            } catch (UnsupportedEncodingException e) {
                throw new WrapRuntimeException(e);
            }
        }
View Full Code Here

TOP

Related Classes of org.slim3.util.RequestMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.