Re: String concatenation

2004-08-23 Thread Keith
You were close:



There's no JSTL concatenation operator (that I know). Whatever you want the separator
between them to be, just put it there. In this instance, it's a space.

Keith


-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Mon, 23 Aug 2004 13:37:30 -0400
Subject: String concatenation

> Is there a way to concatenate strings in JSTL 1.1?
> For example, 
> 
> David Schwartz
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: Display Taglib & Dates

2004-08-16 Thread Keith
I wasn't formatting anymore. I did not have an "AS column_name" after the TO_CHAR(),
though. That lets it display. Thanks.

Only problem I can see with this, though, is that I now have to explicitly list all the
columns I need from a table if there's a date in it. There are some queries where I 
need
all columns and do a SELECT *, and this wouldn't be an easy fix for some of them. Still
looking through the taglib documentation. I'm still pretty new to custom tag 
libraries, so
it's slow going now.

Keith


-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Mon, 16 Aug 2004 13:35:50 -0400
Subject: RE: Display Taglib & Dates

> Once it's returned from oracle simply display using JSTL. There wont be a need
> to format.
> 
> Quoting Keith <[EMAIL PROTECTED]>:
> 
> >> That is what the TO_CHAR() function does. Using it results in no output
> >> (empty table
> >> cells) with the display taglib, tho.
> >>
> >> Keith
> >>
> >> -- Original Message ---
> >> From: "Karl Coleman" <[EMAIL PROTECTED]>
> >> To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
> >> Sent: Mon, 16 Aug 2004 13:20:06 -0400
> >> Subject: RE: Display Taglib & Dates
> >>
> >> > I know T-SQL on MS SQL Server has functions that allow for date
> >> formatting. Maybe
> >> something similar exists for Oracle.
> >> >
> >> > Karl
> >> >
> >> > -Original Message-
> >> > From: Keith [mailto:[EMAIL PROTECTED]
> >> > Sent: Monday, August 16, 2004 1:18 PM
> >> > To: Taglibs
> >> > Subject: Display Taglib & Dates
> >> >
> >> > I just got the Display taglib to try and make some of my job a little
> >> easier. Things
> >> > seemed to be going good til I ran across the problem of a date field. I'm
> >> pulling from an
> >> > Oracle database, so the following query:
> >> >
> >> > 
> >> >  SELECT a.project_id,
> >> >  a.project_name,
> >> >  a.kickoff_date
> >> >  FROM project_main a
> >> >  ORDER BY project_id DESC
> >> > 
> >> >
> >> > returns something like this:
> >> >
> >> > 10016
> >> > Project1234
> >> > 2004-07-15 00:00:00.0
> >> >
> >> > I'd like to format the date field to look like this: 15-Jul-2004
> >> > Before, I just used the  tag, but I'm at a loss for how to
> >> use it in
> >> > conjuction with the display taglib. I tried using the TO_CHAR function in
> >> the database
> >> > query to format my date beforehand, but then it doesn't return any date
> >> information at
> >> > all. Any help?
> >> >
> >> > Keith
> >> >
> >> > -
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> > -
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> --- End of Original Message ---
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> 
> David Schwartz
> Array Software Inc.
> http://www.arrayone.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: Display Taglib & Dates

2004-08-16 Thread Keith
That is what the TO_CHAR() function does. Using it results in no output (empty table
cells) with the display taglib, tho.

Keith

-- Original Message ---
From: "Karl Coleman" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Mon, 16 Aug 2004 13:20:06 -0400
Subject: RE: Display Taglib & Dates

> I know T-SQL on MS SQL Server has functions that allow for date formatting. Maybe
something similar exists for Oracle.
> 
> Karl
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 16, 2004 1:18 PM
> To: Taglibs
> Subject: Display Taglib & Dates
> 
> I just got the Display taglib to try and make some of my job a little easier. Things
> seemed to be going good til I ran across the problem of a date field. I'm pulling 
> from an
> Oracle database, so the following query:
> 
> 
>   SELECT a.project_id, 
>   a.project_name,
>   a.kickoff_date
>   FROM project_main a
>   ORDER BY project_id DESC
> 
> 
> returns something like this:
> 
> 10016
> Project1234
> 2004-07-15 00:00:00.0
> 
> I'd like to format the date field to look like this: 15-Jul-2004
> Before, I just used the  tag, but I'm at a loss for how to use it in
> conjuction with the display taglib. I tried using the TO_CHAR function in the 
> database
> query to format my date beforehand, but then it doesn't return any date information 
> at
> all. Any help?
> 
> Keith
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Display Taglib & Dates

2004-08-16 Thread Keith
I just got the Display taglib to try and make some of my job a little easier. Things
seemed to be going good til I ran across the problem of a date field. I'm pulling from 
an
Oracle database, so the following query:


SELECT a.project_id, 
a.project_name,
a.kickoff_date
FROM project_main a
ORDER BY project_id DESC


returns something like this:

10016
Project1234
2004-07-15 00:00:00.0

I'd like to format the date field to look like this: 15-Jul-2004
Before, I just used the  tag, but I'm at a loss for how to use it in
conjuction with the display taglib. I tried using the TO_CHAR function in the database
query to format my date beforehand, but then it doesn't return any date information at
all. Any help?

Keith






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



jakarta taglib problem

2004-08-04 Thread Keith Westcott
I have just installed jakarta-taglibs-standard-1.0.6 and only get the 
following error when I try to use it or run any of the examples which 
came with it:

 javax.servlet.ServletException: fRecognizedFeatures
root cause
 java.lang.NoSuchFieldError: fRecognizedFeatures
   at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
I am running jakarta-tomcat-4.1.10 on solaris.
Explanation and help would be much appreciated.
Best wishes
Keith
--

Keith Westcott   [EMAIL PROTECTED]
Archaeology Data Service  http://ads.ahds.ac.uk/
University of York
King's Manor
York YO1 7EP

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


Re: Trouble with JSP and Oracle sequences

2004-07-08 Thread Keith
Why didn't I think of that? Thank you! :)

Keith

-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Thu,  8 Jul 2004 10:52:04 -0400
Subject: Re: Trouble with JSP and Oracle sequences

> I would first constrain the sequence value...
> 
> 
> Select main_id.NextVal as currentID From Dual
> 
> 
> Then save it into a form var...
> 
>  />
> 
> Now use this currentID value in your insert queries...
> 
> 
> INSERT INTO main (main_id, project_id, selection )
> VALUES (
>   ,
>   , ? 
>   , ? 
>  )
> 
> 
> Once you have the mainID you can use it throughout the page.
> 
> Quoting Keith <[EMAIL PROTECTED]>:
> 
> >> First, here's my relevant code:
> >>
> >>  >> pattern="dd-MMM-" />
> >>
> >> 
> >>
> >> 
> >> INSERT INTO main (
> >>main_id
> >>, project_id
> >>, selection
> >> )
> >> VALUES (
> >>main_id_seq.NEXTVAL
> >>, ? 
> >>, ? 
> >> )
> >> 
> >>
> >> 
> >> INSERT INTO meeting_dates (
> >>main_id
> >>, meeting_date
> >>, meeting_type_id
> >> )
> >> VALUES
> >>main_id_seq.CURRVAL
> >>, ? 
> >>, ? 
> >> )
> >> 
> >>
> >> 
> >>
> >> The user is submitting the data via an HTML form. I need to use the same
> >> sequence number
> >> that was generated by the first  as the ID value in the second
> >> .
> >> But, I'm getting the following ORACLE error:
> >>
> >> ORA-00947: not enough values
> >>
> >> Looking through the Oracle documentation, it says the .CURRVAL option for a
> >> sequence is
> >> only available within the same session that the .NEXTVAL option was first
> >> used. The only
> >> thing I can think of that's happening is these two  are not
> >> being done within
> >> the same session, even thought they're in the same .
> >> Therefore, the
> >> .CURRVAL of the sequence is no longer available, thus throwing the above
> >> error. Doing
> >> something like this in an SQL*Plus session works perfectly fine and the
> >> documentation
> >> gives examples of multiple inserts being done like this, so I know it can be
> >> done. But, I
> >> don't know enough about what's going on behind the scenes in JSP to be able
> >> to see if
> >> that's what is causing the problem. Anyone able to shed a little light on
> >> what might be
> >> causing this? Thanks!
> >>
> >> Keith
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> 
> David Schwartz
> Array Software Inc.
> http://www.arrayone.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: Trouble with JSP and Oracle sequences

2004-07-08 Thread Keith
Thanks for the info. I think I understand what you're saying... the sequence number is
available to be saved as a variable to be used later? Unfortunately I wouldn't know 
how to
go about doing that yet. I'm still pretty new to raw Java and haven't really gotten 
into
Servlets yet. That's why I'm using the Taglibs. ;) Currently waiting for O'Reilly to
release "Head First Servlets and JSP" this month to get into that stuff. 

Keith


-- Original Message ---
From: Don Albertson <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Thu, 08 Jul 2004 10:36:55 -0400
Subject: Re: Trouble with JSP and Oracle sequences

> Keith wrote:
> 
> > First, here's my relevant code:
> > 
> >  > pattern="dd-MMM-" />
> > 
> > 
> > 
> > 
> > INSERT INTO main (
> > main_id
> > , project_id
> > , selection
> > )
> > VALUES (
> > main_id_seq.NEXTVAL
> > , ? 
> > , ? 
> > )
> > 
> > 
> > 
> > INSERT INTO meeting_dates (
> > main_id
> > , meeting_date
> > , meeting_type_id
> > )
> > VALUES
> > main_id_seq.CURRVAL
> > , ? 
> > , ? 
> > )
> > 
> > 
> > 
> > 
> > The user is submitting the data via an HTML form. I need to use the same sequence 
> > number
> > that was generated by the first  as the ID value in the second 
> > .
> > But, I'm getting the following ORACLE error:
> > 
> > ORA-00947: not enough values
> > 
> > Looking through the Oracle documentation, it says the .CURRVAL option for a 
> > sequence is
> > only available within the same session that the .NEXTVAL option was first used. 
> > The only
> > thing I can think of that's happening is these two  are not being 
> > done within
> > the same session, even thought they're in the same . Therefore, 
> > the
> > .CURRVAL of the sequence is no longer available, thus throwing the above error. 
> > Doing
> > something like this in an SQL*Plus session works perfectly fine and the 
> > documentation
> > gives examples of multiple inserts being done like this, so I know it can be done. 
> > But, I
> > don't know enough about what's going on behind the scenes in JSP to be able to see 
> > if
> > that's what is causing the problem. Anyone able to shed a little light on what 
> > might be
> > causing this? Thanks!
> > 
> > Keith
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> >
> 
> I can't help you to use the sql taglib but I can tell you how I deal with 
> that situation using servlet technology.
> The SQL table is represented by a class which has read and write methods 
> and maintains a state variable so it can decide whether to Insert, 
> Update, or Delete when you use the write method.  On Insert it retrieves 
> the sequence.nextval for the sequence field and holds on to it for the 
> life of the object.  The object meets the minimal requirements for a jsp 
> bean so it can be set and got from the jsp based on what the browser 
> provides on POST from the form.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Trouble with JSP and Oracle sequences

2004-07-08 Thread Keith
First, here's my relevant code:






INSERT INTO main (
main_id
, project_id
, selection
)
VALUES (
main_id_seq.NEXTVAL
, ? 
, ? 
)



INSERT INTO meeting_dates (
main_id
, meeting_date
, meeting_type_id
)
VALUES
main_id_seq.CURRVAL
, ? 
, ? 
)




The user is submitting the data via an HTML form. I need to use the same sequence 
number
that was generated by the first  as the ID value in the second 
.
But, I'm getting the following ORACLE error:

ORA-00947: not enough values

Looking through the Oracle documentation, it says the .CURRVAL option for a sequence is
only available within the same session that the .NEXTVAL option was first used. The 
only
thing I can think of that's happening is these two  are not being done 
within
the same session, even thought they're in the same . Therefore, the
.CURRVAL of the sequence is no longer available, thus throwing the above error. Doing
something like this in an SQL*Plus session works perfectly fine and the documentation
gives examples of multiple inserts being done like this, so I know it can be done. 
But, I
don't know enough about what's going on behind the scenes in JSP to be able to see if
that's what is causing the problem. Anyone able to shed a little light on what might be
causing this? Thanks!

Keith

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



Re: Search Engine Queries

2004-06-04 Thread Keith
Might be a lot of work depending how many AND statments you have, but you can nest 
 
statements inside  tags. Using one of your fields as an example:


...
 
  and nvl(d.cable,' ') like nvl(?,'%')  and

...

  

...


This way, the above field will only be added as part of the query if the 'cable' 
parameter has data entered into it (tests to see if it's "not empty"). Just have to 
make 
sure you put the  statements in both the query and params part.

Keith

-- Original Message ---
From: Nic Werner <[EMAIL PROTECTED]>
To: tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Thu, 03 Jun 2004 09:29:50 -0700
Subject: Search Engine Queries

> I know this might not be a pure JSTL thing, but if anyone could offer 
> some pointers, I'd appreciate it:
> 
> I've got a search page thing going on in JSP (JSTL), and I want to be 
> able to search on any of the fields that are entered, basically an AND 
> filter. So as to not create dynamic SQL queries, I use the below SQL code:
> 
> 
> and nvl(d.cable,' ') like nvl(?,'%')  and
> nvl( d.pair , ' ') like nvl(?,'%')  and
> nvl( to_char(d.prefix) , ' ') like nvl(?,'%')  and
> nvl( upper(d.lname) , ' ') like upper(nvl(?,'%')) and
> nvl( upper(d.fname) , ' ') like upper(nvl(?,'%')) and
> nvl( to_char(d.DN) , ' ') like nvl(?,'%')   and
> nvl( to_char(d.TN) , ' ') like nvl(?,'%')and
> nvl( upper(d.DEPT_CD) , ' ') like  nvl(?,'%')
> 
> sql:param value="${param.cable}"/>
> 
> 
> 
> 
> 
>  
> 
> 
> This works well, except all the 'like' statements really bog down the 
> Oracle system. Can anyone suggest a way to dynamically create the above 
> query portion, only putting in the statements that actually have data?
> 
>  I don't know much Java, but this seems like an applicable language 
> to create the text, but PL/SQL seems viable also. JSTL might be 
> inappropriate for this. Any thoughts? Am I reinventing the wheel?
> 
> Thanks,
> 
> - Nic.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: passing JSTL to custom tag attribute

2004-05-21 Thread Keith
Just did a re-install of Tomcat on my computer at home last night (gotta love 
reformatting). It does NOT come with the JSTL standard tag libraries. Have to download 
them from the Taglibs section of Jakarta and install them yourself.

Keith

-- Original Message ---
From: "Karl Coleman" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Fri, 21 May 2004 09:47:43 -0400
Subject: RE: passing JSTL to custom tag attribute

> It implements EL natively since it is a JSP 2.0 container. But including JSTL is 
> news 
to me as well.
> 
> Karl
> 
> -Original Message-
> From: Derek Mahar [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 21, 2004 9:45 AM
> To: Tag Libraries Users List
> Subject: RE: passing JSTL to custom tag attribute
> 
> Are you sure about this?  Tomcat 5 does not ship with jstl.jar and standard.jar 
> which 
are the standard JSTL distribution files.  Does it hide JSTL in some other JAR file(s).
> 
> Derek (M)
> 
> -Original Message-
> From: Derek [mailto:[EMAIL PROTECTED] 
> Sent: May 20, 2004 8:33 PM
> To: Tag Libraries Users List
> Subject: Re: passing JSTL to custom tag attribute
> 
> No, actually you don't have to in Tomcat 5.  It does ship with JSTL 
> built in.  You just have to use the appropriate declarations in the 
> web.xml and so on.
> 
> Derek (H)
> 
> On May 20, 2004, at 5:04 PM, Derek Mahar wrote:
> 
> > What do you mean when you say that Tomcat 5 implements JSTL 
> > "natively"? From my experience, Tomcat 5 does not ship with JSTL.  You 
> > must download and install JSTL separately.
> >
> > Derek
> >
> > -Original Message-
> > From: Karr, David [mailto:[EMAIL PROTECTED]
> > Sent: May 13, 2004 9:14 AM
> > To: Tag Libraries Users List
> > Subject: RE: passing JSTL to custom tag attribute
> >
> >
> > I would say there are several basic ideas here:
> >
> > 1. Use a JSP 2.0 container, like Tomcat 5.  The JSTL is implemented 
> > natively there.
> >
> > 2. Use solution 1.
> >
> > 3. Build a second tag library that's implemented exactly like
> > Struts-EL.
> > Each tag class in Struts-EL is a subclass of the corresponding tag in
> > the base library, and the only functionality in the Struts-EL tag is to
> > pass the attribute value through the EL engine from the Jakarta JSTL
> > implementation.
> >
> > 4. Do not build a tag library that implements your business logic AND 
> > references the Jakarta EL engine.  When you move to a JSP 2.0 
> > container, you'll then have to spend more time yanking it out.
> >
> >> -Original Message-
> >> From: Paul Wallace [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, May 12, 2004 8:15 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: passing JSTL to custom tag attribute
> >>
> >>
> >> Hi,
> >>  I wish to call a custom tag, passing a dynamic value for its 
> >> attribute. I retrieve the value thus:
> >>
> >> 
> >>
> >> and I wish to call my custom tag passing 'userid' as an attribute. 
> >> Curently I have:
> >>
> >> 
> >>
> >> but the literal string "${userid}" is passed into the handler. To 
> >> acheive the desired results I could of course use:
> >>
> >> ">
> >>
> >> but that would mean embedding JSP, when I wish to encompass all logic 
> >> in tags. Does anyone have any suggestions how I might pass the JSTL 
> >> value, dynamically to the attribute of my custom tag please?
> >>
> >> Thanks
> >>
> >> Paul.
> >>
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > NOTICE: This email contains privileged and confidential information
> > and is intended only for the individual to whom it is addressed. If 
> > you are not the named addressee, you should not disseminate, 
> > distribute or copy this e-mail. Please notify the sender immediately 
> > by e-mail if you have received this transmission by mistake and delete 
> > this communication from your system. E-mail transmission cannot be 
> > guaranteed to be secured or error-free as information could be 
> > intercepted, corrupted, lost, destroyed, arrive late or incomplete, or 
> > contain viruses.
> >
> > AVIS: Le p

RE: [JSTL] How do I enter a null value with ?

2004-05-20 Thread Keith
One of these days (when I have the time) I'll be contacting Oracle to see if they can 
fix 
their driver. There's no other alternative JDBC drivers like this for Oracle are there?

Keith


-- Original Message ---
From: "Derek Mahar" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Thu, 20 May 2004 16:02:02 -0400
Subject: RE: [JSTL] How do I enter a null value with ?

> Wow!  I just installed the jTDS JDBC driver for Microsoft SQL Server, and it does 
> *not* 
produce the NULL parameter problem that I encountered using Microsoft's SQL Server 
JDBC 
driver.  I can now pass  a JSTL null value and it will update the 
corresponding column with an SQL NULL value.
> 
> Thank you again for this jTDS reference!
> 
> Derek
> 
> -Original Message-
> From: Kris Schneider [mailto:[EMAIL PROTECTED] 
> Sent: May 20, 2004 3:21 PM
> To: Tag Libraries Users List
> Subject: RE: [JSTL] How do I enter a null value with ?
> 
> I'm merely aware of its existence. I've never used jTDS (or SQL Server) but just 
> wanted 
to let you know about a potential alternative...
> 
> Quoting Derek Mahar <[EMAIL PROTECTED]>:
> 
> > Thank you for the referral!  Does the jTDS driver correctly implement 
> > PreparedStatement.setObject(index, null) (i.e. set the selected SQL 
> > parameter to NULL)?  Have you encountered any serious flaws using this 
> > driver?
> > 
> > Derek
> > 
> > -Original Message-
> > From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > Sent: May 20, 2004 2:57 PM
> > To: Tag Libraries Users List
> > Subject: RE: [JSTL] How do I enter a null value with ?
> > 
> > 
> > On a slightly different topic, how about trying a different driver:
> > 
> > http://jtds.sourceforge.net/
> > 
> > Quoting Derek Mahar <[EMAIL PROTECTED]>:
> > 
> > > I need to clarify the first statement that I made in my previous 
> > > post
> > > (see below).  I claim that parameter sqlType in method 
> > > PreparedStatement.setNull(int parameterIndex, int sqlType) is 
> > > redundant because a NULL SQL parameter has no intrinsic type.  A NULL 
> > > SQL value applies to any column type, so it is unnecessary to identify 
> > > its type.
> > > 
> > > Derek
> > > 
> > > -Original Message-
> > > From: Derek Mahar
> > > Sent: May 20, 2004 2:08 PM
> > > To: Tag Libraries Users List
> > > Subject: RE: [JSTL] How do I enter a null value with ?
> > > 
> > > 
> > > Thank you.  I appreciate your attention and quick response.
> > > 
> > > After reading JDBC Specification Section 13.2.2.3, Setting NULL
> > > Parameters, I understand now why Kris suggested that the JSTL 
> > > specification add the sqlType attribute to :  method 
> > > PreparedStatement.setNull(int parameterIndex, int sqlType) requires 
> > > the type of the parameter that you want to set to NULL.  However, why 
> > > does method setNull require this parameter?  A NULL parameter has no 
> > > intrinsic type!  In order to determine the "type" of a NULL parameter, 
> > > you must consider its expression or assignment context.  That is, in 
> > > order to determine the "type" of a NULL parameter, must consider the 
> > > type of the column to which you are assigning the parameter in a SET 
> > > clause or the column or literal value to which you are comparing the 
> > > parameter in a WHERE clause.  Or, you must assign it a type using a 
> > > new attribute like sqlType.
> > > 
> > > According to JDBC Specification Section 13.2.3, Describing Outputs 
> > > and
> > > Inputs of a PreparedStatement Object, 
> > > ParameterMetaData.getParameterMetaData(int
> > > param) returns the type of each parameter in a parameterized query.  What
> > > "type" does this method return for a NULL parameter?  If it does, in fact,
> > > return a NULL parameter's contextual type, then I can change the
> > 
> > > implementation so that it invokes PreparedStatement.setNull instead 
> > > of PreparedStatement.setObject for NULL parameters.  Otherwise, I 
> > > cannot see
> > how
> > > I can supply setNull with a correct "type".  Consequently, I'll just 
> > > have
> > to
> > > wait for Microsoft to fix its JDBC driver so that it correctly 
> > > handles the case PreparedStatement.setObject(index,null).
> > > 
> > > Derek
> 

Re: pulling values from query strings

2004-05-19 Thread Keith

The page that loads when you enter that URL should just be able to use this:



Keith

-- Original Message ---
From: "Jason Slade" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Wed, 19 May 2004 15:39:35 -0500
Subject: pulling values from query strings

> if i'm passing a url of www.foo.com?a=1&b=2, how can i assign the values 
> of "a" & "b" to variables?
> 
> i've been trying to use pageContext.request.queryString and then parsing 
> that through the  tag lib, but I have the feeling that I'm doing much 
> more than necessary for what should be a fairly simple and probably 
> inherint thing.
> 
> Jason Slade
> Client-Side Developer
> Hewitt Associates
> 847.442.7525
--- End of Original Message ---


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



Re: [JSTL] How do I enter a null value with ?

2004-05-19 Thread Keith
This was on the Users list and was my problem. But mine had to do specifically with 
the 
 and the Oracle JDBC driver. The regular  worked fine for me 
when I passed it a null value. 

Link to the starting thread in the archive: 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg06748.html 

Keith 



-- Original Message ---
From: Wolfgang Röckelein <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Wed, 19 May 2004 16:05:14 +0200
Subject: Re: [JSTL] How do I enter a null value with ?

> Derek Mahar wrote:
> 
> > Your solution is equivalent to Case 2 that I listed in my original
> > message.  The Microsoft SQL Server JDBC driver complains with a
> > JspException:
> > 
> > javax.servlet.ServletException: javax.servlet.jsp.JspException: 
> >   INSERT INTO tblTest(a) VALUES (?)
> > : [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Syntax error 
> > converting the nvarchar value 'null' to a column of data type int.
> > 
> > However, the JDBC driver accepts and correctly processes the following
> > query:
> > 
> > 
> >   INSERT INTO tblTestDerek VALUES (null)
> > 
> > 
> > In light of this, I suspect that there may be an error in the
> > implementation of  where it treats "null" as a string
> > argument rather than as an SQL null argument.
> 
> Please search the (user & devel) list. We discussed this problem a while ago and 
> came to the conclusing that this is a problem caused by the JDBC driver used. 
> The subject might have been "SQL Update problem with Dates"
> 
> Regards,
>Wolfgang
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: whitespace inside but outside inserted in to output

2004-05-03 Thread Keith
Well, technically I could do that with the  operator as well. I just did it for 
clarity of distinguishing between HTML and JSTL code. I also have other  
situations with HTML attributes that get to be several lines long. Personally, I'm not 
too worried about how the HTML source looks in the final output. I'm more worried 
about 
keeping my JSP/HTML original source code readable. I'm trying to be nice to those who 
may 
follow me on this project. ;)

Thanks for the tip, though! Didn't know the tertiary operator was available!

Keith


-- Original Message ---
From: "Karl Coleman" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Mon, 3 May 2004 12:32:12 -0400
Subject: RE: whitespace inside  but outside  inserted in to output

> The new tertiary operator in JSP 2.0 may help clean this up.
> 
> 
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 03, 2004 12:12 PM
> To: Tag Libraries Users List
> Subject: Re: whitespace inside  but outside  inserted
> in to output
> 
> I've noticed that JSP never suppresses any whitespace at all outside the < > 
characters. 
> I'm doing HTML output, so this doesn't effect me to much in the final output. 
> Looking 
at 
> my resulting HTML source sure is an eyesore, though. Especially when I use optional 
HTML 
> attributes. Below is a snippet of code I use to make even numbered rows appear a 
> different color:
> 
> bgcolor="99" 
> >
> 
> The resulting  tags look like this:
> 
> 
>   >
> 
> bgcolor="99" 
>   >
> 
> I have some that appears MUCH worse, too. No solution to it as far as I know, 
> besides 
> either having some really unreadable JSP source code or doing some additional 
> parsing 
to 
> get rid of it.
> 
> Keith
> 
> -- Original Message ---
> From: Andreas Schildbach <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Sent: Mon, 03 May 2004 17:58:14 +0200
> Subject: Re: whitespace inside  but outside  inserted in to output
> 
> > Morrow, Steve D. wrote:
> > 
> > > I would have expected the space.
> > 
> > I thought there is no sense in putting any text between  and 
> > . When should it show up?
> > 
> > Suppressing the whitespace at this point would ease indenting choose 
> > constructs. If I want no whitespace at all, with the current 
> > implementation I have to write the whole 
> > choose/when/when/otherwise-construct in one line, which results in a 300 
> > character line.
> > 
> > Regards,
> > 
> > Andreas
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> --- End of Original Message ---
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: whitespace inside but outside inserted in to output

2004-05-03 Thread Keith
I've noticed that JSP never suppresses any whitespace at all outside the < > 
characters. 
I'm doing HTML output, so this doesn't effect me to much in the final output. Looking 
at 
my resulting HTML source sure is an eyesore, though. Especially when I use optional 
HTML 
attributes. Below is a snippet of code I use to make even numbered rows appear a 
different color:

 bgcolor="99" 
>

The resulting  tags look like this:






I have some that appears MUCH worse, too. No solution to it as far as I know, besides 
either having some really unreadable JSP source code or doing some additional parsing 
to 
get rid of it.

Keith

-- Original Message ---
From: Andreas Schildbach <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Mon, 03 May 2004 17:58:14 +0200
Subject: Re: whitespace inside  but outside  inserted in to output

> Morrow, Steve D. wrote:
> 
> > I would have expected the space.
> 
> I thought there is no sense in putting any text between  and 
> . When should it show up?
> 
> Suppressing the whitespace at this point would ease indenting choose 
> constructs. If I want no whitespace at all, with the current 
> implementation I have to write the whole 
> choose/when/when/otherwise-construct in one line, which results in a 300 
> character line.
> 
> Regards,
> 
> Andreas
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: JSTL setup

2004-04-29 Thread Keith
Not sure if I'm understanding your problem correctly, but to use the function tags you 
need to have a different taglib uri besides the core.

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"; %>


Keith


-- Original Message ---
From: Anuj Agrawal <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Thu, 29 Apr 2004 09:49:01 -0700 (PDT)
Subject: JSTL setup

> Ok, i must be doing something wrong, but it's not apparent to me. :(
> 
> I am using the 1.0.x version of standard.jar, and everything is fine. 
> The taglib uri i'm using is http://java.sun.com/jstl/core.  I don't
> have any taglib related entries in my web.xml and there are no tld
> files in my WEB-INF directory.
> 
> I want to use the function tags available in 1.1.x, so i tried dropping
> in the new standard.jar, and changed my taglib uri to
> http://java.sun.com/jsp/jstl/core, and now my IDE (WSAD) reports that
> the URI does not exist.  And i'm unable to test my application.
> 
> Any help?
> Anuj.
> 
>   
>   
> __
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: html tag in sql-database

2004-04-29 Thread Keith
I'm guessing that you're using the  tag to output the data.  has the 
escapeXml attribute set to "true" by default. That's what's turning all your special 
characters into their escape equivalents. Use this:



and that should keep that from happening.

Keith



-- Original Message ---
From: Martin Nad <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Thu, 29 Apr 2004 05:06:25 -0700 (PDT)
Subject: html tag in sql-database

> Hi!
> 
> I use sql-taglib for reading from database.Everything
> works fine but i have some problem with html-tag in
> database, when i print-out the contants av a record,
> the html-tags dosent work and when i look at the
> source, it stands &alt; &glt; for <,>. But i want to
> use the html-tags in my record. how can i resolve this
> problem.
> 
> Cheers
> 
>   
>   
> __
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: Can't find commons-lang-2.jar - nevermind

2004-04-23 Thread Keith
Bah... nevermind. Redownloaded the .jar file from the website mentioned and 
everythings 
fine now. No idea what happened before.

Sorry for the trouble.


-- Original Message ---
From: "Keith" <[EMAIL PROTECTED]>
To: "Taglibs" <[EMAIL PROTECTED]>
Sent: Fri, 23 Apr 2004 09:28:41 -0500
Subject: Can't find commons-lang-2.jar

> I'm trying to use the Display Tag Library (http://displaytag.sourceforge.net/) and 
> am 
> having some trouble getting it working. This is my first time using a tag library 
outside 
> the standard, so I'm wondering where I may have messed up.
> 
> Here is my code:
> 
> 
>   SELECT technology_id, technology_name
>   FROM technology_types
>   ORDER BY technology_name
> 
> 
> 
> 
> And here is my error:
> 
> javax.servlet.ServletException: You do not appear to have the Commons Lang library, 
> version 2.  commons-lang-2.jar is available in the displaytag distribution, or from 
> the 
> Jakarta website at http://jakarta.apache.org/commons .
> 
> Odd thing is, I checked and the commons-lang-2.jar file is located in the 
> /common/lib 
> directory. It was installed by default with Tomcat 5.0.19. I've followed all the 
> instructions on the displaytag website for installing the taglib. I'm using the EL 
> version of the displaytag library. The displaytag.tld file is located in my WEB-INF 
> folder. The displaytag.jar is located in my WEB-INF/lib folder. I've restarted 
> tomcat 
and 
> everything else in my web application works perfectly fine.
> 
> Anyone help?
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Can't find commons-lang-2.jar

2004-04-23 Thread Keith
I'm trying to use the Display Tag Library (http://displaytag.sourceforge.net/) and am 
having some trouble getting it working. This is my first time using a tag library 
outside 
the standard, so I'm wondering where I may have messed up. 

Here is my code:


SELECT technology_id, technology_name
FROM technology_types
ORDER BY technology_name




And here is my error:

javax.servlet.ServletException: You do not appear to have the Commons Lang library, 
version 2.  commons-lang-2.jar is available in the displaytag distribution, or from 
the 
Jakarta website at http://jakarta.apache.org/commons .  

Odd thing is, I checked and the commons-lang-2.jar file is located in the /common/lib 
directory. It was installed by default with Tomcat 5.0.19. I've followed all the 
instructions on the displaytag website for installing the taglib. I'm using the EL 
version of the displaytag library. The displaytag.tld file is located in my WEB-INF 
folder. The displaytag.jar is located in my WEB-INF/lib folder. I've restarted tomcat 
and 
everything else in my web application works perfectly fine. 

Anyone help?

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



Re: More SQL Date problems

2004-04-16 Thread Keith
Alright. Thanks a lot, everyone! I'll be contacting Oracle Support next week to see 
about 
getting the issue resolved. :)

Keith


-- Original Message ---
From: Justyna Horwat <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Fri, 16 Apr 2004 11:24:32 -0700
Subject: Re: More SQL Date problems

> Keith,
> 
> That's why they have the compatibility tests to avoid the very problem 
> that you are seeing with the Oracle driver. This is definitely a bug in 
> Oracle's driver implementation that needs to be fixed.
> 
> Justyna
> 
> Keith wrote:
> 
> >So this is something in the Oracle JDBC driver that needs to be fixed? Just 
> >wondering 
> >whether I have to watch for a new JDBC driver or the next JSTL update to solve the 
> >problem.
> >
> >Right now I'm using a workaround similar to what Hans showed me and things are 
> >working 
> >fine. Just may be confusing for whoever may take over for me in the future if they 
don't 
> >know about the problem.
> >
> >Thanks!
> >
> >Keith
> >
> >
> >-- Original Message ---
> >From: Justyna Horwat <[EMAIL PROTECTED]>
> >To: Tag Libraries Users List <[EMAIL PROTECTED]>
> >Sent: Fri, 16 Apr 2004 09:54:13 -0700
> >Subject: Re: More SQL Date problems
> >
> >  
> >
> >>Hans,
> >>
> >>I looked into the SQL problem and consulted with the JDBC specification 
> >>lead, Jonathan Bruce. Jonathan said that what JSTL is doing is correct: 
> >>when setObject(index, null) is passed in a null value this should be 
> >>converted by the driver to an SQL null.
> >>
> >>This behavior is in fact enforced as part of the J2EE compatibility in 
> >>the CTS. The JDBC Driver Test Suite is publicly accessible and can be 
> >>used to weed out the JDBC drivers that are not compatible.
> >>
> >>Thanks,
> >>
> >>Justyna
> >>
> >>Hans Bergsten wrote:
> >>
> >>
> >>
> >>>Wolfgang Röckelein wrote:
> >>>
> >>>  
> >>>
> >>>>Hi,
> >>>>
> >>>>at JDBC level there are two different possibilities to set a 
> >>>>parameter value to null: with setNull and setting to null. Depending 
> >>>>on the driver sometimes only on of these methods work, and when it 
> >>>>does not work, you see the "java.sql.SQLException: Invalid column 
> >>>>type" error you see.
> >>>>
> >>>>I think this was already changed or discussed sometime during the 
> >>>>standard taglib development.
> >>>>
> >>>>
> >>>Right. I was looking at the code for JSTL in the CVS archive, and it
> >>>calls setObject(index, null) when passed a null value, and there's a
> >>>comment that this should be converted by the driver to an SQL null.
> >>>Browsing through the JDBC JavaDocs and the JDBC spec, there seems to
> >>>be some support for this claim, but it's not 100% clear. It's possible
> >>>that the driver Keith is using doesn't handle it, and maybe it would
> >>>be better if JSTL used setNull(). The reason it doesn't is that it
> >>>would required additional type info for the  case.
> >>>
> >>>Pierre, this may be something to look at again for JSTL.next.
> >>>
> >>>Keith, a work-around for this would be:
> >>>
> >>>   >>>pattern="dd-MM-" />
> >>>
> >>>  
> >>>
> >>>  
> >>>INSERT INTO resource_registry (resource_id, dob)
> >>>  VALUES (res_id_seq.NEXTVAL, ? )
> >>>
> >>>  
> >>>
> >>>
> >>>INSERT INTO resource_registry (resource_id)
> >>>  VALUES (res_id_seq.NEXTVAL)
> >>>  
> >>>
> >>>  
> >>>
> >>>If the real case involves many parameters that may be null, this
> >>>gets ugly, but if it's just this one, it may be okay.
> >>>
> >>>Hans
> >>>  
> >>>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >--- End of Original Message ---
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >  
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: More SQL Date problems

2004-04-16 Thread Keith
So this is something in the Oracle JDBC driver that needs to be fixed? Just wondering 
whether I have to watch for a new JDBC driver or the next JSTL update to solve the 
problem.

Right now I'm using a workaround similar to what Hans showed me and things are working 
fine. Just may be confusing for whoever may take over for me in the future if they 
don't 
know about the problem.

Thanks!

Keith


-- Original Message ---
From: Justyna Horwat <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Fri, 16 Apr 2004 09:54:13 -0700
Subject: Re: More SQL Date problems

> Hans,
> 
> I looked into the SQL problem and consulted with the JDBC specification 
> lead, Jonathan Bruce. Jonathan said that what JSTL is doing is correct: 
> when setObject(index, null) is passed in a null value this should be 
> converted by the driver to an SQL null.
> 
> This behavior is in fact enforced as part of the J2EE compatibility in 
> the CTS. The JDBC Driver Test Suite is publicly accessible and can be 
> used to weed out the JDBC drivers that are not compatible.
> 
> Thanks,
> 
> Justyna
> 
> Hans Bergsten wrote:
> 
> > Wolfgang Röckelein wrote:
> >
> >> Hi,
> >>
> >> at JDBC level there are two different possibilities to set a 
> >> parameter value to null: with setNull and setting to null. Depending 
> >> on the driver sometimes only on of these methods work, and when it 
> >> does not work, you see the "java.sql.SQLException: Invalid column 
> >> type" error you see.
> >>
> >> I think this was already changed or discussed sometime during the 
> >> standard taglib development.
> >
> >
> > Right. I was looking at the code for JSTL in the CVS archive, and it
> > calls setObject(index, null) when passed a null value, and there's a
> > comment that this should be converted by the driver to an SQL null.
> > Browsing through the JDBC JavaDocs and the JDBC spec, there seems to
> > be some support for this claim, but it's not 100% clear. It's possible
> > that the driver Keith is using doesn't handle it, and maybe it would
> > be better if JSTL used setNull(). The reason it doesn't is that it
> > would required additional type info for the  case.
> >
> > Pierre, this may be something to look at again for JSTL.next.
> >
> > Keith, a work-around for this would be:
> >
> >> pattern="dd-MM-" />
> >
> >   
> > 
> >   
> > INSERT INTO resource_registry (resource_id, dob)
> >   VALUES (res_id_seq.NEXTVAL, ? )
> > 
> >   
> > 
> > 
> > INSERT INTO resource_registry (resource_id)
> >   VALUES (res_id_seq.NEXTVAL)
> >   
> > 
> >   
> >
> > If the real case involves many parameters that may be null, this
> > gets ugly, but if it's just this one, it may be okay.
> >
> > Hans
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: Conditional Loop

2004-04-15 Thread Keith

Hmm... I think I get what you did now. Didn't click before. I'll try it out tomorrow. 

Thanks! :)

-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Thu, 15 Apr 2004 16:11:09 -0400
Subject: RE: Conditional Loop

> The query I sent will do exactly that!
> The sub-select with Count(Name) gives you the total number of product names
> - that will correspond to your RowSpan amount.
> 
> Since you want to display the Tech Type & Requirements beneath/within a
> given Product name just add an Order By clause to the sql...
> 
> Order By t.Product_Name, t.Technology_Type etc.
> 
> Now your result set has everything you need - the JSTL need only display it.
> 
> As for performance, with Oracle 9i the query should have sub-second
> processing time (you can also tune it once you get your desired result set
> working). 
> If you find that it's too slow make sure you have an index on Product_Name.
> 
> David Schwartz
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 15, 2004 3:25 PM
> To: Tag Libraries Users List
> Subject: RE: Conditional Loop
> 
> Yes, it already is a lot of coding, so any working shortcut I can find is
> good. ;) But,
> some of the different columns in the DB are being combined into one column
> in the
> resulting HTML table (ex. a complete address), so the output is more compact
> in the end.
> It's an Oracle 9i R2 database.
> 
> Here's a hopefully clearer explination of what I'm trying to do...
> 
> Some of the DB information is product names, technology types, and
> requirements with each
> of those 3 being stored in their own table (they get joined). Some products
> have multiple
> technology types and requirements. Right now I have a  loop
> outputting each
> row. When a product name has multiple technology types or requirements, it
> puts them in
> their own, individual table row. So the same product name is being output in
> multiple
> rows, but each row having a different technology or requirement.
> 
> To avoid the multiple product name listings, I was trying to create rowspans
> based on how
> many technologies or requirements a product had. So, the rowspan would be
> changing with
> each iteration through the loop. I was thinking that if I had a conditional
> loop inside
> the  loop (before the row is output), checking to see how many
> technologies or
> requirements there were for the current product name in the loop, I could
> use that as a
> variable for the rowspan.
> 
> This is complex problem, I know. But it's what I'm stuck trying to figure
> out. :p I admit
> I could be thinking about this in completely the wrong way. I'm still a
> novice
> programmer, so if anyone understands what I'm trying to do and has a
> different way to do
> it, I'd appreciate it!
> 
> Thanks!
> 
> -- Original Message ---
> From: David Schwartz <[EMAIL PROTECTED]>
> To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> Sent: Thu, 15 Apr 2004 15:07:20 -0400
> Subject: RE: Conditional Loop
> 
> > >> Isn't there any way to do this via JSTL and not in the DB query?
> > Maybe, but I'm not sure why you would want to. Seems like the
> functionality
> > you describe is a feature of the DB.
> > Also, with JSTL & 30+ columns could be a lot of coding.
> >
> > Do you have more specific example? What db?
> >
> > David Schwartz
> >
> > -Original Message-
> > From: Keith [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 15, 2004 2:28 PM
> > To: Tag Libraries Users List
> > Subject: RE: Conditional Loop
> >
> > Isn't there any way to do this via JSTL and not in the DB query? My
> example
> > was rather
> > simplistic for what I'm really doing, but still is a good example of the
> raw
> > data. I'm
> > using the resulting number in colspans and rowspans to build a nicer table
> > layout
> > (displaying data only once that's repeated for several rows). I was trying
> > to avoid sub
> > selects and such because I have anywhere from 30 and up columns that I'm
> > returning and
> > having to store a separate count variable for each one is getting
> > ridiculous. I really do
> > appreciate your time in replying, though!
> >
> > Keith
> >
> > -- Original Message ---
> > From: David Schwartz <[EMAIL PROTECTED]>
> > To: "'Tag Libraries Users List&

RE: Conditional Loop

2004-04-15 Thread Keith
Thank you! That may have what I was looking for. This will be my first venture outside 
of 
the standard tag library.

Even if it doesn't, it's a nice tool that will make my tables look much nicer! :)

Keith

-- Original Message ---
From: "Francois Beausoleil" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>, "'Tag Libraries Users 
List'" <[EMAIL PROTECTED]>
Sent: Thu, 15 Apr 2004 15:08:42 -0400
Subject: RE: Conditional Loop

> Keith, take a look at the Display Tag library http://displaytag.sf.net
> 
> It provides a grouping function where a column's value is not repeated if
> it is the same as the value in the row above.
> 
> Hope that helps !
> François
> 
> On Thu, 15 Apr 2004 15:07:20 -0400, "David Schwartz" <[EMAIL PROTECTED]>
> said:
> > >> Isn't there any way to do this via JSTL and not in the DB query? 
> > Maybe, but I'm not sure why you would want to. Seems like the
> > functionality
> > you describe is a feature of the DB.
> > Also, with JSTL & 30+ columns could be a lot of coding.
> > 
> > Do you have more specific example? What db?
> > 
> > David Schwartz
> > 
> > -Original Message-
> > From: Keith [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 15, 2004 2:28 PM
> > To: Tag Libraries Users List
> > Subject: RE: Conditional Loop
> > 
> > Isn't there any way to do this via JSTL and not in the DB query? My
> > example
> > was rather
> > simplistic for what I'm really doing, but still is a good example of the
> > raw
> > data. I'm
> > using the resulting number in colspans and rowspans to build a nicer
> > table
> > layout
> > (displaying data only once that's repeated for several rows). I was
> > trying
> > to avoid sub
> > selects and such because I have anywhere from 30 and up columns that I'm
> > returning and
> > having to store a separate count variable for each one is getting
> > ridiculous. I really do
> > appreciate your time in replying, though!
> > 
> > Keith
> > 
> > 
> > 
> > -- Original Message ---
> > From: David Schwartz <[EMAIL PROTECTED]>
> > To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> > Sent: Thu, 15 Apr 2004 14:23:03 -0400
> > Subject: RE: Conditional Loop
> > 
> > > Try a sub select that returns the count...
> > >
> > > SELECT
> > >
> > > t.Primary_Key,
> > > h.Name,
> > > (Select Count(tt.Name) as Count_Name
> > > FROM myTable tt
> > > where tt.Name = t.Name
> > > )
> > > FROM myTable tt
> > >
> > > It's fast & returns all nesc data from the db.
> > >
> > > David Schwartz
> > >
> > > -Original Message-
> > > From: Keith [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, April 15, 2004 1:45 PM
> > > To: Taglibs
> > > Subject: Conditional Loop
> > >
> > > Here's a generic scenario similar to my situation:
> > >
> > > A database with two columns, one being an auto-sequence number for the
> > > primary key, the
> > > other listing names.
> > >
> > > 1   Bob
> > > 2   Bob
> > > 3   Jim
> > > 4   John
> > > 5   Jim
> > > 6   Bob
> > > 7   John
> > > 8   John
> > > 9   Jim
> > > 10  Bob
> > >
> > > Ok, I query the database to return both columns, since I need all the
> > stored
> > > data. But I
> > > also want to get the number of each unique name in the 'names' column (how
> > > many Jim's,
> > > how many Bob's, and how many John's). I know I could do a separate query
> > > looking for a
> > > count() on each unique name, but that's not realistic with the amount of
> > > data I'm dealing
> > > with (actually tried doing it and nearly killed the poor DB server).
> > >
> > > Normally, I'd do this with a 'while' conditional loop and a counter
> > > incrementing while
> > > the 'name' column contains a specific value, but I don't see that
> > > functionality in JSTL.
> > > I had asked generally before if JSTL had any 'while' loop capability, but
> > > got no
> > > response. So, I figured I'd give an example of what I'm trying to do and
> > > ma

RE: Conditional Loop

2004-04-15 Thread Keith
Yes, it already is a lot of coding, so any working shortcut I can find is good. ;) 
But, 
some of the different columns in the DB are being combined into one column in the 
resulting HTML table (ex. a complete address), so the output is more compact in the 
end. 
It's an Oracle 9i R2 database.

Here's a hopefully clearer explination of what I'm trying to do...

Some of the DB information is product names, technology types, and requirements with 
each 
of those 3 being stored in their own table (they get joined). Some products have 
multiple 
technology types and requirements. Right now I have a  loop outputting each 
row. When a product name has multiple technology types or requirements, it puts them 
in 
their own, individual table row. So the same product name is being output in multiple 
rows, but each row having a different technology or requirement.

To avoid the multiple product name listings, I was trying to create rowspans based on 
how 
many technologies or requirements a product had. So, the rowspan would be changing 
with 
each iteration through the loop. I was thinking that if I had a conditional loop 
inside 
the  loop (before the row is output), checking to see how many technologies 
or 
requirements there were for the current product name in the loop, I could use that as 
a 
variable for the rowspan.

This is complex problem, I know. But it's what I'm stuck trying to figure out. :p I 
admit 
I could be thinking about this in completely the wrong way. I'm still a novice 
programmer, so if anyone understands what I'm trying to do and has a different way to 
do 
it, I'd appreciate it!

Thanks!

-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Thu, 15 Apr 2004 15:07:20 -0400
Subject: RE: Conditional Loop

> >> Isn't there any way to do this via JSTL and not in the DB query? 
> Maybe, but I'm not sure why you would want to. Seems like the functionality
> you describe is a feature of the DB.
> Also, with JSTL & 30+ columns could be a lot of coding.
> 
> Do you have more specific example? What db?
> 
> David Schwartz
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 15, 2004 2:28 PM
> To: Tag Libraries Users List
> Subject: RE: Conditional Loop
> 
> Isn't there any way to do this via JSTL and not in the DB query? My example
> was rather
> simplistic for what I'm really doing, but still is a good example of the raw
> data. I'm
> using the resulting number in colspans and rowspans to build a nicer table
> layout
> (displaying data only once that's repeated for several rows). I was trying
> to avoid sub
> selects and such because I have anywhere from 30 and up columns that I'm
> returning and
> having to store a separate count variable for each one is getting
> ridiculous. I really do
> appreciate your time in replying, though!
> 
> Keith
> 
> -- Original Message ---
> From: David Schwartz <[EMAIL PROTECTED]>
> To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> Sent: Thu, 15 Apr 2004 14:23:03 -0400
> Subject: RE: Conditional Loop
> 
> > Try a sub select that returns the count...
> >
> > SELECT
> >
> > t.Primary_Key,
> > h.Name,
> > (Select Count(tt.Name) as Count_Name
> > FROM myTable tt
> > where tt.Name = t.Name
> > )
> > FROM myTable tt
> >
> > It's fast & returns all nesc data from the db.
> >
> > David Schwartz
> >
> > -Original Message-
> > From: Keith [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 15, 2004 1:45 PM
> > To: Taglibs
> > Subject: Conditional Loop
> >
> > Here's a generic scenario similar to my situation:
> >
> > A database with two columns, one being an auto-sequence number for the
> > primary key, the
> > other listing names.
> >
> > 1   Bob
> > 2   Bob
> > 3   Jim
> > 4   John
> > 5   Jim
> > 6   Bob
> > 7   John
> > 8   John
> > 9   Jim
> > 10  Bob
> >
> > Ok, I query the database to return both columns, since I need all the
> stored
> > data. But I
> > also want to get the number of each unique name in the 'names' column (how
> > many Jim's,
> > how many Bob's, and how many John's). I know I could do a separate query
> > looking for a
> > count() on each unique name, but that's not realistic with the amount of
> > data I'm dealing
> > with (actually tried doing it and nearly killed the poor DB server).
>

RE: Conditional Loop

2004-04-15 Thread Keith
Isn't there any way to do this via JSTL and not in the DB query? My example was rather 
simplistic for what I'm really doing, but still is a good example of the raw data. I'm 
using the resulting number in colspans and rowspans to build a nicer table layout 
(displaying data only once that's repeated for several rows). I was trying to avoid 
sub 
selects and such because I have anywhere from 30 and up columns that I'm returning and 
having to store a separate count variable for each one is getting ridiculous. I really 
do 
appreciate your time in replying, though!

Keith



-- Original Message ---
From: David Schwartz <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Thu, 15 Apr 2004 14:23:03 -0400
Subject: RE: Conditional Loop

> Try a sub select that returns the count...
> 
> SELECT
> 
> t.Primary_Key,
> h.Name,
> (Select Count(tt.Name) as Count_Name
> FROM myTable tt
> where tt.Name = t.Name
> )
> FROM myTable tt
> 
> It's fast & returns all nesc data from the db.
> 
> David Schwartz
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 15, 2004 1:45 PM
> To: Taglibs
> Subject: Conditional Loop
> 
> Here's a generic scenario similar to my situation:
> 
> A database with two columns, one being an auto-sequence number for the
> primary key, the
> other listing names.
> 
> 1   Bob
> 2   Bob
> 3   Jim
> 4   John
> 5   Jim
> 6   Bob
> 7   John
> 8   John
> 9   Jim
> 10  Bob
> 
> Ok, I query the database to return both columns, since I need all the stored
> data. But I
> also want to get the number of each unique name in the 'names' column (how
> many Jim's,
> how many Bob's, and how many John's). I know I could do a separate query
> looking for a
> count() on each unique name, but that's not realistic with the amount of
> data I'm dealing
> with (actually tried doing it and nearly killed the poor DB server).
> 
> Normally, I'd do this with a 'while' conditional loop and a counter
> incrementing while
> the 'name' column contains a specific value, but I don't see that
> functionality in JSTL.
> I had asked generally before if JSTL had any 'while' loop capability, but
> got no
> response. So, I figured I'd give an example of what I'm trying to do and
> maybe someone
> could help.
> 
> Thanks!
> 
> Keith
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Conditional Loop

2004-04-15 Thread Keith
Here's a generic scenario similar to my situation:

A database with two columns, one being an auto-sequence number for the primary key, 
the 
other listing names.

1   Bob
2   Bob
3   Jim
4   John
5   Jim
6   Bob
7   John
8   John
9   Jim
10  Bob

Ok, I query the database to return both columns, since I need all the stored data. But 
I 
also want to get the number of each unique name in the 'names' column (how many Jim's, 
how many Bob's, and how many John's). I know I could do a separate query looking for a 
count() on each unique name, but that's not realistic with the amount of data I'm 
dealing 
with (actually tried doing it and nearly killed the poor DB server).

Normally, I'd do this with a 'while' conditional loop and a counter incrementing while 
the 'name' column contains a specific value, but I don't see that functionality in 
JSTL. 
I had asked generally before if JSTL had any 'while' loop capability, but got no 
response. So, I figured I'd give an example of what I'm trying to do and maybe someone 
could help.

Thanks!

Keith

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



While Conditional action?

2004-04-14 Thread Keith
Might be having a dense moment here, so excuse me if I'm missing something obvious...

Is there any kind of "while" conditional loop functionality in the JSTL? As far as I 
can 
see,  only loops for a fixed number of times, or once for each item in a 
collection of some sort. Is there some way to use the  action to loop on a 
condition?

Or is this not in JSTL yet? Seems like a major oversite if it's missing.

Keith

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



RE: Replacing returns with

2004-04-14 Thread Keith
Woops! :p

Well, that got rid of the invalid attribute error. But, it's not doing the replacing. 
It 
looks like it would if I just did a normal .

I just went with a  tag using a CSS style to change its appearance.

Thanks for the help, though!


-- Original Message ---
From: Felix Velasco <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Wed, 14 Apr 2004 15:22:53 +0200
Subject: RE: Replacing returns with 

> you have a typo: the attribute is escapeXml ,not escapeXmL (look at the 'L')
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: 14 April 2004 15:24
> To: Tag Libraries Users List
> Subject: Re: Replacing returns with 
> 
> When I try putting the '\\\n' in with the escapeXmL attribute set to false,
> I get this:
> 
> org.apache.jasper.JasperException: /filename.jsp(301,2) Attribute escapeXmL
> invalid for 
> tag out according to TLD
> 
> Which makes no sense what-so-ever. I tried just putting the
> escapeXmL="false" attribute 
> in with '\n' being my string, and I get my original error.
> 
> I think the problem may be that it's not seeing \n as the return character
> from my 
> database.
> 
> Any ideas?
> 
> Keith
> 
> -- Original Message ---
> From: Pierre Delisle <[EMAIL PROTECTED]>
> To: Tag Libraries Users List <[EMAIL PROTECTED]>
> Sent: Tue, 13 Apr 2004 18:08:51 -0700
> Subject: Re: Replacing returns with 
> 
> > Not very intuitive, but the following should work:
> > 
> >   
> >   
> > 
> >-- Pierre
> > 
> > Keith wrote:
> > 
> > > I have a column in a database that is used to store a comments section.
> It's just a 
> large 
> > > string (VARCHAR2(4000) in Oracle), and the information is entered into
> it via a 
> > >  form field. If I output that data to another  I can
> see that the 
> > > return characters are preserved in the database.
> > > 
> > > I was trying to output this column's data as normal text in HTML, but
> need to 
> preserve 
> > > the returns somehow. I was thinking I could use the  action
> to turn them 
> into 
> > > 's, but I'm not sure how it sees the return characters in the
> string. I tried 
> this:
> > > 
> > > 
> > > 
> > > But get this error back:
> > > 
> > > org.apache.jasper.JasperException: /filename.jsp(281,2) "${fn:replace
> > > (row.comments, '\n', '')}" contains invalid expression(s): 
> > > javax.servlet.jsp.el.ELException: Encountered "'\n", expected one of 
> [, 
> > > , , "true", "false", "null",
> "(", "-
> > > ", "not", "!", "empty", ]
> > > 
> > > 
> > > Anyone help with how I can go about doing this? Thanks!
> > > 
> > > Keith
> > > 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > >
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> --- End of Original Message ---
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: Replacing returns with

2004-04-14 Thread Keith
When I try putting the '\\\n' in with the escapeXmL attribute set to false, I get this:

org.apache.jasper.JasperException: /filename.jsp(301,2) Attribute escapeXmL invalid 
for 
tag out according to TLD

Which makes no sense what-so-ever. I tried just putting the escapeXmL="false" 
attribute 
in with '\n' being my string, and I get my original error.

I think the problem may be that it's not seeing \n as the return character from my 
database.

Any ideas?

Keith


-- Original Message ---
From: Pierre Delisle <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Tue, 13 Apr 2004 18:08:51 -0700
Subject: Re: Replacing returns with 

> Not very intuitive, but the following should work:
> 
>   
>   
> 
>-- Pierre
> 
> Keith wrote:
> 
> > I have a column in a database that is used to store a comments section. It's just 
> > a 
large 
> > string (VARCHAR2(4000) in Oracle), and the information is entered into it via a 
> >  form field. If I output that data to another  I can see that 
> > the 
> > return characters are preserved in the database.
> > 
> > I was trying to output this column's data as normal text in HTML, but need to 
preserve 
> > the returns somehow. I was thinking I could use the  action to turn 
> > them 
into 
> > 's, but I'm not sure how it sees the return characters in the string. I tried 
this:
> > 
> > 
> > 
> > But get this error back:
> > 
> > org.apache.jasper.JasperException: /filename.jsp(281,2) "${fn:replace
> > (row.comments, '\n', '')}" contains invalid expression(s): 
> > javax.servlet.jsp.el.ELException: Encountered "'\n", expected one of 
[, 
> > , , "true", "false", "null", "(", "-
> > ", "not", "!", "empty", ]
> > 
> > 
> > Anyone help with how I can go about doing this? Thanks!
> > 
> > Keith
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Replacing returns with

2004-04-13 Thread Keith
I have a column in a database that is used to store a comments section. It's just a 
large 
string (VARCHAR2(4000) in Oracle), and the information is entered into it via a 
 form field. If I output that data to another  I can see that the 
return characters are preserved in the database.

I was trying to output this column's data as normal text in HTML, but need to preserve 
the returns somehow. I was thinking I could use the  action to turn them 
into 
's, but I'm not sure how it sees the return characters in the string. I tried this:



But get this error back:

org.apache.jasper.JasperException: /filename.jsp(281,2) "${fn:replace
(row.comments, '\n', '')}" contains invalid expression(s): 
javax.servlet.jsp.el.ELException: Encountered "'\n", expected one of 
[, 
, , "true", "false", "null", "(", "-
", "not", "!", "empty", ]


Anyone help with how I can go about doing this? Thanks!

Keith

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



RE: isLast() method of LoopTagStatus class

2004-04-12 Thread Keith
I have Hans Bergsten's JSP book from O'Reilly. I'm only about 1/3 of the way through 
it 
so far, so I may not have gotten to a point where he explained that yet. Thanks for 
the 
reference and Bean explination, though! Helps a lot.

Keith


-- Original Message ---
From: Felix Velasco <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Mon, 12 Apr 2004 19:02:54 +0200
Subject: RE: isLast() method of LoopTagStatus class

> this is a very basic application of the JavaBeans spec, and I don't really
> think you should read it to use in jstl. You just need to know that any
> class with non-static methods starting with "get", "set" or "is" (this last
> one only for booleans) is a JavaBean to you. Then, to call this method,
> remove the prefix and lowercase the first letter after it. Unless there are
> more than one uppercase letters, so:
> 
> getId() -->  .id
> getID() -->  .ID
> 
> In most EL tutorials you'll find this better explained, I'd start with Shawn
> Bayern's book, JSTL in Action, probably the best there is for JSTL.
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: 12 April 2004 18:57
> To: Tag Libraries Users List
> Subject: RE: isLast() method of LoopTagStatus class
> 
> Perfect! Thanks!
> 
> Where would I have looked to find that info? I'm still really new to Beans
> and raw Java 
> code. Main reason why I'm going with JSTL right now. I had tried looking in
> the Java 
> Docs, but I really didn't know where to begin.
> 
> Keith
> 
> -- Original Message ---
> From: Felix Velasco <[EMAIL PROTECTED]>
> To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
> Sent: Mon, 12 Apr 2004 18:41:51 +0200
> Subject: RE: isLast() method of LoopTagStatus class
> 
> > try loop_status.last instead of loop_status.isLast(). EL will translate it
> > as per javabeans specification
> > 
> > -Original Message-
> > From: Keith [mailto:[EMAIL PROTECTED]
> > Sent: 12 April 2004 18:41
> > To: Taglibs
> > Subject: isLast() method of LoopTagStatus class
> > 
> > I'm trying to output a comma delimited list based on a varying list of
> > statuses that will 
> > be input from a select menu in a form. I was trying to figure out how to
> > avoid putting a 
> > comma after the last value, and it seemed like testing with the isLast()
> > method of the 
> > LoopTagStatus class would be a good thing to use. I'm not quite sure how
> to
> > go about 
> > using it, though. Reading about it, it looks like the 'varStatus'
> attribute
> > of the 
> >  tag creates a variable to hold a LoopTagStatus object. My code
> > below was how 
> > I assumed I would then be able to access the isLast() method:
> > 
> > <%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
> > <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> > <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %>
> >  > varStatus="loop_status">
> > '${status_row.status_name}'
> >   , 
> > 
> > 
> > But when I do this, I get the following error back:
> > 
> > org.apache.jasper.JasperException: /report_status_data.jsp(20,3) The
> > function isLast must 
> > be used with a prefix when a default namespace is not specified
> > 
> > Here's an example of the kind of output I'm trying to generate. The list
> has
> > a 
> > possibility of being shorter or longer than this:
> > 
> > 'In-Progress', 'Closed', 'Terminated', 'Withdrawn'
> > 
> > Thanks in advance!
> > 
> > Keith
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> --- End of Original Message ---
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: isLast() method of LoopTagStatus class

2004-04-12 Thread Keith
Perfect! Thanks!

Where would I have looked to find that info? I'm still really new to Beans and raw 
Java 
code. Main reason why I'm going with JSTL right now. I had tried looking in the Java 
Docs, but I really didn't know where to begin. 

Keith

-- Original Message ---
From: Felix Velasco <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Mon, 12 Apr 2004 18:41:51 +0200
Subject: RE: isLast() method of LoopTagStatus class

> try loop_status.last instead of loop_status.isLast(). EL will translate it
> as per javabeans specification
> 
> -Original Message-
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: 12 April 2004 18:41
> To: Taglibs
> Subject: isLast() method of LoopTagStatus class
> 
> I'm trying to output a comma delimited list based on a varying list of
> statuses that will 
> be input from a select menu in a form. I was trying to figure out how to
> avoid putting a 
> comma after the last value, and it seemed like testing with the isLast()
> method of the 
> LoopTagStatus class would be a good thing to use. I'm not quite sure how to
> go about 
> using it, though. Reading about it, it looks like the 'varStatus' attribute
> of the 
>  tag creates a variable to hold a LoopTagStatus object. My code
> below was how 
> I assumed I would then be able to access the isLast() method:
> 
> <%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %>
>  varStatus="loop_status">
> '${status_row.status_name}'
>   , 
> 
> 
> But when I do this, I get the following error back:
> 
> org.apache.jasper.JasperException: /report_status_data.jsp(20,3) The
> function isLast must 
> be used with a prefix when a default namespace is not specified
> 
> Here's an example of the kind of output I'm trying to generate. The list has
> a 
> possibility of being shorter or longer than this:
> 
> 'In-Progress', 'Closed', 'Terminated', 'Withdrawn'
> 
> Thanks in advance!
> 
> Keith
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



isLast() method of LoopTagStatus class

2004-04-12 Thread Keith
I'm trying to output a comma delimited list based on a varying list of statuses that 
will 
be input from a select menu in a form. I was trying to figure out how to avoid putting 
a 
comma after the last value, and it seemed like testing with the isLast() method of the 
LoopTagStatus class would be a good thing to use. I'm not quite sure how to go about 
using it, though. Reading about it, it looks like the 'varStatus' attribute of the 
 tag creates a variable to hold a LoopTagStatus object. My code below was 
how 
I assumed I would then be able to access the isLast() method:

<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %>

'${status_row.status_name}'
  , 



But when I do this, I get the following error back:

org.apache.jasper.JasperException: /report_status_data.jsp(20,3) The function isLast 
must 
be used with a prefix when a default namespace is not specified

Here's an example of the kind of output I'm trying to generate. The list has a 
possibility of being shorter or longer than this:

'In-Progress', 'Closed', 'Terminated', 'Withdrawn'

Thanks in advance!

Keith

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



Prohibited content

2004-04-12 Thread Keith
Can someone please do something about the Taglibs mailing list responding 
with "Prohibited Content"? Nearly every message I send bounces this back to me (even 
when 
it doesn't contain JSP code), and a number of others keep resending their messages, 
thinking they never get through because of the same thing. All we're sending is plain 
text messages with no attachments. 

Keith

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



Re: JSTL Tags Vs. JavaBeans

2004-04-12 Thread Keith
Jeff, 

Here's an example of how I did what you were looking for in regards to building a 
select 
menu based on data pulled from a database. There is a page before this one in which 
the 
user selects which project they're looking to edit and it's passed on to the page 
containing the code below. The first query is used to get the values to build the 
entire 
select menu. The second query gets the technology that associated with the chosen 
project 
ID. The nested 'forEach' that I did also allows for if there is more than one 
technology 
associated with the project they chose and generates multiple drop-down menus if there 
are. As it builds the select menu it compares the current value to the chosen one. If 
it 
is, the 'selected' attribute is inserted. 
If you have any questions about it, feel free to ask!

Keith



SELECT technology_id, technology_name FROM technology_types ORDER BY 
technology_name
  

 
SELECT technology_id 
FROM technology_registry
WHERE project_id = ? 
ORDER BY technology_name
  
  
  
  

 
selected 
 
>${fn:escapeXml(tech_row.technology_name)} 


<%-- end forEach for "tech_row" --%>
  
  
  
  <%-- end forEach for "chosen_tech" --%>


-- Original Message ---
From: "Jeff Brewer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sun, 11 Apr 2004 18:17:05 -0400
Subject: Re: JSTL Tags Vs. JavaBeans

> Sure. Here's a piece of what I'm in the middle of trying to update right
> now. It started out using the "jsp:useBean" tag followed by the
> "jsp:getProperty" tags. One of the limitations (probably due to my own
> ignorance) I ran into was some way of writing the options for a select tag
> that would "select" the appropriate option corresponding to the value found
> in the database. Note in the "source" select tag below, I simply wrote a
> function in my bean that would iterate all of the options in the bean while
> building a string containing all the necessary HTML code.
> 
> Contrast that with "link_type" options that I built this afternoon where I'm
> using JSTL to iterate a collection of very simple objects. Here all of the
> HTML code is on the JSP page.
> 
> I guess what I mean by "using beans vs. using JSTL tags" has to do more with
> how I get the data onto the page. For example, on this page I can write the
> "sourceUrl" value by either...
> 
> 
> ...or...
> 
> 
> Right now I'm inclined to be consistent (as consistently as I can) and since
> I like using the  my "select" tag I'm inclined to use the  get rid of the  
> Anyway, that's enough rambling for one post. Thanks for responding! Here's
> my code sample...
> 
> <%@ page import = "com.dumfries.utilities.*, java.util.ArrayList,
> java.util.Iterator, java.util.Collections"%>
> <%@ taglib prefix="c" uri="/WEB-INF/lib/c.tld" %>
>  type="com.dumfries.utilities.ArticleForm" />
> 
> 
> 
>
>   ID:
>/>
>">
>
>
>   Title:
>wrap="soft"> />
>
> 
>
>   Subtitle:
>wrap="soft"> />
>
>
>   Byline:
>wrap="soft"> />
>
> 
>
>   Article Date:
>value=" />">
>
> 
>
>   source:
>   
> 
>   
>
> 
>
>   Body:
>name="dumfriesArticle" property="body" />
>
> 
>
>   Formatted:
>value="true" property="formattedCheckboxState" />>
>
> 
>
>   Publish:
>name="dumfriesArticle" property="publishCheckboxState" />>
>
> 
>
>   Article Type:
>   
> 
>   
>
> 
>
>   Link Type:
>   
> 
> 
>  " test="${lto.value==dumfriesArticle.linkTypeSelection}">
> selected>
> 
> 
>   
>
> 
>
>   Source URL:
>   ">
>
> 
>
>   Alt URL:
>   ">
>
> 
>
>   Created Date/Time:
>/>
>
> 
> - Original Message - 
> From: "Martin Cooper" <[EMAIL PROTECTED]>
> To: "Tag

Re: More SQL Date problems

2004-03-31 Thread Keith
I just got that "prohibited content" email myself. All I'm sending is plaintext email. 
Is that something from the mailing list doing it? Snipped Hans' original message out 
and 
am resending...


Thanks a lot, Hans! Yeah, I had seen a workaround like that would work. I groaned when 
I 
realized that, though. Some other forms I'm working on have a lot more date fields 
(two 
have 15 each), so it would get pretty ugly. 

The other problem comes in when/if the date column data needs to be deleted. I have 
another "UPDATE" form that pulls the existing data from the database and fills in the 
form. People can then edit that entry. If the sql:dateParam tag worked like it's 
supposed 
to, they could just erase the date in the desired form field, and the JSTL tag would 
set 
it to NULL, effectively deleting it. The workaround wouldn't work in this case, 
because 
the field is not originally "empty". Fortunately, in the case of my application, dates 
never should be deleted once entered. Mine is a unique case, though, and is 
effectively 
using what seems to be a bug to keep the date in the database. :p 

Is there any chance of this problem being fixed in the case of the Oracle JDBC driver? 

Keith 


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



Re: More SQL Date problems

2004-03-31 Thread Keith
Thanks a lot, Hans! Yeah, I had seen a workaround like that would work. I groaned when 
I 
realized that, though. Some other forms I'm working on have a lot more date fields 
(two 
have 15 each), so it would get pretty ugly.

The other problem comes in when/if the date column data needs to be deleted. I have 
another "UPDATE" form that pulls the existing data from the database and fills in the 
form. People can then edit that entry. If the sql:dateParam tag worked like it's 
supposed 
to, they could just erase the date in the desired form field, and the JSTL tag would 
set 
it to NULL, effectively deleting it. The workaround wouldn't work in this case, 
because 
the field is not originally "empty". Fortunately, in the case of my application, dates 
never should be deleted once entered. Mine is a unique case, though, and is 
effectively 
using what seems to be a bug to keep the date in the database. :p

Is there any chance of this problem being fixed in the case of the Oracle JDBC driver?

Keith

-- Original Message ---
From: Hans Bergsten <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Wed, 31 Mar 2004 12:18:19 -0800
Subject: Re: More SQL Date problems

> Wolfgang Röckelein wrote:
> > Hi,
> > 
> > at JDBC level there are two different possibilities to set a parameter 
> > value to null: with setNull and setting to null. Depending on the driver 
> > sometimes only on of these methods work, and when it does not work, you 
> > see the "java.sql.SQLException: Invalid column type" error you see.
> > 
> > I think this was already changed or discussed sometime during the 
> > standard taglib development.
> 
> Right. I was looking at the code for JSTL in the CVS archive, and it
> calls setObject(index, null) when passed a null value, and there's a
> comment that this should be converted by the driver to an SQL null.
> Browsing through the JDBC JavaDocs and the JDBC spec, there seems to
> be some support for this claim, but it's not 100% clear. It's possible
> that the driver Keith is using doesn't handle it, and maybe it would
> be better if JSTL used setNull(). The reason it doesn't is that it
> would required additional type info for the  case.
> 
> Pierre, this may be something to look at again for JSTL.next.
> 
> Keith, a work-around for this would be:
> 
>  pattern="dd-MM-" />
> 
>
>  
>
>  INSERT INTO resource_registry (resource_id, dob)
>VALUES (res_id_seq.NEXTVAL, ? )
>  
>
>  
>  
>  INSERT INTO resource_registry (resource_id)
>VALUES (res_id_seq.NEXTVAL)
>
>  
>
> 
> If the real case involves many parameters that may be null, this
> gets ugly, but if it's just this one, it may be okay.
> 
> Hans
> -- 
> Hans Bergsten<[EMAIL PROTECTED]>
> Gefion Software   <http://www.gefionsoftware.com/>
> Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1
> Details at<http://TheJSPBook.com/>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: Formatted date not returning

2004-03-31 Thread Keith
Yeah, I guess I could use the fmt:formatDate tag. I'll give it a try. To me, it's a 
lot 
easier to format the date output in the SQL query than it is via JSTL. Just seems a 
bit 
buggy to me that it works with the Indexed output, but not with the SortedMap. Thanks!

Keith

-- Original Message ---
From: "Martin van Dijken" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Wed, 31 Mar 2004 08:48:19 +0200
Subject: RE: Formatted date not returning

> Hey Keith,
> 
> I still have to guess this has indeed something to do with JSTL not
> understanding the .dob . Haven't been around SQL much of late so I can't
> answer that one. Why not simplify this problem and use a fmt:formatDate tag
> instead of doing the formatting in SQL?
> 
> Martin
> 
> -Oorspronkelijk bericht-
> Van: Keith [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag 31 maart 2004 3:27
> Aan: Tag Libraries Users List
> Onderwerp: Re: Formatted date not returning
> 
> Nope, that didn't work. I don't see the identifiers being used anywhere in
> the Oracle
> book I have. It didn't throw an error or anything, just did the same thing.
> Thanks for
> the suggestion, though!
> I did notice that I do have formated dates returning in another document,
> but the
> forEach is using the rowsByIndex instead. The below outputs the TO_CHAR()
> formatted date
> exactly as I want it. Anyone know why the Indexed list returns the formated
> date, but
> not the SortedMap?
> 
> 
>   
>   
>   
>    
>   ${column}
>   
>   
>   
> 
> 
> Keith
> 
> -- Original Message ---
> From: Hassan Schroeder <[EMAIL PROTECTED]>
> To: Tag Libraries Users List <[EMAIL PROTECTED]>
> Sent: Tue, 30 Mar 2004 13:57:17 -0800
> Subject: Re: Formatted date not returning
> 
> > Keith wrote:
> > > I'm trying to return a formatted date from an Oracle database. I format
> the date in
> the
> > > query itself using the TO_CHAR() funtion. The problem is, when I use the
> TO_CHAR()
> > > function, JSP is acting like nothing is returned. If I take the function
> out and
> just
> > > select the column as normal, it outputs but with the full TimeStamp
> (which I don't
> want).
> >
> > I don't know Oracle, but if this was MySQL I'd say you need to
> > assign an identifier to your returned result, something like
> >
> > > 
> > >   SELECT
> > >TO_CHAR(dob, 'DD-MON-')
> >   TO_CHAR(dob, 'DD-MON-YYY') AS thisDOB
> > >   FROM ccevs_resource_registry
> > > 
> >
> > ..and then call it as
> >
> > >   
> > >   
> >  
> >
> > Untested, but FWIW!
> > --
> > Hassan Schroeder - [EMAIL PROTECTED]
> > Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
> >
> >dream.  code.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> --- End of Original Message ---
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



RE: More SQL Date problems

2004-03-31 Thread Keith
ttp11.Http11Processor.process(Http11Processor.java:833)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:534)


-- Original Message ---
From: "Martin van Dijken" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Wed, 31 Mar 2004 08:58:24 +0200
Subject: RE: More SQL Date problems

> Hmm Keith,
> 
> Can you specify the url you're using to connect to the database? * out the
> uid and psw of course... Also can you post a stack trace? I did a few
> Googles on your exception and heard some people shouting the oracle thin
> driver should work best. It's what I have used in the past and I've not had
> any headaches with it.
> 
> Martin
> 
> -Oorspronkelijk bericht-
> Van: Keith [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag 31 maart 2004 5:55
> Aan: Tag Libraries Users List
> Onderwerp: Re: More SQL Date problems
> 
> Yeah, I'd read about not using that bridge driver. I'm using Oracle 9i
> Release 2, J2SE
> v1.4.2, and the JDBC Oracle Driver for JDK 1.4.
> 
> Keith
> 
> -- Original Message ---
> From: Hans Bergsten <[EMAIL PROTECTED]>
> To: Tag Libraries Users List <[EMAIL PROTECTED]>
> Sent: Tue, 30 Mar 2004 20:40:41 -0800
> Subject: Re: More SQL Date problems
> 
> > Keith wrote:
> > > Ahhh, ok. I assumed it was the JSTL stuff throwing the error. I've not
> done much
> > > programming in actual Java, which is why I'm using the JSTL library.
> > >
> > > The field is set to accept a NULL value in the database. There's already
> data in the
> > > database, and there's many DOB's missing for some people. I can do
> inserts to the
> > > database from SQL*Plus fine and leave the date fields blank. It's just
> when I'm
> trying
> > > to do it via JSP. I'm trying to design an new interface to the database
> and this has
> > > been my roadblock for the week.
> >
> > Okay. Which JDBC driver are you using? If it's the JDBC-ODBC bridge, I
> > suggest you try with a real Oracle JDBC type 3 or 4 driver instead. The
> > bridge driver is buggy and not intended for production use.
> >
> > Hans
> >
> > > -- Original Message ---
> > > From: Hans Bergsten <[EMAIL PROTECTED]>
> > > To: Tag Libraries Users List <[EMAIL PROTECTED]>
> > > Sent: Tue, 30 Mar 2004 19:30:44 -0800
> > > Subject: Re: More SQL Date problems
> > >
> > >
> > >>Keith wrote:
> > >>
> > >>>Now I'm thorougly confused. I could've sworn this was working before
> (as I claimed
> > >
> > > in my
> > >
> > >>>first email to the group.
> > >>>
> > >>>
> > >>> pattern="dd-MM-" />
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> INSERT INTO resource_registry ( dob )
> > >>>VALUES (?  )
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>This works perfectly fine when I put a date in the format specified in
> the
> parseDate
> > >>>action. The JSP book I got (O'Reilly 3rd Ed) says the 
> action is
> > >
> > > supposed
> > >
> > >>>to set the value to an SQL NULL when a null value is provided to it. I
> keep getting
> > >
> > > an
> > >
> > >>>Invalid Column Type SQL exception (not an Oracle error) back whenever I
> leave the
> > >
> > > date
> > >
> > >>>field blank. Anyone know what's wrong? Thanks!
> > >>
> > >>It looks to me as if the "Invalid Column Type SQL exception" indeed
> > >>comes from the database (or the JDBC driver), because nothing in JSTL
> > >>can issue such an error message (JSTL doesn't have enough info; it
> > >>just relays the error issued by the JDBC driver).
> > >>
> > >>JSTL sets the parameter in the SQL statement to SQL NULL if the
> > >> value is null (according to the spec; bugs in an
> > >>implementation is a different story). One possible reason for the
>

Re: More SQL Date problems

2004-03-30 Thread Keith
Yeah, I'd read about not using that bridge driver. I'm using Oracle 9i Release 2, J2SE 
v1.4.2, and the JDBC Oracle Driver for JDK 1.4. 

Keith

-- Original Message ---
From: Hans Bergsten <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Tue, 30 Mar 2004 20:40:41 -0800
Subject: Re: More SQL Date problems

> Keith wrote:
> > Ahhh, ok. I assumed it was the JSTL stuff throwing the error. I've not done much 
> > programming in actual Java, which is why I'm using the JSTL library.
> > 
> > The field is set to accept a NULL value in the database. There's already data in 
> > the 
> > database, and there's many DOB's missing for some people. I can do inserts to the 
> > database from SQL*Plus fine and leave the date fields blank. It's just when I'm 
trying 
> > to do it via JSP. I'm trying to design an new interface to the database and this 
> > has 
> > been my roadblock for the week.
> 
> Okay. Which JDBC driver are you using? If it's the JDBC-ODBC bridge, I
> suggest you try with a real Oracle JDBC type 3 or 4 driver instead. The
> bridge driver is buggy and not intended for production use.
> 
> Hans
> 
> > -- Original Message ---
> > From: Hans Bergsten <[EMAIL PROTECTED]>
> > To: Tag Libraries Users List <[EMAIL PROTECTED]>
> > Sent: Tue, 30 Mar 2004 19:30:44 -0800
> > Subject: Re: More SQL Date problems
> > 
> > 
> >>Keith wrote:
> >>
> >>>Now I'm thorougly confused. I could've sworn this was working before (as I 
> >>>claimed 
> > 
> > in my 
> > 
> >>>first email to the group. 
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>   INSERT INTO resource_registry ( dob ) 
> >>>VALUES (?  )
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>This works perfectly fine when I put a date in the format specified in the 
parseDate 
> >>>action. The JSP book I got (O'Reilly 3rd Ed) says the  action is 
> > 
> > supposed 
> > 
> >>>to set the value to an SQL NULL when a null value is provided to it. I keep 
> >>>getting 
> > 
> > an 
> > 
> >>>Invalid Column Type SQL exception (not an Oracle error) back whenever I leave the 
> > 
> > date 
> > 
> >>>field blank. Anyone know what's wrong? Thanks!
> >>
> >>It looks to me as if the "Invalid Column Type SQL exception" indeed
> >>comes from the database (or the JDBC driver), because nothing in JSTL
> >>can issue such an error message (JSTL doesn't have enough info; it
> >>just relays the error issued by the JDBC driver).
> >>
> >>JSTL sets the parameter in the SQL statement to SQL NULL if the
> >> value is null (according to the spec; bugs in an
> >>implementation is a different story). One possible reason for the
> >>error you get is that the column isn't declared to accept a NULL
> >>value. Check the database table constraints.
> >>
> >>Hans
> 
> -- 
> Hans Bergsten<[EMAIL PROTECTED]>
> Gefion Software   <http://www.gefionsoftware.com/>
> Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1
> Details at<http://TheJSPBook.com/>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Re: More SQL Date problems

2004-03-30 Thread Keith
Ahhh, ok. I assumed it was the JSTL stuff throwing the error. I've not done much 
programming in actual Java, which is why I'm using the JSTL library.

The field is set to accept a NULL value in the database. There's already data in the 
database, and there's many DOB's missing for some people. I can do inserts to the 
database from SQL*Plus fine and leave the date fields blank. It's just when I'm trying 
to do it via JSP. I'm trying to design an new interface to the database and this has 
been my roadblock for the week.

Keith

-- Original Message ---
From: Hans Bergsten <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Tue, 30 Mar 2004 19:30:44 -0800
Subject: Re: More SQL Date problems

> Keith wrote:
> > Now I'm thorougly confused. I could've sworn this was working before (as I claimed 
in my 
> > first email to the group. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > INSERT INTO resource_registry ( dob ) 
> > VALUES (?  )
> > 
> > 
> > 
> > 
> > 
> > This works perfectly fine when I put a date in the format specified in the 
> > parseDate 
> > action. The JSP book I got (O'Reilly 3rd Ed) says the  action is 
supposed 
> > to set the value to an SQL NULL when a null value is provided to it. I keep 
> > getting 
an 
> > Invalid Column Type SQL exception (not an Oracle error) back whenever I leave the 
date 
> > field blank. Anyone know what's wrong? Thanks!
> 
> It looks to me as if the "Invalid Column Type SQL exception" indeed
> comes from the database (or the JDBC driver), because nothing in JSTL
> can issue such an error message (JSTL doesn't have enough info; it
> just relays the error issued by the JDBC driver).
> 
> JSTL sets the parameter in the SQL statement to SQL NULL if the
>  value is null (according to the spec; bugs in an
> implementation is a different story). One possible reason for the
> error you get is that the column isn't declared to accept a NULL
> value. Check the database table constraints.
> 
> Hans
> -- 
> Hans Bergsten<[EMAIL PROTECTED]>
> Gefion Software   <http://www.gefionsoftware.com/>
> Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1
> Details at<http://TheJSPBook.com/>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



More SQL Date problems

2004-03-30 Thread Keith
Now I'm thorougly confused. I could've sworn this was working before (as I claimed in 
my 
first email to the group. 







INSERT INTO resource_registry ( dob ) 
VALUES (?  )





This works perfectly fine when I put a date in the format specified in the parseDate 
action. The JSP book I got (O'Reilly 3rd Ed) says the  action is 
supposed 
to set the value to an SQL NULL when a null value is provided to it. I keep getting an 
Invalid Column Type SQL exception (not an Oracle error) back whenever I leave the date 
field blank. Anyone know what's wrong? Thanks!

Keith


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



Re: Formatted date not returning

2004-03-30 Thread Keith
Nope, that didn't work. I don't see the identifiers being used anywhere in the Oracle 
book I have. It didn't throw an error or anything, just did the same thing. Thanks for 
the suggestion, though!
I did notice that I do have formated dates returning in another document, but the 
forEach is using the rowsByIndex instead. The below outputs the TO_CHAR() formatted 
date 
exactly as I want it. Anyone know why the Indexed list returns the formated date, but 
not the SortedMap?





 
${column}

    
    


Keith

-- Original Message ---
From: Hassan Schroeder <[EMAIL PROTECTED]>
To: Tag Libraries Users List <[EMAIL PROTECTED]>
Sent: Tue, 30 Mar 2004 13:57:17 -0800
Subject: Re: Formatted date not returning

> Keith wrote:
> > I'm trying to return a formatted date from an Oracle database. I format the date 
> > in 
the 
> > query itself using the TO_CHAR() funtion. The problem is, when I use the TO_CHAR() 
> > function, JSP is acting like nothing is returned. If I take the function out and 
just 
> > select the column as normal, it outputs but with the full TimeStamp (which I don't 
want).
> 
> I don't know Oracle, but if this was MySQL I'd say you need to
> assign an identifier to your returned result, something like
> 
> > 
> > SELECT 
> >  TO_CHAR(dob, 'DD-MON-')
>   TO_CHAR(dob, 'DD-MON-YYY') AS thisDOB
> > FROM ccevs_resource_registry
> > 
> 
> ..and then call it as
> 
> >   
> > 
>  
> 
> Untested, but FWIW!
> -- 
> Hassan Schroeder - [EMAIL PROTECTED]
> Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
> 
>dream.  code.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--- End of Original Message ---


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



Formatted date not returning

2004-03-30 Thread Keith
I'm trying to return a formatted date from an Oracle database. I format the date in 
the 
query itself using the TO_CHAR() funtion. The problem is, when I use the TO_CHAR() 
function, JSP is acting like nothing is returned. If I take the function out and just 
select the column as normal, it outputs but with the full TimeStamp (which I don't 
want).
Is there anything wrong with what I've done? Is there any other way to format a date's 
output with JSTL?

Here's the snippet of relevant code with the TO_CHAR() function included:


SELECT 
 TO_CHAR(dob, 'DD-MON-')
FROM ccevs_resource_registry



  
Date of Birth
  
  <%-- set variable for checking if current row is odd or even --%>
  
  
  
  <%-- color every even numbered row --%>
   bgcolor="99" 
  >


 


  
  <%-- increment rowNum counter --%>
  
  


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



SQL Update problem with Dates

2004-03-29 Thread Keith
I'm creating a web form application with JSP to interact with an Oracle database. I'm 
using Tomcat 5.0.19, JSTL 1.1 Standard, and Oracle 9i Release 2. I'm running across a 
problem when I try to update a Date column in the database.  The date is entered via a 
text input field that I validate the format of via JavaScript. INSERTing the date as a 
NULL works fine (separate form from the update). It's when the Date column already has 
a 
value and I try to UPDATE it to a NULL value. The fmt:parseDate action was copied 
directly from my INSERT page, so I know that part works fine. I've verified that all 
other fields besides the Date fields are being passed and updated correctly. 
Thanks in advance!

Here are the relevant snippets of my code and the resultant error stack trace:






UPDATE ccevs_projects_registry SET 
project_date = ?   
 

WHERE project_id = ? 








exception 

javax.servlet.ServletException: 
UPDATE ccevs_projects_registry SET 
product_name = ? ,  
project_date = ?

WHERE project_id = ? 
: Invalid column type
org.apache.jasper.runtime.PageContextImpl.doHandlePageException
(PageContextImpl.java:864)
org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:800)
org.apache.jsp.project_005fupdate_005fstore_jsp._jspService
(project_005fupdate_005fstore_jsp.java:141)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause 

java.sql.SQLException: Invalid column type
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:6414)
oracle.jdbc.driver.OraclePreparedStatement.setNull
(OraclePreparedStatement.java:1354)
oracle.jdbc.driver.OraclePreparedStatement.setObject
(OraclePreparedStatement.java:2791)
oracle.jdbc.driver.OraclePreparedStatement.setObject
(OraclePreparedStatement.java:3217)

org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.setParameters(Unknown 
Source)
org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doEndTag(Unknown 
Source)
org.apache.jsp.project_005fupdate_005fstore_jsp._jspx_meth_sql_update_0
(project_005fupdate_005fstore_jsp.java:487)
org.apache.jsp.project_005fupdate_005fstore_jsp._jspx_meth_sql_transaction_0
(project_005fupdate_005fstore_jsp.java:417)
org.apache.jsp.project_005fupdate_005fstore_jsp._jspService
(project_005fupdate_005fstore_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)



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



Re: How to access Resource bundle from filter?

2004-03-12 Thread Keith Hyland
 > ResourceBundle myResources =
 >ResourceBundle.getBundle("foo", locale);
 >

Thanks, I didn't actually know that which is a bit embarrasing, but ...

I want to get the resource used by the  tag lib. The one 
specified in web.xml as

  
javax.servlet.jsp.jstl.fmt.localizationContext
resources.application


At the moment it looks like I have to jump through a few hoops to do this.

String rb = 
session.getServletContext().getInitParameter("javax.servlet.jsp.jstl.fmt.localizationContext");
Locale locale = (Locale)session.getAttribute(Config.FMT_LOCALE);
ResourseBundle.getBundle(rb, locale).getString(key);

Is this right?, or is some of the logic of the  tag 
accessible outside of a jsp context?

Cheers,
Keith



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



How to access Resource bundle from filter?

2004-03-12 Thread Keith Hyland
Hi,

How do I access the resource bundle used by the  tags from 
a filter (or servlet).

Cheers,
Keith


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