Hi!!,
   Servlet Chaining is connecting two or more servlets
together. You can easily implement this in JWS were
you have an option for servlet chaining where you can
give the servlets to be chained seperated by
semi-colon.
   The main reason why servlet chaining is not
recommended is that the servlets may reside in
different JVM's and this can be a problem.

Hope you got the point you were looking for.

regds,
arun

--- "Nottebrok, Guido" <[EMAIL PROTECTED]>
wrote:
> Hallo,
> I'm new in Java and servlets and have read in this
> and other lists that chaining servlets is no good
> programming style.
>
> My question is: what exactly is servlet-chaining?
>
> Here is some code of the Sun's bookstore example.
>
> public class BookStoreServlet extends HttpServlet {
>
>     public void service (HttpServletRequest request,
>                          HttpServletResponse
> response)
>         throws ServletException, IOException
>     {
>
>         [snip]
>
>         //Left cell -- the "book of choice"
>         out.println("<td valign=\"TOP\"
> width=\"55%\">" +
>                     "<h3>What We're Reading</h3>" +
>                     "<p>" +
>                     "In <em><a href=\"" +
>
>
response.encodeUrl("/servlet/bookdetails?bookId=203")
>         [snip]
>
> In the last two lines the servlet BookDetails can be
> called from the site generated by the
> BookStoreServlet
> Is this meant by chaining servlets???
>
> Or is it something like this (also from the Sun
> example):
>
> public class BookDetailServlet extends HttpServlet {
>
>     public void doGet (HttpServletRequest request,
>                        HttpServletResponse response)
>         throws ServletException, IOException
>     {
>
>         [snip]
>
>         //Get the identifier of the book to display
>         String bookId =
> request.getParameter("bookId");
>         if (bookId != null) {
>
>             // and the information about the book
>             BookDBServlet database = (BookDBServlet)
>
>
getServletConfig().getServletContext().getServlet("bookdb");
>                        BookDetails bd =
> database.getBookDetails(bookId);
>          [snip]
>
> In the last lines the servlet BookDetailServlet
> calls a method of the BookDBServlet.
>
> Or is it something totally different.
>
> Can anyone please explain what servlet-chaining is
> and why I shouln't use it.
> Thanks
>
> Guido
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to