• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to show errors on the same page?

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic