Jayson Falkner wrote:
> Thanks for the feedback Hans,
> 
> Hans Bergsten wrote:
> 
>> Absolutely. If you have experience with a real programming language,
>> learning Java in itself is a lot of work. Learning servlets, JDBC,
>> and at least a basic idea about multithreading issues on top of that
>> is just too much. And some people are not even interested in becoming
>> programmers; they just want to provide a simple web interface to an
>> existing database, with no bells and whistles.
> 
> 
> I see and would agree if you are not a Java developer then these tags 
> would be handy, however, I was asking assuming everyone using the JSTL 
> had at least some Java experience. JSP encourages this especially with 
> the scripting elements.

I don't think that's a correct assumption. Yes, if you use the scripting
elements, you have to know some Java. But one of the main points with
JSTL, and custom actions in general, is to lower the bar and make it
possible to do what's needed without any Java code at all.

> How often would you say someone using JSP does not understand Java but 
> would use JSP because they can use the JSTL. Also would you say these 
> people are not responsible for said existing database, they are just 
> required to use it?

Based on my experience with the commercial product I mentioned earlier
and the type of questions I see on the JSP-INTEREST list, there are
many people who doesn't know Java but want to use JSP. For them, JSTL
is what's been missing. Today many of them struggle with Java code
for simple stuff like loops and if/else, and even more so with JDBC
code in scriptlets.

It's harder to say if they are responsible for the database they
access or not. I have examples of non-programmers learning enough
SQL to put together the database for a small application, but I'm
sure there are cases where the database already exist and they are
just adding a web interface to it.

>> Most of my customers call themselves non-programmers but have managed
>> to develop really nice, fairly complex web applications using the
>> product, with just a little bit of hand-holding on my part.
> 
> 
> Great, this is exactly the type of information I am looking for. Now 
> where would you say these users fit in with the larger picture of JSP 
> web development. Obviously they are not die-hard J2EE programmers, but 
> would you say that they are the majority of JSP users? Or would you say 
> most developers interested in using JSP/Servlets would better be 
> directed to learn the Java aspect of the technologies, in a few cases as 
> an experienced J2EE developer you can analyze a case and suggest the 
> JSP/JSTL for use with it?

Based on a very informal, and hardly scientific, survey on my web site,
roughly % of all applications people develop with JSP today use only
JSP, compared to % for JSP/Servlets and % for JSP/Servlets/EJB. All
I can say that there are many who only use JSP.

I'm not sure where you're going with these questions. If you're asking
if the majority would be better off not learning JSTL at all, I say
you're wrong; JSTL is a far better alternative than scriptlets for
the iterations and conditional processing you will always have in
JSP pages, no matter if you use a servlet or not.

But I believe you're asking if the majority of JSP users would be better
off ignoring just the SQL and XML actions, and learn how to use Java for
these tasks instead. Again, I don't think you can say that that's true
for all cases; some people simply don't want to learn Java, and their
apps are simple enough to work fine with just JSP. In other case, doing
the complete servlet/JSP/beans thing may simply be overkill; why spend
a lot of time on design and implementation for a two- or three-page
application when I can develop it faster with just JSP?

>> If you're not a programmers, it's definitely easier to learn how to
>> use JSTL than to write the equivalent logic in Java. If you already
>> know Java, I agree that it's mostly a "different" approach. But even
>> though I know Java, I tend to use just JSP and JSTL for simple sites;
>> for me, it's simply faster and easier.
> 
> 
> Great, more of what I'm after. Could you clarify a little on what you 
> would consider 'simple sites', or does the quick comment you gave two 
> e-mails ago sum it up completely?

I don't remember ;-) Don't take this too seriously, but an application
with less than 20 pages and a database with say less than 10 tables
would typically qualify as "simple" in my book, as long as there's
basically no business logic other than input validation and reading
and writing database data.

>> Like I said earlier, some people don't want to become programmers and
>> build complex web applications where the advantages of using pure
>> Java code in servlets, beans, and other component types shines. If
>> you try to force them by making "the right way" the only way, they
>> will just use other technology where they have a choice. Besides,
>> as should be clear by now, I don't subscribe to the idea that MVC
>> with a servlet controller is "the right way" for all applications and
>> situations.
> 
> 
> Agreed. In general, would you agree that people attempting to seriously 
> use Servlets and JSP as Java programmers should be directed to learning 
> MVC? Even if it is not always the best solution but the majority of the 
> time it will reap good benefits.

Again, I think you should evaluate the requirements, the skills available,
how long the app will be used, by how many, etc. and pick the most
appropriate technology based on all of this. So if you're serious about
it, I would suggest you learn how to use JSTL, servlets, filters,
JDBC, XML processing, and everything else you may need to make an
informed decision.


> [...]
>> Again, you assume that there's someone around that knows Java; that's
>> not always the case. The import action is basically a more powerful
>> version of the standard include action, sporting features that makes
>> it play better with JSTL (supports EL attributes, well-defined error
>> handling so the catch action can be used the deal with errors). If
>> you don't use the XML actions, it's still useful for including pieces
>> of common content.
> 
> 
> Assuming someone is around that does know Java, would you say the the 
> action is helpful? E.G. someone who read your book aspiring to be a 
> superb J2EE developer. Would you suggest they use the import action?

See above.

> I do agree if no Java experience is around then the import does get the 
> job done well.
> 
>>> What is a good use for the redirect tag?
>>
>>
>> I often use it in a Controller page to redirect to a result View page
>> so that a reload of the result page doesn't invoke the Controller page
>> again, as it would if I used forward. I have also used it on a site
>> that tracks the number of times people clicks on the links for
>> external sites; the link goes to a Controller page that increments
>> a counter and then redirects to the requested site.
> 
> 
> So this is assuming you are using something similar to MVC, but the 
> controller component is a JSP. Certainly works. Would you suggest this 
> approach for use in general? 

Again, "one size doesn't fit all"; it depends, see above.

> Personally I would not because I think it 
> takes away a lot of the benefits you get from using Java. A web app is 
> tied to Java and something like an MVC control component usually 
> requires much more complex functionality then something the JSP/JSTL 
> actions readily provide. Do you use a JSP control component as a 
> starting point for a web app then migrate to a Servlet or Filter should 
> more functionality be required?

I recommend separating View and Controller/Model logic on separate
pages to make it easier to maintain, and to make it easier to move
to a servlet/JSP combo if needed one day.

Hans
-- 
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to