• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to displays pop up message when error occurs?

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

I'd like to know if there any way to display pop up window contains error message? I can do it with javascript embedded in jsp, but I wonder if I can use pure java (I mean, without javascript at all).

For example, please examine following snippet :

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
String fullName = request.getParameter(ApplicantEntryConstant.PARAM_FULL_NAME);

if (fullName == null || fullName.length() == 0) {
// show pop up message contains string
// "Full name must be filled"
}
} catch (SQLException ex) {
logger.getLogger().error("Error inserting applicant");
}
}
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No Javascript == no client-side activity
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaScript, or perhaps havinga link open up in a new parent window, are pretty much the only way to get things to pop-up. Simple Java won't be able to do it.

-Cameron McKenzie
 
Timotius Pamungkas
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I must use javascript, whether I like it or not, for such client-side activity?
 
Bear Bibeault
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. JSP and servlet technology is just a server-side mechanism to create dynamically generated HTML pages to send to the browser.

Regardless of what happens on the server, a good old fashioned HTML page is still sent to the browser so there's no magic to make the browsers do anything other than what they know: HTML and Javascript.
 
Timotius Pamungkas
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK guys, thanks for your explanations.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic