2013年9月26日星期四

el expression is a String type saved time to format the display time how to get ?

I el expression is a String type saved time , so with struts and fmt tags are required I have is date type,

from a sub- type of the background , then I this project may not be feasible because the entity is not used directly in a table check out all the data are on the list of

I do not know there is no other way ?
------ Solution ---------------------------------------- ----

<% @ taglib prefix = "fmt" uri = "http://java.sun.com/jstl/fmt"%> < fmt: formatDate value = "$ {dateStr}" pattern = "yyyy-MM-dd" /> '
------ Solution ---------- ----------------------------------
this line !
------ For reference only -------------------------------------- -



java small script slightly
------ For reference only ------------------------------ ---------
the time to format it , use that simpleDateFormate
------ For reference only ----------------- ----------------------
absolutely no problem
------ For reference only ---------- -----------------------------

fmt I tried, no, I el inside the string type , he being given . .

Serious : Servlet.service () for servlet action threw exception
javax.el.ELException: Cannot convert 20110523 of type class java.lang.String to class java.util.Date
------ For reference only ---------------------------------------

I check out the result is not good to go backstage conversion, with a small script , then there can not put el expressions as parameters .
------ For reference only -------------------------------------- -
guide who knows what ah.
------ For reference only -------------------------------------- -
can sprinkle a look fmt tag specific usage I have forgotten
------ For reference only - -------------------------------------


landlord , you can use it. Should be given to me.
------ For reference only -------------------------------------- -
formatting tags will not work on the use of Chinese script manually implement . . . . . Like upstairs .
------ For reference only -------------------------------------- -

If only the date , say, 20110709 script that cut on the line, but if it is then also include the date of the how to get a specific time ?
example: 20110709 ( There followed a string of numbers ) have to put into the figures behind the 24-hour show how to do ?
------ For reference only -------------------------------------- -

see you take the median , so on the line, you should be able to tie the knot .
------ For reference only -------------------------------------- -
seeking advice ah.
------ For reference only -------------------------------------- -
characters interception !
------ For reference only -------------------------------------- -
use js solution recommended
------ For reference only ----------------------------- ----------
first with hidden Take your time in reading this page
then read characters in JS into time , ready () {} written to the page
------ For reference only ------- --------------------------------
Date type can be used only fmt tag
------ For reference only --------------------------------------- < br> Date type can be used only fmt tag
how your landlord needs and normal is reversed. Usually put Date into String bar.
you can get String, generated in the background the format you want , front displayed directly on the line, how to turn went to reception format it.
------ For reference only -------------------------------------- -

+ + according to the way upstairs to try
------ For reference only ------------- --------------------------
landlord is pojo class it ?
Or this
/ / Auto- generated
public date getToday ()
{
return this.doday;
}
/ / append
public string getToday4Str ()
{
/ / convert the data into a string
retuen str;
}

/ / front desk
$ {todat4Str}
------ For reference only ------------------------------ ---------
custom el expression method on
------ For reference only ---------------- -----------------------
custom label it
------ For reference only ------ ---------------------------------
seeking to use jquery segmentation method .
------ For reference only -------------------------------------- -
background in relation to type of discharge Date
If the background is of type String , then the first directly into the foreground in the background somehow not finished
------ For reference only ---------- -----------------------------


I also want to like this, but this project is directly thrown into the list check out all of the inside .

I also do very tangled . Not so good in the background, turn up, turn it is to have two sets , then traverse it on the page do not know how traversed .
------ For reference only -------------------------------------- -
------ For reference only ------------------------------- --------


fmt tag must el data is date type, I was a String . Not to mention the background conversion ,

jquery segmentation can find a solution.
------ For reference only -------------------------------------- -

trouble you believe in and I can talk about it ?
mainly if you call js method , then, have to take a time parameter , this time parameter is read out of the el loop form . So I do not know how to do it.
------ For reference only -------------------------------------- -
submit the form when calling a js way to put that date string into Date type , and then submitted to the background !
------ For reference only -------------------------------------- -
original can be like this.
fmt tag is not directly an expression of type String el formatted time ( I was told this above )

But nobody told me how you can use the String type el expression into a date type ?



------ For reference only ---------------------------------------
  This reply was moderator deleted at 2012-09-10 16:04:54

------ For reference only ---------------------------------- -----
Good ! Also solved my problem.

没有评论:

发表评论