Re: No tag [format] defined in tag library imported with prefix [cms]

Antonio Cordeddu via opencms-dev <[email protected]> Wed, 20 Nov 2024 20:39:06 +0100
Newsgroups gmane.comp.cms.opencms.devel
Message-ID <[email protected]>
Hello Atle,

to format  a date you have to use the fmt library and the tag 
|fmt:formatDate.|

For example:

|<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<fmt:formatDate value="|${content.value.AddedDate}|" var="formattedDate" type="both" pattern="|yyyy-MM-dd HH:mm:ss|" />|

Kind regards
Antonio Cordeddu



On 20/11/2024 18:54, Atle Enersen via opencms-dev wrote:
>
> I have this code going:
>
> <%@ taglib prefix="cms" uri=http://www.opencms.org/taglib/cms %>
>
> <cms:formatter var="content">
>
> <div class="row rowpadding">
>
>   <div class="col-lg-12">
>
> <cms:format
>
>     value="${content.value.AddedDate}"
>
>     pattern="yyyy-MM-dd HH:mm:ss" />
>
>   </div>
>
> </div>
>
> </cms:formatter>
>
> It results in the following exception:
>
> javax.servlet.jsp.JspException: org.apache.jasper.JasperException: 
> /WEB-INF/jsp/offline/system/modules/org.enersen.core/formatters/enersenarticlesimple.jsp 
> (line: [21], column: [0]) No tag [format] defined in tag library 
> imported with prefix [cms]
>
>                 at 
> org.opencms.jsp.CmsJspTagInclude.includeActionNoCache(CmsJspTagInclude.java:366)
>
>                 at 
> org.opencms.jsp.CmsJspTagInclude.includeTagAction(CmsJspTagInclude.java:270)
>
>                 at 
> org.opencms.jsp.CmsJspTagContainer.renderContainerElement(CmsJspTagContainer.java:1636)
>
>                 at 
> org.opencms.jsp.CmsJspTagContainer.doEndTag(CmsJspTagContainer.java:601)
>
> The cms:format is at line 21. Anyone have any ideas?
>
> Alt godt/best regards, hilsen Atle Enersen.
>
> --
>
> Telefon: +47 48 06 31 71
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>

-- 
Logo
_______________________________________________
Coranto informatica di Antonio Cordeddu
Via Torricelli, 9 09047 Selargius (CA) - Italy
Phone: +39 070 8607521
Fax: +39 070 8607521
Mobile: +39 328 7552662
[email protected]
https://www.coranto.it
_______________________________________________

Dichiarazione di riservatezza: tutte le informazioni incluse in questa comunicazione sono destinate esclusivamente alla consegna e all'uso autorizzato da parte del destinatario identificato sopra.
Se Lei non è il destinatario previsto, tenga presente che qualsiasi uso, distribuzione o copia di questa comunicazione non è autorizzato e potrebbe essere illegale.
Se ha ricevuto questa comunicazione per errore, La preghiamo di avvisare immediatamente il mittente ed eliminare il presente messaggio.

Confidentiality Notice: All information included in this communication is intended solely for delivery and authorized use by the recipient identified above.
If you are not the intended recipient, please note that any use, distribution, or copying of this communication is not authorized and may be illegal.
If you have received this communication in error, please notify the sender immediately and delete this message.

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
https://lists.opencms.org/mailman/listinfo/opencms-dev