【问题标题】:Ijetty deployed war, need ijetty's contextijetty部署战争,需要ijetty的上下文
【发布时间】:2011-09-09 16:37:58
【问题描述】:

我正在使用 ijetty,我在上面部署了一场战争。它提供的一项服务是从手机远程发送电子邮件。收件人/主题/正文都已发布到服务器,我想将它们从电话中发送出去。

我正在使用this 方法,它可以正常发送邮件,但我需要用户凭据。即使我可以收到电子邮件,然后用户发布密码也可以,但要做到这一点,我需要使用

AccountManager accountManager = AccountManager.get(context); 

问题是我不知道如何获取 ijetty 的上下文以便获取帐户。

如果有人可以提供帮助或提供其他方向,我将不胜感激。

【问题讨论】:

    标签: android ijetty


    【解决方案1】:

    好的,我从 ijetty 邮件列表中得到了一个遮阳篷,就在这里,

    android.content.ContentResolver resolver =
    (android.content.ContentResolver)getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");
    android.content.Context androidContext =
    (android.content.Context)getServletContext().getAttribute("org.mortbay.ijetty.context");
    

    有了这 2 个对象,您应该能够做您想做的事。或者, 你总是可以继承 i-jetty 以提供对更多 android 对象的访问。

    【讨论】:

      猜你喜欢
      • 2010-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-12
      • 1970-01-01
      • 2015-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多