Yes. It is run using Netscape iPlanet 4.0 Web server. All files are
retireved from the Web server and are executed there.

The order of events occur as follows:
1. I request EShop.jsp.
2. Server receives the request and 'compiles' EShop.jsp at the server
and responds with an HTML response to my browser. I can check the log to
see that it is compiled at the server.
3. As a browser user, I select some shopping items from a form and then
submit.
4. The submit is linked to a servlet that stores the selected shopping
item in a session vector.
5. The servlet then tries to do the RequestDispatcher code I wrote about
in the original mailing (see below).
6. My understanding is that this dispatch is to resend (refresh) my
browser with the EShop.jsp generated html. The EShop.jsp includes
another JSP file (Cart.jsp). A conditional statement is part of the
Cart.jsp file that checks if any shopping cart entries exist or not.
Depending on whether any shopping cart items exist, it will add HTML to
the response to show a list of selected shopping items. If none have
been selected, then no HTML is generated by Cart.jsp. The first time the
EShop.jsp is called, there are no shopping cart items, therefore the
Cart.jsp does not generate any HTML for inclusion in the output. After a
shopping cart selection is made, subsequent EShop.jsp dispatches would
pick up shopping cart entries and therefore Cart.jsp would generate HTML
for display.

Problem is as I reported. I cannot get the dispatch to update to the
browser. It instead doesn't recognize the file type response. I would
guess it has something to do with a lack of understanding on my part of
the Servlet Context and Dispatcher stuff.

I do not know if other browsers have the problem. Our company only
supports Netscape at this time (for good or bad).

Thanks for any help.

...Ken

   -----Original Message-----
   From:       JSP-INTEREST(a)JAVA.SUN.COM
   Sent:       Wednesday, March 29, 2000 6:51 PM
   To:         JSP-INTEREST(a)JAVA.SUN.COM
   Cc:         shrisha(u)radhakrishna(a)YAHOO.COM
   Subject:    Re: 'RequestDispatcher' Problem

   I am assuming that you are running this sample app under a web server
   and
   not just opening it from your browser.  U R, aren't u?  (sorry to
   ask)...

   If U R, is this problem *only* with Netscape?

   ----- Original Message -----
   From: "Boi Ken" <[EMAIL PROTECTED]>
   To: <[EMAIL PROTECTED]>
   Sent: Wednesday, March 29, 2000 3:23 PM
   Subject: 'RequestDispatcher' Problem


   > I am trying to run an example JSP/Servlet application. The
   application
   > starts by requesting 'EShop.jsp'. This page allows the user to shop
   for
   > items. On the submit, a servlet is run where the requested shopping
   item
   > is added to a session shopping list. Then the following code
   snippet is
   > run that should refresh 'EShop.jsp' to show the selected shopping
   list:
   >
   >    String url = "/cas/html/JSPExample/EShop.jsp";
   >    ServletContext sc = getServletContext();
   >    RequestDispatcher rd = sc.getRequestDispatcher(url);
   >    rd.forward(req, res);
   >
   > But when this code is run from the Netscape 4.5 browser, I get a
   browser
   > popup window indicating:
   >   "Unknown file type. You have started to download a file type
   > application/java-vm"
   >    The popup window includes buttons for More Info, Pick App..,
   Save
   > App.., and Cancel.
   >
   > Any ideas what might be wrong here or what is causing this?
   >
   > Thank you and I hope I don't get yelled at for it being an obvious
   FAQ
   > question or newbie question.
   >
   >
   =====================================================================
   ======
   > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
   JSP-INTEREST".
   > Some relevant FAQs on JSP/Servlets can be found at:
   >
   >  http://java.sun.com/products/jsp/faq.html
   >  http://www.esperanto.org.nz/jsp/jspfaq.html
   >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
   >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


   __________________________________________________
   Do You Yahoo!?
   Talk to your friends online with Yahoo! Messenger.
   http://im.yahoo.com

   =====================================================================
   ======
   To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
   JSP-INTEREST".
   Some relevant FAQs on JSP/Servlets can be found at:

    http://java.sun.com/products/jsp/faq.html
    http://www.esperanto.org.nz/jsp/jspfaq.html
    http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
    http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to