agreed. That is a why we are developing/using our own stuff: alaJSP
have look at
  http://coldjava.hypermart.net
  http://coldjava.hypermart.net/servlets/alaJSP.htm

- translated to HTML text (not to servlet)
- script language is still JavaScript
- allows to use any java classes (at the first hand directly
set parameters for constructors)

--------------------------------
Hi,

I have implemented some of the components available in Microsofts ASP as
Java Beans and used these components in JSP. In doing so I found that the
Bean concept in JSP has severe limits. I would like to hear your opinions
about my thoughts:

1. Using only the three actions useBean, setProperty and getProperty
does not allow really interesting beans. Very often I wanted to invoke
a method having parameters and printing the result. Printing is only
possible using getProperty which does not accept parameters.  It would
be usefull, if this action would accept additional parameters, for
example

<jsp:getProperty name="name" property="pName">
   <jsp:param name="param1" value="44"/>
</jsp:getProperty>

This action should be translated into:
out.print(name.getPName(44))

Currently you have to do
<%= name.getPName(44) %>

Using this script kills one of the main advantages of beans in JSP:
simple usage. If I have to use Scripts, I might as well not use
getProperty and setProperty at all. But then the only thing left about
beans is the notion of scope (i.e. share beans in different
JSP-pages).

The current versions of setProperty and getProperty encourage
programmers to write access methods performing all kinds of
side-effects. In doing so, some actions have to be called before
others. How can you express this information to a future user of your
bean?

2. Beans should have access to implicit objects such as request,
response etc. Currently you have to use scripts again, for example

<% name.processRequest(request, session) %>

(almost all of my beans needed a similar method). It would be better
if these objects would be automatically accessible to beans. How to do
that?  Using introspection a JSP-server could detect methods such as
setRequest, setResponse etc. and invoke these method automatically
while processing the action useBean.

3. In order to assign the value of a property to a scripting variable,
you cannot do something like:

<% int i = %> <jsp:getProperty name="name" property="pName"/>

The following works:

<% int i = name.getPName(); %>

I thought scripts should only be the "glue" between beans. Scripts
should be simple, i.e. JavaScript type. The fact that you can access a
property in two ways (<%= name.getPName() %> and <jsp:getProperty
name="name" property="pName"/>) is confusing for a non programmer.

SUMMARY:

--- Without using scripts (i.e. java code in JSP pages) beans are only of
very limited value.
--- JSP developers of type "Designer" should be able to use
Beans provided by JSP developers of type "Programmer" WITHOUT using
scripts.
--- Java code in JSP pages should be minimal, otherwise it is better
to write a servelt in the first place.
--- Java is too complex for a scripting language.



ColdJava: java server side programming
http://coldjava.hypermart.net

____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at 
http://webmail.netscape.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to