Search:

Type: Posts; User: mrcritical; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Use Throwable for Setting status?

    This is more a question, than a solution. Would it be "bad form" to throw a throwable that indicates the status? Perhaps a "NoContentException" or "UnauthorizedException". Then register...
  2. Thread: Spring-PHP

    by mrcritical
    Replies
    4
    Views
    11,423

    While .NET and Java are capable of providing...

    While .NET and Java are capable of providing front-ends languages, via JSP, Velocity, etc. for Java, and ASP.NET in .NET, that is not the main focus of Spring.

    The main focus is enterprise...
  3. Just out of curiosity, is the following line a...

    Just out of curiosity, is the following line a misspelling in your code or in your adding it to this post:

    mav.addObject("erros", errors);

    You are trying to get "errors" in the JSP tag, but it...
  4. On the field that contains the bean you want to...

    On the field that contains the bean you want to inject into the controller add the @Autowired annotation, like below. Spring will then automatically inject the bean when creating the controller. ...
  5. Replies
    2
    Views
    6,851

    Change your component-scan tag as follows: ...

    Change your component-scan tag as follows:


    <context:component-scan base-package="com.foo.web" scoped-proxy="targetClass" />

    This will add a scope proxy as needed. You should make sure you...
  6. Replies
    9
    Views
    2,831

    Yes, it will work that way. However, it is...

    Yes, it will work that way. However, it is strange that your overwriting the bound Customer object with one from the DB. It is usually bad practice to directly expose a DB object to the view. It...
  7. Replies
    6
    Views
    1,381

    Behind the scenes a form bind tag uses a...

    Behind the scenes a form bind tag uses a BeanWrapper to get the value. A BeanWrapper uses PropertyEditors. So that is why directly accessing the object off the command object will not give you the...
  8. Replies
    10
    Views
    1,756

    What exactly is it doing right now, instead of...

    What exactly is it doing right now, instead of showing a new form? Because it appears you aren't returning to the page in the case of validation errors. I see the only time you show the form again...
  9. Take a look at this documentation...

    Take a look at this documentation. It outlines multiple ways to register a custom property editor without extending any classes.
  10. Replies
    3
    Views
    818

    You'll need to read up on proxies here...

    You'll need to read up on proxies here.

    You probably either have some AOP interceptors in action or have scoped the object as "request", "session", or some other scope. Any of these cases...
  11. Replies
    9
    Views
    2,831

    Ok, so you should not pass in the command object...

    Ok, so you should not pass in the command object to the "saveCustomer" method. This is because it is a handler method and, as such, passing in the command object will signal that automatic binding...
  12. Replies
    2
    Views
    909

    Actually, the @RequestMapping on the Controller...

    Actually, the @RequestMapping on the Controller is no longer being used to map the URL to the Controller. Instead it is now using the ControllerClassNameHandlerMapping to map the HotelsController...
  13. Replies
    9
    Views
    2,831

    What does "getCustomer" do? And how have you...

    What does "getCustomer" do? And how have you configured the MultiActionController? If "saveCustomer" is "registered" as an action, then it is a different request and will not have the command...
  14. I find the Spring BeanWrapper...

    I find the Spring BeanWrapper to be pretty fast, especially since it caches. You can use it by doing the following:


    BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(target);...
  15. Replies
    9
    Views
    2,831

    First off, you don't want to pass CustomerEntity...

    First off, you don't want to pass CustomerEntity into the method since that will trigger binding already. Remove that argument. Instead the command should be instantiated inside the method instead....
  16. Replies
    2
    Views
    3,362

    The following can be used off the...

    The following can be used off the "messageSource", if you inject it into the class you want to read the message text:


    messageSource.getMessage(String code, Object[] args, Locale locale)

    You...
  17. According to the JavaDoc for the ErrorsTag: ...

    According to the JavaDoc for the ErrorsTag:



    So you'll want to call the tag without a path which is:


    <form:errors path="" />
  18. According to the JavaDoc for the...

    According to the JavaDoc for the MultiActionController:



    So, I would suggest the following in your saveCustomer method:


    public ModelAndView saveCustomer(HttpServletRequest request,...
  19. Not sure what is going on here. Everything looks...

    Not sure what is going on here. Everything looks pretty basic and should work. For some reason it isn't registering "product1" so it can't insert it into the list in "productManager". Perhaps...
  20. The problem appears to be with your Product...

    The problem appears to be with your Product class. Can you post that source code?
  21. Thread: Validation

    by mrcritical
    Replies
    3
    Views
    1,027

    If you can't wait, can you do this: ...

    If you can't wait, can you do this:


    BindingResult bindingResult = new BeanPropertyBindingResult(target, "nameOfBean");
    ValidationUtils.invokeValidator(validator, target, bindingResult);
    List...
  22. Replies
    3
    Views
    4,685

    It appears your trying to directly rendered a...

    It appears your trying to directly rendered a template without going through a handler/controller. So, in essence, your skipping the ContextLoaderListener or DispatcherServlet which is what makes...
  23. Replies
    3
    Views
    936

    You can do the following to destroy only the...

    You can do the following to destroy only the beans of the type Job.class:


    AbstractApplicationContext context = new ClassPathXmlApplicationContext("abc.xml");
    Map beans =...
  24. Replies
    4
    Views
    4,578

    What do you mean by "allow the process to...

    What do you mean by "allow the process to continue"? If you are talking about the controller continuing, then that isn't possible unless you catch the exception and handle it appropriately in the...
  25. Please see the thread...

    Please see the thread http://forum.springframework.org/showthread.php?t=37068.

    You are overriding the ModelAndView that contains the binding result in your onSubmit() method. The thread above...
Results 1 to 25 of 36
Page 1 of 2 1 2