views:

117

answers:

0

hi i am configuring struts.xml with <global-exception-mappings>

but i would like to return the exception stack according to ajax/xmlhttprequest type or typical one

thus:

  • if request is typical ordinal http request, and exception thrown to struts -> response html
  • if request is ajax/xmlhttprequest (and expecting json) -> response json

thus somehow i need to access to the httprequest header before i determine which type to response, could anybody tell how to configure this in <global-exception-mappings>?