<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Guice with GWT</title>
	<atom:link href="http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/</link>
	<description>Technology and Geek Stuff by Eric Burke</description>
	<lastBuildDate>Sat, 27 Feb 2010 14:52:46 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Axel Rauschmayer</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-51049</link>
		<dc:creator>Axel Rauschmayer</dc:creator>
		<pubDate>Sat, 27 Feb 2010 14:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-51049</guid>
		<description>Thanks for this blog post! I&#039;ve just tried this approach with GWT 2.0 and it works perfectly. But I did need aopalliance.jar in addition to the two JARs you mentioned.

Question:
- Is it possible to avoid &quot;/MyApp/&quot; in serve(&quot;/MyApp/GWT.rpc&quot;)? Given that this is just the name of the web application, it would be nice if one could avoid this redundancy somehow.</description>
		<content:encoded><![CDATA[<p>Thanks for this blog post! I&#8217;ve just tried this approach with GWT 2.0 and it works perfectly. But I did need aopalliance.jar in addition to the two JARs you mentioned.</p>
<p>Question:<br />
- Is it possible to avoid &#8220;/MyApp/&#8221; in serve(&#8221;/MyApp/GWT.rpc&#8221;)? Given that this is just the name of the web application, it would be nice if one could avoid this redundancy somehow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Putzig</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50674</link>
		<dc:creator>Peter Putzig</dc:creator>
		<pubDate>Sat, 09 Jan 2010 06:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50674</guid>
		<description>Solution is simple. I forgot to adapt the the path in serve()

serve( &quot;/myweb/GWT.rpc&quot; ).with( GuiceRemoteServiceServlet.class );</description>
		<content:encoded><![CDATA[<p>Solution is simple. I forgot to adapt the the path in serve()</p>
<p>serve( &#8220;/myweb/GWT.rpc&#8221; ).with( GuiceRemoteServiceServlet.class );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toine</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50485</link>
		<dc:creator>Toine</dc:creator>
		<pubDate>Thu, 17 Dec 2009 02:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50485</guid>
		<description>Hello again

I tried to use it but i get the error
Error 404: SRVE0190E: File not found: /bw_gxt_01/GWT.rpc

protected void configureServlets() {
 serve(&quot;/bw_gxt_01/GWT.rpc&quot;).with(GuiceRemoteServiceImpl.class);
 System.out.println(&quot;BwServletModel.configureServlets()&quot;);
 bind(ListService.class).to(ListServiceImpl.class);
}
@RemoteServiceRelativePath(&quot;GWT.rpc&quot;)
public interface ListService extends RemoteService  {

Am i forgetting something
regards toine</description>
		<content:encoded><![CDATA[<p>Hello again</p>
<p>I tried to use it but i get the error<br />
Error 404: SRVE0190E: File not found: /bw_gxt_01/GWT.rpc</p>
<p>protected void configureServlets() {<br />
 serve(&#8221;/bw_gxt_01/GWT.rpc&#8221;).with(GuiceRemoteServiceImpl.class);<br />
 System.out.println(&#8221;BwServletModel.configureServlets()&#8221;);<br />
 bind(ListService.class).to(ListServiceImpl.class);<br />
}<br />
@RemoteServiceRelativePath(&#8221;GWT.rpc&#8221;)<br />
public interface ListService extends RemoteService  {</p>
<p>Am i forgetting something<br />
regards toine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toine</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50484</link>
		<dc:creator>Toine</dc:creator>
		<pubDate>Thu, 17 Dec 2009 01:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50484</guid>
		<description>Hello

thx for the Info
Did you also tried to implement JPA and EJB3 with it 

regards toine</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>thx for the Info<br />
Did you also tried to implement JPA and EJB3 with it </p>
<p>regards toine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ming Zhu</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50279</link>
		<dc:creator>Ming Zhu</dc:creator>
		<pubDate>Thu, 03 Dec 2009 13:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50279</guid>
		<description>Here is my modified code. I have to a cast to request. Does this look right? Thanks! -Ming

   private Provider request;
   private HttpServlet servlet;
    
    @Inject
    public GreetingServiceImpl(Provider request, HttpServlet servlet) {
	this.request = request;
	this.servlet = servlet;
    }
    public String greetServer(String input) {
		String serverInfo = servlet.getServletContext().getServerInfo();
		String userAgent = ((HttpServletRequest) request).getHeader(&quot;User-Agent&quot;);
		return &quot;Hello, &quot; + input + &quot;!I am running &quot; + serverInfo
				+ &quot;.It looks like you are using:&quot; + userAgent;
    }</description>
		<content:encoded><![CDATA[<p>Here is my modified code. I have to a cast to request. Does this look right? Thanks! -Ming</p>
<p>   private Provider request;<br />
   private HttpServlet servlet;</p>
<p>    @Inject<br />
    public GreetingServiceImpl(Provider request, HttpServlet servlet) {<br />
	this.request = request;<br />
	this.servlet = servlet;<br />
    }<br />
    public String greetServer(String input) {<br />
		String serverInfo = servlet.getServletContext().getServerInfo();<br />
		String userAgent = ((HttpServletRequest) request).getHeader(&#8221;User-Agent&#8221;);<br />
		return &#8220;Hello, &#8221; + input + &#8220;!I am running &#8221; + serverInfo<br />
				+ &#8220;.It looks like you are using:&#8221; + userAgent;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Burke</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50267</link>
		<dc:creator>Eric Burke</dc:creator>
		<pubDate>Wed, 02 Dec 2009 21:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50267</guid>
		<description>You probably need to inject Provider&lt;HttpServletRequest&gt; for this reason from that same page I linked to: &quot;Note that if you want access to any of the request or session scoped classes from singletons or other wider-scoped instances, you should inject a Provider&lt;T&gt; instead.&quot;</description>
		<content:encoded><![CDATA[<p>You probably need to inject Provider&lt;HttpServletRequest&gt; for this reason from that same page I linked to: &#8220;Note that if you want access to any of the request or session scoped classes from singletons or other wider-scoped instances, you should inject a Provider&lt;T&gt; instead.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ming Zhu</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50266</link>
		<dc:creator>Ming Zhu</dc:creator>
		<pubDate>Wed, 02 Dec 2009 21:22:42 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50266</guid>
		<description>Is this what I should do?
Old code: 

@SuppressWarnings(&quot;serial&quot;)
public class GreetingServiceImpl extends RemoteServiceServlet implements
		GreetingService {
	public String greetServer(String input) {
		String serverInfo = getServletContext().getServerInfo();
		String userAgent = getThreadLocalRequest().getHeader(&quot;User-Agent&quot;);
		return &quot;Hello, &quot; + input + &quot;!I am running &quot; + serverInfo
				+ &quot;.It looks like you are using:&quot; + userAgent;
	}
}

New code:

@SuppressWarnings(&quot;serial&quot;)
public class GreetingServiceImpl implements GreetingService {

    HttpServletRequest request;
    HttpServlet servlet;
    
    @Inject
    public GreetingServiceImpl(HttpServletRequest request, HttpServlet servlet) {
	this.request = request;
	this.servlet = servlet;
    }

    public String greetServer(String input) {
        String serverInfo = servlet.getServletContext().getServerInfo();
	String userAgent = request.getHeader(&quot;User-Agent&quot;);
	return &quot;Hello, &quot; + input + &quot;!I am running &quot; + serverInfo
		+ &quot;.It looks like you are using:&quot; + userAgent;
    }
	
}</description>
		<content:encoded><![CDATA[<p>Is this what I should do?<br />
Old code: </p>
<p>@SuppressWarnings(&#8221;serial&#8221;)<br />
public class GreetingServiceImpl extends RemoteServiceServlet implements<br />
		GreetingService {<br />
	public String greetServer(String input) {<br />
		String serverInfo = getServletContext().getServerInfo();<br />
		String userAgent = getThreadLocalRequest().getHeader(&#8221;User-Agent&#8221;);<br />
		return &#8220;Hello, &#8221; + input + &#8220;!I am running &#8221; + serverInfo<br />
				+ &#8220;.It looks like you are using:&#8221; + userAgent;<br />
	}<br />
}</p>
<p>New code:</p>
<p>@SuppressWarnings(&#8221;serial&#8221;)<br />
public class GreetingServiceImpl implements GreetingService {</p>
<p>    HttpServletRequest request;<br />
    HttpServlet servlet;</p>
<p>    @Inject<br />
    public GreetingServiceImpl(HttpServletRequest request, HttpServlet servlet) {<br />
	this.request = request;<br />
	this.servlet = servlet;<br />
    }</p>
<p>    public String greetServer(String input) {<br />
        String serverInfo = servlet.getServletContext().getServerInfo();<br />
	String userAgent = request.getHeader(&#8221;User-Agent&#8221;);<br />
	return &#8220;Hello, &#8221; + input + &#8220;!I am running &#8221; + serverInfo<br />
		+ &#8220;.It looks like you are using:&#8221; + userAgent;<br />
    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Burke</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50263</link>
		<dc:creator>Eric Burke</dc:creator>
		<pubDate>Wed, 02 Dec 2009 20:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50263</guid>
		<description>If you need to use HttpServletRequest, HttpSession, etc, you simply @Inject those objects wherever you need them. This is mentioned here: http://code.google.com/p/google-guice/wiki/ServletModule</description>
		<content:encoded><![CDATA[<p>If you need to use HttpServletRequest, HttpSession, etc, you simply @Inject those objects wherever you need them. This is mentioned here: <a href="http://code.google.com/p/google-guice/wiki/ServletModule" rel="nofollow">http://code.google.com/p/google-guice/wiki/ServletModule</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ming Zhu</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50262</link>
		<dc:creator>Ming Zhu</dc:creator>
		<pubDate>Wed, 02 Dec 2009 20:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50262</guid>
		<description>Without using the extends RemoteServiceServlet, how can I use method like getServletContext().getServerInfo() and getThreadLocalRequest().getHeader(&quot;User-Agent&quot;)? Thanks! -Ming</description>
		<content:encoded><![CDATA[<p>Without using the extends RemoteServiceServlet, how can I use method like getServletContext().getServerInfo() and getThreadLocalRequest().getHeader(&#8221;User-Agent&#8221;)? Thanks! -Ming</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Burke</title>
		<link>http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/comment-page-1/#comment-50166</link>
		<dc:creator>Eric Burke</dc:creator>
		<pubDate>Sun, 29 Nov 2009 13:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1398#comment-50166</guid>
		<description>@Craig Thanks! I fixed that just now.</description>
		<content:encoded><![CDATA[<p>@Craig Thanks! I fixed that just now.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.316 seconds -->
