基于 Web 的应用程序中的删除确认
再会!
基于Web的应用程序中通常如何确认删除?我经常使用 JOptionPane 在 Java 桌面应用程序中执行确认消息,因此我也考虑在我的 Web 应用程序中执行相同的操作。 J2EE中有类似JOptionPane的东西吗?
所以我的确认消息计划类似于 这个 因为我觉得它很酷。是否可以使用 Java(JSP/Servlet)对此进行编码?我在哪里可以找到示例代码(或者我应该搜索什么术语以便我学习)?
另外,为什么我在访问不同的网站时没有遇到很多弹出窗口?弹出消息在网络应用程序中不是一个好习惯吗?如果这不是一个好的做法,我该如何做才能符合标准?
先感谢您。
Good day!
How is the confirmation for deletion usually done in Web-based applications? I often use JOptionPane in doing the confirmation messages in my Java desktop applications so I am also thinking of doing the same in my web-application. Is there something like JOptionPane in J2EE?
So my plan of confirmation message is something like THIS because I find it cool. Is it possible to code this using Java (JSP/Servlets)? Where can i find sample codes (or what term should i search so i'll learn it)?
Also, why haven't I encountered many pop-ups when visiting different websites? Are pop-up messages not a good practice in web-apps? If it's not a good practice, how can i do it to conform to the standards?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
上述两种技术都是服务器端的,而弹出窗口等客户端交互则是客户端的。所以,是的,在
javascript
中使用客户端弹出窗口将可以在 jsp 中正常工作。弹出窗口通常被认为是邪恶且烦人的。然而,当用于确认例如删除操作时,它们确实有意义。也许 jQuery UI 对话框 对您有用。
Both mentioned technologies are server-side, while client interaction such as popups are client-side. So yes, using a client-side popup in e.g.,
javascript
will work fine with jsp.Popups are usually considered evil and annoying. They do make sense however when used to confirm e.g., a delete operation. Perhaps the jQuery UI dialog could be useful for you.
您可以考虑的一种选择是使用 Google Web Toolkit (GWT),它允许您在java,并为您提供了很好的小部件来执行弹出窗口等操作(注意:这些小部件最终使用 javascript,但您不必关心它)。
One option that you may consider is using the Google Web Toolkit (GWT), which allows you to program in java, and gives you nice widgets for doing things like popup etc. (note: those widget ultimately use javascript, but you don't have to care about it).
实现这一原则的最简单方法是使用 javascript 确认功能。
做它需要做的事情,但当然网络非常酷。
实现一些很酷的东西的最简单方法是使用像 jquery 这样的 js 框架:就像this。
Jquery 和类似的框架将在窗口上创建一个半透明层,其中包含一个(对话框)div。该层本身会阻止其后面的任何操作,因此可以将其视为“模式对话框”。
问候,
斯泰因
the simplest way the achieve this principle is using the javascript confirm function.
Does what it needs to do but net very cool of course.
The easiest way to achieve something cool is using a js framework like jquery: like this.
Jquery and similar frameworks will create a semi-transparent layer on your window with a (dialog) div inside it. The layer itself blocks any actions that are behind it so this can be seen as a 'modal dialog'.
regards,
Stijn
这是通过 JavaScript 在浏览器中完成的,特别是称为 AJAX 的技术。您可以从许多不同的 AJAX 框架中进行选择。我推荐 GWT。您还可以使用 jQuery 或 Dojo,或尝试 Wikipedia AJAX 框架列表。
That's being done in the browser with JavaScript, specifically techniques called AJAX. You can choose from a number of different AJAX frameworks. I would recommned GWT. You could also use jQuery or Dojo, or try the Wikipedia List of AJAX frameworks.