EL in Input taglib

2003-02-18 Thread Igor Kozlov
Hello!

I have a question.
Why expression language don't used in Input taglib?


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




JSTL

2003-02-18 Thread Jeff Corliss
Hi all,

Recently started using the standard taglib - great
stuff!  I have a couple of questions about it:

1) There doesn't seem to be a varStatus attribute for
the x:forEach tag like there is for the c:forEach tag.
 For the time being, I implemented one using c:set
etc. (so I can have even/odd table row styles for a
table being built from xml data), but it seems like
there should be one.  Will this be added in a future
version?

2) Does anyone know if the Appendix PDF file (from the
link on the java.sun.com jstl page) is redistributable
(no licensing issues)?

3) There are no WAR files in the 1.02 release (?), or
did I download the wrong .zip?

Thanks,
JC


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




Re: JSTL

2003-02-18 Thread Shawn Bayern
On Tue, 18 Feb 2003, Jeff Corliss wrote:

 1) There doesn't seem to be a varStatus attribute for the x:forEach
 tag like there is for the c:forEach tag.
  For the time being, I implemented one using c:set etc. (so I can have
 even/odd table row styles for a table being built from xml data), but
 it seems like there should be one.  Will this be added in a future
 version?

I believe it's in the pipeline of suggestions; there's probably no good
reason not to add it.  To record your specific need, you can mail

  [EMAIL PROTECTED]

 2) Does anyone know if the Appendix PDF file (from the link on the
 java.sun.com jstl page) is redistributable (no licensing issues)?

My publisher technically owns the copyright until the contract expires,
but as it's author, I'm willing to go on record that there are no problems
with redistributing it.

 3) There are no WAR files in the 1.02 release (?), or did I download
 the wrong .zip?

The version of 1.0.2 currently available from the download site has this
problem; I vaguely remember fixing it long ago, but the oversight might
still remain.  Anyway, release 1.0.3 will be out soon; I had planned on
releasing it this weekend but got sidetracked by a number of other things
-- I expect to have it posted tonight or tomorrow.

-- 
Shawn Bayern
JSTL in Action   http://www.manning.com/bayern


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




Re: EL in Input taglib

2003-02-18 Thread Glenn Nielsen
The input taglib was developed before there was the Standard taglib and
the EL.  Over time, those taglibs here which are not superceded by the
Standard taglib may have support for the EL added.

Glenn

Igor Kozlov wrote:

Hello!

I have a question.
Why expression language don't used in Input taglib?


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



--
--
Glenn Nielsen [EMAIL PROTECTED] | /* Spelin donut madder|
MOREnet System Programming   |  * if iz ina coment.  |
Missouri Research and Education Network  |  */   |
--


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




Re: JSTL

2003-02-18 Thread Jeff Corliss
Thanks so much for the prompt reply, Shawn!
JC


__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

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




RE: Tag List

2003-02-18 Thread Schnitzer, Jeff
So far the best explanation I have found of MVC aka Model-2 is on
Sun's site:

http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents
.html#JSPIntro4

Sun calls the pattern Model-2, but there is enough similarity to the
Smalltalk pattern that the term MVC has been (arguably
mis-)appropriated.

Jeff Schnitzer
[EMAIL PROTECTED]
The Maverick MVC Framework:  http://mav.sourceforge.net

 -Original Message-
 From: Scott Taylor [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, February 16, 2003 7:43 AM
 To: Tag Libraries Users List
 Subject: Re: Tag List
 
 Thanks I will look at Maverick. Why is Maverick and Struts considerd
MVC,
 when the idea of JSP is part of MVC?
 
 Scott
 
 
 - Original Message -
 From: Schnitzer, Jeff [EMAIL PROTECTED]
 To: Tag Libraries Users List [EMAIL PROTECTED]
 Sent: Friday, February 14, 2003 8:19 PM
 Subject: RE: Tag List
 
 
 Yes, if you're using JSTL then you will be a whole lot better off with
 an MVC framework like Struts or Maverick.  I recommend Maverick -
it's
 considerably simpler than Struts, yet offers more features.  Also,
 unlike most other similar frameworks (Struts, WebWork, etc), Maverick
 never started out with a now-crufty set of specialized set of JSP tags
-
 JSTL works great.
 
 The core distribution includes a sample application that uses JSTL.
 
 http://mav.sourceforge.net
 
 Jeff Schnitzer
 [EMAIL PROTECTED]
 (yes, I'm the lead developer of Maverick)
 
  - Original Message -
  From: Scott Taylor [EMAIL PROTECTED]
  To: Tag Libraries Users List [EMAIL PROTECTED]
  Sent: Friday, February 14, 2003 10:23 AM
  Subject: Re: Tag List
 
 
   Thanks...how about an entry form?
  
   Also, if I want to do JSP's easier are Struts better?
  
   I will get the book though
  
   Thanks
  
   Scott
  
  
   - Original Message -
   From: Eddie Barna [EMAIL PROTECTED]
   To: Tag Libraries Users List [EMAIL PROTECTED]
   Sent: Friday, February 14, 2003 6:01 PM
   Subject: Re: Tag List
  
  
You can pass the value from your search form to the page which
you
  have
listed in your email.  For example:  You have a search form with
a
  text
   box
titled search
   
Here's what the page that queries the db would look like now
   
 sql:query var=productQuery  dataSource=${productDS}  
 SELECT * FROM CD WHERE CDTITLE = ?
sql:param value=${param.search}/
 /sql:query
You can also expand on this by using the OR statement in your
 query.
  For
example:
   
 sql:query var=productQuery  dataSource=${productDS}  
 SELECT * FROM CD WHERE CDTITLE = ? OR ARTIST = ?
sql:param value=${param.search}/
sql:param value=${param.search}/
 /sql:query
   
For every condition in your query you must add a sql;param/
tag.
   
Hope this helps.  I really do recomend that you get Shawn
Bayern's
  book
titled JSTL in Action.  It explains all this in great detail,
plus
everything else.
   
   
- Original Message -
From: Scott Taylor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 14, 2003 9:31 AM
Subject: Tag List
   
   
 I am trying to find a list of tags to help me modify the CD
Shop
  Cart
   web
 application from Sun One.

 For example, how do I insert tags that provide a search form
 (and
  entry
 form) rather than simply list everything.

 Here is what the code looks like so far:

 %@page contentType=text/html%
 html
 headtitleCD Catalog List/title/head
 %@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
 %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; %
 body
 h1 CD Catalog List /h1
 sql:setDataSource var=productDS
url=jdbc:postgresql://localhost:5432/recruitment
driver=org.postgresql.Driver
user=scott password= /

 sql:query var=productQuery  dataSource=${productDS}  
 SELECT * FROM CD
 /sql:query

 TABLE border=1
   TR
 THID/TH
 THCD Title/TH
 THArtist/TH
 THCountry/TH
 THPrice/TH
   /TR

 c:forEach var=row items=${productQuery.rows}
   TR
 TDc:out value=${row.ID}//TD
 TDc:out value=${row.CDTITLE}//TD
 TDc:out value=${row.ARTIST}//TD
 TDc:out value=${row.COUNTRY}//TD
 TDc:out value=${row.PRICE}//TD
 TD
 form method=get action=ShopCart.jsp
   input type=hidden name=cdId value=c:out
  value=${row.ID}/
   input type=hidden name=cdTitle value=c:out
 value=${row.CDTITLE}/
   input type=hidden name=cdPrice value=c:out
value=${row.PRICE}/
   input type=submit name=operation value=Add
 /form
 /TD
   /TR
 /c:forEach
 /TABLE
 /body
 /html

 Regards

 Scott



 
  -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 

RE: Tag List

2003-02-18 Thread Shawn Bayern
Just as interesting historical background...

The terms model 1 and model 2 actually come from an old version of the
JSP specification that describes two models of web-application
development:  the first model (model 1) sends requests directly to JSP
pages, whereas the second (model 2) sends requests to servlets, which
forward to JSP pages as necessary.

Model-View-Controller (MVC) is a design pattern that a model 2 web
application will often resemble.

Shawn

On Tue, 18 Feb 2003, Schnitzer, Jeff wrote:

 So far the best explanation I have found of MVC aka Model-2 is on
 Sun's site:
 
 http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents
 .html#JSPIntro4
 
 Sun calls the pattern Model-2, but there is enough similarity to the
 Smalltalk pattern that the term MVC has been (arguably
 mis-)appropriated.
 
 Jeff Schnitzer
 [EMAIL PROTECTED]
 The Maverick MVC Framework:  http://mav.sourceforge.net
 
  -Original Message-
  From: Scott Taylor [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, February 16, 2003 7:43 AM
  To: Tag Libraries Users List
  Subject: Re: Tag List
  
  Thanks I will look at Maverick. Why is Maverick and Struts considerd
 MVC,
  when the idea of JSP is part of MVC?
  
  Scott
  
  
  - Original Message -
  From: Schnitzer, Jeff [EMAIL PROTECTED]
  To: Tag Libraries Users List [EMAIL PROTECTED]
  Sent: Friday, February 14, 2003 8:19 PM
  Subject: RE: Tag List
  
  
  Yes, if you're using JSTL then you will be a whole lot better off with
  an MVC framework like Struts or Maverick.  I recommend Maverick -
 it's
  considerably simpler than Struts, yet offers more features.  Also,
  unlike most other similar frameworks (Struts, WebWork, etc), Maverick
  never started out with a now-crufty set of specialized set of JSP tags
 -
  JSTL works great.
  
  The core distribution includes a sample application that uses JSTL.
  
  http://mav.sourceforge.net
  
  Jeff Schnitzer
  [EMAIL PROTECTED]
  (yes, I'm the lead developer of Maverick)
  
   - Original Message -
   From: Scott Taylor [EMAIL PROTECTED]
   To: Tag Libraries Users List [EMAIL PROTECTED]
   Sent: Friday, February 14, 2003 10:23 AM
   Subject: Re: Tag List
  
  
Thanks...how about an entry form?
   
Also, if I want to do JSP's easier are Struts better?
   
I will get the book though
   
Thanks
   
Scott
   
   
- Original Message -
From: Eddie Barna [EMAIL PROTECTED]
To: Tag Libraries Users List [EMAIL PROTECTED]
Sent: Friday, February 14, 2003 6:01 PM
Subject: Re: Tag List
   
   
 You can pass the value from your search form to the page which
 you
   have
 listed in your email.  For example:  You have a search form with
 a
   text
box
 titled search

 Here's what the page that queries the db would look like now

  sql:query var=productQuery  dataSource=${productDS}  
  SELECT * FROM CD WHERE CDTITLE = ?
 sql:param value=${param.search}/
  /sql:query
 You can also expand on this by using the OR statement in your
  query.
   For
 example:

  sql:query var=productQuery  dataSource=${productDS}  
  SELECT * FROM CD WHERE CDTITLE = ? OR ARTIST = ?
 sql:param value=${param.search}/
 sql:param value=${param.search}/
  /sql:query

 For every condition in your query you must add a sql;param/
 tag.

 Hope this helps.  I really do recomend that you get Shawn
 Bayern's
   book
 titled JSTL in Action.  It explains all this in great detail,
 plus
 everything else.


 - Original Message -
 From: Scott Taylor [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, February 14, 2003 9:31 AM
 Subject: Tag List


  I am trying to find a list of tags to help me modify the CD
 Shop
   Cart
web
  application from Sun One.
 
  For example, how do I insert tags that provide a search form
  (and
   entry
  form) rather than simply list everything.
 
  Here is what the code looks like so far:
 
  %@page contentType=text/html%
  html
  headtitleCD Catalog List/title/head
  %@ taglib prefix=c uri=http://java.sun.com/jstl/core; %
  %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; %
  body
  h1 CD Catalog List /h1
  sql:setDataSource var=productDS
 url=jdbc:postgresql://localhost:5432/recruitment
 driver=org.postgresql.Driver
 user=scott password= /
 
  sql:query var=productQuery  dataSource=${productDS}  
  SELECT * FROM CD
  /sql:query
 
  TABLE border=1
TR
  THID/TH
  THCD Title/TH
  THArtist/TH
  THCountry/TH
  THPrice/TH
/TR
 
  c:forEach var=row items=${productQuery.rows}
TR
  TDc:out value=${row.ID}//TD
  TDc:out value=${row.CDTITLE}//TD
  TDc:out value=${row.ARTIST}//TD
  

RE: Tag List

2003-02-18 Thread Schnitzer, Jeff
 From: Mark R. Diggory [mailto:[EMAIL PROTECTED]]
 
 Is this kinda what you mean? Are you trying to add the
 search/edit/remove/add functionality to the jsp page? This could
easily
 be captured with forms which submit back to the jsp plus a choose
block
 to designate which operation is being performed. I bet this'll really
 irk those Struts/Maveric MVC folks out there with its use of the JSP
 page as both the Controller and View. But it is relatively easy to
 accomplish using JSTL without such heavy MVC frameworks.
 
 Here is the example:

 [...]

If you plan on using JSTL as a programming language, you're going to run
out of rope rather quickly.  Yeah, the basic constructs are there -
assignment, iteration, conditionals - but Java it is not.  What about
file access, or image manipulation, or remote procedure calls, or any of
the 50 million other things people do in their business logic?  After
you write custom tags for all of that what you end up with is an ugly,
untyped, interpreted programming language.  IMHO, in any nontrivial web
application, JSTL is best treated as a templating language.

Aside from that, the main problem with pages that submit back to
themselves is that they confuse the hell out of designers.  My designers
would be bewildered by all that business logic, whether it be in tags or
scriptlets.

 If you want to encapsulate the functions for adding/removing/editing
 the content and not have them in this View/Controller, you could
 include them from separate JSP's or Servlets. or likewise submit the
 forms directly to those JSP's or Servlets  and then redirect back to
 this jsp once the work was done.

...at which point what you have is a lightweight MVC framework.  In
fact, this is pretty much exactly what Maverick does.  It's what Struts
does too, except that Struts does it with 100 times more code...

 It stays pretty independent and light without too much dependency on
 any particular framework other than the JSP/JSTL tags. Which results
in
 less research and development effort  to accomplish the same task. All
 you need to know is JSP/JSTL.

Any webapp of a more than trivial nature ends up with a significant
amount of framework; it's just a question of whether you use existing
software or craft your own.  That said, I believe frameworks should be
minimalist, modular, and focused on a narrow goal - which is why my
fellow developers and I gave up on Struts, WebWork, etc and wrote
Maverick.

Jeff Schnitzer
[EMAIL PROTECTED]
The Maverick MVC Framework:  http://mav.sourceforge.net

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




Re: Tag List

2003-02-18 Thread Mark R. Diggory
Just to be clear, I was responding to a user with an interest in 
convering the demo example in the Webservices tutorial into JSLT. A very 
specific and small application. We're on the Taglibs listserv. I saw 
several people tell him to use heavier frameworks external to this 
project. I just wanted to provide him with answer he asked for and could 
easily do in one JSP page with JSTL.

***

That said, I agree with you on many points. I have no problem with MVC 
itself, I'll look over maverick more to see if I feel the same way about 
it that I do about Struts.

I primarily struggle with the whole issue of having too much 
configuration mapping going on.

1.) I have this great Tomcat JSP Servlet Container that works quite 
elegantly. Like an http server, you know what url's are going to lead to 
your JSP's simply by thier location on the filesystem.  Quite nice, easy 
to use. You've got the Context,Session,Request,Response objects to store 
things in when you need to. Its easy to get used to. And you got custom 
tags to push your model back behind the presentation.

2.) Then you have frameworks like struts that introduce another level 
of configuration into the picture. You end up with web.xml and struts 
config.xml files in your web application. You end up tracing through 
them trying to setup all this stuff. What if you want to use Cocoon too, 
now you've got a whole other config to deal with on top of your current 
config. ouch... A whole other realm of complexity.

This is all too much for a small application.


Schnitzer, Jeff wrote:
Aside from that, the main problem with pages that submit back to
themselves is that they confuse the hell out of designers.  My designers
would be bewildered by all that business logic, whether it be in tags or
scriptlets.



Granted that is a pro for the use of a framework that breaks the 
presentation off of the model. I would never suggest that is not a 
benifit when you have designers to contend with. Or larger applications 
to work with.

...at which point what you have is a lightweight MVC framework.  In
fact, this is pretty much exactly what Maverick does.  It's what Struts
does too, except that Struts does it with 100 times more code...


Yes, and mine does it simply by using a JSP as Controller instead of a 
bunch of servlets and a config file. A simple solution for his request.


Any webapp of a more than trivial nature ends up with a significant
amount of framework; it's just a question of whether you use existing
software or craft your own.  That said, I believe frameworks should be
minimalist, modular, and focused on a narrow goal - which is why my
fellow developers and I gave up on Struts, WebWork, etc and wrote
Maverick.


True...

Cheers :-)
Mark




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




Usage of JSTL with a custom tag

2003-02-18 Thread Vernon Wu

The following tags: 

c:set var=ccmm:myAttribute attribute=country//c:set
 fmt:message key=countryCode.${cc} / 

And

fmt:messagecountryCode.mm:myAttribute attribute=country//fmt:message

yield the same output. Which one is better?


Vernon



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