Announcement Announcement Module
Collapse
No announcement yet.
Distinguishing GET and POST data in a CommandController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Distinguishing GET and POST data in a CommandController

    Is there any way I can make a subclass of AbstractCommandController distinguish between GET and POST data in its CommandClass object? I cannot find any mention of it in the documentation.

    I guess I could use a FormController om some kind, but it seems weird, since the controller is just going to handle a page filled with links having GET data in them ("id=33&view=forum", for instance).

    Any suggestions?

  • #2
    Is there any way I can make a subclass of AbstractCommandController distinguish between GET and POST data in its CommandClass object?
    Not sure why you'd want your command class aware of this.

    the controller is just going to handle a page filled with links having GET data in them ("id=33&view=forum", for instance)
    Why not just pull it straigt out using the request object API.

    Comment


    • #3
      Originally posted by katentim
      Is there any way I can make a subclass of AbstractCommandController distinguish between GET and POST data in its CommandClass object?
      Not sure why you'd want your command class aware of this.
      Security issues. Not quite as relevant this time, but with POST requests it would be very relevant to know that it was POST data and not something some cracker appended to the url.

      Originally posted by katentim
      the controller is just going to handle a page filled with links having GET data in them ("id=33&view=forum", for instance)
      Why not just pull it straigt out using the request object API.
      Because the CommandController class already does that for me, so I don't have to mess with the HttpServletRequest API

      Comment


      • #4
        Security issues. Not quite as relevant this time, but with POST requests it would be very relevant to know that it was POST data and not something some cracker appended to the url.
        It only takes a slightly smarter cracker to alter data in a POST. Still, I guess you could log such activity.

        Comment


        • #5
          Overwrite getCommand and set the command flag there.

          Not sure if this would work if you have session backed forms.

          Comment

          Working...
          X