Also, sorry for the multiple posts on my topic, but I've got a little bit more information that may be helpful to show you guys exactly where I'm at right now.
Okay so here's a cut 'n paste of text from a BBS where I was looking for some help with this... It explains a little more thoroughly what I've tried to do to get this working, as well as the point that I don't know nearly enough about JSP/Java interaction yet.
-=-=-=-=-=-
Aug 28, 2008 16:42 from Grumps
Instantiate a DateFormat object df, then myDate = df.parse(myString)?
Sry, I know that's on the page. 's all I got.
[Programming> msg #198 (3 remaining)] Read cmd -> Next
Aug 28, 2008 16:45 from Qwe
Well after including java.text.Dateformat the following code is not
working
from within the jsp:
Code:
<%
inDate = java.text.DateFormat.parse(param.timeIn);
outDate = java.text.DateFormat.parse(param.timeOut);
%>
*feels eyelids grow heavy*
[Programming> msg #199 (2 remaining)] Read cmd -> Next
Aug 28, 2008 16:59 from Qwe
Okay my guess at this point is that I have to use a
Code:
<jsp:useBean id="ouah" class="java.text.DateFormat" scope="page" />
to instantiate DateFormat into something that I can use... then it will probably be some sort of
Code:
<jsp:setProperty name="ouah" property=??? value=???>
to invoke the formatting on my string... I don't really have a clue what goes in property, but I can probably find that in the class methods... Now that I think about it it should be "parse" I would assume, and value should have my "${whatever}" holding the string that I want to format.
I do not have a clue if I'm right, though. And if I'm right I don't have a clue on how to access the results unless they'd be ouah.hours, .minutes, etc...
[Programming> msg #200 (1 remaining)] Read cmd -> Next
Aug 28, 2008 17:09 from Qwe
java.text.DateFormat is completely unknown to my tomcat6
java.text.SimpleDateFormat is found, and seems alright until it tries to execute the block of code that my parse testing is in.
tomcat logs vomit this:
ug 28, 2008 4:08:16 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Cannot find any information on property 'parse' in a bean of type 'java.text.SimpleDateFormat'
from my code of:
Code:
<jsp:useBean id="fmtDate" class="java.text.SimpleDateFormat" scope="page" />
. . . .
<%-- debugging --%>
<jsp:setProperty name="fmtDate" property="parse" value="$ (param.timeIn}" />
<%-- done debugging --%>
[Programming> msg #201 (0 remaining)] Read cmd ->
-=-=-=-=-=-
Hope this gives more of a clue of where I'm at...
TIA for any advice you can give or pointers in the right direction.
Damon Getsman
http://bbs.utopiadammit.com
ITrx