How GWT pages are served: FileServlet/Dispatcher or Both

9 views
Skip to first unread message

sidni

unread,
Jun 16, 2009, 12:20:30 PM6/16/09
to ToCollege-net
Hi,

I referred to a post "GWT pages does not pass dispatcher servlet" in
this forum (it didnt had option to reply to all, hence a new post) to
find out answer about my question (mentioned as subject of this post)


To Jeff (in conjuction to previous post: (others refer to the post)

Now, Im really confused by your answer Jeff, bcoz u said that u had
kept spring-MVC out when handling GWT pages.

Lets take calculator GWT component.
And this is how I think its displayed on To-College, correct me if Im
wrong:

To-College's home page (index.html) contains a link for Calculator.
I can see that "SimpleAnnotatedController" acts as handler to
"calculator.html" request.
ControllerUtils prepares a ModelMap object which uses
"RequestToViewNameTranslator" to evaluate the view component i.e
"calculator.ftl"
This freemarker template inturn is rendered as HTML page which
contains java script for GWT Calculator component.

While I was coding to display "Calculator" for my version of To-
College, I had done the above said implementation but my page wasnt
displaying it. It just said "Loading..."
I then found out that there is a servlet entry in "web.xml" to
handle request for com.apress.progwt.Interactive.* which was handled
by File Servlet.

Adding this file and web.xml entry, it now works.
Hence it seems that the HTML page rendered (from FTL) calls java
script request i.e com.apress.progwt.Interactive.nocache.js which
inturn calls File Servlet and God knows what it does then.

My doubts:

1. If the above description is correct then to display Calculator, we
needed both Spring-MVC and FileServlet. Hence why have u said in ur
post that FileServlet takes Dispatcher-servlet out of the equation.

If Im wrong, then do elaborate how its handled.

2. In short explain what FileServlet do, and does it serve all the GWT
pages of To-College ( MyList, My Rankings etc).

3. If dispatcher-servlet really stays out of it (calculator.html) ,
then plz confirm how is Decoration (by Sitemesh) is handled bcoz
"decorators.xml" includes below text:

<excludes>
<pattern>/com.apress.progwt.Interactive/**</pattern>
<pattern>/facebook*</pattern><!-- FBML Pages <UL> -->
</excludes>

jdwy

unread,
Jun 17, 2009, 2:35:15 PM6/17/09
to ToCollege-net
Hey Sidni,

Yeah, you're on the right track. Sorry if I gave you the impression
that all work was done by FileServlet, it's not.
It's just the calls for the GWT stuff: "com.aavu...." that should go
through FileServlet. All the other requests, calculator.html etc
should go through dispatcher just as you described.

So yes, the GWT stuff totally avoids DispatcherServlet, but since it's
embedded on a page that is ftl DispatcherServlet is used there. You
could browse to localhost/com.aavu.../..NoCache.html and not use
DispatcherServlet, but then you wouldn't get the sitemesh etc.

so

2) FileServlet serves all the compiled GWT stuff. DispatcherServlet
serves everything else.

3) I think this exclude in the decorators.xml may be redundant. A
leftover from a previous technique.

cheers,

-Jeff

qwerty qwerty

unread,
Jul 4, 2009, 11:46:09 AM7/4/09
to tocoll...@googlegroups.com
", but then you wouldn't get the sitemesh etc."
 
What do you mean ? WHy ?

2009/6/17 jdwy <jdw...@gmail.com>

nitesh singh

unread,
Jul 6, 2009, 2:06:29 AM7/6/09
to tocoll...@googlegroups.com
Hey,
 
Sitemesh is based on Decorator pattern which applies to Freemarker Templates (in To-College.net 's case) and decorates them.
 
If we try accessing GWT cache.html pages directly, that means our web app is not using Spring-MVC to serve GWT pages and since Sitemesh decorates FM templates which inturn is a part of MVC, it wont be applied to GWT pages.
 
regards,
Nitesh
Reply all
Reply to author
Forward
0 new messages