Re: Question about the io taglib

2002-03-11 Thread Mike Hulse

From: Meltsner, Kenneth 
If you set the system properties:

http.proxyHost
http.proxyPort

(either programmatically, or by using -Dpropname=value when starting Java)
it will work with a proxy server that doesn't require authentication.  For
authentication, you need to add a custom header to the request.  I have the
code for this somewhere

That worked!  Thanks for your help.

Mike


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




why is there no dbtags getField tag ?

2002-03-11 Thread Soefara Redzuan

Instead of writing getColumn, is there a more intuitive method that uses the 
field name instead getColumn ?  For example the current method is this

sql:statement id=stmt1 conn=conn1
  sql:query select * from members /sql:query
  sql:resultSet id=rset2
 sql:getColumn position=1/
 sql:getColumn position=2/
  /sql:resultSet
/sql:statement

Why is there not something like this instead

sql:statement id=stmt1 conn=conn1
  sql:query select * from members /sql:query
  sql:resultSet id=rset2
 sql:getField name=firstname /
 sql:getField name=lastname  /
  /sql:resultSet
/sql:statement

Or does something like this exist ?

Thank you, Soefara.

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




can output of dbtags query be used to fill javabean properties ?

2002-03-11 Thread Soefara Redzuan

Sorry I have another question. I have a form that sets the default values of 
the fields with a javabean like this

jsp:useBean id=mybean class=mybean scope=request

form
First name is input type=text name=firstname 
value=%=mybean.getFirstname()%

Last name is input type=text name=lastname 
value=%=mybean.getLastname()%
/form

This fills default field values if the parameters are submitted in the 
request otherwise it makes the fields blank .

But how can I set the values of the bean properties from the SQL result 
returned from the dbtags query ?

For example I would like to loop through the results of a sql:query and set 
or create a javabean each time.

sql:statement id=stmt1 conn=conn1
  sql:query
select * from members
  /sql:query
  %-- loop through the rows and create a bean each time --%
  jsp:useBean id=resultbean class=mybean
  sql:resultSet id=rset2
First name is input type=text name=firstname 
value=%=resultbean.getFirstname()%
Last name is input type=text name=lastname 
value=%=resultbean.getLastname()%
  /sql:resultSet
/sql:statement

Is something like this possible ?

Thank you, Soefara

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: c:set and scriptlets

2002-03-11 Thread Shawn Bayern

On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:

 In my code i have c:set var=x value=4/
 
 I'd like to be able to access the variable x from within a scriptlet,
 something like:
 
 %
   x = x++;
 %
 
 and vice versa.
 
 Is this even possible?  I don't see anything in the docs that refer to
 such interchangeability. 8(

JSTL doesn't particularly encourage this usage, but it's perfectly
possible using older, scriptlet-oriented mechanisms like jsp:useBean.  
Just use a jsp:useBean tag after c:set to declare your scripting
variable.

--
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming this spring from Manning Publications)


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




Re: c:set and scriptlets

2002-03-11 Thread Mark R. Diggory

See my last message about multipart stuff. You can capture this 
functionality in TEI (TagExtraInfo) Support class to your tag. Then in 
your tag you can set the value of the variable via a special method 
 which you have to define.

!-- Straight off the javadoc

public abstract class TagExtraInfo
extends java.lang.Object

Optional class provided by the tag library author to describe additional 
translation-time information not described in the TLD. The TagExtraInfo 
class is mentioned in the Tag Library Descriptor file (TLD).

This class can be used:

* to indicate that the tag defines scripting variables
* to perform translation-time validation of the tag attributes.

...

--
-Mark Diggory


Shawn Bayern wrote:

On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:

In my code i have c:set var=x value=4/

I'd like to be able to access the variable x from within a scriptlet,
something like:

%
  x = x++;
%

and vice versa.

Is this even possible?  I don't see anything in the docs that refer to
such interchangeability. 8(


JSTL doesn't particularly encourage this usage, but it's perfectly
possible using older, scriptlet-oriented mechanisms like jsp:useBean.  
Just use a jsp:useBean tag after c:set to declare your scripting
variable.

--
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming this spring from Manning Publications)


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





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




Re: c:set and scriptlets

2002-03-11 Thread Mark R. Diggory

I'm sorry, that was on the development list, not the user list

Mark R. Diggory wrote:

 See my last message about multipart stuff. You can capture this 
 functionality in TEI (TagExtraInfo) Support class to your tag. Then in 
 your tag you can set the value of the variable via a special method 
 which you have to define.

 !-- Straight off the javadoc

 public abstract class TagExtraInfo
 extends java.lang.Object

 Optional class provided by the tag library author to describe 
 additional translation-time information not described in the TLD. The 
 TagExtraInfo class is mentioned in the Tag Library Descriptor file (TLD).

 This class can be used:

* to indicate that the tag defines scripting variables
* to perform translation-time validation of the tag attributes.

 ...

 --
 -Mark Diggory


 Shawn Bayern wrote:

 On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:

 In my code i have c:set var=x value=4/

 I'd like to be able to access the variable x from within a scriptlet,
 something like:

 %
 x = x++;
 %

 and vice versa.

 Is this even possible?  I don't see anything in the docs that refer to
 such interchangeability. 8(


 JSTL doesn't particularly encourage this usage, but it's perfectly
 possible using older, scriptlet-oriented mechanisms like 
 jsp:useBean.  Just use a jsp:useBean tag after c:set to declare 
 your scripting
 variable.

 -- 
 Shawn Bayern
 Author, JSP Standard Tag Library  http://www.jstlbook.com
 (coming this spring from Manning Publications)


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





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





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




Re: c:set and scriptlets

2002-03-11 Thread Shawn Bayern

Anuj was writing about the JSTL tag c:set, though.  JSTL de-emphasizes
scripting variables in favor of the expression language it introduces.

Scripting variables are a reasonable mechanism for some applications, but
they inherently depend on scriptlets, which means that they're useful only
if a page author knows something about Java.  Scripting variables can also
be confusing many situations.  For instance, consider the following code:

   %-- Sets a scoped attribute four with the value of 4 --%
   c:set var=four value=${2 + 2}/

   %-- Declares a scripting variable four to match this scoped var --%
   jsp:useBean id=four type=java.lang.Number/

   %-- Replaces the scripting variablr four with the value 5 --%
   % four = new Integer(5); %

   %-- Prints out the value of the scoped variable four --%
   c:out value=${four}/

What do you expect the final c:out tag to output?  You might think 5
because you replaced the scripting variable 'four' with an Integer object
for the number 5.  But the tag actually prints out 4, because changing a
scripting variable doesn't change the scoped variable that it was
originally tied to.

--
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming this spring from Manning Publications)

On Mon, 11 Mar 2002, Mark R. Diggory wrote:

 See my last message about multipart stuff. You can capture this 
 functionality in TEI (TagExtraInfo) Support class to your tag. Then in 
 your tag you can set the value of the variable via a special method 
  which you have to define.
 
 !-- Straight off the javadoc
 
 public abstract class TagExtraInfo
 extends java.lang.Object
 
 Optional class provided by the tag library author to describe additional 
 translation-time information not described in the TLD. The TagExtraInfo 
 class is mentioned in the Tag Library Descriptor file (TLD).
 
 This class can be used:
 
 * to indicate that the tag defines scripting variables
 * to perform translation-time validation of the tag attributes.
 
 ...
 
 --
 -Mark Diggory
 
 
 Shawn Bayern wrote:
 
 On Mon, 11 Mar 2002, Agrawal, Anuj (Anuj)** CTR ** wrote:
 
 In my code i have c:set var=x value=4/
 
 I'd like to be able to access the variable x from within a scriptlet,
 something like:
 
 %
 x = x++;
 %
 
 and vice versa.
 
 Is this even possible?  I don't see anything in the docs that refer to
 such interchangeability. 8(
 
 
 JSTL doesn't particularly encourage this usage, but it's perfectly
 possible using older, scriptlet-oriented mechanisms like jsp:useBean.  
 Just use a jsp:useBean tag after c:set to declare your scripting
 variable.
 
 --
 Shawn Bayern
 Author, JSP Standard Tag Library  http://www.jstlbook.com
 (coming this spring from Manning Publications)
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


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




RE: c:set and scriptlets

2002-03-11 Thread Agrawal, Anuj (Anuj)** CTR **

I really didn't want to use scriptlets (per the documentation), but i was
running into situations where the JSTL actions were not (yet) supporting
some things that scriptlets could do.. OR SO I THOUGHT! 8

I've since then found a way around it using JSTL actions alone - so i'm a
little happier now.

I haven't found any detailed documentation on how i put different
programming expressions or what kind of statements i can and cannot place in
things like value= or test=.. but throught trial and error and also this
wonderful mailing list, i'm learning about what's legal and what's illegal.

Thanks.
PS: Shawn - you rule! 8)

 Anuj was writing about the JSTL tag c:set, though.  JSTL 
 de-emphasizes
 scripting variables in favor of the expression language it introduces.
 
 Scripting variables are a reasonable mechanism for some 
 applications, but
 they inherently depend on scriptlets, which means that 
 they're useful only
 if a page author knows something about Java.  Scripting 
 variables can also
 be confusing many situations.  For instance, consider the 
 following code:
 
%-- Sets a scoped attribute four with the value of 4 --%
c:set var=four value=${2 + 2}/
 
%-- Declares a scripting variable four to match this 
 scoped var --%
jsp:useBean id=four type=java.lang.Number/
 
%-- Replaces the scripting variablr four with the value 5 --%
% four = new Integer(5); %
 
%-- Prints out the value of the scoped variable four --%
c:out value=${four}/
 
 What do you expect the final c:out tag to output?  You 
 might think 5
 because you replaced the scripting variable 'four' with an 
 Integer object
 for the number 5.  But the tag actually prints out 4, 
 because changing a
 scripting variable doesn't change the scoped variable that it was
 originally tied to.

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




Re: 2nd try: Using set to change scope

2002-03-11 Thread Shawn Bayern

Ah, I meant to try to answer this, but it slipped through...

I wasn't sure exactly what you meant by change the scope on one of the
attributes on our tags.  You can use c:set to override an existing
attribute, and thus to change the scope of a scoped variable:

 c:set var=foo scope=session value=${page.foo}/

but I'm not sure if that's what you mean.

You can't make the 'scope' attribute dynamic, which might be another thing
you mean.  That is, you can't say scope=${myscope}.  This restriction is
designed primarily to aid tool support and translation-time error
checking.  If you need to decide on the fly what scope to use, you'll need
to use a c:if or c:choose block.  We didn't consider this case very
common, so the somewhat circuitous solution didn't seem to be a major
issue.  (Hmm, that's the first I've used the word circuitous to actually
refer to circuit-like logic.  I wonder if that counts as a pun or not...)

--
Shawn Bayern
Author, JSP Standard Tag Library  http://www.jstlbook.com
(coming this spring from Manning Publications)

On Mon, 11 Mar 2002, Steve Bang wrote:

 Can anyone help me on this?  
 
 Thanks,
 Steve
 
  -Original Message-
  From: Steve Bang [mailto:[EMAIL PROTECTED]]
  Sent: Friday, March 08, 2002 11:03 AM
  To: 'Tag Libraries Users List'
  Subject: Using set to change scope
  
  
  We have a custom tag library that treats all of our tags with 
  a session scope (by design).  Is it possible to use JSTL's 
  c:set tag to change the scope on one of the attributes on 
  our tags?  Users are requesting the ability to dynamically 
  change an attribute value on our tags when a page is refreshed, 
  but so far this is not possible within the tags themselves --
  they are only interpreted the first time a page loads.  If 
  so, do we have to modify our tag library to support this?
  
  Steve
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


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




Re: can output of dbtags query be used to fill javabean properties ?

2002-03-11 Thread horwat

Once again you can use the sql tags available in the Standard tag library.
You can populate a bean like this:

 sql:update var=newTable
   create table mytable (
 nameid int primary key,
 name varchar(80)
)
  /sql:update

 sql:query var=resultSet
   SELECT * FROM mytable
 /sql:query

  c:forEach var=row items=${resultSet.rowsByIndex}
jsp:useBean id=mybean class=mybean scope=request/
   jsp:setProperty name=mybean property=nameId
value=%=row[0]%/
   jsp:setProperty name=mybean property=name value=%=row[1]%/
  /c:forEach

Justy


- Original Message -
From: Soefara Redzuan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 6:06 AM
Subject: can output of dbtags query be used to fill javabean properties ?


 Sorry I have another question. I have a form that sets the default values
of
 the fields with a javabean like this

 jsp:useBean id=mybean class=mybean scope=request

 form
 First name is input type=text name=firstname
 value=%=mybean.getFirstname()%

 Last name is input type=text name=lastname
 value=%=mybean.getLastname()%
 /form

 This fills default field values if the parameters are submitted in the
 request otherwise it makes the fields blank .

 But how can I set the values of the bean properties from the SQL result
 returned from the dbtags query ?

 For example I would like to loop through the results of a sql:query and
set
 or create a javabean each time.

 sql:statement id=stmt1 conn=conn1
   sql:query
 select * from members
   /sql:query
   %-- loop through the rows and create a bean each time --%
   jsp:useBean id=resultbean class=mybean
   sql:resultSet id=rset2
 First name is input type=text name=firstname
 value=%=resultbean.getFirstname()%
 Last name is input type=text name=lastname
 value=%=resultbean.getLastname()%
   /sql:resultSet
 /sql:statement

 Is something like this possible ?

 Thank you, Soefara

 _
 MSN Photos is the easiest way to share and print your photos:
 http://photos.msn.com/support/worldwide.aspx


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



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




Re: can output of dbtags query be used to fill javabean properties ?

2002-03-11 Thread Soefara Redzuan

Thank you so much Justyna.  I can understand it but in a paralell topic 
about JSTL it is said that the reason for using tags is to make it easier 
for web page designers.  However I don't know any designers who would not be 
intimidated by this code. It looks like tags are still putting a lot of code 
into the page.

   c:forEach var=row items=${resultSet.rowsByIndex}
 jsp:useBean id=mybean class=mybean scope=request/
jsp:setProperty name=mybean property=nameId
value=%=row[0]%/
jsp:setProperty name=mybean property=name 
value=%=row[1]%/
   /c:forEach

Thank you again, Soefara.

- Original Message -
From: Soefara Redzuan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 6:06 AM
Subject: can output of dbtags query be used to fill javabean properties ?


  Sorry I have another question. I have a form that sets the default 
values
of
  the fields with a javabean like this
 
  jsp:useBean id=mybean class=mybean scope=request
 
  form
  First name is input type=text name=firstname
  value=%=mybean.getFirstname()%
 
  Last name is input type=text name=lastname
  value=%=mybean.getLastname()%
  /form
 
  This fills default field values if the parameters are submitted in the
  request otherwise it makes the fields blank .
 
  But how can I set the values of the bean properties from the SQL result
  returned from the dbtags query ?
 
  For example I would like to loop through the results of a sql:query and
set
  or create a javabean each time.
 
  sql:statement id=stmt1 conn=conn1
sql:query
  select * from members
/sql:query
%-- loop through the rows and create a bean each time --%
jsp:useBean id=resultbean class=mybean
sql:resultSet id=rset2
  First name is input type=text name=firstname
  value=%=resultbean.getFirstname()%
  Last name is input type=text name=lastname
  value=%=resultbean.getLastname()%
/sql:resultSet
  /sql:statement
 
  Is something like this possible ?
 
  Thank you, Soefara
 
  _
  MSN Photos is the easiest way to share and print your photos:
  http://photos.msn.com/support/worldwide.aspx
 
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 


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



_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: can output of dbtags query be used to fill javabean properties ?

2002-03-11 Thread Agrawal, Anuj (Anuj)** CTR **

 Subject: Re: can output of dbtags query be used to fill javabean
 properties ?

This is a similar question i had wanted to ask.

 Once again you can use the sql tags available in the Standard 
 You can populate a bean like this:
   c:forEach var=row items=${resultSet.rowsByIndex}
 jsp:useBean id=mybean class=mybean scope=request/
jsp:setProperty name=mybean property=nameId
 value=%=row[0]%/
jsp:setProperty name=mybean property=name 
 value=%=row[1]%/
   /c:forEach

This violates one of the core suggestions made by the documentation (and
Shawn) - we should try not to mix scriptlets with the JSTL tags.  I'd like
to stick to that rule.  So the question is - how do we achieve the above
without using scriptlets?

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