![]() |
|
|
|
|
1
20th November 22:41
External User
Posts: 1
|
I have a date being passed to a sub as a java string in the following
format: 2008-07-11 15:30:00.0 Does anybody know a simple method to turn this into a java.util.Date object so that I can access ouah.hours, ouah.minutes. ouah.seconds, ouah.month, ouah.date, ouah.year? I know it's a very basic question but I haven't been able to find anything worthwhile on google yet, and I have to keep working on this project now despite the fact that my texts on JSP/JSTL don't get here until Monday. I know that in Java it would be as simple as formulating a java.text.DateFormat.parse('string') or java.text.SimpleDateFormat.parse('string'), but I don't know how to do this from within my JSP. TIA ITrx http://www.lookupanyone.com/namelist...ew-getson.html Damon Getsman |
|
|
|
|
2
20th November 22:41
External User
Posts: 1
|
I have a date being passed to a sub as a java string in the following
format: 2008-07-11 15:30:00.0 Does anybody know a simple method to turn this into a java.util.Date object so that I can access ouah.hours, ouah.minutes. ouah.seconds, ouah.month, ouah.date, ouah.year? I know it's a very basic question but I haven't been able to find anything worthwhile on google yet, and I have to keep working on this project now despite the fact that my texts on JSP/JSTL don't get here until Monday. I know that in Java it would be as simple as formulating a java.text.DateFormat.parse('string') or java.text.SimpleDateFormat.parse('string'), but I don't know how to do this from within my JSP. TIA ITrx http://www.lookupanyone.com/namelist...ew-getson.html Damon Getsman |
|
|
|
|
3
20th November 22:41
External User
Posts: 1
|
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. ![]() -=-=-=-=-=- 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 Khelair Well after including java.text.Dateformat the following code is not working from within the jsp: <% inDate = java.text.DateFormat.parse(param.timeIn); outDate = java.text.DateFormat.parse(param.timeOut); %> ouah ouah ouah *feels eyelids grow heavy* [Programming> msg #199 (2 remaining)] Read cmd -> Next Aug 28, 2008 16:59 from Khelair Okay my guess at this point is that I have to use a <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 <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 Khelair 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: <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 |
|
|
4
20th November 22:41
External User
Posts: 1
|
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. ![]() -=-=-=-=-=- 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 Khelair Well after including java.text.Dateformat the following code is not working from within the jsp: <% inDate = java.text.DateFormat.parse(param.timeIn); outDate = java.text.DateFormat.parse(param.timeOut); %> ouah ouah ouah *feels eyelids grow heavy* [Programming> msg #199 (2 remaining)] Read cmd -> Next Aug 28, 2008 16:59 from Khelair Okay my guess at this point is that I have to use a <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 <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 Khelair 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: <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 |
|