Yesss if the URL ends with /about then the AboutService will be called.

- Litty

On Wed, Nov 5, 2008 at 7:18 PM, Muhannad <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> Okay, then how could I switch between my services when I click on one
> link?
> I mean, on the website's home page load, I will instantiate the
> default service (let's say "homeService"). Then on "About Us" link I
> have to switch to the "aboutServie" how could that switch be done? Is
> it enough to pass the "/about" at the end of the URL?
>
> Best regards.
>
> On Nov 5, 3:28 pm, "Litty Preeth" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > The <servlet-mapping> tag of your web.xml is exactly for that purpose.
> >
> > <servlet-mapping>
> >         <servlet-name>ProductService</servlet-name>
> >         <url-pattern>/product</url-pattern>
> > </servlet-mapping>
> >
> > Regards,
> > Litty
> >
> > On Wed, Nov 5, 2008 at 3:42 PM, Muhannad <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > I want to build a website with (Home, about, products, ...) menu. I
> > > need to build multiple forms (panels), each panel corresponds to one
> > > menu item, e.g. aboutPanel for "about" menu item, productsPanel for
> > > "products"...
> >
> > > Moreover, I would like to implement that panel in terms of RPC
> > > services; I need to correspond each panel to a single RPC service that
> > > communicates with the server to get its data, build the whole form,
> > > and return the result as a panel to be displayed somewhere in the home
> > > page (for example).
> >
> > > Of course, GWT allows us to define multiple services and add multiple
> > > <servlet path="/service" ...> to the module XML file.
> >
> > > My problem is how to know which service should I instantiate depending
> > > on the URL mapping, i.e. suppose that the menu is defined as follow:
> >
> > > <div id="menu">
> > >    <a href="index.html">Home</a>
> > >    <a href="/about">About us</a>
> > >    <a href="/products">Products</a>
> > >    ...
> > > </div>
> >
> > > So when someone clicks the "About us" link, the URL would be "http://
> > > domain/about". So I should instantiate the "about" service and create
> > > an aboutPanel to display it. The same thing when s/he clicks the
> > > "Products" link, then the URL is "http://domain/products"; and, in this
> > > case, I should build the product panel...
> >
> > > So, is there somewhere in GWT application that I could parse the URL
> > > and depending on the mapping portion of it "/about" or "/products"
> > > could I decide which service to instantiate? Or is there another
> > > better way to do that?
> >
> > > Thank you very much in advance.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to