gpt4 book ai didi

java - 如何使用 "Out.Format(Format,String Var)"错误 "The method format(String, String) is undefined for the type JspWrite"在 JSP 页面格式化字符串?

转载 作者:行者123 更新时间:2023-11-30 04:55:33 32 4
gpt4 key购买 nike

嗨,我正在尝试在 JSP 页面上格式化字符串,它给了我错误,正如我在标题中提到的,我的代码是,

    String header="";
header = 12-29-2011 15;
out.format("%0$s:00:00\n",header);

它会导致错误“JspWrite 类型的方法格式(String, String) 未定义”

希望得到您的建议

提前致谢!

最佳答案

我认为您需要使用 string.format()SimpleDateFormat 并使用 out.print() 打印结果。

关于java - 如何使用 "Out.Format(Format,String Var)"错误 "The method format(String, String) is undefined for the type JspWrite"在 JSP 页面格式化字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8676375/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com