简体   繁体   English

如何提示用户在Struts2中触发动作

[英]how to prompt user to fire an action in Struts2

I have a 3 layer web application using Struts2, Spring and Hibernate. 我有一个使用Struts2,Spring和Hibernate的3层Web应用程序。 I want to prompt user in a JSP page (Struts2 in presentation layer) and if ok is pressed, an action occur. 我想在JSP页面(表示层中的Struts2)中提示用户,如果按OK,则会发生操作。

I can not find any prompt tags in Struts2. 我在Struts2中找不到任何提示标签。

You can add the prompt in the onclick event like this: 您可以像这样在onclick事件中添加提示:

onclick="return confirm('Continue?')"

Otherwise you need to redirect to the correct url of the action with window.location or call form.submit() programatically 否则,您需要使用window.location重定向到操作的正确网址,或以编程方式调用form.submit()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM