scala、spring 和 scalate
我有一个用 scala、spring、sitemesh 和 jspx/jstl 编写的 Web 项目。问题出在 jspx 上。我一直遇到问题,它希望类型是 java 集合类型,所以我必须继续在 scala/java 集合之间进行转换。有时我会忘记,我的观点会爆炸,等等。
我想知道是否有一篇博客文章描述了如何/从 jsp/jstl/jspx 迁移到 scalate?因为否则的话,切换起来似乎有点难以承受,不管现在我认为 jspx 有多烦人。
I have a web project written in scala, spring, sitemesh, and jspx/jstl. The problem is with the jspx. I keep running into issues where it wants the types to be java collection types and so I have to keep converting between scala/java collections. And sometimes I forget, and my view blows up, etc.
I'm wondering if there's a blog post out there somewhere that describes how/what's involved to migrate from jsp/jstl/jspx to scalate? Because otherwise it just seems a bit overwhelming to switch, no matter now annoying I think jspx is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,所以我冒险尝试一下,只是想看看整个事情是如何运作的。事实证明这相当容易。以下是任何感兴趣的人的步骤:
Maven pom 依赖项:
mvc-servlet.xml:
然后我重命名了一些 jspx 并开始翻译代码。为了访问模型对象,我在我的诈骗文件顶部执行此操作:
然后我只是按照诈骗文档进行操作。超级简单。唯一尴尬的是尝试放入内联 javascript...它抱怨缩进或其他问题。所以我把它移到一个单独的文件中。
根本不必删除 sitemesh(但将来只要我准备好就可以删除),并且我可以在闲暇时迁移 jspx 文件。再简单不过了。
Ok so I took the plunge and just tried to see how this whole thing works. It turns out to be fairly easy. Here's the steps for anyone interested:
Maven pom dependencies:
mvc-servlet.xml:
Then I renamed some jspx and started translating code. To get access to model objects I do this at the top of my scaml file:
Then I just followed the scaml docs. Super easy. The only thing that was awkward was trying to put inline javascript...it complained about indentation or something. So I moved that out to a separate file.
Didn't have to remove sitemesh at all (but I can in the future whenever I'm ready), and I can migrate jspx files at my leisure. Couldn't be easier.