小编sno*_*916的帖子

输入焦点上的jQuery Mobile Show键盘

当我关注文本输入时,我遇到了让Android键盘显示的问题.我在我的函数中有这个初始化页面:

jQuery(document).bind('pageshow', function()
{
    jQuery($inputItemReference).focus();
    jQuery($inputItemReference).prompt();
});
Run Code Online (Sandbox Code Playgroud)

$ inputItemReference是一个指向输入文本框的变量.

有人告诉我,prompt()会显示键盘.但事实并非如此.我只获取输入以在页面加载时显示闪烁的光标.如果我想要显示键盘,我必须再次点击输入.我想在页面加载时正确显示键盘.有什么想法吗?谢谢.

keyboard focus jquery-mobile

12
推荐指数
2
解决办法
3万
查看次数

如何创建自定义Apache 503错误页面

我创建了一个HTML文档,它将显示服务器尚未就绪,然后重定向到另一个页面.我希望这是503错误页面.

我需要在Apache中编辑哪个文件才能将此自定义HTML作为我的新503错误页面?我曾尝试按照多个网站上的说明进行操作,但它仍指向最初的Apache网站.

这是我在"httpd-vhosts.conf"文件中的代码.

<VirtualHost *:80>
ServerAdmin blah@blah.com
ServerName blah.blah.com
ServerAlias blah blah.blah.local
ErrorLog "logs/blah-error.log"
CustomLog "logs/blah-access.log" common
ErrorDocument 503 "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah/error.html"
LogLevel warn
RewriteEngine On
JkMount /* worker5
DocumentRoot "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah"
<Directory "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah">
            Options All
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

在"httpd.conf"文件中,它包含"httpd-vhosts.conf"文件,所以我不知道它为什么不起作用.任何帮助,将不胜感激.谢谢.

apache http-status-code-503

9
推荐指数
1
解决办法
2万
查看次数

我如何使用SessionDestroyedEvent?

我试图让SessionDestroyedEvent工作时遇到问题.我希望它在会话超时时打印出来.我正在清除我的历史,迫使它超时.

这是我的代码:

@Service
public class MyTimeoutFilter implements
        ApplicationListener<ApplicationEvent>
{
    public MyTimeoutFilter()
    {
        super();
        System.out.println("Application context listener is created!");
    }

    public void onApplicationEvent(ApplicationEvent event)
    {
        if (event instanceof SessionDestroyedEvent)
        {
            SessionDestroyedEvent sdEvent = (SessionDestroyedEvent) event;

            List<SecurityContext> lstSecurityContext = sdEvent
                    .getSecurityContexts();

            for (SecurityContext securityContext : lstSecurityContext)
            {
                System.out.println("Security Context: "
                    securityContext.getAuthentication().getName());
            }
        }

        System.out.println("This is a test.");
    }
}
Run Code Online (Sandbox Code Playgroud)

我得到的只是"创建应用程序上下文监听器",然后是"这是一个测试".我从来没有在if语句中运行代码.

这是我的web.xml:

<!-- The definition of the Root Spring Container shared by all Servlets 
    and Filters -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/root-context.xml,
        /WEB-INF/spring/appServlet/security-context.xml</param-value>
</context-param>

<!-- …
Run Code Online (Sandbox Code Playgroud)

java spring-security

7
推荐指数
1
解决办法
7878
查看次数

在Cygwin中使用"email"命令

我正在尝试使用Cygwin从命令行发送电子邮件.这就是我所说的:

email -f myaddress@blah.com -s "This is a test" -b toaddress@blah.com
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息:

/bin/sh: /usr/lib/sendmail: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我在/ usr/lib中创建了一个名为"sendmail"的文件夹,现在我得到了这个:

/bin/sh: /usr/lib/sendmail: is a directory
Run Code Online (Sandbox Code Playgroud)

有人可以给我一步一步说明如何从Cygwin发送电子邮件吗?喜欢如何设置它和一切?我到处寻找,我准备把头发撕掉了.

编辑:感谢您的回复.这就是我最终让它发挥作用的方式.

bash.exe -c "echo  -e 'To: thepeopleimsendingitto@blah.com\nSubject: mySQL Upload\nSQL files from machines uploaded to log table successfully.' | sendmail -f me@blah.com otherpeople@blah.com"
Run Code Online (Sandbox Code Playgroud)

即使Cygwin在我的Windows路径中,也无法识别它,所以我必须直接运行bash.exe并说"将此命令作为Linux命令".回声就是构建电子邮件本身的内容.\n字符将其分为"To","Subject"和Body.

email command-line cygwin

3
推荐指数
1
解决办法
2万
查看次数

Apache Common IO FileUtils问题

我正在尝试使用Apache Commons IO的FileUtils.writeStringToFile()方法.每一份文档都说我可以这样做:

FileUtils.writeStringToFile(File, String with data, boolean append);
Run Code Online (Sandbox Code Playgroud)

我想要这种方法,因为我希望每次都将数据写入文件的末尾.

但是,在Eclipse中,它一直告诉我这个方法不存在.我唯一的两个是:

FileUtils.writeStringToFile(File, String with data);
FileUtils.writeStringToFile(File, String with data, String encoding);
Run Code Online (Sandbox Code Playgroud)

我纠正了我的POM文件,现在有这种依赖:

<dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

有人可以告诉我我做错了什么吗?

apache apache-commons fileutils

3
推荐指数
1
解决办法
6910
查看次数