I'm very impressed with the architecture of JSPs.  All of the 
infrastructure that you get with servlets (request, response, session, 
etc.) is made available to you, and you can forward requests 
interchangeably between servlets and JSPs.

One great advantage of using JSPs over doing everything in servlets is that 
you can give the .jsp file to a non-programmer type web designer to do the 
cosmetic stuff, and you can focus on the content.  Of course the more java 
code you put in a JSP, the more stuff there will be for the designer to 
trip over or get lost in or even clobber.  So it is essential that you only 
put in what is absolutely necessary.  You shouldn't need to have much more 
java than conditional code that evaluates bean properties and activates or 
deactivates various visual sections and/or forwards to other JSPs or 
servlets.  The rest of your java code can be hidden behind rich bean 
interfaces.  Servlets can be used to take requests and route them to 
different JSPs, depending on conditions.

I'm putting the finishing touches on a test app, a proof of concept.

The general flow of processing in each JSP is:
1.  set request parameters into bean properties (using 'properties="*"' 
option, so properties need not be listed)
2.  execute bean action, if any (the action type is a property set in step 
1, activated by setting a 'doAction' property)
3.  test bean properties and forward the request to another JSP or servlet, 
if indicated
4  (fall through) test properties and output various sections of the 
JSP.  All hrefs and buttons return control to this JSP (exactly the same as 
ND page event processing)

This model does not require servlets.  One of my JSPs either displays the 
contents or a row, or, if you pressed a submit button that will lead to an 
update or delete, a 'confirm update' / 'cancel' display, two completely 
different outputs.  As an alternate, I created each distinct display as a 
separate JSP, each returning control to a servlet that decides where to go 
next.  I'm not sure which model is better in the case where most of the 
java is in the bean.  In a case where the routing logic is complex, I think 
the servlet/jsp option would be better, as it would keep the JSPs cleaner.

I think people are rushing headlong into EJBs when they might do just as 
well to deploy JSPs/servlets/java beans on a lighter-weight less expensive 
app server (depending on load/reliability/failover requirements), 
particularly at the current time, as the EJB implementations and 
'enterprise' class servers are still solidifying.  In 6 months, you might 
make different choices in that space than you would right now.

-- Curt Springer, Team ND


At 09:43 PM 12/15/99 -0800, Joel Parker Henderson wrote:

> > 1) How do I choose between using JHTML and JSP. They seem to be overlapping
> > 2) Which one of these will be supported by iPlanet and ND 5.0.2 ?
> > 3) What is the advantage of JSP/JHTML over traditional ND templates.
>
>Hi,
>
>JHTML and JSP and Java Servlets do indeed overlap.
>JHTML is basic, JSP is medium, and Servlets are advanced.
>
>
>In my experience, I would choose JHTML if I were developing a simple
>project with developers who understand HTML and little else. JHTML
>is like CFML (ColdFusion) and ASP, and will be fine for these kinds
>of projects.
>
>JSP (Java Server Pages) is a more sophisticated way to build dynamic HTML
>pages. You embed Java code into your pages, and there are easy ways to get
>and set variables, as well as easy ways to write full-fledged Java code.
>In my experience, JSP is fine for quick-and-dirty projects for developers
>who are comfortable writing real Java and/or who have good Java beans.
>
>When a JSP page is loaded, it is automatically compiled into a servlet;
>so at run time, there is absolutely no difference between the two.
>The difference is that JSPs are quick and easy to write, whereas
>servlets require you to use the javax.servlet package and truly
>compile your code.
>
>Like most technologies, there is a tradeoff between easy quick approaches
>and advanced profession approaches. I would absolutely use servlets for
>any kind of important project, and I would probably use JHTML for easy
>things like prototyping. I am not a big fan of JSP because I think it is
>overly complex for easy things, and overly loose for complex things.
>
>So in general, I recommend servlets.
>
>ND5 already supports servlets for development, and the new ND 5.02
>supports servlets for deployment as well. IAS6 will support these too.
>
>The advantage of JSP over ND templates is that JSP is a standard
>technologies, and will allow embedding of arbitrary code. There
>are also third-party editors that can edit well-written JSP pages,
>especially if you use the XML-style JSP syntax (not <%...%> markup)
>
>In general, I recommend separating the display (the HTML/XML)  from the
>application logic (Java/servlets). The separation tends to improve
>flexibility and reusability, and is also easier for development teams that
>combine artists and programmers. I think mixing HTML and code, in general,
>leads to problems down the line-- so I try to minimize my use of templates
>like ND.spg, JSP, ASP, etc.
>
>What do other people here think?
>
>Cheers,
>
>Joel
>home: [EMAIL PROTECTED]
>work: [EMAIL PROTECTED]
>
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to