Package com.astamuse.asta4d.web.dispatch.response.provider

Examples of com.astamuse.asta4d.web.dispatch.response.provider.RedirectTargetProvider


            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            flashScopeData.put("nameErrMsg", nameErrMsg);
            flashScopeData.put("ageErrMsg", ageErrMsg);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
    }
View Full Code Here


                        } catch (NumberFormatException nfe) {
                            // do nothing
                        }
                    }
                }
                RedirectTargetProvider provider = DeclareInstanceUtil.createInstance(RedirectTargetProvider.class);
                provider.setStatus(status);
                provider.setTargetPath(path);
                return provider;
            } else {// asta4d page
                try {
                    Page page = Page.buildFromPath(result.toString());
                    if (page == null) {
                        return new TemplateNotFoundException(result.toString());
                    } else {
                        Asta4DPageProvider provider = DeclareInstanceUtil.createInstance(Asta4DPageProvider.class);
                        provider.setPage(page);
                        return provider;
                    }
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
View Full Code Here

    public Object transformToContentProvider(Object result) {
        if (result instanceof String) {
            String target = result.toString();
            if (target.startsWith("redirect:")) {
                String path = target.substring("redirect:".length());
                RedirectTargetProvider provider = DeclareInstanceUtil.createInstance(RedirectTargetProvider.class);
                provider.setTargetPath(path);
                return provider;
            } else {
                return null;
            }
        } else {
View Full Code Here

        if (cancel != null) {
            Map<String, Object> flashScopeData = new HashMap<>();
            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
        if (submit != null) {
            System.out.println("[FormCompleteHandler:complete]" + String.format("name=%s, age=%s, bloodtype=%s", name, age, bloodtype));
            return "/templates/form/complete.html";
        }
View Full Code Here

            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            flashScopeData.put("nameErrMsg", nameErrMsg);
            flashScopeData.put("ageErrMsg", ageErrMsg);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
    }
View Full Code Here

        if (cancel != null) {
            Map<String, Object> flashScopeData = new HashMap<>();
            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
        if (submit != null) {
            System.out.println("[FormCompleteHandler:complete]" + String.format("name=%s, age=%s, bloodtype=%s", name, age, bloodtype));
            return "/templates/form/complete.html";
        }
View Full Code Here

            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            flashScopeData.put("nameErrMsg", nameErrMsg);
            flashScopeData.put("ageErrMsg", ageErrMsg);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
    }
View Full Code Here

                            // do nothing
                        }
                    }
                    path = path.substring(possibleStatus.length() + 1);
                }
                RedirectTargetProvider provider = DeclareInstanceUtil.createInstance(RedirectTargetProvider.class);
                provider.setStatus(status);
                provider.setTargetPath(path);
                return provider;
            } else {// asta4d page
                try {
                    Page page = Page.buildFromPath(result.toString());
                    if (page == null) {
                        return new TemplateNotFoundException(result.toString());
                    } else {
                        Asta4DPageProvider provider = DeclareInstanceUtil.createInstance(Asta4DPageProvider.class);
                        provider.setPage(page);
                        return provider;
                    }
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
View Full Code Here

            flashScopeData.put("name", name);
            flashScopeData.put("age", age);
            flashScopeData.put("bloodtype", bloodtype);
            flashScopeData.put("nameErrMsg", nameErrMsg);
            flashScopeData.put("ageErrMsg", ageErrMsg);
            return new RedirectTargetProvider("/app/form/input", flashScopeData);
        }
    }
View Full Code Here

TOP

Related Classes of com.astamuse.asta4d.web.dispatch.response.provider.RedirectTargetProvider

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.