Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show errors on the same page?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a tab.jsp page that when a user clicks, an action is performed - preparing the form to show previous information.



when the user add/edit the form and clicks SAVE, validation kicks in. If errors exists, the user should see the info on the form (obviously). The input in the struts-config.xml of the form points to the tab.jsp page, but when it gets there it perform the action (not good, because ignores the errors).

Q: how can I point to the same page and embed the errors without performing an action?

struts-config.xml:

displayUserGroups.jsp=tabs.jsp

 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question has me a little lost. If validation fails (your own validate method on the form or using the validator framework) then flow will be forward to your input attribute. In your case, it is a jsp file, so no action should be executed. You could set your input attribute to "/PrepearPayment.do" in which case that action will be called.

BTW...it looks like you have a little typo in PrepearPayment...should be PreparePayment but that does not make a difference.

- Brent
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well... if validation fails, the flow is forward to the input attribute page which is this:

<ajax:tab caption="Payments" baseUrl="${contextPath}/Prj/PrepearPayment.do"/>

so the PrepearPayment.do ignites the action; this is what I'm trying to avoid because the errors are lost.

hope this clarifies my question
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic