-
15. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
luxspes Nov 15, 2009 8:30 PM (in response to luxspes)OTOH maybe I have just hit a bug similar to WELDX-43...
-
16. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
luxspes Nov 15, 2009 8:51 PM (in response to luxspes)As a workaround (until WELDX-43 is fixed) I decided to do this:
In ServletContexts.scala:
@RequestScoped class ServletContexts extends Serializable{ //@Produces @RequestScoped @Request def getServletRequest()={ ServletContexts.getServletRequest() } //@Produces @RequestScoped @Response def getServletResponse()={ ServletContexts.getServletResponse() } }
In Game.scala:
private var servletContexts:ServletContexts=null; @Inject def setRequest(currentServletContexts:ServletContexts){ servletContexts=currentServletContexts; }
That way I can reach the servlet request and response form Game class.
So far, it seems to be working fine, it is not as elegant as using @Produces but it is fine for the moment.
-
17. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
gavin.king Nov 15, 2009 10:37 PM (in response to luxspes)The scope of the object returned by the producer method is not related to the scope of the object that produced it.
No idea about the cnfe. Have you tried moving some jars to the server classpath? Just an idea...
-
18. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
nickarls Nov 15, 2009 10:41 PM (in response to luxspes)The Javaassist CNFE sounds like a Glassfish issue that was recently resolved
-
19. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
luxspes Nov 15, 2009 11:32 PM (in response to luxspes)
Nicklas Karlsson wrote on Nov 15, 2009 22:41:
The Javaassist CNFE sounds like a Glassfish issue that was recently resolvedYou mean WELDX-43? Because it looks open to me... I think it is no longer Glassfish specific, because I am working on Tomcat 6.0
-
20. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
luxspes Nov 15, 2009 11:41 PM (in response to luxspes)
Gavin King wrote on Nov 15, 2009 22:37:
The scope of the object returned by the producer method is not related to the scope of the object that produced it.Mmmmm...
No idea about the cnfe. Have you tried moving some jars to the server classpath? Just an idea...Could be a way to make it work... but not one I particularly like... at least not until Tomcat has a solution for ClasspathHell... anyone knows of a project like Geronimo Repository but for Tomcat? ;-)
-
21. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
gavin.king Nov 16, 2009 12:40 AM (in response to luxspes)Francisco Peredo wrote on Nov 15, 2009 23:41:
Gavin King wrote on Nov 15, 2009 22:37:
No idea about the cnfe. Have you tried moving some jars to the server classpath? Just an idea...
Could be a way to make it work... but not one I particularly like...Of course, but it would give us some information about the problem that might help us figure out what's going on.
-
22. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
gavin.king Nov 16, 2009 12:45 AM (in response to luxspes)
Francisco Peredo wrote on Nov 15, 2009 23:32:
Nicklas Karlsson wrote on Nov 15, 2009 22:41:
The Javaassist CNFE sounds like a Glassfish issue that was recently resolved
You mean WELDX-43? Because it looks open to me... I think it is no longer Glassfish specific, because I am working on Tomcat 6.0If WELDX-43 was caused by a bug in GlassFish, it might easily have been fixed in GlassFish without the issue being closed in our JIRA. You're only assuming that your problem is related - you don't really have much evidence for it. A CNFE is a pretty generic exception, with lots of possible causes.
-
23. Re: How to reach HttpServletRequest and HttpServletResponse from bean?
luxspes Nov 16, 2009 12:52 AM (in response to luxspes)
Gavin King wrote on Nov 16, 2009 00:40:
Of course, but it would give us some information about the problem that might help us figure out what's going on.Ok, I'll do it and report back