myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott O'Bryan" <darkar...@gmail.com>
Subject Re: [MyFaces 2.0] how to handle _SystemEventServletRequest and _SystemEventServletResponse classes (attn:Werner)
Date Tue, 01 Dec 2009 23:27:48 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I'm not sure number 2 would work, you should try it out.  I know that
when I tried to do this for Trinidad, it complained that I was not
implementing the right version of the interfaces, even though the
methods were there.  If this is the case then perhaps you should use a
Proxy Object.  We did that in Trinidad to handle differences of several
objects and the interface isn't applied until runtime.  Your
InvocationHandler can then call into the real methods as they are
called if you wish, but it's the most foolproof way I found of
implementing this.<br>
<br>
If #2 works for you, though, then I say go for it.  If it doesn't,
Proxy's aren't a bad alternative.<br>
<br>
Scott<br>
<br>
Jakob Korherr wrote:
<blockquote
 cite="mid:fd49e8160912011503g454f89dhb8f242521105a58a@mail.gmail.com"
 type="cite">I'd also prefer 2)<br>
  <br>
Regards,<br>
  <br>
Jakob Korherr<br>
  <br>
  <div class="gmail_quote">2009/12/2 Leonardo Uribe <span dir="ltr">&lt;<a
 moz-do-not-send="true" href="mailto:lu4242@gmail.com">lu4242@gmail.com</a>&gt;</span><br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;"><br>
    <br>
    <div class="gmail_quote">2009/12/1 Matthias Wessendorf <span
 dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:mwessendorf@gmail.com" target="_blank">mwessendorf@gmail.com</a>&gt;</span>
    <div class="im"><br>
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;"><br>
      <br>
Sent from my iPod.
      <div><br>
      <br>
On 01.12.2009, at 22:48, Michael Concini &lt;<a moz-do-not-send="true"
 href="mailto:mconcini@gmail.com" target="_blank">mconcini@gmail.com</a>&gt;
wrote:<br>
      <br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
I need some help with the best way to handle updating the dummy
request/response objects that we use for system event listeners kicked
off when there isn't a request context.  Currently, we're implementing
ServletRequest and ServletResponse directly.  This is broken when using
a servlet 3.0 runtime though since we're not implementing the new
methods added by the servlet 3.0 spec.<br>
I tried already updating the classes to extend the request/response
wrapper classes, but that turned out to be problematic since the
constructor requires a request/response object to be passed.  Since we
don't have access to that as we're outside of a request I hit an NPE
try to use FacesContext that wasn't there.<br>
I've come up with a couple of potential solutions on this and would
like some input as to the best way to go.<br>
        <br>
1) We could also extend the wrapper classes, but add a no-arg
constructor to the dummy classes that would just call super(null).
 This would be fine in most cases, but if an application tried to call
any of the new ServletContext methods from Servlet 3.0 we'd get an NPE
instead of a runtime exception (not ideal)<br>
        <br>
2) We can simply add the new methods from the Servlet 3.0 API to our
dummy classes.  I think as long as we don't include the @Override
annotation it should build and run in either a 2.5 or 3.0 environment.<br>
      </blockquote>
      <br>
      </div>
I think I like that. We should test 2.5 env<br>
      <font color="#888888"><br>
-Matthias</font>
      <div>
      <div><br>
      </div>
      </div>
    </blockquote>
    </div>
    <div><br>
I like number 2 too, because it keeps things simple.<br>
    <font color="#888888"><br>
Leonardo Uribe<br>
 </font></div>
    <div class="im">
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
      <div>
      <div><br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
3) We could implement a dynamic proxy to handle the calls.  Would be a
little more complex to implement, but might be the most elegant
solution.  Not fully sure if there are performance implications here
though.<br>
Personally, I'd lean towards (2), I'd like to here from Werner as well
since he was the one that initially implemented this.  Any additional
feedback from others in the community is of course welcome.<br>
        <br>
Thanks,<br>
Mike<br>
      </blockquote>
      </div>
      </div>
    </blockquote>
    </div>
    </div>
    <br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
</body>
</html>

Mime
View raw message