File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to displays pop up message when error occurs?

 
Timotius Pamungkas
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • 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");
}
}
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Javascript == no client-side activity
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I must use javascript, whether I like it or not, for such client-side activity?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic