File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Displaying response messages after some action executed Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Displaying response messages after some action executed" Watch "Displaying response messages after some action executed" New topic
Author

Displaying response messages after some action executed

Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45
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.


Nandish
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

^^
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?


Never try to be a hard-worker. Be a smart-worker.
My Blog
Nandish Sri
Ranch Hand

Joined: Jan 19, 2004
Posts: 45
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 ?

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Displaying response messages after some action executed
 
Similar Threads
how to update colunm in database table for particular userid after session is expire
Opening File Chooser in a jsp Page?
how can i update the databse for partcular user_id after session is expire ?
built a program that can directly run in the same page
Navigating From one page to another Page