You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Michael Duffy <du...@yahoo.com> on 2003/07/09 16:52:59 UTC

Setting Date Value For SQL Query

I've got a question that will turn out to be simple,
but I'm not seeing it.

I'm writing an SQL query that has a date parameter, so
I'm using the <sql:dateParam> tag nested underneath my
<sql:query> tag, with the type="date" attribute set.

"JSTL In Action" tells me that the value for
<sql:dateParam> has to be a scoped variable of type
java.util.Date, so I've got a <jsp:useBean> tag that
declares one.

The problem comes when I try to set the value of the
Date Bean.  I get a string value from an HTML form
input text, so I want to use <fmt:parseDate> to turn
it into a Date.  I wrap the <fmt:parseDate> in a
<c:if> tag that makes sure I only parse when the
parameter for the text box is not empty.

But when I run the JSP I get an exception back in the
browser:

javax.servlet.jsp.JspException: An error occurred
while evaluating custom action attribute "value" with
value "sinceReportDate": Attempt to convert String
"sinceReportDate" to type "java.util.Date", but there
is no PropertyEditor for that type (null) 

I'm not seeing my error.  Can anybody on the list spot
it?  Thanks - MOD


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: XML Doc type problem

Posted by Michael Duffy <du...@yahoo.com>.
Sounds like you need an EntityResolver, like the one
in the org.xml.sax package.  But I don't know know how
to register such a thing with the SAX parser inside
the JSTL tag library.  I'll have to leave that to my
betters. - MOD


--- Brian Menke <br...@lspeed.com> wrote:
> Hi everyone,
> 
> I have created a JSP page that use the xml tag
> library, specifically using
> xpath. Everything works perfectly fine as long as I
> don't have a doctype
> definition like the following in my XML instance:
> 
> <!DOCTYPE datasheet PUBLIC "-//Innovtech//DTD
> datasheet//EN"
> "c:/dtds/innovtech/datasheet.dtd">
> 
> If I remove it, life is great, but if I don't, I get
> a java error like this:
> 
> org.apache.jasper.JasperException: Could not resolve
> entity reference:
> "///c:/dtds/innovtech/datasheet.dtd"
> 
> I have to have the doctype in the xml. Does anyone
> know how I can fix this??
> 
> Thanks!
> 
> -Brian
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


XML Doc type problem

Posted by Brian Menke <br...@lspeed.com>.
Hi everyone,

I have created a JSP page that use the xml tag library, specifically using
xpath. Everything works perfectly fine as long as I don't have a doctype
definition like the following in my XML instance:

<!DOCTYPE datasheet PUBLIC "-//Innovtech//DTD datasheet//EN"
"c:/dtds/innovtech/datasheet.dtd">

If I remove it, life is great, but if I don't, I get a java error like this:

org.apache.jasper.JasperException: Could not resolve entity reference:
"///c:/dtds/innovtech/datasheet.dtd"

I have to have the doctype in the xml. Does anyone know how I can fix this??

Thanks!

-Brian


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Kris Schneider <kr...@dotech.com>.
No problem, glad it's working.

Quoting Michael Duffy <du...@yahoo.com>:

> 
> I know - I deserve a dope slap for this one.  ;)
> 
> But you're absolutely right - I've been trying to slow
> down and be a little more careful with my query.  I
> must have done something wrong with a parameter in a
> previous incarnation, because now I'm getting a good
> result back.
> 
> I apologize for taking your time.  Thanks for
> answering.  There are no other Java folks in my
> department.  Sometimes I use lists as a remote
> substitute for asking someone "Can you take a look at
> this?"  I appreciate the feedback very much. 
> Sincerely, MOD

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Michael Duffy <du...@yahoo.com>.
I know - I deserve a dope slap for this one.  ;)

But you're absolutely right - I've been trying to slow
down and be a little more careful with my query.  I
must have done something wrong with a parameter in a
previous incarnation, because now I'm getting a good
result back.

I apologize for taking your time.  Thanks for
answering.  There are no other Java folks in my
department.  Sometimes I use lists as a remote
substitute for asking someone "Can you take a look at
this?"  I appreciate the feedback very much. 
Sincerely, MOD


--- Kris Schneider <kr...@dotech.com> wrote:
> Well of course the data access stuff shouldn't be
> embedded in a JSP ;-). But it
> should still work. Actually, it sounds like you
> might have a mismatch between
> the types you're using for your input parameters and
> the column types your
> querying against. Can you build your query up param
> by param to see when you get
> one that causes the error? In other words, start
> with a query that only uses one
> input parameter. If that works, add your second and
> so on. When adding a param
> causes the error, check the type you're providing
> versus the type of the column.
> 
> Quoting Michael Duffy <du...@yahoo.com>:
> 
> > 
> > I made a bonehead error on that one, Kris.  My
> > original query had parameters in it.  When it
> failed,
> > I stripped it down to "SELECT * FROM DEFECT" - but
> in
> > my haste I forgot to remove the <sql:param> tags
> > underneath.  Once I saw that, the simple query
> worked
> > just fine.
> > 
> > Once that was working, I put back my longer SQL
> query.
> >  It's pretty long, with all those joins: 423
> chars.  I
> > can run it in that SQL testing JSP by cutting and
> > pasting into the HTML text area.
> > 
> > But when I try to run it in the app JSP, I get a
> > JSPException: "Invalid column type".
> > 
> > Is it because there's a limit on query string
> length? 
> > I believe the SQL is okay, because it runs
> properly on
> > Oracle.
> > 
> > The real answer might be that complicated SQL
> rightly
> > belongs on the server side, not in a JSP.  But I
> hoped
> > this project would fall into the category of
> simple
> > prototype.  Perhaps that's not true.
> > 
> > --- Kris Schneider <kr...@dotech.com> wrote:
> > > So you're saying something simple like:
> > > 
> > > <sql:query var="results">
> > >   SELECT * FROM DEFECT
> > > </sql:query>
> > > 
> > > is blowing up?
> > > 
> > > Quoting Michael Duffy <du...@yahoo.com>:
> > > 
> > > > 
> > > > Good check, Kris, but I did have the EL
> notation.
> > > > 
> > > > I stripped my query down (it got big with
> joins)
> > > to a
> > > > "SELECT * FROM DEFECT".  I still get an
> "invalid
> > > > column exception".  The query runs fine in
> > > Oracle's
> > > > SQL*Plus.
> > > > 
> > > > I wrote a simple JSP a while back that lets me
> > > type an
> > > > ad-hoc query into an HTML text area and
> displays
> > > the
> > > > results in a table.  It's been helpful for
> testing
> > > > connections and data source set-ups.  I can
> type
> > > > "SELECT * FROM DEFECT" into that JSP and get a
> > > table
> > > > result back. 
> > > > 
> > > > What does all this tell me?  I must need more
> > > coffee,
> > > > because I'm still not seeing what I've missed.
> > > > 
> > > > Gotta be a bonehead problem.
> > > >  
> > > > 
> > > > 
> > > > --- Kris Schneider <kr...@dotech.com> wrote:
> > > > > Are you using:
> > > > > 
> > > > > <sql:dateParam value="sinceReportDate"
> > > type="date"/>
> > > > > 
> > > > > instead of:
> > > > > 
> > > > > <sql:dateParam value="${sinceReportDate}"
> > > > > type="date"/>
> > > > > 
> > > > > Quoting Michael Duffy <du...@yahoo.com>:
> > > > > 
> > > > > > 
> > > > > > I've got a question that will turn out to
> be
> > > > > simple,
> > > > > > but I'm not seeing it.
> > > > > > 
> > > > > > I'm writing an SQL query that has a date
> > > > > parameter, so
> > > > > > I'm using the <sql:dateParam> tag nested
> > > > > underneath my
> > > > > > <sql:query> tag, with the type="date"
> > > attribute
> > > > > set.
> > > > > > 
> > > > > > "JSTL In Action" tells me that the value
> for
> > > > > > <sql:dateParam> has to be a scoped
> variable of
> > > > > type
> > > > > > java.util.Date, so I've got a
> <jsp:useBean>
> > > tag
> > > > > that
> > > > > > declares one.
> > > > > > 
> > > > > > The problem comes when I try to set the
> value
> > > of
> > > > > the
> > > > > > Date Bean.  I get a string value from an
> HTML
> > > form
> > > > > > input text, so I want to use
> <fmt:parseDate>
> > > to
> > > > > turn
> > > > > > it into a Date.  I wrap the
> <fmt:parseDate> in
> > > a
> > > > > > <c:if> tag that makes sure I only parse
> when
> > > the
> > > > > > parameter for the text box is not empty.
> > > > > > 
> > > > > > But when I run the JSP I get an exception
> back
> > > in
> > > > > the
> > > > > > browser:
> > > > > > 
> > > > > > javax.servlet.jsp.JspException: An error
> > > occurred
> > > > > > while evaluating custom action attribute
> > > "value"
> > > > > with
> > > > > > value "sinceReportDate": Attempt to
> convert
> > > String
> > > > > > "sinceReportDate" to type
> "java.util.Date",
> > > but
> > > > > there
> > > > > > is no PropertyEditor for that type (null) 
> > > > > > 
> > > > > > I'm not seeing my error.  Can anybody on
> the
> > > list
> > > > > spot
> > > > > > it?  Thanks - MOD
> > > > > 
> > > > > -- 
> > > > > Kris Schneider <ma...@dotech.com>
> > > > > D.O.Tech       <http://www.dotech.com/>
> > > 
> > > -- 
> > > Kris Schneider <ma...@dotech.com>
> > > D.O.Tech       <http://www.dotech.com/>
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Kris Schneider <kr...@dotech.com>.
Well of course the data access stuff shouldn't be embedded in a JSP ;-). But it
should still work. Actually, it sounds like you might have a mismatch between
the types you're using for your input parameters and the column types your
querying against. Can you build your query up param by param to see when you get
one that causes the error? In other words, start with a query that only uses one
input parameter. If that works, add your second and so on. When adding a param
causes the error, check the type you're providing versus the type of the column.

Quoting Michael Duffy <du...@yahoo.com>:

> 
> I made a bonehead error on that one, Kris.  My
> original query had parameters in it.  When it failed,
> I stripped it down to "SELECT * FROM DEFECT" - but in
> my haste I forgot to remove the <sql:param> tags
> underneath.  Once I saw that, the simple query worked
> just fine.
> 
> Once that was working, I put back my longer SQL query.
>  It's pretty long, with all those joins: 423 chars.  I
> can run it in that SQL testing JSP by cutting and
> pasting into the HTML text area.
> 
> But when I try to run it in the app JSP, I get a
> JSPException: "Invalid column type".
> 
> Is it because there's a limit on query string length? 
> I believe the SQL is okay, because it runs properly on
> Oracle.
> 
> The real answer might be that complicated SQL rightly
> belongs on the server side, not in a JSP.  But I hoped
> this project would fall into the category of simple
> prototype.  Perhaps that's not true.
> 
> --- Kris Schneider <kr...@dotech.com> wrote:
> > So you're saying something simple like:
> > 
> > <sql:query var="results">
> >   SELECT * FROM DEFECT
> > </sql:query>
> > 
> > is blowing up?
> > 
> > Quoting Michael Duffy <du...@yahoo.com>:
> > 
> > > 
> > > Good check, Kris, but I did have the EL notation.
> > > 
> > > I stripped my query down (it got big with joins)
> > to a
> > > "SELECT * FROM DEFECT".  I still get an "invalid
> > > column exception".  The query runs fine in
> > Oracle's
> > > SQL*Plus.
> > > 
> > > I wrote a simple JSP a while back that lets me
> > type an
> > > ad-hoc query into an HTML text area and displays
> > the
> > > results in a table.  It's been helpful for testing
> > > connections and data source set-ups.  I can type
> > > "SELECT * FROM DEFECT" into that JSP and get a
> > table
> > > result back. 
> > > 
> > > What does all this tell me?  I must need more
> > coffee,
> > > because I'm still not seeing what I've missed.
> > > 
> > > Gotta be a bonehead problem.
> > >  
> > > 
> > > 
> > > --- Kris Schneider <kr...@dotech.com> wrote:
> > > > Are you using:
> > > > 
> > > > <sql:dateParam value="sinceReportDate"
> > type="date"/>
> > > > 
> > > > instead of:
> > > > 
> > > > <sql:dateParam value="${sinceReportDate}"
> > > > type="date"/>
> > > > 
> > > > Quoting Michael Duffy <du...@yahoo.com>:
> > > > 
> > > > > 
> > > > > I've got a question that will turn out to be
> > > > simple,
> > > > > but I'm not seeing it.
> > > > > 
> > > > > I'm writing an SQL query that has a date
> > > > parameter, so
> > > > > I'm using the <sql:dateParam> tag nested
> > > > underneath my
> > > > > <sql:query> tag, with the type="date"
> > attribute
> > > > set.
> > > > > 
> > > > > "JSTL In Action" tells me that the value for
> > > > > <sql:dateParam> has to be a scoped variable of
> > > > type
> > > > > java.util.Date, so I've got a <jsp:useBean>
> > tag
> > > > that
> > > > > declares one.
> > > > > 
> > > > > The problem comes when I try to set the value
> > of
> > > > the
> > > > > Date Bean.  I get a string value from an HTML
> > form
> > > > > input text, so I want to use <fmt:parseDate>
> > to
> > > > turn
> > > > > it into a Date.  I wrap the <fmt:parseDate> in
> > a
> > > > > <c:if> tag that makes sure I only parse when
> > the
> > > > > parameter for the text box is not empty.
> > > > > 
> > > > > But when I run the JSP I get an exception back
> > in
> > > > the
> > > > > browser:
> > > > > 
> > > > > javax.servlet.jsp.JspException: An error
> > occurred
> > > > > while evaluating custom action attribute
> > "value"
> > > > with
> > > > > value "sinceReportDate": Attempt to convert
> > String
> > > > > "sinceReportDate" to type "java.util.Date",
> > but
> > > > there
> > > > > is no PropertyEditor for that type (null) 
> > > > > 
> > > > > I'm not seeing my error.  Can anybody on the
> > list
> > > > spot
> > > > > it?  Thanks - MOD
> > > > 
> > > > -- 
> > > > Kris Schneider <ma...@dotech.com>
> > > > D.O.Tech       <http://www.dotech.com/>
> > 
> > -- 
> > Kris Schneider <ma...@dotech.com>
> > D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Michael Duffy <du...@yahoo.com>.
I made a bonehead error on that one, Kris.  My
original query had parameters in it.  When it failed,
I stripped it down to "SELECT * FROM DEFECT" - but in
my haste I forgot to remove the <sql:param> tags
underneath.  Once I saw that, the simple query worked
just fine.

Once that was working, I put back my longer SQL query.
 It's pretty long, with all those joins: 423 chars.  I
can run it in that SQL testing JSP by cutting and
pasting into the HTML text area.

But when I try to run it in the app JSP, I get a
JSPException: "Invalid column type".

Is it because there's a limit on query string length? 
I believe the SQL is okay, because it runs properly on
Oracle.

The real answer might be that complicated SQL rightly
belongs on the server side, not in a JSP.  But I hoped
this project would fall into the category of simple
prototype.  Perhaps that's not true.

--- Kris Schneider <kr...@dotech.com> wrote:
> So you're saying something simple like:
> 
> <sql:query var="results">
>   SELECT * FROM DEFECT
> </sql:query>
> 
> is blowing up?
> 
> Quoting Michael Duffy <du...@yahoo.com>:
> 
> > 
> > Good check, Kris, but I did have the EL notation.
> > 
> > I stripped my query down (it got big with joins)
> to a
> > "SELECT * FROM DEFECT".  I still get an "invalid
> > column exception".  The query runs fine in
> Oracle's
> > SQL*Plus.
> > 
> > I wrote a simple JSP a while back that lets me
> type an
> > ad-hoc query into an HTML text area and displays
> the
> > results in a table.  It's been helpful for testing
> > connections and data source set-ups.  I can type
> > "SELECT * FROM DEFECT" into that JSP and get a
> table
> > result back. 
> > 
> > What does all this tell me?  I must need more
> coffee,
> > because I'm still not seeing what I've missed.
> > 
> > Gotta be a bonehead problem.
> >  
> > 
> > 
> > --- Kris Schneider <kr...@dotech.com> wrote:
> > > Are you using:
> > > 
> > > <sql:dateParam value="sinceReportDate"
> type="date"/>
> > > 
> > > instead of:
> > > 
> > > <sql:dateParam value="${sinceReportDate}"
> > > type="date"/>
> > > 
> > > Quoting Michael Duffy <du...@yahoo.com>:
> > > 
> > > > 
> > > > I've got a question that will turn out to be
> > > simple,
> > > > but I'm not seeing it.
> > > > 
> > > > I'm writing an SQL query that has a date
> > > parameter, so
> > > > I'm using the <sql:dateParam> tag nested
> > > underneath my
> > > > <sql:query> tag, with the type="date"
> attribute
> > > set.
> > > > 
> > > > "JSTL In Action" tells me that the value for
> > > > <sql:dateParam> has to be a scoped variable of
> > > type
> > > > java.util.Date, so I've got a <jsp:useBean>
> tag
> > > that
> > > > declares one.
> > > > 
> > > > The problem comes when I try to set the value
> of
> > > the
> > > > Date Bean.  I get a string value from an HTML
> form
> > > > input text, so I want to use <fmt:parseDate>
> to
> > > turn
> > > > it into a Date.  I wrap the <fmt:parseDate> in
> a
> > > > <c:if> tag that makes sure I only parse when
> the
> > > > parameter for the text box is not empty.
> > > > 
> > > > But when I run the JSP I get an exception back
> in
> > > the
> > > > browser:
> > > > 
> > > > javax.servlet.jsp.JspException: An error
> occurred
> > > > while evaluating custom action attribute
> "value"
> > > with
> > > > value "sinceReportDate": Attempt to convert
> String
> > > > "sinceReportDate" to type "java.util.Date",
> but
> > > there
> > > > is no PropertyEditor for that type (null) 
> > > > 
> > > > I'm not seeing my error.  Can anybody on the
> list
> > > spot
> > > > it?  Thanks - MOD
> > > 
> > > -- 
> > > Kris Schneider <ma...@dotech.com>
> > > D.O.Tech       <http://www.dotech.com/>
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Kris Schneider <kr...@dotech.com>.
So you're saying something simple like:

<sql:query var="results">
  SELECT * FROM DEFECT
</sql:query>

is blowing up?

Quoting Michael Duffy <du...@yahoo.com>:

> 
> Good check, Kris, but I did have the EL notation.
> 
> I stripped my query down (it got big with joins) to a
> "SELECT * FROM DEFECT".  I still get an "invalid
> column exception".  The query runs fine in Oracle's
> SQL*Plus.
> 
> I wrote a simple JSP a while back that lets me type an
> ad-hoc query into an HTML text area and displays the
> results in a table.  It's been helpful for testing
> connections and data source set-ups.  I can type
> "SELECT * FROM DEFECT" into that JSP and get a table
> result back. 
> 
> What does all this tell me?  I must need more coffee,
> because I'm still not seeing what I've missed.
> 
> Gotta be a bonehead problem.
>  
> 
> 
> --- Kris Schneider <kr...@dotech.com> wrote:
> > Are you using:
> > 
> > <sql:dateParam value="sinceReportDate" type="date"/>
> > 
> > instead of:
> > 
> > <sql:dateParam value="${sinceReportDate}"
> > type="date"/>
> > 
> > Quoting Michael Duffy <du...@yahoo.com>:
> > 
> > > 
> > > I've got a question that will turn out to be
> > simple,
> > > but I'm not seeing it.
> > > 
> > > I'm writing an SQL query that has a date
> > parameter, so
> > > I'm using the <sql:dateParam> tag nested
> > underneath my
> > > <sql:query> tag, with the type="date" attribute
> > set.
> > > 
> > > "JSTL In Action" tells me that the value for
> > > <sql:dateParam> has to be a scoped variable of
> > type
> > > java.util.Date, so I've got a <jsp:useBean> tag
> > that
> > > declares one.
> > > 
> > > The problem comes when I try to set the value of
> > the
> > > Date Bean.  I get a string value from an HTML form
> > > input text, so I want to use <fmt:parseDate> to
> > turn
> > > it into a Date.  I wrap the <fmt:parseDate> in a
> > > <c:if> tag that makes sure I only parse when the
> > > parameter for the text box is not empty.
> > > 
> > > But when I run the JSP I get an exception back in
> > the
> > > browser:
> > > 
> > > javax.servlet.jsp.JspException: An error occurred
> > > while evaluating custom action attribute "value"
> > with
> > > value "sinceReportDate": Attempt to convert String
> > > "sinceReportDate" to type "java.util.Date", but
> > there
> > > is no PropertyEditor for that type (null) 
> > > 
> > > I'm not seeing my error.  Can anybody on the list
> > spot
> > > it?  Thanks - MOD
> > 
> > -- 
> > Kris Schneider <ma...@dotech.com>
> > D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Michael Duffy <du...@yahoo.com>.
Good check, Kris, but I did have the EL notation.

I stripped my query down (it got big with joins) to a
"SELECT * FROM DEFECT".  I still get an "invalid
column exception".  The query runs fine in Oracle's
SQL*Plus.

I wrote a simple JSP a while back that lets me type an
ad-hoc query into an HTML text area and displays the
results in a table.  It's been helpful for testing
connections and data source set-ups.  I can type
"SELECT * FROM DEFECT" into that JSP and get a table
result back. 

What does all this tell me?  I must need more coffee,
because I'm still not seeing what I've missed.

Gotta be a bonehead problem.
 


--- Kris Schneider <kr...@dotech.com> wrote:
> Are you using:
> 
> <sql:dateParam value="sinceReportDate" type="date"/>
> 
> instead of:
> 
> <sql:dateParam value="${sinceReportDate}"
> type="date"/>
> 
> Quoting Michael Duffy <du...@yahoo.com>:
> 
> > 
> > I've got a question that will turn out to be
> simple,
> > but I'm not seeing it.
> > 
> > I'm writing an SQL query that has a date
> parameter, so
> > I'm using the <sql:dateParam> tag nested
> underneath my
> > <sql:query> tag, with the type="date" attribute
> set.
> > 
> > "JSTL In Action" tells me that the value for
> > <sql:dateParam> has to be a scoped variable of
> type
> > java.util.Date, so I've got a <jsp:useBean> tag
> that
> > declares one.
> > 
> > The problem comes when I try to set the value of
> the
> > Date Bean.  I get a string value from an HTML form
> > input text, so I want to use <fmt:parseDate> to
> turn
> > it into a Date.  I wrap the <fmt:parseDate> in a
> > <c:if> tag that makes sure I only parse when the
> > parameter for the text box is not empty.
> > 
> > But when I run the JSP I get an exception back in
> the
> > browser:
> > 
> > javax.servlet.jsp.JspException: An error occurred
> > while evaluating custom action attribute "value"
> with
> > value "sinceReportDate": Attempt to convert String
> > "sinceReportDate" to type "java.util.Date", but
> there
> > is no PropertyEditor for that type (null) 
> > 
> > I'm not seeing my error.  Can anybody on the list
> spot
> > it?  Thanks - MOD
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> taglibs-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Setting Date Value For SQL Query

Posted by Kris Schneider <kr...@dotech.com>.
Are you using:

<sql:dateParam value="sinceReportDate" type="date"/>

instead of:

<sql:dateParam value="${sinceReportDate}" type="date"/>

Quoting Michael Duffy <du...@yahoo.com>:

> 
> I've got a question that will turn out to be simple,
> but I'm not seeing it.
> 
> I'm writing an SQL query that has a date parameter, so
> I'm using the <sql:dateParam> tag nested underneath my
> <sql:query> tag, with the type="date" attribute set.
> 
> "JSTL In Action" tells me that the value for
> <sql:dateParam> has to be a scoped variable of type
> java.util.Date, so I've got a <jsp:useBean> tag that
> declares one.
> 
> The problem comes when I try to set the value of the
> Date Bean.  I get a string value from an HTML form
> input text, so I want to use <fmt:parseDate> to turn
> it into a Date.  I wrap the <fmt:parseDate> in a
> <c:if> tag that makes sure I only parse when the
> parameter for the text box is not empty.
> 
> But when I run the JSP I get an exception back in the
> browser:
> 
> javax.servlet.jsp.JspException: An error occurred
> while evaluating custom action attribute "value" with
> value "sinceReportDate": Attempt to convert String
> "sinceReportDate" to type "java.util.Date", but there
> is no PropertyEditor for that type (null) 
> 
> I'm not seeing my error.  Can anybody on the list spot
> it?  Thanks - MOD

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org