我该如何在 Java 中做到这一点? (一个带有一些java回调的博客)
我想构建一个基本上是一个博客的网站,其中包含一些自定义 java 代码,可通过服务器上的 ajax 调用运行。
我最初的想法是用 wordpress 或 drupal 或类似的东西构建博客,然后运行一个非常简单的 java web 应用程序来接收 ajax 请求。然而,由于没有 Java Web 应用程序的经验,我不确定是否有一个框架可以用于此类简单的任务。我也没有使用过 wordpress/drupal/etc 来了解集成这些 java ajax 调用是多么容易。
然后我想,也许我应该运行一些 Java CMS,而不是 drupal、wordpress 等。这应该可以让我轻松集成我的 ajax 挂钩。但同样,我没有使用任何 Java CMS 的经验,不知道哪种效果最好。
有一些 Java Web 应用程序经验的人可以给出建议吗?
I want to build a website that is basically a blog with a little bit of custom java code to be run via ajax calls on the server.
My initial thoughts were to build the blog in wordpress or drupal or something similar, then run a very simple java webapp to receive the ajax requests. However, having no experience with Java webapps, I am not sure of a framework made for such simple tasks. Nor have I ever used wordpress/drupal/etc to know how easy it would be to integrate these java ajax calls.
Then I thought, perhaps I should just run some Java CMS instead of drupal, wordpress, etc. This should allow me to easily integrate my ajax hooks. But again, I have no experience with any Java CMS's to know which would work well.
Can someone with some Java webapp experience give their recommendation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在两篇文章中第二次提出了相同的建议(!),但也许看看 Liferay 门户服务器的免费社区版?它在 Java 上运行(在 tomcat+mysql 上很容易),并包含博客和 CMS 以及其他功能。还可以选择修改源代码(根据许可证)以添加您的自定义行为。
Second time in two posts I have made the same recommendation (!) but maybe look at the free Community edition of Liferay portal server? It runs on Java (easy on tomcat+mysql) and has blogs and CMS and other features included. There is also the option of modifying the source code (subject to the license) to add your custom behaviour.
如果您要使用 Wordpress 或 Drupal,您究竟希望在 Java 中实现哪些在 PHP 中无法实现的功能?
WordPress 的设置相当容易。如果您有任何 Web 应用程序经验并且对 PHP 略知一二,那么您应该不会有任何问题。
Spring MVC 是一个相当简单的 Java Web 应用程序框架。您可以相对轻松地在 Google App Engine 上运行它,并且在线有大量文档/支持。
需要考虑的一件事是,您的 AJAX 调用需要对您的 CMS 所在的同一域进行。如果您要创建两个单独的 Web 应用程序,那么它们需要显示在同一域中。
不知道您的具体要求是什么,很难给出任何详细的建议,但我希望这对您有所帮助。
What exactly are you looking to do in Java that you couldn't accomplish in PHP if you were to use Wordpress or Drupal?
Wordpress is rather easy to setup. If you have any web app experience at all and minor knowledge of PHP then you shouldn't have any problems.
Spring MVC is a fairly straightforward Java web app framework. You can run it on Google App Engine with relative ease and there's a lot of documentation / support online.
One thing to consider is that your AJAX calls will need to be made to the same domain that your CMS is on. If you're creating two separate web apps then they need to appear to be on the same domain.
It's a bit difficult to give any detailed advice not knowing what your particular requirements are but I hope this helped a little.
我认为你不应该使用任何框架。只需创建一个 servlet 即可。因为即使你使用了框架,你仍然要了解servlet是什么。这些代码来自 Oracle 的 站点,修改doGet来进行您的处理。或者你可以将其更改为 doPost。
I think you shouldn't use any framework. Just create a servlet. Because even if you use a framework, you still have to understand what a servlet is. These code are from oracle's site, modify doGet to do your processing. Or you could change it to doPost.