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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Display error message in div tag

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

After i have caught an error using try catch i would like to display that message on the same page in a div panel.

I was just wondering how would i call a div panel and display the message in it without clearing the rest of the page. Would i have to re-create the page in the java code?

The code is as follows:
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You could try setting a boolean variable inside that catch and somewhere outside the table check to see if that variable is true. If yes, then print the message.
 
Talhah Mafawalla
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi Wilson,

Thanks very much for the help.

I was just wondering if you could explain why when i had my code in that catch statement and it printed the message the entire page above that catch code got over written and only the error message and the "Add New" <a> tag got displayed.

When i changed it to the following the page prints out correctly.



Thanks again for the help
Talhah Mafawalla
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Crosspost https://coderanch.com/t/291706/JSP/java/Display-error-when-record-not
 
    Bookmark Topic Watch Topic
  • New Topic