Announcement Announcement Module
Collapse
No announcement yet.
Handling Exception while using AjaxUrlBasedViewResolver & Spring.AjaxEventDecoration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling Exception while using AjaxUrlBasedViewResolver & Spring.AjaxEventDecoration

    Hi,
    I am using Spring MVC, AjaxUrlBasedViewResolver, Spring-js (Spring.AjaxEventDecoration) is my application.
    I have also used InternalResourceViewResolver in few screens.
    I need to configure a centralized Exception Resolver.
    Code:
    <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    		<property name="exceptionMappings">
    			<props>
                              <prop key="com.nbcu.common.exception.AddressBookException">error</prop>
    			  <prop key="java.lang.Exception">error</prop>
    			</props>
    		</property>
    </bean>
    The above config works fine for InternalResourceViewResolver.
    But while using AjaxUrlBasedViewResolver the error page rendering is not as desirable (the exception message overlaps the existing tiles html page).
    Please suggest a better solution to handle exception while using AjaxUrlBasedViewResolver.

  • #2
    But while using AjaxUrlBasedViewResolver the error page rendering is not as desirable (the exception message overlaps the existing tiles html page)
    Could you show your JSP file content? Little confuse your problem

    Comment


    • #3
      Dr_pompeii,
      thanks your response,
      I am looking for a general solution for the above scenario. What is the best way to handle exception (in case of tiles and ajax calls) using spring exception resolver and display a message to the user?
      Couple of options that I have thought thro'

      1) Display the error message in the tiles section from which the request originated.
      Since the general exception resolver wouldn't know the tile-view name and the fragment name, it can not route the exception to the correct fragment.
      I guess we can write some custom code to figure out the tile-view name and fragment name.
      But I want to know if there is a solution already available.

      2) I can set the exception message to the BindingResult and display it @ the top of the section.
      Still I am not sure how to achieve this .

      Appreciate you help.

      Comment


      • #4
        Can anyone throw in some ideas.
        It will be of great help.

        Thanks.

        Comment

        Working...
        X