• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Displaying response messages after some action executed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After adding/updating any value in DB, I want to display the same message like "Updated Successfully" in an alert box or a dialog page. I am using Struts2, Tiles and Hibernate.
I want a generic jsp page which can accept a message. This message will be passed by other pages like add.jsp or update.jsp using String return values.
How I can do this ?
I implemented this by using my own exception. Is it the right way ?
Please let me know how to do this.
 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
^^
Why you want to display it as a alert message? That is not a good way. Instead simply place a status_message variable in your jsp page under a div, so that it can display the message if exists, Otherwise it'll not.

Other method would be by handling you own exception handling. Whatever the status_message is, we need to display it to user, in laymen terms. Right?
 
Nandish Sri
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response. Now I am handling using Like below..

MyException


Struts.xml



DAO Code


Like above I am passing message. Is it the right way ?

Can you please let me know how will you set status_message in jsp from DAO. Using same getter/setter from a bean ?

 
Do you want ants? Because that's how you get ants. And a tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic