You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ro...@surecomp.com on 2011/04/27 19:02:22 UTC

webapp servlet vers web services

Hi all,

Not sure where to direct this question.. I thought I try here...

In a webapp you have a servlet where by means of servlet mapping we can direct all traffic, example

  <servlet-mapping>
    <servlet-name>InitServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

If I understand spec correctly and this being the only mapping, it will become the default and all requests will be routed to the servlet.

I also have a bunch of web services which when called do not route to the servlet. My question; is there something like the idea of serlvet for web services that will route all requests into a common location and from there let the application farm it out to the correct web service.  The reason I ask is I like to isolate some security and business logic in to one location and have that entered first by the web service call and then pass along to correct service.

I could extend a base object for each web service but that would prevent adding external web services from source to the system without making modifications to those sources.

Sincerely,

Robert Jenkin
Surecomp Services, Inc.
2 Hudson Place, 4th Floor
Hoboken, NJ 07030
Skype: robert.jenkin
Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537
http://www.Surecomp.com


This mail was sent via Mail-SeCure System.



RE: webapp servlet vers web services

Posted by Martin Gainty <mg...@hotmail.com>.
Hi Robert-

There are a number of "web-service frameworks" you can implement to publish a service and consume the service with a client stub

starting with the lightly loaded REST webservice (WADL)
http://wikis.sun.com/display/Jersey/WADL

next implementation and most widely used in the non-REST genre is JAX-WS (Java WebServices for XML)
http://jax-ws.java.net/

to AXIS which is my favourite
http://axis.apache.org/axis/java/architecture-guide.html

(dont get side-tracked by Jersey or Glassfish documentation..all 3 frameworks successfully under TOMCAT7)

hth
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: Robert.Jenkin@surecomp.com
> To: users@tomcat.apache.org
> Date: Wed, 27 Apr 2011 20:02:22 +0300
> Subject: webapp servlet vers web services
> 
> Hi all,
> 
> Not sure where to direct this question.. I thought I try here...
> 
> In a webapp you have a servlet where by means of servlet mapping we can direct all traffic, example
> 
>   <servlet-mapping>
>     <servlet-name>InitServlet</servlet-name>
>     <url-pattern>/</url-pattern>
>   </servlet-mapping>
> 
> If I understand spec correctly and this being the only mapping, it will become the default and all requests will be routed to the servlet.
> 
> I also have a bunch of web services which when called do not route to the servlet. My question; is there something like the idea of serlvet for web services that will route all requests into a common location and from there let the application farm it out to the correct web service.  The reason I ask is I like to isolate some security and business logic in to one location and have that entered first by the web service call and then pass along to correct service.
> 
> I could extend a base object for each web service but that would prevent adding external web services from source to the system without making modifications to those sources.
> 
> Sincerely,
> 
> Robert Jenkin
> Surecomp Services, Inc.
> 2 Hudson Place, 4th Floor
> Hoboken, NJ 07030
> Skype: robert.jenkin
> Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537
> http://www.Surecomp.com
> 
> 
> This mail was sent via Mail-SeCure System.
> 
> 
 		 	   		  

RE: webapp servlet vers web services

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Calum [mailto:caluml@gmail.com] 
> Subject: Re: webapp servlet vers web services

> On 27 April 2011 18:02,  <Ro...@surecomp.com> wrote:
> >  <servlet-mapping>
> >    <servlet-name>InitServlet</servlet-name>
> >    <url-pattern>/</url-pattern>
> >  </servlet-mapping>
> >
> If I understand spec correctly and this being the only mapping,
> it will become the default and all requests will be routed to
> the servlet.

> No - I think it would have to be /*

You need to read the servlet spec; it explicitly states that using just a slash indicates the default servlet for the webapp, used when all other attempts at mapping fail.  However, doing so means you override Tomcat's DefaultServlet, so it will not be available to handle static content - which may or may not be a problem, depending on the webapp.

> > is there something like the idea of serlvet for web services 
> > that will route all requests into a common location and from
> > there let the application farm it out to the correct web service.

That's how a lot of the frameworks operate; all requests are passed through a controller servlet which then decides what to do with it based on its own configuration.

> > I like to isolate some security and business logic in to one 
> > location and have that entered first by the web service call
> > and then pass along to correct service.

Try using a filter rather than a servlet for actions.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: webapp servlet vers web services

Posted by Calum <ca...@gmail.com>.
On 27 April 2011 18:02,  <Ro...@surecomp.com> wrote:
>
>  <servlet-mapping>
>    <servlet-name>InitServlet</servlet-name>
>    <url-pattern>/</url-pattern>
>  </servlet-mapping>
>
> If I understand spec correctly and this being the only mapping, it will become the default and all requests will be routed to the servlet.

No - I think it would have to be /*

> I also have a bunch of web services which when called do not route to the servlet. My question; is there something like the idea of serlvet for web services that will route all requests into a common location and from there let the application farm it out to the correct web service.  The reason I ask is I like to isolate some security and business logic in to one location and have that entered first by the web service call and then pass along to correct service.

Yes, you could write a handler which accepted all requests, and then
farmed them all out internally based on whatever rules you wrote in
the handler?

C

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org