我们使用 jBoss 日志记录并让它最终工作 - 现在我们遇到了问题,我们不想在每次出现错误时发送电子邮件。如果抛出定义的异常,我们只想发送一封电子邮件。例如 com.myproject.exceptions.fatal.ProjectFatalException
“jboss-logging.xml”中的默认定义如下所示:
<log4j-appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
<error-manager>
<only-once/>
</error-manager>
<level name="ERROR"/>
<properties>
<property name="to">admin@myhost.domain.com</property>
<property name="from">nobody@myhost.domain.com</property>
<property name="subject">JBoss Sever Errors</property>
<property name="SMTPHost">localhost</property>
<property name="bufferSize">10</property>
</properties>
<formatter>
<pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>
</formatter>
</log4j-appender>
Run Code Online (Sandbox Code Playgroud) 我想检查一个字符串是否有任何特殊字符。我正在使用这个脚本:
var name = $("#name").val();
if(name.match(/[_\W]0-9/))
{
alert('Not A Name');
}
Run Code Online (Sandbox Code Playgroud)
即使什么时候也不会提醒 name="sas23"
基本上我是这样做的:
window.onload=function wait(){
alert ("Please, wait until process has finished.");
window.location="index.jsp";
};
Run Code Online (Sandbox Code Playgroud)
我需要的是一个警报窗口或类似的东西,它会消失/启用弹出窗口中的“确定”按钮,只有在 X 秒过去后。
我怎样才能做到这一点?
我希望在表单底部创建一个按钮,该按钮将创建一个警报框,显示输入的表单数据。表格包括: 名字 姓氏 地址 1 地址 2 城市 州 邮编电话传真
表单完成后,单击该按钮并弹出一个警告框,显示输入的表单数据。
有谁知道如何在没有实际提交或验证表单的情况下完成?没有用于提交表单数据的数据库,因此没有可从中提取信息的数据库。
任何帮助将不胜感激。
由于其长度,我没有包含表单代码,但我正在为警报框使用的当前代码如下所示:
<script>
function display_alert()
{
alert("");
}
</script>
<body>
<input type="button" onclick="display_alert()" value="Display alert box">
</body>
Run Code Online (Sandbox Code Playgroud) 目前,我有一个空检查,它显示和警报(运行正常),但是我希望此警报显示为黑色背景,而不仅仅是警报对话框。
我已经尝试删除,finish();但只是显示带有先前布局的警报在其后面 - 并留下它会导致警报出现在用户的主屏幕上 - 我的问题是:如何修改它以显示带有简单黑色背景的警报反而?
StartActivity.java 源代码片段:
} else {
// ICS and UP
if (isMDNPresent) {
//start SaveMDN activity
Intent i = new Intent(StartActivity.this, SaveMDN.class);
startActivity(i);
finish();
} else {
//start Update Activity
Intent i = new Intent(StartActivity.this,
UpdateActivity.class);
startActivity(i);
finish();
}
}
Run Code Online (Sandbox Code Playgroud)
SaveMDN.java 源代码片段:
public class SaveMDN extends Activity {
EditText saveMDN;
TextView enterMdn;
Button save;
public static String mdn = "";
int version;
String temp;
TelephonyManager tm;
AlertDialog mErrorAlert = null;
@Override
protected void …Run Code Online (Sandbox Code Playgroud) 我是 android 新手,我正在开发我的第一个基于位置的提醒应用程序。我正在添加带有地点、日期和时间的任务,当我到达时应该通知我。我正在正确地收到任务的警报。问题是当为任务生成警报时,当我单击通知时,它应该显示在活动中。我没有得到警报任务的值..
从下面的代码中,我将任务值传递给 Alertview 活动。
代码
private void processTasks() {
List<Task> tasks = loadFiles();
if(tasks == null || tasks.size() < 1){
// Toast.makeText(getApplicationContext(),"No Tasks Found",Toast.LENGTH_LONG).show();
}
// Toast.makeText(getApplication(),"Number of Tasks " + tasks.size(),Toast.LENGTH_LONG).show();
for (Task task : tasks) {
if (tasks != null && task.alert) {
Log.i("Task is ",task.toString());
//Toast.makeText(getApplicationContext(),"Your Task is " + task.toString(),Toast.LENGTH_LONG).show();
// if in time range
boolean timeRange = false;
// if in loc range
boolean locRange = false;
float dst = 0.0f;
if(lat > …Run Code Online (Sandbox Code Playgroud) 我正在使用Xamarin和iOS,但是在通知方面我遇到了很多麻烦.我可以创建一个发送到通知中心的本地推送通知,但没有声音或指示通知实际到达.如何使通知成为警报通知,以便在进入通知中心之前显示在屏幕上?
这是我正在生成通知的代码:
//create notification
var notification = new UILocalNotification ();
notification.AlertAction = "Open App";
notification.AlertTitle = "App";
notification.AlertBody = "There has been activity in the app";
notification.SoundName = UILocalNotification.DefaultSoundName;
//display notification
UIApplication.SharedApplication.ScheduleLocalNotification (notification);
Run Code Online (Sandbox Code Playgroud)
编辑:问题不仅仅是声音,而是没有收到警报的反馈,它只是静默地出现在通知中心.我也要求使用此代码的权限:
var settings = UIUserNotificationSettings.GetSettingsForTypes(
UIUserNotificationType.Alert
| UIUserNotificationType.Badge
| UIUserNotificationType.Sound,
new NSSet());
UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
UIApplication.SharedApplication.RegisterForRemoteNotifications();
Run Code Online (Sandbox Code Playgroud) 我想要 Bootstrap 警报和关闭按钮功能。我已经在我的页面头中包含了 JQuery 和 Bootstrap javascript 文件,但不想要其中的 CSS,因为它覆盖了大量的样式。
目前,我已将 Bootstrap 的这些部分添加到我自己的 css 中,以使警报和关闭按钮出现。
.alert {
padding: 8px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px
}
.alert h4 {
margin-top: 0;
color: inherit
}
.alert .alert-link {
font-weight: 700
}
.alert>p,
.alert>ul {
margin-bottom: 0
}
.alert>p+p {
margin-top: 5px
}
.alert-dismissable,
.alert-dismissible {
padding-right: 35px
}
.alert-dismissable .close,
.alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit
}
.alert-info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1 …Run Code Online (Sandbox Code Playgroud) 按下位置权限警报按钮时如何触发操作?我想在按下允许或取消按钮后执行segue.
我可以将文本和变量放在同一个警告框中吗我认为代码可以工作但它没有
alert('text'Variable);Run Code Online (Sandbox Code Playgroud)