的替代方案是允许更多格式的标签,如 BBcode 或 Wiki
我正在设计 JSP 应用程序,我想打印用户输入。我需要类似
标签的东西,但需要一个允许用户进行一些格式化的东西。
首先,我想将 \n
转换为
但我仍然需要所有 XML 转义
> 提供。然后我意识到允许更多的格式会很好,比如 BBcode 或 Wiki 语法。
有没有 JSP 标签库可以实现这一点?
I'm designing JSP application and I want to print user input. I'm in need of something like <c:out>
tag but then one that allows user to do some formatting.
To start, I want to translate \n
to <br />
but I still need all the XML escaping <c:out>
provides. Then I realized that it would be nice to allow more formating, like BBcode or Wiki syntax.
Is there any JSP tag library, which allows that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不使用 xml
http://www.java2s 创建您自己的标签.com/Code/Java/JSP/Createyourowntagacustomtagbody.htm
XML 文件:
然后编写一些您想要实现的 Java 代码!
例如对应上面标签的简单java代码示例:
why not create your own tags, with the use of xml
http://www.java2s.com/Code/Java/JSP/Createyourowntagacustomtagbody.htm
XML file:
And then you write a little java code of what you want to achive !
e.g. corresponding to tag above simple java code example:
您是否考虑过在需要的地方嵌入像 CKEditor 这样的东西?
http://ckeditor.com/demo
这是一个很棒的工具,但请确保许可证满足您的要求:
< a href="http://ckeditor.com/license" rel="nofollow">http://ckeditor.com/license
一个轻量级的替代方案是 TinyMCE:
http://tinymce.moxiecode.com/
Have you thought about embedding something like CKEditor where you need it?
http://ckeditor.com/demo
It's a great tool, but make sure that the license meets your requirements:
http://ckeditor.com/license
A lightweight alternative to this is TinyMCE:
http://tinymce.moxiecode.com/
您还可以考虑使用类似 wiki 的编辑器,例如 stackoverflow 中使用的编辑器:
http://wmd-editor.com/
You could also consider a wiki-like editor, like the one used here in stackoverflow:
http://wmd-editor.com/