You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Jayson Falkner <ja...@jspinsider.com> on 2002/06/07 20:57:24 UTC

JSTL XML, URL, and SQL tags, does anyone use them?

Does anyone seriously use the JSTL XML, URL, and SQL tags? I'm looking 
for some reasons as to why they are helpful, but, I can't really find 
any. Obviously they work, but the important point seems to be the tag's 
functionality would best be placed elsewhere using Model 2 (MVC).

If anyone is seriously using them and has a good argument as to why they 
are helpful, I'd like to discuss it with them further. Does anyone?

Cheers,

Jayson Falkner
jayson@jspinsider.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
>> Hans Bergsten wrote:
> 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.

Right, those are besides the point I'm after. Hence the XML, URL, SQL 
tags :) I completely agree the JSTL iteration and conditional tags are 
great. The trouble is if the tags in question should be encouraged for 
use same as the core ones. All JSP developers should know and use the 
JSTL core tags, but should developers developing complex apps use the 
XML and SQL tags? or should they be discouraged in favor of learning the 
Java equivalent I.E. a Model 2/MVC concepts - you answered this question 
later on in the e-mail, thanks.

> 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?

Yes, you are guessing right. There is no good reason for small apps. I 
think I get your point well that trying to classify apps is not 
something you recommend or practice. It really depends on a case by case 
basis. What is important is the XML and SQL tags insert functionality 
previously not readily available - does that sound right?

>> 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.

Thanks, I'm not taking notes ;) Just looking for a rough idea for 
comparison.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
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		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Paul DuBois wrote:
> Well, now you're re-framing your question to get the answer you want.  Your
> original message asked a much more general question, which was whether 
> anyone
> uses JSTL and finds it helpful.

Yes I am, sorry I don't mean to waste time, but, I loaded the question 
so I could narrow it down on interesting parts. Overall it has helped 
quite a bit, thanks to everyone's well-thought responses.

> You've been asking several questions here, and I'd like to ask some in
> return, since I've noticed that other people here other than myself are
> beginning to wonder the same thing:  What's your purpose in this 
> discussion?
> Where are you going with it?  It *seems* that you've essentially made up
> your mind that MVC is terrific and are looking for ammunition against JSTL.
> Or are you trying to find where the border is between them in terms of
> application complexity that would justify switching from one to the other?


I'm trying to clarify the border between the two prominent and helpful 
JSP design approaches. The motivation is a title I'm helping with for 
JSP 2.0/Servlets 2.4. It is aimed more for building complex web apps via 
MVC, hopefully that helps explain my behavior.

Jayson


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Paul DuBois <pa...@snake.net>.
At 22:39 -0400 6/11/02, Jayson Falkner wrote:
>Paul DuBois wrote:
>>Why make that assumption?  One of JSTL's strongest points (my opinion) is
>>that it makes it easy to start writing JSP applications *without* having
>>to know any Java.  At the very least, JSTL certainly minimizes the amount
>>of Java you have to know.
>
>The assumption would be if you were giving direction to a new 
>developer who wanted to build potentially complex web applications. 
>The JSTL works, but does it hurt to explain using the JSTL tags 
>before introducing MVC concepts?

Well, now you're re-framing your question to get the answer you want.  Your
original message asked a much more general question, which was whether anyone
uses JSTL and finds it helpful.

But to answer your question, I would say that if you're advising a new
developer, that it depends on what the new developer already knows.
If the developer already has related background that would facilitate
assimilation of MVC concepts, then it may be best to go to that.  If
the developer doesn't have such background, I would consider something
like JSTL as a helpful tool for developing working code right off the
bat without first having to go study a several-miles-high pile of MVC
documentation.

You've been asking several questions here, and I'd like to ask some in
return, since I've noticed that other people here other than myself are
beginning to wonder the same thing:  What's your purpose in this discussion?
Where are you going with it?  It *seems* that you've essentially made up
your mind that MVC is terrific and are looking for ammunition against JSTL.
Or are you trying to find where the border is between them in terms of
application complexity that would justify switching from one to the other?

>
>>If JSP helps you get Java out of your pages so you can write web 
>>scripts with less Java knowledge, JSTL takes that process even 
>>further -- especially in
>>the arena of database access, using the SQL tags.  At the risk of making
>>you groan, I'd put it like this: JSTL makes it PHP-dead-easy to write web
>>scripts.  Sure, if you're going to write complext apps, you'll probably want
>>to go the MVC route.  If you're not, MVC is a lot of messing around just
>>to achieve ethical purity.
>
>Right, this is almost exactly as I would describe the JSTL tags in 
>question. Would you agree it is best to push MVC concepts on to a 
>new user who desires to be able to write complex web apps and 
>discourage use of custom tags that conflict, like the JSTL XML and 
>SQL tags?

As above, not necessarily.  Because I think JSTL can help the developer
understand more complex concepts.

What do you mean by "use of custom tags that conflict"?  Conflict with
what?  Each other?  MVC concepts?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Paul DuBois wrote:
> Why make that assumption?  One of JSTL's strongest points (my opinion) is
> that it makes it easy to start writing JSP applications *without* having
> to know any Java.  At the very least, JSTL certainly minimizes the amount
> of Java you have to know.

The assumption would be if you were giving direction to a new developer 
who wanted to build potentially complex web applications. The JSTL 
works, but does it hurt to explain using the JSTL tags before 
introducing MVC concepts?

> If JSP helps you get Java out of your pages so you can write web scripts 
> with less Java knowledge, JSTL takes that process even further -- 
> especially in
> the arena of database access, using the SQL tags.  At the risk of making
> you groan, I'd put it like this: JSTL makes it PHP-dead-easy to write web
> scripts.  Sure, if you're going to write complext apps, you'll probably 
> want
> to go the MVC route.  If you're not, MVC is a lot of messing around just
> to achieve ethical purity.

Right, this is almost exactly as I would describe the JSTL tags in 
question. Would you agree it is best to push MVC concepts on to a new 
user who desires to be able to write complex web apps and discourage use 
of custom tags that conflict, like the JSTL XML and SQL tags?

> I suppose one might say that with Java you can do anything.  But one of
> Java's problems is that you have to know a lot before you can do even a
> little.  JSTL makes it possible to do quite a bit, even if you know only
> a little.

That is a good way to put it.

Jayson


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by FEDERICO MARTIN LARA <i5...@uco.es>.
Paul DuBois!!!!

I have your book "MySQL Edicion Especial" - Prentice Hall ISBN 84-205-2956-7
of Spain.
It is really good.

I have a problem. this is:

I have a database in MySQL with 13618 books. I make SQL queries to this
database via JSP taglibs activated with a form. An example:

"De windows a Linux" and the database don't return any rows.

I make the same query introducing "windows" or "linux" and it shopw the
record

It is due to the space character?

Thanks

Email:

<ma...@hotmail.com>, <ma...@terra.es>,
<ma...@iespana.es>, <ma...@telefonica.net>,
<ma...@uco.es>,
<ma...@anuntis.com> (Cuenta compartida)

Pagina web:
http://lathander.iespana.es , http://www.lathander.es.vg





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Paul DuBois <pa...@snake.net>.
At 14:51 -0400 6/11/02, 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.

Why make that assumption?  One of JSTL's strongest points (my opinion) is
that it makes it easy to start writing JSP applications *without* having
to know any Java.  At the very least, JSTL certainly minimizes the amount
of Java you have to know.

If JSP helps you get Java out of your pages so you can write web 
scripts with less Java knowledge, JSTL takes that process even 
further -- especially in
the arena of database access, using the SQL tags.  At the risk of making
you groan, I'd put it like this: JSTL makes it PHP-dead-easy to write web
scripts.  Sure, if you're going to write complext apps, you'll probably want
to go the MVC route.  If you're not, MVC is a lot of messing around just
to achieve ethical purity.

>
>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?

I wouldn't know *how* often, but I'd say that in both cases, JSTL pushes
the answer in the *more* often direction.


I suppose one might say that with Java you can do anything.  But one of
Java's problems is that you have to know a lot before you can do even a
little.  JSTL makes it possible to do quite a bit, even if you know only
a little.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
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.

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?


> 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?

> 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?

> 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.

>> I have a hard time believing this would ever occur. Certainly if you 
>> have to train developers the what and how of MVC then it would take 
>> more time, but if the skillset exists certainly not.
> 
> Not sure what you refer to by "this", but using MVC even for a pure
> JSP app is a good idea and not too hard to learn. They just have to
> read my book :-)

"this" meant a developer understanding MVC and using a pure JSP/Servlets 
app. The answer you gave was the type of information I was trying to get 
your opinion on, thanks.

> 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?

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? 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?

Cheers,

Jayson Falkner
jayson@jspinsider.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Jayson Falkner wrote:
> Thanks for the comments Hans.
> 
>  > As Shawn and David, I think these types of actions make sense. It's
>  > dangerous to think that "one size fits all."
> 
> Agreed, but could you elaborate on your reasons? You didn't explain why 
> it is dangerous.

Dangerous in a generic sense; if you think there's only one way of doing
things, suitable for all situations, you're going to spend uncessesary
long time developing simple applications, never get funding for your
project because you can't show a working prototype in time, force some
applications to be implemented with inferior technology, etc.

> By "one size fits all", do you mean assuming everyone should only use MVC?

MVC can be implemented in many ways. My comment about "one size fits all"
was about the common argument for using a servlet controller in all
applications; even though it's a good idea for many applications, it's
not always the right choice. The right choice depends on many factors,
such as the application complexity, the amount of people that will use
the application, the current knowledge and experience of the people
available to develop it, how long the application will be used, etc.

>  > But
>  > there are exceptions where I think it's perfectly okay to use the
>  > database access actions in JSP pages, e.g.
>  > * for a small, company-internal application, when no one with enough
>  >   Java knowledge is around to develop servlets. I believe this is a
>  >   very common scenario that is often overlooked when programmers
>  >   discuss "the right way" to develop web applications. The alternatives
>  >   in a case like this are likely that the app doesn't get developed at
>  >   all, or that it's done with JDBC code is scriptlets, or (gasp!)
>  >   using ASP and Visual Basic code.
> 
> Are you saying the these JSTL tags are easier to learn then the 
> Java/Servlets required?

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.

> What about understanding SQL and XML. Are you suggesting a developer 
> would understand these enough to use them, but not with a programming 
> language such as Java?

Learning basic SQL is much easier than learning Java. For the last
four years or so, I've sold a commerical product that makes it easy
to develop database-driven web applications. It started out as a set
of servlets embedded with <servet> elements in web pages and then
moved to JSP custom actions when JSP 1.1 was released. It has an EL
similar to the JSTL EL, and pretty much the same set of features as
JSTL implemented as custom actions.

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.

> What do you mean by "the right way"? Are you saying when developers talk 
> about how to develop, "the right way" is equivalent to the only way that 
> should be done?

Yes. Just look at some discussions about this subject on various mailing
lists.

> Overall your opinion seems to be the JSTL tags would just be easier and 
> accomplish the same thing. I tend to think they are not easier at all, 
> just a different approach.  

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.

> Do you think it is wise to promote the use 
> of these tags to new users? Especially when it may result in a JSTL 
> skillset compared to a sound understanding of what most people consider 
> the best method of developing JSP/Servlet Web Applications.

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.

>  > * for any simple application, when its clear that it will not go
>  >   through major extensions; using just JSP pages with action elements
>  >   is probaly very cost-efficive in this case (lower development time).
> 
> Probably? Is it quicker for you or any projects you have helped on?

Yes, see above.

> I have a hard time believing this would ever occur. Certainly if you 
> have to train developers the what and how of MVC then it would take more 
> time, but if the skillset exists certainly not.

Not sure what you refer to by "this", but using MVC even for a pure
JSP app is a good idea and not too hard to learn. They just have to
read my book :-)

>  > * for prototyping an idea; if the proof-of-concept is successful,
>  >   the app can be redesigned with a servlet Controller, filters, and all
>  >   the other goodies after getting some experience with the basic
>  >   application functionality.
> 
> This is another argument about development time? What about a MVC style 
> design pattern is so time consuming?

Part of it is likely the compilation phase with Java code, even though
I know that some containers actually recompile Java classes automatically.
But it's also the additional components that need to be developed.
For a simple two-page web app (a form for entering a search criterion
and a page that displays the result), I only need to develop two parts
if I use just JSP and JSTL. If I use a servlet controller, I need
the servlet (if I use Struts, I need an Action class), a bean to
encapsulate the database access, I still need the two JSP pages, and I
typically need to define a few mappings in configuration files (web.xml
and struts-config.xml if I use Struts).

>  > As Shawn, I also see the URL actions as a perfect fit with the View
>  > in MVC, no matter if you use servlets or not. XML processing can
> 
> About the URL components. The import action seems nice, but not really 
> practical. Is there a good case where it would be desired to directly 
> import external content in to a web app? If the content needs to be 
> further manipulated it makes sense Java would be desired to properly do 
> it, so importing some XML, perhaps from a Web Service, is something that 
> would much better be done by a Java class.

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.

> Do you think the url tag is more helpful then a custom anchor-like tag? 
> e.g. <a href="<c:url/>">link text</a> versus
>  <c:a url="http://...">link text</a>
> The custom anchor-like tag syntax is cleaner, and it would be easy to 
> code any URL rewriting logic in to the custom tags setter method.

Shawn answered this one exactly like I would have, so please see his
reply.

> 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.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thanks Boris!

Borislav Iordanov wrote:
> Hi Jayson,
> 
> Yes, I've used the JSTL SQL tags in a bioinformatics web application
> (managing users, experiments, experiment results, protocols, publications, a
> complex search on everything). There is a lot of UI logic related to
> retrieving data from the database in the JSPs, done with the SQL tags. And
> the JSPs are quite clean and maintainable. However, the situation is a bit
> different than the common case because I used our UI component tag library
> TICL, which you kindly added to the JspInsider listings a while ago and
> which lets you place UI components (TableView, TreeView,  forms etc..)
> through tags in the JSP. In TICL, the tags deal only with the functional
> aspect of a UI component, MVC is implemented at the component level and you
> define the look&feel of the components (their HTML/DHTML rendering)
> elsewhere. So the combination of that with JSTL with its expression
> language, SQL and logic tags yielded JSPs with almost no HTML nor Java code
> in them.  A big part of this application simply did not need any beans on
> top of the DB, the cost of doing that extra layer was not justified. And
> it's not just a prototype and it's not that small, and the web design is
> still separated from UI and business logic.
> 
> Cheers,
> Boris
> 
> -----------------------------------------
> Borislav Iordanov
> Kobrix Software http://www.kobrix.com
> 
> ----- Original Message -----
> From: "Jayson Falkner" <ja...@jspinsider.com>
> To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> Sent: Tuesday, June 11, 2002 10:12 PM
> Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?
> 
> 
> 
>>Thanks Boris, that is a good insight.
>>
>>If you don't mind, have you personally found the JSTL SQL, XML, or URL
>>tags (or equivalent other taglibs) helpful while working on a project?
>>I.E. has there been a situation where you needed to get something done,
>>and it worked out great to use those tags? If so what was the case(s)?
>>
>>Thanks,
>>
>>Jayson
>>
>>Borislav Iordanov wrote:
>>
>>>Hi guys,
>>>
>>>Just my two cents in this discussion....
>>>
>>>JSP is as much a programming technology as it is a presentation
>>
> technology.
> 
>>>It is useful precisely because of the coupling of presentation and
>>>programming facilities. There is little or no point in using JSP if the
>>>programming constructs it offers (essentially tags and the Java
>>
> language)
> 
>>>are left aside. The web has become a true application development
>>
> platform
> 
>>>because of such technologies. And when it comes to application
>>
> development,
> 
>>>the term "presentation" seems a bit of a misnomer - it actually refers
>>
> to
> 
>>>true UI programming. In that context, I have yet to see a "web designer"
>>>writing JSPs that is not familiar with programming in one language or
>>>another. The so called "web designer" is often quite familiar with the
>>>business logic of the application also, because he/she is doing actual
>>>programming on top of it. I see a web designer as a person how really
>>
> does
> 
>>>not know how to write an "if" statement in any language, but that's
>>
> another
> 
>>>discussion. Even large, page-level MVC (i.e. with central controller
>>>servlet) projects have JSPs with quite a bit of programming code in
>>
> them. In
> 
>>>short, at least in my experience, this presentation only layer where
>>
> data is
> 
>>>only formatted to look nice is a myth. Or where it is not a myth, the
>>
> high
> 
>>>decoupling is somewhat artificial and creates an unnecessary complexity
>>
> at
> 
>>>least as difficult to maintain as the mixture of programming and
>>>presentation constructs in a single file. It very much depends on the
>>>application at hand, but quite often maintenance is easy not so much
>>
> when
> 
>>>you have n layers of abstractions, but when the code is short (but not
>>
> to
> 
>>>short), clean and readable, when decisions are made in a single place
>>
> (and
> 
>>>the right place) and the overall structure of an application is
>>
> consistent
> 
>>>and intuitive. It takes good programmers to do that, not lack of
>>>functionality that may be misused. So even if we leave out the prototype
>>
> and
> 
>>>very small apps cases, I don't think JSTL SQL and XML can hurt quality
>>
> of
> 
>>>code. On the opposite, they will improve it for people directly
>>
> accessing
> 
>>>DBs and doing XML parsing/tranforms from the JSPs anyway.
>>>
>>>Cheers,
>>>Boris
>>>
>>>-----------------------------------------
>>>Borislav Iordanov
>>>Kobrix Software http://www.kobrix.com
>>>
>>>----- Original Message -----
>>>From: "Jayson Falkner" <ja...@jspinsider.com>
>>>To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
>>>Sent: Tuesday, June 11, 2002 1:15 PM
>>>Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?
>>>
>>>
>>>
>>>
>>>>Thank James, this is some good feedback.
>>>>
>>>>James Strachan wrote:
>>>>
>>>>
>>>>>>I agree. Do you think the JSTL SQL and XML tags hurt future quality of
>>>>>>code?
>>>>>
>>>>>
>>>>>Huh?
>>>>
>>>>Just meaning maintenance as you answered later on in the e-mail.
>>>>
>>>>
>>>>
>>>>>>For instance, a MVC pattern can keep all of its View components
>>>>>>regardless of changes to the backend. This is due to a clean
>>>>>
> abstraction
> 
>>>>>>and good interface (e.g. custom JavaBean). With something such as the
>>>>>>JSTL SQL or XML tags you are restricted to a datasource or XML,
>>>>>>respectively.
>>>>>
>>>>>
>>>>>If your development team wish to go the whole hog and put custom bean
>>>>>wrappers around every piece of information in your enterprise, then you
>>>>
>>>can
>>>
>>>
>>>>>happily use the core JSTL tags to work with that data. If you have some
>>>>
>>>SQL
>>>
>>>
>>>>>or XML data available you need to present in a web page, you can use
>>>>
> the
> 
>>>SQL
>>>
>>>
>>>>>or XML tags - it gets the job done quickly. One size does not fit all,
>>>>>choose the best tool for the job. Also there's value in an XP approach,
>>>>
>>>only
>>>
>>>
>>>>>refactor code to add layers and abstractions if you really need to do
>>>>
>>>so,
>>>
>>>
>>>>>don't do unnecessary development work unless there is a real need to do
>>>>
>>>so..
>>>
>>>
>>>>Right, the concept it clear and I agree. What would be helpful is
>>>>personally have the SQL and XML tags helped you? Have you found them
>>>>handy when working on JSP/Servlet related projects, if so what type of a
>>>>project was it and  how much time to you think it saved?
>>>>
>>>>
>>>>
>>>>>>The advantage of using Java is getting everything Java supports.
>>>>>
> Namely,
> 
>>>>>>you can easily write up some validation and error handling code in
>>>>>
> Java.
> 
>>>>>
>>>>>But we're talking about page designers here, so Java is not relevant as
>>>>
>>>page
>>>
>>>
>>>>>designers typically are not Java developers. Maybe you're suggesting we
>>>>>dispense with page designers altogether and just have Java developers
>>>>
>>>write
>>>
>>>
>>>>>Java Servlets for everything?
>>>>
>>>>I'm not suggesting page designers are to be dispensed with, but I do
>>>>think someone who cares about XML and SQL related to the web app should
>>>>be more then a page designer, e.g. they should understand Java. If you
>>>>have people working on a project that are only page designers they
>>>>should only focus on the page, not caring about where the dynamic
>>>>content comes from or how it got there.
>>>>
>>>>Do you think it is a common to have a page designer fluent in HTML/XHTML
>>>>and some client-side scripting also understand SQL or XML enough to be
>>>>able to easily use the JSTL XML and SQL related tags?
>>>>
>>>>Cheers,
>>>>
>>>>Jayson Falkner
>>>>jayson@jspinsider.com
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>
>>><ma...@jakarta.apache.org>
>>>
>>>>For additional commands, e-mail:
>>>
>>><ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>
> <ma...@jakarta.apache.org>
> 
>>>For additional commands, e-mail:
>>
> <ma...@jakarta.apache.org>
> 
>>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:
> 
> <ma...@jakarta.apache.org>
> 
>>For additional commands, e-mail:
> 
> <ma...@jakarta.apache.org>
> 
>>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Borislav Iordanov <bo...@speakeasy.net>.
Hi Jayson,

Yes, I've used the JSTL SQL tags in a bioinformatics web application
(managing users, experiments, experiment results, protocols, publications, a
complex search on everything). There is a lot of UI logic related to
retrieving data from the database in the JSPs, done with the SQL tags. And
the JSPs are quite clean and maintainable. However, the situation is a bit
different than the common case because I used our UI component tag library
TICL, which you kindly added to the JspInsider listings a while ago and
which lets you place UI components (TableView, TreeView,  forms etc..)
through tags in the JSP. In TICL, the tags deal only with the functional
aspect of a UI component, MVC is implemented at the component level and you
define the look&feel of the components (their HTML/DHTML rendering)
elsewhere. So the combination of that with JSTL with its expression
language, SQL and logic tags yielded JSPs with almost no HTML nor Java code
in them.  A big part of this application simply did not need any beans on
top of the DB, the cost of doing that extra layer was not justified. And
it's not just a prototype and it's not that small, and the web design is
still separated from UI and business logic.

Cheers,
Boris

-----------------------------------------
Borislav Iordanov
Kobrix Software http://www.kobrix.com

----- Original Message -----
From: "Jayson Falkner" <ja...@jspinsider.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Tuesday, June 11, 2002 10:12 PM
Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?


> Thanks Boris, that is a good insight.
>
> If you don't mind, have you personally found the JSTL SQL, XML, or URL
> tags (or equivalent other taglibs) helpful while working on a project?
> I.E. has there been a situation where you needed to get something done,
> and it worked out great to use those tags? If so what was the case(s)?
>
> Thanks,
>
> Jayson
>
> Borislav Iordanov wrote:
> > Hi guys,
> >
> > Just my two cents in this discussion....
> >
> > JSP is as much a programming technology as it is a presentation
technology.
> > It is useful precisely because of the coupling of presentation and
> > programming facilities. There is little or no point in using JSP if the
> > programming constructs it offers (essentially tags and the Java
language)
> > are left aside. The web has become a true application development
platform
> > because of such technologies. And when it comes to application
development,
> > the term "presentation" seems a bit of a misnomer - it actually refers
to
> > true UI programming. In that context, I have yet to see a "web designer"
> > writing JSPs that is not familiar with programming in one language or
> > another. The so called "web designer" is often quite familiar with the
> > business logic of the application also, because he/she is doing actual
> > programming on top of it. I see a web designer as a person how really
does
> > not know how to write an "if" statement in any language, but that's
another
> > discussion. Even large, page-level MVC (i.e. with central controller
> > servlet) projects have JSPs with quite a bit of programming code in
them. In
> > short, at least in my experience, this presentation only layer where
data is
> > only formatted to look nice is a myth. Or where it is not a myth, the
high
> > decoupling is somewhat artificial and creates an unnecessary complexity
at
> > least as difficult to maintain as the mixture of programming and
> > presentation constructs in a single file. It very much depends on the
> > application at hand, but quite often maintenance is easy not so much
when
> > you have n layers of abstractions, but when the code is short (but not
to
> > short), clean and readable, when decisions are made in a single place
(and
> > the right place) and the overall structure of an application is
consistent
> > and intuitive. It takes good programmers to do that, not lack of
> > functionality that may be misused. So even if we leave out the prototype
and
> > very small apps cases, I don't think JSTL SQL and XML can hurt quality
of
> > code. On the opposite, they will improve it for people directly
accessing
> > DBs and doing XML parsing/tranforms from the JSPs anyway.
> >
> > Cheers,
> > Boris
> >
> > -----------------------------------------
> > Borislav Iordanov
> > Kobrix Software http://www.kobrix.com
> >
> > ----- Original Message -----
> > From: "Jayson Falkner" <ja...@jspinsider.com>
> > To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> > Sent: Tuesday, June 11, 2002 1:15 PM
> > Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?
> >
> >
> >
> >>Thank James, this is some good feedback.
> >>
> >>James Strachan wrote:
> >>
> >>>>I agree. Do you think the JSTL SQL and XML tags hurt future quality of
> >>>>code?
> >>>
> >>>
> >>>Huh?
> >>
> >>Just meaning maintenance as you answered later on in the e-mail.
> >>
> >>
> >>>>For instance, a MVC pattern can keep all of its View components
> >>>>regardless of changes to the backend. This is due to a clean
abstraction
> >>>>and good interface (e.g. custom JavaBean). With something such as the
> >>>>JSTL SQL or XML tags you are restricted to a datasource or XML,
> >>>>respectively.
> >>>
> >>>
> >>>If your development team wish to go the whole hog and put custom bean
> >>>wrappers around every piece of information in your enterprise, then you
> >>
> > can
> >
> >>>happily use the core JSTL tags to work with that data. If you have some
> >>
> > SQL
> >
> >>>or XML data available you need to present in a web page, you can use
the
> >>
> > SQL
> >
> >>>or XML tags - it gets the job done quickly. One size does not fit all,
> >>>choose the best tool for the job. Also there's value in an XP approach,
> >>
> > only
> >
> >>>refactor code to add layers and abstractions if you really need to do
> >>
> > so,
> >
> >>>don't do unnecessary development work unless there is a real need to do
> >>
> > so..
> >
> >>Right, the concept it clear and I agree. What would be helpful is
> >>personally have the SQL and XML tags helped you? Have you found them
> >>handy when working on JSP/Servlet related projects, if so what type of a
> >>project was it and  how much time to you think it saved?
> >>
> >>
> >>>>The advantage of using Java is getting everything Java supports.
Namely,
> >>>>you can easily write up some validation and error handling code in
Java.
> >>>
> >>>
> >>>But we're talking about page designers here, so Java is not relevant as
> >>
> > page
> >
> >>>designers typically are not Java developers. Maybe you're suggesting we
> >>>dispense with page designers altogether and just have Java developers
> >>
> > write
> >
> >>>Java Servlets for everything?
> >>
> >>I'm not suggesting page designers are to be dispensed with, but I do
> >>think someone who cares about XML and SQL related to the web app should
> >>be more then a page designer, e.g. they should understand Java. If you
> >>have people working on a project that are only page designers they
> >>should only focus on the page, not caring about where the dynamic
> >>content comes from or how it got there.
> >>
> >>Do you think it is a common to have a page designer fluent in HTML/XHTML
> >>and some client-side scripting also understand SQL or XML enough to be
> >>able to easily use the JSTL XML and SQL related tags?
> >>
> >>Cheers,
> >>
> >>Jayson Falkner
> >>jayson@jspinsider.com
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >
> > <ma...@jakarta.apache.org>
> >
> >>For additional commands, e-mail:
> >
> > <ma...@jakarta.apache.org>
> >
> >>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thanks Boris, that is a good insight.

If you don't mind, have you personally found the JSTL SQL, XML, or URL 
tags (or equivalent other taglibs) helpful while working on a project? 
I.E. has there been a situation where you needed to get something done, 
and it worked out great to use those tags? If so what was the case(s)?

Thanks,

Jayson

Borislav Iordanov wrote:
> Hi guys,
> 
> Just my two cents in this discussion....
> 
> JSP is as much a programming technology as it is a presentation technology.
> It is useful precisely because of the coupling of presentation and
> programming facilities. There is little or no point in using JSP if the
> programming constructs it offers (essentially tags and the Java language)
> are left aside. The web has become a true application development platform
> because of such technologies. And when it comes to application development,
> the term "presentation" seems a bit of a misnomer - it actually refers to
> true UI programming. In that context, I have yet to see a "web designer"
> writing JSPs that is not familiar with programming in one language or
> another. The so called "web designer" is often quite familiar with the
> business logic of the application also, because he/she is doing actual
> programming on top of it. I see a web designer as a person how really does
> not know how to write an "if" statement in any language, but that's another
> discussion. Even large, page-level MVC (i.e. with central controller
> servlet) projects have JSPs with quite a bit of programming code in them. In
> short, at least in my experience, this presentation only layer where data is
> only formatted to look nice is a myth. Or where it is not a myth, the high
> decoupling is somewhat artificial and creates an unnecessary complexity at
> least as difficult to maintain as the mixture of programming and
> presentation constructs in a single file. It very much depends on the
> application at hand, but quite often maintenance is easy not so much when
> you have n layers of abstractions, but when the code is short (but not to
> short), clean and readable, when decisions are made in a single place (and
> the right place) and the overall structure of an application is consistent
> and intuitive. It takes good programmers to do that, not lack of
> functionality that may be misused. So even if we leave out the prototype and
> very small apps cases, I don't think JSTL SQL and XML can hurt quality of
> code. On the opposite, they will improve it for people directly accessing
> DBs and doing XML parsing/tranforms from the JSPs anyway.
> 
> Cheers,
> Boris
> 
> -----------------------------------------
> Borislav Iordanov
> Kobrix Software http://www.kobrix.com
> 
> ----- Original Message -----
> From: "Jayson Falkner" <ja...@jspinsider.com>
> To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> Sent: Tuesday, June 11, 2002 1:15 PM
> Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?
> 
> 
> 
>>Thank James, this is some good feedback.
>>
>>James Strachan wrote:
>>
>>>>I agree. Do you think the JSTL SQL and XML tags hurt future quality of
>>>>code?
>>>
>>>
>>>Huh?
>>
>>Just meaning maintenance as you answered later on in the e-mail.
>>
>>
>>>>For instance, a MVC pattern can keep all of its View components
>>>>regardless of changes to the backend. This is due to a clean abstraction
>>>>and good interface (e.g. custom JavaBean). With something such as the
>>>>JSTL SQL or XML tags you are restricted to a datasource or XML,
>>>>respectively.
>>>
>>>
>>>If your development team wish to go the whole hog and put custom bean
>>>wrappers around every piece of information in your enterprise, then you
>>
> can
> 
>>>happily use the core JSTL tags to work with that data. If you have some
>>
> SQL
> 
>>>or XML data available you need to present in a web page, you can use the
>>
> SQL
> 
>>>or XML tags - it gets the job done quickly. One size does not fit all,
>>>choose the best tool for the job. Also there's value in an XP approach,
>>
> only
> 
>>>refactor code to add layers and abstractions if you really need to do
>>
> so,
> 
>>>don't do unnecessary development work unless there is a real need to do
>>
> so..
> 
>>Right, the concept it clear and I agree. What would be helpful is
>>personally have the SQL and XML tags helped you? Have you found them
>>handy when working on JSP/Servlet related projects, if so what type of a
>>project was it and  how much time to you think it saved?
>>
>>
>>>>The advantage of using Java is getting everything Java supports. Namely,
>>>>you can easily write up some validation and error handling code in Java.
>>>
>>>
>>>But we're talking about page designers here, so Java is not relevant as
>>
> page
> 
>>>designers typically are not Java developers. Maybe you're suggesting we
>>>dispense with page designers altogether and just have Java developers
>>
> write
> 
>>>Java Servlets for everything?
>>
>>I'm not suggesting page designers are to be dispensed with, but I do
>>think someone who cares about XML and SQL related to the web app should
>>be more then a page designer, e.g. they should understand Java. If you
>>have people working on a project that are only page designers they
>>should only focus on the page, not caring about where the dynamic
>>content comes from or how it got there.
>>
>>Do you think it is a common to have a page designer fluent in HTML/XHTML
>>and some client-side scripting also understand SQL or XML enough to be
>>able to easily use the JSTL XML and SQL related tags?
>>
>>Cheers,
>>
>>Jayson Falkner
>>jayson@jspinsider.com
>>
>>
>>--
>>To unsubscribe, e-mail:
> 
> <ma...@jakarta.apache.org>
> 
>>For additional commands, e-mail:
> 
> <ma...@jakarta.apache.org>
> 
>>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Borislav Iordanov <bo...@speakeasy.net>.
> > In short, at least in my experience, this presentation only layer
> > where data is only formatted to look nice is a myth. Or where it is
> > not a myth, the high decoupling is somewhat artificial and creates an
> > unnecessary complexity at least as difficult to maintain as the
> > mixture of programming and presentation constructs in a single file.
>
> In general, you might be right that such a methodology isn't as common as
> some people claim it is, but it's much more than a myth.  At Yale, we
> developed a relatively large web application (for "network registration,"
> used routinely by about 10000 users to register and update DHCP entries
> and other similar information) using this methodology and proto-JSTL
> concepts.  Specifically, the Manager of Student Computing -- a
> nonprogrammer with enough technical understanding to work with HTML and
> <form> elements in particular -- designed the presentation and user
> interface with minimal day-to-day help from me, whereas I played the role
> of the back-end programmer providing business logic and JSTL-like tag
> libraries.
>
> --
> Shawn Bayern
> "JSTL in Action"   http://www.jstlbook.com
> (coming in July 2002 from Manning Publications)
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>

I am not saying that business logic invariably ends up in JSP pages and that
the separation of back-end and front-end programming is a myth. Just that
the creation of an interactive web-based UI most of the time involves some
form of programming, not just data formatting - it involves making logical
decisions, looping, responding to user input etc., managing the application
flow and, last but not least ;), UI state. What I consider as a "myth" is
the common believe that web development is done two types of people:
back-end programmers coding business logic and web designers creating the
presentation layer.  There is also the UI _programmer_  working on the
functional aspects of a web application. Creating a good user interface
requires much more than deciding how to display things so that they look
nice (the job of web designers). It usually requires a good understanding of
the business logic of an application as well the UI development platform.
And it calls for different skills than "web design", it calls for
programming skills. This is why it's so hard to just let the design people
create JSPs as "views".

Cheers,
Boris

-----------------------------------------
Borislav Iordanov
Kobrix Software http://www.kobrix.com





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Shawn Bayern <ba...@essentially.net>.
On Tue, 11 Jun 2002, Borislav Iordanov wrote:

> In short, at least in my experience, this presentation only layer
> where data is only formatted to look nice is a myth. Or where it is
> not a myth, the high decoupling is somewhat artificial and creates an
> unnecessary complexity at least as difficult to maintain as the
> mixture of programming and presentation constructs in a single file.

In general, you might be right that such a methodology isn't as common as
some people claim it is, but it's much more than a myth.  At Yale, we
developed a relatively large web application (for "network registration,"  
used routinely by about 10000 users to register and update DHCP entries
and other similar information) using this methodology and proto-JSTL
concepts.  Specifically, the Manager of Student Computing -- a
nonprogrammer with enough technical understanding to work with HTML and
<form> elements in particular -- designed the presentation and user
interface with minimal day-to-day help from me, whereas I played the role
of the back-end programmer providing business logic and JSTL-like tag
libraries.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Borislav Iordanov <bo...@speakeasy.net>.
Hi guys,

Just my two cents in this discussion....

JSP is as much a programming technology as it is a presentation technology.
It is useful precisely because of the coupling of presentation and
programming facilities. There is little or no point in using JSP if the
programming constructs it offers (essentially tags and the Java language)
are left aside. The web has become a true application development platform
because of such technologies. And when it comes to application development,
the term "presentation" seems a bit of a misnomer - it actually refers to
true UI programming. In that context, I have yet to see a "web designer"
writing JSPs that is not familiar with programming in one language or
another. The so called "web designer" is often quite familiar with the
business logic of the application also, because he/she is doing actual
programming on top of it. I see a web designer as a person how really does
not know how to write an "if" statement in any language, but that's another
discussion. Even large, page-level MVC (i.e. with central controller
servlet) projects have JSPs with quite a bit of programming code in them. In
short, at least in my experience, this presentation only layer where data is
only formatted to look nice is a myth. Or where it is not a myth, the high
decoupling is somewhat artificial and creates an unnecessary complexity at
least as difficult to maintain as the mixture of programming and
presentation constructs in a single file. It very much depends on the
application at hand, but quite often maintenance is easy not so much when
you have n layers of abstractions, but when the code is short (but not to
short), clean and readable, when decisions are made in a single place (and
the right place) and the overall structure of an application is consistent
and intuitive. It takes good programmers to do that, not lack of
functionality that may be misused. So even if we leave out the prototype and
very small apps cases, I don't think JSTL SQL and XML can hurt quality of
code. On the opposite, they will improve it for people directly accessing
DBs and doing XML parsing/tranforms from the JSPs anyway.

Cheers,
Boris

-----------------------------------------
Borislav Iordanov
Kobrix Software http://www.kobrix.com

----- Original Message -----
From: "Jayson Falkner" <ja...@jspinsider.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Tuesday, June 11, 2002 1:15 PM
Subject: Re: JSTL XML, URL, and SQL tags, does anyone use them?


> Thank James, this is some good feedback.
>
> James Strachan wrote:
> >>I agree. Do you think the JSTL SQL and XML tags hurt future quality of
> >>code?
> >
> >
> > Huh?
>
> Just meaning maintenance as you answered later on in the e-mail.
>
> >>For instance, a MVC pattern can keep all of its View components
> >>regardless of changes to the backend. This is due to a clean abstraction
> >>and good interface (e.g. custom JavaBean). With something such as the
> >>JSTL SQL or XML tags you are restricted to a datasource or XML,
> >>respectively.
> >
> >
> > If your development team wish to go the whole hog and put custom bean
> > wrappers around every piece of information in your enterprise, then you
can
> > happily use the core JSTL tags to work with that data. If you have some
SQL
> > or XML data available you need to present in a web page, you can use the
SQL
> > or XML tags - it gets the job done quickly. One size does not fit all,
> > choose the best tool for the job. Also there's value in an XP approach,
only
> > refactor code to add layers and abstractions if you really need to do
so,
> > don't do unnecessary development work unless there is a real need to do
so..
>
> Right, the concept it clear and I agree. What would be helpful is
> personally have the SQL and XML tags helped you? Have you found them
> handy when working on JSP/Servlet related projects, if so what type of a
> project was it and  how much time to you think it saved?
>
> >>The advantage of using Java is getting everything Java supports. Namely,
> >>you can easily write up some validation and error handling code in Java.
> >
> >
> > But we're talking about page designers here, so Java is not relevant as
page
> > designers typically are not Java developers. Maybe you're suggesting we
> > dispense with page designers altogether and just have Java developers
write
> > Java Servlets for everything?
>
> I'm not suggesting page designers are to be dispensed with, but I do
> think someone who cares about XML and SQL related to the web app should
> be more then a page designer, e.g. they should understand Java. If you
> have people working on a project that are only page designers they
> should only focus on the page, not caring about where the dynamic
> content comes from or how it got there.
>
> Do you think it is a common to have a page designer fluent in HTML/XHTML
> and some client-side scripting also understand SQL or XML enough to be
> able to easily use the JSTL XML and SQL related tags?
>
> Cheers,
>
> Jayson Falkner
> jayson@jspinsider.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thank James, this is some good feedback.

James Strachan wrote:
>>I agree. Do you think the JSTL SQL and XML tags hurt future quality of
>>code?
> 
> 
> Huh?

Just meaning maintenance as you answered later on in the e-mail.

>>For instance, a MVC pattern can keep all of its View components
>>regardless of changes to the backend. This is due to a clean abstraction
>>and good interface (e.g. custom JavaBean). With something such as the
>>JSTL SQL or XML tags you are restricted to a datasource or XML,
>>respectively.
> 
> 
> If your development team wish to go the whole hog and put custom bean
> wrappers around every piece of information in your enterprise, then you can
> happily use the core JSTL tags to work with that data. If you have some SQL
> or XML data available you need to present in a web page, you can use the SQL
> or XML tags - it gets the job done quickly. One size does not fit all,
> choose the best tool for the job. Also there's value in an XP approach, only
> refactor code to add layers and abstractions if you really need to do so,
> don't do unnecessary development work unless there is a real need to do so..

Right, the concept it clear and I agree. What would be helpful is 
personally have the SQL and XML tags helped you? Have you found them 
handy when working on JSP/Servlet related projects, if so what type of a 
project was it and  how much time to you think it saved?

>>The advantage of using Java is getting everything Java supports. Namely,
>>you can easily write up some validation and error handling code in Java.
> 
> 
> But we're talking about page designers here, so Java is not relevant as page
> designers typically are not Java developers. Maybe you're suggesting we
> dispense with page designers altogether and just have Java developers write
> Java Servlets for everything?

I'm not suggesting page designers are to be dispensed with, but I do 
think someone who cares about XML and SQL related to the web app should 
be more then a page designer, e.g. they should understand Java. If you 
have people working on a project that are only page designers they 
should only focus on the page, not caring about where the dynamic 
content comes from or how it got there.

Do you think it is a common to have a page designer fluent in HTML/XHTML 
and some client-side scripting also understand SQL or XML enough to be 
able to easily use the JSTL XML and SQL related tags?

Cheers,

Jayson Falkner
jayson@jspinsider.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Jayson Falkner" <ja...@jspinsider.com>
>  > if the applications performs sufficiently well without finer-grained
>  > management of such resources, then development is easier with no loss
>  > in quality of the code.
>
> I agree. Do you think the JSTL SQL and XML tags hurt future quality of
> code?

Huh?

> For instance, a MVC pattern can keep all of its View components
> regardless of changes to the backend. This is due to a clean abstraction
> and good interface (e.g. custom JavaBean). With something such as the
> JSTL SQL or XML tags you are restricted to a datasource or XML,
> respectively.

If your development team wish to go the whole hog and put custom bean
wrappers around every piece of information in your enterprise, then you can
happily use the core JSTL tags to work with that data. If you have some SQL
or XML data available you need to present in a web page, you can use the SQL
or XML tags - it gets the job done quickly. One size does not fit all,
choose the best tool for the job. Also there's value in an XP approach, only
refactor code to add layers and abstractions if you really need to do so,
don't do unnecessary development work unless there is a real need to do so..

Sure in an ideal world, we'll always wrap things in beans and have a full
MVC model II or hierarchial pull model and would probably have session
facades over session beans which would uses entity beans internally with
maybe data-access objects with value objects passing from the back end to
the front. Though implementing all of the various J2EE patterns can take a
very long time and can often be a very large sledgehammer to crack a tiny
little nut. In the real world, sometimes all we need to do is extract some
information from an SQL database or an XML source and display it on a web
page. No huge requirement for a java middle tier, just a simple 2 tier
architecture. Sure one day that might get refactored into beans if it is
required. Maybe not though.

Indeed if Web Services take off, I can see extracting information from XML
much more popular than having to deal with the massive complexity of working
with EJBs, session beans, session facades, value objects, JNDI, JTS and all
the rest, just to get some information to display in a web page.



> > For importing data from a web service, I tend to agree that more
> > abstraction is useful; James Strachan and others like the idea of using
> > XPath to parse responses from web-services, but I'm not fully convinced
of
> > the utility of that approach.  However, displaying data from an XML
> > document that's retrieved from a database or URL is reasonably within
the
> > realm of the presentation tier.  What's the advantage of using Java,
> > versus JSTL, to loop over all <customer> elements of a document and
print
> > the value of their <orderNumber> children?
>
> The advantage of using Java is getting everything Java supports. Namely,
> you can easily write up some validation and error handling code in Java.

But we're talking about page designers here, so Java is not relevant as page
designers typically are not Java developers. Maybe you're suggesting we
dispense with page designers altogether and just have Java developers write
Java Servlets for everything?

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thanks again for the comments Shawn,

Shawn Bayern wrote:
> I think making functionality available to those who know less is what
> abstraction is all about.  As a point of comparison, Microsoft .NET claims
> to let a number of languages interoperate.  But all of these languages
> exist at roughly the same level of abstraction, meaning that they're all
> substantially the same:  they're different syntaxes to address the same
> problem.  With the array of Java standards, my hope is that they cover
> *different* levels in the abstraction hierarchy and are thus suitable for
> different users.

I see, but it would be helpful if you could narrow this down to 
specifically relating to the JSTL XML and SQL tags. Those are what I'm 
most interested in. Would it be correct to interpret this as you do 
think the JSTL encourages users to know less, but that isn't a bad 
thing; Lowering the level of knowledge required is something abstraction 
is good for, and, it means different types of developers can more easily 
use the same functionality?

Would you conisder yourself someone who benefits from the JSTL XML and 
SQL tags? why/why not?

>  > How much faster and is it because JSP auto-compiles?
> 
> You're asking for metrics I don't have and which, to be honest, I doubt
> very many people have.  (I'd say that applies even to those people whom
> spend the majority of their time debating application-development
> methodologies.)  As an analogy, most people agree that DOM is "easier" to
> develop with than SAX, but does anyone have metrics for "how much faster"?
> You're holding JSTL to an extremely high (and perhaps impossible)
> standard.

Specific numbers like a benchmark are not important, I was referring 
more to development time as you perceive it. When developing with JSP 
and XML and/or SQL, and you have the choice of using either the JSTL or 
a design pattern you well understand (perhaps MVC or embedding 
scriptlets) which do you choose and why?

>  > Why would you want to do this?
>  > 
> Why replicate a common header across multiple web applications when
> locating it in a single place allows you to change it once and have the
> changes noticed immediately by multiple systems?

As in multiple servers running the same web app? If this was the case 
and there was part of a header which would change often why not make it 
dynamic and centralize it in the main datasource (likely in a db)? For 
big changes to the web app it would make sense to have a scheme which 
redeploys the entire web app as needed, perhaps by hot-deployment so the 
servers do not need to be shut down.

A single external import for something like a header does not seem to be 
very helpful. I do not wish to debate pointlessly about how things could 
get done. There are many ways, which I realize, however personal votes 
are really what I want. Have you ever had to personally used the import 
action for a good purpose (not examples of course ;)? If so what was it 
and did it do a good job?

> But we're talking about XML here; you don't typically want to write
> validation logic in Java, instead relying on schema methodologies for the
> integrity of the application.  Separately, JSTL lets you catch errors and
> logically pass them to Java code, if that's what you want to do.

I think I see what you are saying, in your opinion the XML tags are 
really designed for best use when relying on previous proper use of XML 
schemas?

>  > information is always correct is a stretch, especially if you are not
>  > responsible for generating the XML.
> 
> Not if it adheres to a schema.

Right, same as above. The case is when your schema is not being enforced 
by Java. So someone using the XML tags would likely understand XML well 
and the schemas related to it, or count on someone else for these skills.

>  > I meant the url action would be unfavorable versus a HTML-like link 
>  > action authored individually on a per project basis. So if HTML was the 
>  > only thing used it would be HTML, likewise for other formats.
> 
> But that sounds like wasted effort, which is worse than dealing with
> <c:url>'s syntax.

Okay, so you are saying it is more effort to shift this to building it 
as needed on a per-project basis, the better approach would be to use 
the slightly awkward url tag sytanx?

>  > Right, but why would you want to do this? The jsp:forward action is not 
>  > something which is helpful either. The API it uses is very helpful, but 
>  > making a tag out of the API doesn't seem to be of use. Do you think
>  > this type of tag should be encouraged for use with JSP?
> 
> It doesn't seem hard to come up with justifications of <jsp:forward>'s
> utility.  For instance, it can allow finer-grained error handling than JSP
> errorPages:
> 
>  <c:if test="${error1.occurred}">
>    <jsp:forward page="/error1Handler"/>
>  </c:if>
> 
> (where /error1Handler points, perhaps, to a servlet).
> 
> It can, more generally, link JSP pages and servlets flexibly; a JSP page
> need not be the terminal component for every request.

Again I am most interested in your personal opinion. There are many ways 
in which JSP can be used. Do you use the the jsp:forward action and/or 
the JSTL version of it? why not/why and what are the most common uses?

Cheers,

Jayson Falkner
jayson@jspinsider.com




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 10 Jun 2002, Jayson Falkner wrote:

 > > In general, JSTL requires that users know less, making its use
 > > easier.  For instance, users of JSTL tags don't need to understand
 > > the lifecycle considerations associated with a JDBC Connection,
 > > Statement, or ResultSet;
 > 
 > Do you think it is better to encourage use of JDBC and SQL by users
 > that know less, or, is it better to encourage users to know more
 > before dealing with it? Which way do you think the JSTL is encouraging
 > users to go?

I think making functionality available to those who know less is what
abstraction is all about.  As a point of comparison, Microsoft .NET claims
to let a number of languages interoperate.  But all of these languages
exist at roughly the same level of abstraction, meaning that they're all
substantially the same:  they're different syntaxes to address the same
problem.  With the array of Java standards, my hope is that they cover
*different* levels in the abstraction hierarchy and are thus suitable for
different users.

 > > I can certainly say, from my own experience and anecdotal evidence,
 > > that prototyped pages (and small applications) can be faster to
 > > develop in JSP than in JSP + Java.
 > 
 > How much faster and is it because JSP auto-compiles?

You're asking for metrics I don't have and which, to be honest, I doubt
very many people have.  (I'd say that applies even to those people whom
spend the majority of their time debating application-development
methodologies.)  As an analogy, most people agree that DOM is "easier" to
develop with than SAX, but does anyone have metrics for "how much faster"?
You're holding JSTL to an extremely high (and perhaps impossible)
standard.

 > > Sure - consider importing a header from another web application.  Would
 > > you really want Java code to do this, instead of a single <c:import>
 > > action element?
 > 
 > Why would you want to do this?
 > 
 > If I had to, I would want Java code to do this for cache reasons. But,
 > I can't think of a good reason why a external header would be needed.

Why replicate a common header across multiple web applications when
locating it in a single place allows you to change it once and have the
changes noticed immediately by multiple systems?

 > The advantage of using Java is getting everything Java
 > supports. Namely, you can easily write up some validation and error
 > handling code in Java.

But we're talking about XML here; you don't typically want to write
validation logic in Java, instead relying on schema methodologies for the
integrity of the application.  Separately, JSTL lets you catch errors and
logically pass them to Java code, if that's what you want to do.

 > Both are unrelated to looping through some values but required when
 > getting the information which is being looped through. Assuming the
 > information is always correct is a stretch, especially if you are not
 > responsible for generating the XML.

Not if it adheres to a schema.

 > I meant the url action would be unfavorable versus a HTML-like link 
 > action authored individually on a per project basis. So if HTML was the 
 > only thing used it would be HTML, likewise for other formats.

But that sounds like wasted effort, which is worse than dealing with
<c:url>'s syntax.

 > The point of asking was to see if encouraging use of the url action
 > would be better then encouraging use of the API that powers it.

There are multiple APIs, however; using JSTL lets you ignore the details.  
<c:url> both uses response.encodeURL() and normalizes relative URLs
against a context path.

 > > Forwarding to a resource that's not in the web application (and is
 > > thus beyond the reach of <jsp:forward>).
 > 
 > Right, but why would you want to do this? The jsp:forward action is not 
 > something which is helpful either. The API it uses is very helpful, but 
 > making a tag out of the API doesn't seem to be of use. Do you think
 > this type of tag should be encouraged for use with JSP?

It doesn't seem hard to come up with justifications of <jsp:forward>'s
utility.  For instance, it can allow finer-grained error handling than JSP
errorPages:

 <c:if test="${error1.occurred}">
   <jsp:forward page="/error1Handler"/>
 </c:if>

(where /error1Handler points, perhaps, to a servlet).

It can, more generally, link JSP pages and servlets flexibly; a JSP page
need not be the terminal component for every request.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thanks for the comments Shawn,

> In general, JSTL requires that users know less, making its use easier.  
> For instance, users of JSTL tags don't need to understand the lifecycle
> considerations associated with a JDBC Connection, Statement, or ResultSet;

Do you think it is better to encourage use of JDBC and SQL by users that 
know less, or, is it better to encourage users to know more before 
dealing with it? Which way do you think the JSTL is encouraging users to go?

 > if the applications performs sufficiently well without finer-grained
 > management of such resources, then development is easier with no loss 
 > in quality of the code.

I agree. Do you think the JSTL SQL and XML tags hurt future quality of 
code? For instance, a MVC pattern can keep all of its View components 
regardless of changes to the backend. This is due to a clean abstraction 
and good interface (e.g. custom JavaBean). With something such as the 
JSTL SQL or XML tags you are restricted to a datasource or XML, 
respectively.

>>Probably? Is it quicker for you or any projects you have helped on?
> 
> I can certainly say, from my own experience and anecdotal evidence, that
> prototyped pages (and small applications) can be faster to develop in JSP
> than in JSP + Java.

How much faster and is it because JSP auto-compiles? Would you put a 
limit on when it would not be quicker to use JSTL SQL and XML tags? If 
so, what is the limit?

>>About the URL components. The import action seems nice, but not really 
>>practical. Is there a good case where it would be desired to directly 
>>import external content in to a web app?
> 
> Sure - consider importing a header from another web application.  Would
> you really want Java code to do this, instead of a single <c:import>
> action element?

Why would you want to do this?

If I had to, I would want Java code to do this for cache reasons. But, I 
can't think of a good reason why a external header would be needed.

> For importing data from a web service, I tend to agree that more
> abstraction is useful; James Strachan and others like the idea of using
> XPath to parse responses from web-services, but I'm not fully convinced of
> the utility of that approach.  However, displaying data from an XML
> document that's retrieved from a database or URL is reasonably within the
> realm of the presentation tier.  What's the advantage of using Java,
> versus JSTL, to loop over all <customer> elements of a document and print
> the value of their <orderNumber> children?

The advantage of using Java is getting everything Java supports. Namely, 
you can easily write up some validation and error handling code in Java. 
Both are unrelated to looping through some values but required when 
getting the information which is being looped through. Assuming the 
information is always correct is a stretch, especially if you are not 
responsible for generating the XML.

>>e.g. <a href="<c:url/>">link text</a> versus
>>  <c:a url="http://...">link text</a>
> 
> But this then ties JSTL to HTML in particular (something we've
> consistently avoided doing), and it also requires a separate JSTL tag for
> each HTML element that might contain a URL -- including, at least, <a>,
> <img>, <iframe>, <frame>, <form>, and <link>.  Worse, every potential HTML
> 4.0 attribute would need to be replicated by the JSTL tag; I believe <img>
> has about two dozen attributes, for instance.  Furthermore, this wouldn't
> help when sending a URL as part of a block of scripting code (e.g.,
> JavaScript).

I meant the url action would be unfavorable versus a HTML-like link 
action authored individually on a per project basis. So if HTML was the 
only thing used it would be HTML, likewise for other formats.

The point of asking was to see if encouraging use of the url action 
would be better then encouraging use of the API that powers it. Some 
tags such as the JSTL forEach tag are great for most every use, however 
the url tag doesn't seem like one of these because of the awkward 
syntax. What do you think?

>>What is a good use for the redirect tag?
> 
> Forwarding to a resource that's not in the web application (and is thus
> beyond the reach of <jsp:forward>).

Right, but why would you want to do this? The jsp:forward action is not 
something which is helpful either. The API it uses is very helpful, but 
making a tag out of the API doesn't seem to be of use. Do you think this 
type of tag should be encouraged for use with JSP?

Cheers,

Jayson Falkner
jayson@jspinsider.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 10 Jun 2002, Jayson Falkner wrote:

> Overall your opinion seems to be the JSTL tags would just be easier
> and accomplish the same thing. I tend to think they are not easier at
> all, just a different approach.  Do you think it is wise to promote
> the use of these tags to new users? Especially when it may result in a
> JSTL skillset compared to a sound understanding of what most people
> consider the best method of developing JSP/Servlet Web Applications.

In general, JSTL requires that users know less, making its use easier.  
For instance, users of JSTL tags don't need to understand the lifecycle
considerations associated with a JDBC Connection, Statement, or ResultSet;
if the applications performs sufficiently well without finer-grained
management of such resources, then development is easier with no loss in
quality of the code.

>  > * for any simple application, when its clear that it will not go
>  >   through major extensions; using just JSP pages with action elements
>  >   is probaly very cost-efficive in this case (lower development time).
> 
> Probably? Is it quicker for you or any projects you have helped on?

I can certainly say, from my own experience and anecdotal evidence, that
prototyped pages (and small applications) can be faster to develop in JSP
than in JSP + Java.

>  > As Shawn, I also see the URL actions as a perfect fit with the View
>  > in MVC, no matter if you use servlets or not. XML processing can
> 
> About the URL components. The import action seems nice, but not really 
> practical. Is there a good case where it would be desired to directly 
> import external content in to a web app?

Sure - consider importing a header from another web application.  Would
you really want Java code to do this, instead of a single <c:import>
action element?

> If the content needs to be further manipulated it makes sense Java
> would be desired to properly do it, so importing some XML, perhaps
> from a Web Service, is something that would much better be done by a
> Java class.

For importing data from a web service, I tend to agree that more
abstraction is useful; James Strachan and others like the idea of using
XPath to parse responses from web-services, but I'm not fully convinced of
the utility of that approach.  However, displaying data from an XML
document that's retrieved from a database or URL is reasonably within the
realm of the presentation tier.  What's the advantage of using Java,
versus JSTL, to loop over all <customer> elements of a document and print
the value of their <orderNumber> children?

> Do you think the url tag is more helpful then a custom anchor-like tag? 
> e.g. <a href="<c:url/>">link text</a> versus
>   <c:a url="http://...">link text</a>
> The custom anchor-like tag syntax is cleaner, and it would be easy to 
> code any URL rewriting logic in to the custom tags setter method.

But this then ties JSTL to HTML in particular (something we've
consistently avoided doing), and it also requires a separate JSTL tag for
each HTML element that might contain a URL -- including, at least, <a>,
<img>, <iframe>, <frame>, <form>, and <link>.  Worse, every potential HTML
4.0 attribute would need to be replicated by the JSTL tag; I believe <img>
has about two dozen attributes, for instance.  Furthermore, this wouldn't
help when sending a URL as part of a block of scripting code (e.g.,
JavaScript).

> What is a good use for the redirect tag?

Forwarding to a resource that's not in the web application (and is thus
beyond the reach of <jsp:forward>).

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Jayson Falkner <ja...@jspinsider.com>.
Thanks for the comments Hans.

 > As Shawn and David, I think these types of actions make sense. It's
 > dangerous to think that "one size fits all."

Agreed, but could you elaborate on your reasons? You didn't explain why 
it is dangerous.

By "one size fits all", do you mean assuming everyone should only use MVC?

 > But
 > there are exceptions where I think it's perfectly okay to use the
 > database access actions in JSP pages, e.g.
 > * for a small, company-internal application, when no one with enough
 >   Java knowledge is around to develop servlets. I believe this is a
 >   very common scenario that is often overlooked when programmers
 >   discuss "the right way" to develop web applications. The alternatives
 >   in a case like this are likely that the app doesn't get developed at
 >   all, or that it's done with JDBC code is scriptlets, or (gasp!)
 >   using ASP and Visual Basic code.

Are you saying the these JSTL tags are easier to learn then the 
Java/Servlets required?

What about understanding SQL and XML. Are you suggesting a developer 
would understand these enough to use them, but not with a programming 
language such as Java?

What do you mean by "the right way"? Are you saying when developers talk 
about how to develop, "the right way" is equivalent to the only way that 
should be done?

Overall your opinion seems to be the JSTL tags would just be easier and 
accomplish the same thing. I tend to think they are not easier at all, 
just a different approach.  Do you think it is wise to promote the use 
of these tags to new users? Especially when it may result in a JSTL 
skillset compared to a sound understanding of what most people consider 
the best method of developing JSP/Servlet Web Applications.

 > * for any simple application, when its clear that it will not go
 >   through major extensions; using just JSP pages with action elements
 >   is probaly very cost-efficive in this case (lower development time).

Probably? Is it quicker for you or any projects you have helped on?

I have a hard time believing this would ever occur. Certainly if you 
have to train developers the what and how of MVC then it would take more 
time, but if the skillset exists certainly not.

 > * for prototyping an idea; if the proof-of-concept is successful,
 >   the app can be redesigned with a servlet Controller, filters, and all
 >   the other goodies after getting some experience with the basic
 >   application functionality.

This is another argument about development time? What about a MVC style 
design pattern is so time consuming?

 > As Shawn, I also see the URL actions as a perfect fit with the View
 > in MVC, no matter if you use servlets or not. XML processing can

About the URL components. The import action seems nice, but not really 
practical. Is there a good case where it would be desired to directly 
import external content in to a web app? If the content needs to be 
further manipulated it makes sense Java would be desired to properly do 
it, so importing some XML, perhaps from a Web Service, is something that 
would much better be done by a Java class.

Do you think the url tag is more helpful then a custom anchor-like tag? 
e.g. <a href="<c:url/>">link text</a> versus
  <c:a url="http://...">link text</a>
The custom anchor-like tag syntax is cleaner, and it would be easy to 
code any URL rewriting logic in to the custom tags setter method.

What is a good use for the redirect tag?

Cheers,

Jayson Falkner
jayson@jspinsider.com

 >

Hans Bergsten wrote:
> Jayson Falkner wrote:
> 
>> Does anyone seriously use the JSTL XML, URL, and SQL tags? I'm looking 
>> for some reasons as to why they are helpful, but, I can't really find 
>> any. Obviously they work, but the important point seems to be the 
>> tag's functionality would best be placed elsewhere using Model 2 (MVC).
>>
>> If anyone is seriously using them and has a good argument as to why 
>> they are helpful, I'd like to discuss it with them further. Does anyone?
> 
> 
> As Shawn and David, I think these types of actions make sense. It's
> dangerous to think that "one size fits all." In general, I recommend
> using a MVC design with a servlet as the Controller and all database
> access performed by Java classes rather than action elements. But
> there are exceptions where I think it's perfectly okay to use the
> database access actions in JSP pages, e.g.
> * for a small, company-internal application, when no one with enough
>   Java knowledge is around to develop servlets. I believe this is a
>   very common scenario that is often overlooked when programmers
>   discuss "the right way" to develop web applications. The alternatives
>   in a case like this are likely that the app doesn't get developed at
>   all, or that it's done with JDBC code is scriptlets, or (gasp!)
>   using ASP and Visual Basic code.
> * for any simple application, when its clear that it will not go
>   through major extensions; using just JSP pages with action elements
>   is probaly very cost-efficive in this case (lower development time).
> * for prototyping an idea; if the proof-of-concept is successful,
>   the app can be redesigned with a servlet Controller, filters, and all
>   the other goodies after getting some experience with the basic
>   application functionality.
> 
> Even when only JSP pages are used, it's still a good idea to follow
> the MVC patter, though; use separate JSP pages for View pages and
> Controller/Model pages. This makes it easier to introduce servlets
> when warranted.
> 
> As Shawn, I also see the URL actions as a perfect fit with the View
> in MVC, no matter if you use servlets or not. XML processing can
> be either or, but there are cases where it makes perfect sense to
> use them in pure View components. The only really controversial
> actions are the database actions, but like I said, there are cases
> where it's a good idea to use them.
> 
> Hans



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Jayson Falkner wrote:
> Does anyone seriously use the JSTL XML, URL, and SQL tags? I'm looking 
> for some reasons as to why they are helpful, but, I can't really find 
> any. Obviously they work, but the important point seems to be the tag's 
> functionality would best be placed elsewhere using Model 2 (MVC).
> 
> If anyone is seriously using them and has a good argument as to why they 
> are helpful, I'd like to discuss it with them further. Does anyone?

As Shawn and David, I think these types of actions make sense. It's
dangerous to think that "one size fits all." In general, I recommend
using a MVC design with a servlet as the Controller and all database
access performed by Java classes rather than action elements. But
there are exceptions where I think it's perfectly okay to use the
database access actions in JSP pages, e.g.
* for a small, company-internal application, when no one with enough
   Java knowledge is around to develop servlets. I believe this is a
   very common scenario that is often overlooked when programmers
   discuss "the right way" to develop web applications. The alternatives
   in a case like this are likely that the app doesn't get developed at
   all, or that it's done with JDBC code is scriptlets, or (gasp!)
   using ASP and Visual Basic code.
* for any simple application, when its clear that it will not go
   through major extensions; using just JSP pages with action elements
   is probaly very cost-efficive in this case (lower development time).
* for prototyping an idea; if the proof-of-concept is successful,
   the app can be redesigned with a servlet Controller, filters, and all
   the other goodies after getting some experience with the basic
   application functionality.

Even when only JSP pages are used, it's still a good idea to follow
the MVC patter, though; use separate JSP pages for View pages and
Controller/Model pages. This makes it easier to introduce servlets
when warranted.

As Shawn, I also see the URL actions as a perfect fit with the View
in MVC, no matter if you use servlets or not. XML processing can
be either or, but there are cases where it makes perfect sense to
use them in pure View components. The only really controversial
actions are the database actions, but like I said, there are cases
where it's a good idea to use them.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Shawn Bayern <ba...@essentially.net>.
On Fri, 7 Jun 2002, David Geary wrote:

> Good question. One thing to consider is that you can use some of those 
> tags in read-only mode, and not break the MVC paradigm.

In fact (just to expand on this), out of the tags Jayson listed,
<sql:update> is the only one that typically will have a permanent effect
on "model" data.  The <c:import> tag supports only HTTP GET, not HTTP
POST; by the HTTP standard, HTTP GET is meant not to have side effects.  
Similarly, the XML tags do not generally manipulate data; they usually
retrieve (and typically display) it.  We didn't include tags for DOM
modification, for instance.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by David Geary <sa...@earthlink.net>.
Jayson Falkner wrote:

> Does anyone seriously use the JSTL XML, URL, and SQL tags? I'm looking 
> for some reasons as to why they are helpful, but, I can't really find 
> any. Obviously they work, but the important point seems to be the 
> tag's functionality would best be placed elsewhere using Model 2 (MVC).
>
> If anyone is seriously using them and has a good argument as to why 
> they are helpful, I'd like to discuss it with them further. Does anyone? 

Good question. One thing to consider is that you can use some of those 
tags in read-only mode, and not break the MVC paradigm. For example, you 
can use <sql:query> to query a database and access the results. That 
does not break model data encapsulation, and saves some servlet 
(presumably) the trouble of executing the query and packaging the 
results for a view (JSP page) to access. On the other hand, if you want 
to adhere to MVC, you probably don't want to use actions like 
<sql:update> or <sql:transaction> which actually modify model data.


david

>
>
> Cheers,
>
> Jayson Falkner
> jayson@jspinsider.com
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL XML, URL, and SQL tags, does anyone use them?

Posted by Shawn Bayern <ba...@essentially.net>.
On Fri, 7 Jun 2002, Jayson Falkner wrote:

> Does anyone seriously use the JSTL XML, URL, and SQL tags? I'm looking
> for some reasons as to why they are helpful, but, I can't really find
> any. Obviously they work, but the important point seems to be the
> tag's functionality would best be placed elsewhere using Model 2
> (MVC).
> 
> If anyone is seriously using them and has a good argument as to why
> they are helpful, I'd like to discuss it with them further. Does
> anyone?

There were a handful of different thoughts behind these libraries:

 - Not everyone writes applications using the "model 2" methodology.
   Some applications are small, for instance, and don't need rigidly
   separated components.  Furthermore, while many of us appreciate
   the design behind "model 2," it is not universally accepted; JSP
   and JSTL do not require it to be.

 - The inclusion of URLs and the manipulation of XML are both arguably
   "presentation-tier" tasks.  Consider <jsp:include>, which <c:import>
   merely generalizes.  Consider also XSLT, which is clearly appropriate
   for the presentation tier but which engages in the manipulation
   of XML; JSTL's XML libraries can be seen as an imperative
   alternative to XSLT's functional approach.

   To play devil's advocate, how far would you suggest swinging the
   pendulum away from JSP back toward Java code in servlets?  Would
   you argue for having a servlet (versus a JSP page) manage headers
   and footers?  Both <c:import> and the XML tags are appropriate
   for retrieving and processing such inclusions.

   Separately, the other URL tags:  <c:url>, <c:redirect>, and so forth
   seem much less cumbersome in JSTL than their analogues in servlets
   do.  The servlet sees URLs in the "data model" as their literal
   values; the addition of a context path and session ID are arguably
   best left to the domain of presentation rather than business logic.
   I just suggested as a training session I gave that session IDs
   should be added to URLs from within a JSP page, not from a servlet,
   precisely because of this; <c:url> fills this role.  And <c:redirect>
   is appropriate whenever a JSP page needs to initiate a redirect; it's
   an alternative to <jsp:forward> serving a different niche.

 - The SQL libraries are the hardest to defend to those who believe
   in "model 2," but it's nonetheless a requested feature and one where
   standardization is better than the lack of it (and the use of
   fragmentary database-access tags).  However, even in applications
   where "business objects" are handled using a rigorous, thoughtful
   methodology, some data might be intended specifically for the
   presentation tier and might be easier to retrieve using JSTL's
   SQL tags.  For example, is anything really gained by transfering
   a user's color or font preference through multiple tiers of
   business logic?  Perhaps, just for consistency... but perhaps not.

Note that the presence of a JSTL tag isn't the same as an endorsement by
the JSR-052 group of any specific methodology.  JSTL tags, in fact, were
designed to be as tightly focused as possible, each serving a particular
role; many of them can therefore be used irrespective of whether you use
other JSTL tags or not.  The goal of JSTL is simply to make JSP
development easier -- for all JSP users, not just for those who adopt a
specific organizational plan for their applications.

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>