Results 1 to 2 of 2

Thread: Response code with annotated controllers

  1. #1
    Join Date
    Aug 2007
    Location
    Belgium
    Posts
    58

    Default Response code with annotated controllers

    Hi,

    I was wondering if it is possible to just return a response code instead of a view when using annotated controllers ?

    Should I just create a method that accepts the HttpServletResponse and set the code and afterwards return null?

    Regards,
    Davy

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    I was wondering if it is possible to just return a response code instead of a view when using annotated controllers ?
    Well you could, but that would be passed on to a view resolver and being used as a view name. So that wouldn't accomplish what you where looking for.

    Should I just create a method that accepts the HttpServletResponse and set the code and afterwards return null?
    That's the way to do it I and the only way as I see it.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •