jsp页面EL表达式进行日期格式转化

EL表达式包括字符串处理,时间日期的格式化,数字处理 EL表达式的一些操作。包括字符串处理,时间日期的格式化,数字处理 立即下载

首先引入标签库

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

对date类型的数据进行格式转换:

 <fmt:formatDate value="${p.update_time}" pattern="yyyy/MM/dd"/>

如果获取的是字符串类型的:例如:2020-04-29 17:47:00.0
还要再引入另一个标签库

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

首先,将字符串截取,并且转换为时间格式:



<fmt:parseDate value="${fn:substring(list.newsday,0,16)}" pattern="yyyy-MM-dd HH:mm" var="test"/>   

其次,对date类型的数据进行格式转换:

<fmt:formatDate value="${test}" pattern="yyyy-MM-dd HH:mm"/>  
CNN经典论文(一)LeNet Gradient-Based Learning Applied to Document Recognition(梯度学习在文档识别中的应用) Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner 发表时间:December 1998 期刊:Proceedings of the IEEE 影响:世界上第一个卷积神经网络 论文地址:Gradient-Based Learning Applied to Document Recognition 阅读详情

相关推荐

【STM32CubeIDE入门】(一)工程创建&工程配置

​写在前面:如果是刚接触stm32cubeide的同学推荐与这一篇文章共同阅读,能够更加快速认识上手stm32cubeide。 1、打开stm32cubeide,选择好工作目录进入主界面后,点击创建工程。

涛涛子的博客 1万+

EL表达式格式化日期

在EL表达式中要显示“yyyy-MM-dd”格式的日期: 使用<fmt:>格式化标签 1 在页面上导入 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 2 格式化日期<fmt:formatDate value="${X...

weixin_34416649的博客 504

react-window 大数据列表和表格数据渲染组件之虚拟滚动

ReactWindow是一个高性能的React虚拟滚动组件库,专门用于高效渲染大型列表和表格数据。它通过“窗口化”技术,仅渲染用户可见区域的内容,大幅提升性能并减少内存消耗。主要特点包括:支持固定/可变大小列表项、多种布局类型(垂直/水平/网格)、轻量级设计(不足5KB)以及平滑的滚动体验。相比传统渲染方式,它能轻松处理成千上万条数据,并提供自动滚动、自适应容器大小等高级功能。与同类库相比,ReactWindow具有更简洁的API和更优的性能表现,是处理大数据量渲染场景的理想选择。

前端开发-前端技术分享 1136

el表达式中存的是String型的时间要格式化显示时间

' 如果上面不行的话,可以这样: 可以用将String 类型的el表达式转换为date型

fengbonianshao的专栏 1236

ffmpeg中av_read_frame阻塞的原因与解决方案

最近用到ffmpeg,想要av_read_frame立即返回,但是看网上的博客,都没有详细的解说,那就自己看源码。 两种方法: 设置回调打断函数和设置超时 超时,但是如果只设置该参数,依然会在av_read_frame中阻塞, av_dict_set(&inputDic, "stimeout", "2*1000*1000", 0); // milliseconds //打断回调 m_avformatCtx->interrupt_callback.callback = interru

weixin_43360707的博客 1万+

YooAsset 2.2.12四层加密架构:跨平台资源安全实战指南

AssetBundle加密是Unity热更新安全的核心环节,其本质是通过算法、密钥管理与生命周期协同实现资源全链路防护。传统方案常陷于‘打包后加密’的误区,导致内存开销大、跨平台兼容差、逆向防护弱。YooAsset 2.2.12提出打包层、传输层、加载层、运行层四层防护架构,将加密前置到资源序列化前,并依托BundleHeader实现动态算法协商与密钥分发,显著提升iOS/Android/WebGL三端一致性。该方案兼顾AES-128等通用算法与SM4等国密支持,同时通过IMemoryDecryptor实现

weixin_32428571的博客 416

小知识点(二)EL表达式格式化日期

在EL表达式中要显示“yyyy-MM-dd”格式的日期: 使用格式化标签     1 在页面上导入        2 格式化日期

bravemanzhou的专栏 591

Voxel Hashing技术解析:如何解决TSDF内存爆炸问题?

本文深入解析Voxel Hashing技术如何有效解决TSDF内存爆炸问题。通过动态内存分配和空间哈希函数设计,该技术将内存占用降低96.6%,同时保持高精度重建。文章详细介绍了GPU加速实现、现代系统演进及实践指南,为实时3D重建提供工程解决方案。

m2n3b4v5c6的博客 713

EL表达式中将英文日期在页面转换成中文格式日期显示出来

1.导入jstl标签库 2.转换日期并显示 3.总结 以上实现了在jsp中将英文日期格式显示为中文日期格式,方法比较简单,主要步骤是先引入jstl标签库,然后在body标签中使用fmt:formatDate标签将日期值添加进来就可以正常显示为中文的日期格式了。 谢谢帅哥美女们支持,有用就请评论、点赞或者收藏吧! ...

u013343897的博客 540

基于单片机直流电机调速控制系统设计

*单片机设计介绍,基于单片机直流电机调速控制系统设计。

2201_75940997的博客 2780

UE5Could not be compiled. Try rebuilding from source manually.

UE5Could not be compiled. Try rebuilding from source manually.

weixin_45417260的博客 2770

JSP页面用EL表达式 输出date格式

JSP页面用EL表达式 输出date格式    1、头上引入标签 2、 首先导入标签 http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> "/> value="${viewKq.srq}" EL表达式取的日期值 Pattern:输出的日期格式; 这样就可以把时间格式化

凯凯的专栏 3万+

python批量调用大模型API:多线程和异步协程

本文介绍了利用多线程技术批量调用大模型API的实现方法。核心是通过并发请求提高处理效率,主要采用线程池管理并发数量、结果聚合等技术。文章提供了一个完整的Python实现示例,包含APIBatchCaller类及其single_api_call和batch_call方法,详细解析了并发控制、错误处理等关键点,并给出了使用注意事项,包括并发数设置、重试策略和超时处理等。该方案特别适合IO密集型任务,能显著提升批量API调用的效率。

Cachel Wood的博客 759

JSP中的EL表达式的使用语法和隐式对象

概念 EL表达式:替换和简化jsp页面中java代码的编写 jsp页面默认支持EL表达式 让jsp页面不解析EL表达式 使原样显示: isELIgnored=“true” 忽略页面中所有的EL表达式 或 在$前加上转义字符\ 即代表忽略\符号之后的单个EL表达式 例:\${4>3} 语法:${ 表达式 } 用途 1、运算 ✧、算数运算符 + - * /或div %或mod 例: ${1+2...

"✧treasure mountain✧" 8248

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

jsp中用EL读取了数据库里面的时间,怎么设置格式显示的格式

jsp中用EL读取了数据库里面的时间,怎么设置格式显示的格式 首先导入标签 &lt;%@taglib uri=“http://java.sun.com/jsp/jstl/fmt” prefix=“fmt”%&gt; &lt;input type=“text” value="&lt;fmt:formatDate value="p.applyDate&amp;quot;pattern=&amp;quo...

weixin_38061311的博客 453

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

EL格式化日期

在EL表达式中要显示“yyyy-MM-dd”格式的日期:使用格式化标签    1 在页面上导入   http://java.sun.com/jsp/jstl/fmt" %>     2 格式化日期              Value :EL表达式取的日期值;

蜗牛天堂 2334

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

EL,OGNL两种表达式用处的不同

两者都是在服务器端执行的,JSP转化为servlet并编译为java文件,其中会把EL,OGNL,等解释出来,并返回给客户端。   OGNL表达式依赖于struts2标签,必须结合struts2标签使用,如: 但是查看信息这样是不行的,因为标签不是struts2标签 当然可以把它改为查看信息这样就行. 说明:中%{ }作用是告诉解释器,这之间的代码为OGNL表达式,这

ccecwg的专栏 481

EL表达式处理页面毫秒数

数据库存的是Date类型,页面取出后显示的毫秒数,因此需要在页面进行处理,格式化日期, ${item.createTime}"是从数据库取出的毫秒数,在页面进行格式化处理即可 ${item.name}

韩迎宾的博客 1420

EL表达式读取时间格式的处理

今天遇到这个问题,前台页面的时间格式不友好,需要修改为常见的格式。 传统来说,可以在后台解决,在后台sql语句进行insert或select时,可以对属性进行对应的处理。 但是在Hibernate框架下,后台已经用saveorupdate简单略过,除非修改Hibernate源码,当然这是个技术活,可行性不大。 所以前台的问题,只能前台处理了。 ${xxx.bb},我尝试用j

north hunter 6136

浅谈JSP

JSP在服务端被转化为java,本质也是Servlet。此时EL表达式也被解析,然后java输出HTML,单独的JS文件不会被解析,故EL表达式在其内部不起作用,相当于普通的字符串,由于JS被嵌套在页面中,可以使用全局变量。 El表达式: 1.访问bean属性:容器依次从pageContex,request,session,application中查找相应对

qq_35723795的博客 315

web开发 jsp页面4 format

文章目录formatformatNumber标签formatDate标签parseNumber标签praseDate标签例子 format 格式化动作标签 formatNumber标签 将数值型转换成指定格式的字符串 语法格式: <fmt:formatNumber value="<string>" type="<string>" var="<string>" scope="<string>"/> 常用属性: value:要格式化的数值

Sermisry的博客 585

036--EL表达式格式日期

1.字符类型间接转化:20171130082510格式成2017-11-30 &lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %&gt; &lt;td class="c"&gt; &lt;c:set var="approvalTimeVar" value="20...

weixin_42288943的博客 105

java jstl 时间格式_JSTL的时间格式化标签的使用

j2ee项目中的前台页面展示后台数据时,一般会使用el和jstl表达式,那么时间数据从后台取出时显示的是util.date类型的格式,怎么才能转为正常我们所看到的格式呢?下面是一些jstl中的 时间转化器:Library import and parameter capturing:uri="http://java.sun.com/jstl/core"%>uri="http://java.s...

weixin_30646295的博客 430

HttpSession的深入分析与研究

HTTP是无状态协议,这意味着每次客户端检索网页时,都要单独打开一个服务器连接,因此服务器不会记录下先前客户端请求的任何信息。 有三种方法来维持客户端与服务器的会话: 1.网络服务器可以指定一个唯一的session ID作为cookie来代表每个客户端,用来识别这个客户端接下来的请求。 这可能不是一种有效的方式,因为很多时候浏览器并不一定支持cookie,所以我们不建议使用这种方法来维持

qzp1991的专栏 1256

freemarker的${!}

${sss!}<#--没有定义这个变量,默认值是空字符串!--> 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 转自:https://blog.youkuaiyun.com/chang_li/article/details/51913105 在复杂页面上(包含大量判断、日期金额格式化)的页面上,freemarker的性能比使用tag和el的js...

weixin_34007291的博客 1857
上一篇: 个人博客开发第三天
下一篇: 个人博客系统第四天之pageHelper的使用
software_Manito
博客等级 码龄8年 6粉丝 90原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值