Help!

No one as yet seems to have replied to Tom's  comments to say that they did
get Model 2 working?

We are about to build a web-site - using I guess Model 2  - as espoused in
JavaServer Pages by Fields and Kolb - called by them Servlet-centric design
(if I am understanding correctly)- more descriptive than Model 2!

I set up a Model 2 test - using a Servlet to accept requests from the client
and forwarding to jsp pages- which worked fine with data but like Tom (third
point) would show a box but without the image in it - I assumed that I was
doing something wrongly, as in the book above (page 234) is an example which
appears to show an image - I have not yet tried the code out.

Has anyone got  Model 2 to work?

John

----- Original Message -----
From: Tom Gordon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 25, 2000 12:58 AM
Subject: Model 2 & servlet API version


> I just wanted to warn people of a possible gotcha in moving to the model
> 2 pattern.  Perhaps people can correct me if I'm wrong, also.  It seems
> to me that the model 2 pattern doesn't really work with the servlet 2.0
> API.
>
> I recently tried to implement a model 2 pattern, but had to back off.  I
> was using Apache + JServ, which has servlet 2.0 API support, and GNU
> JSP.
>
> First of all, there is no RequestDispatcher in 2.0.  Yuck.
>
> Second, I didn't see any way, from the servlet, to store beans or any
> other object in the request object, only in the session object.
>
> Third, I could not access jsp or html pages in the same directory as the
> servlet.  For example, I created a servlet zone /myservlet.  I could
> access /myservlet/MyServletClass, but when MyServletClass redirected to
> /myservlet/results.jsp, the jsp page would show up, but no links would
> show up (such as images).  I could not access /myservlet/somepage.html
> directly from the browser.
>
> Fourth, every time I hit the servlet and got the session, it was a
> completely new session.  I have no idea why this would be the case.
> This was why I had to give up using a servlet completely.
>
> To get around this, but in the spirit of separation of java from html, I
> am using controller jsp pages.  I don't know why these work instead of a
> servlet.  Maybe I didn't set up apache correctly, or maybe it's the
> combination of apache/JServ/gnujsp.  Essentially, the action attribute
> of a form points to a jsp page, which in turn does validation, talks to
> the server proxy, and redirects to the appropriate response page.
>
> Anyway, I like the controller jsp pages, even if it's a cheap way of
> doing a controller servlet.  You still get most java code in one page
> and most html display code in a separate page.  I just stuck a server
> proxy object in the session so that all pages could reuse it.
>
> Yes, I should use a platform that supports the latest API, but for some
> people, it takes a while to upgrade for various reasons.
>
> -Tom
>
>
===========================================================================
> 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