<legend id='rNE82'><style id='rNE82'><dir id='rNE82'><q id='rNE82'></q></dir></style></legend>
    • <bdo id='rNE82'></bdo><ul id='rNE82'></ul>
    <i id='rNE82'><tr id='rNE82'><dt id='rNE82'><q id='rNE82'><span id='rNE82'><b id='rNE82'><form id='rNE82'><ins id='rNE82'></ins><ul id='rNE82'></ul><sub id='rNE82'></sub></form><legend id='rNE82'></legend><bdo id='rNE82'><pre id='rNE82'><center id='rNE82'></center></pre></bdo></b><th id='rNE82'></th></span></q></dt></tr></i><div id='rNE82'><tfoot id='rNE82'></tfoot><dl id='rNE82'><fieldset id='rNE82'></fieldset></dl></div>
  1. <tfoot id='rNE82'></tfoot>

      <small id='rNE82'></small><noframes id='rNE82'>

      需要在 Struts2 和 Spring 中实现 RESTful Web 服务

      Need to implement RESTful web services in Struts2 and Spring(需要在 Struts2 和 Spring 中实现 RESTful Web 服务)
        <bdo id='cK0dt'></bdo><ul id='cK0dt'></ul>
          <tbody id='cK0dt'></tbody>
        • <legend id='cK0dt'><style id='cK0dt'><dir id='cK0dt'><q id='cK0dt'></q></dir></style></legend>

              <tfoot id='cK0dt'></tfoot>
              <i id='cK0dt'><tr id='cK0dt'><dt id='cK0dt'><q id='cK0dt'><span id='cK0dt'><b id='cK0dt'><form id='cK0dt'><ins id='cK0dt'></ins><ul id='cK0dt'></ul><sub id='cK0dt'></sub></form><legend id='cK0dt'></legend><bdo id='cK0dt'><pre id='cK0dt'><center id='cK0dt'></center></pre></bdo></b><th id='cK0dt'></th></span></q></dt></tr></i><div id='cK0dt'><tfoot id='cK0dt'></tfoot><dl id='cK0dt'><fieldset id='cK0dt'></fieldset></dl></div>

                <small id='cK0dt'></small><noframes id='cK0dt'>

                本文介绍了需要在 Struts2 和 Spring 中实现 RESTful Web 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我目前正在开发一个基于 Strtus2、Spring、open JPA 和 LDAP 的 Web 应用程序.

                I am currently working on a web application that is based on Strtus2, Spring, open JPA and LDAP.

                现在客户希望我们为这个系统开发 RESTful api,以便其他网站或应用程序可以与它集成.

                Now client wants us to develop RESTful api for this system so that other websites or application can integrate with it.

                这项任务已分配给我,我显然不知道从哪里开始.

                This task has been assigned to me and I clearly have no idea from where to start.

                我做了研究发现,有一个插件 struts2-rest 并且对于 Spring 有几种不同的方法.

                I have done my research and found out that, there is a plugin struts2-rest and for Spring there are several different ways.

                除此之外,我看到的大多数示例都使用 Maven,但我们的项目没有使用它.

                More to that most of the example I have been seen are using Maven, but our project does not use that.

                所以,我只需要一个方向来开始这件事.

                So, I just need a direction to start this thing.

                推荐答案

                在 Struts2 中你可以通过 struts2-rest-plugin 实现 RESTful api.起点是 REST 插件.

                In Struts2 you can implement RESTful api via struts2-rest-plugin. The starting point is REST Plugin.

                假设你有一个普通的 Struts 2 应用程序,你需要做的就是这个 REST 演示是添加以下两个插件:

                Setting Up

                Assuming you have a normal Struts 2 application, all you need to do for this REST demo is to add the following two plugins:

                Struts 2 Rest Plugin
                Struts 2 Convention Plugin
                

                注意,您可以从 Maven Central 下载这些插件的 jars配置(struts.xml)

                Note, you can download the jars for these plugins from Maven Central Configuration ( struts.xml )

                只是将插件放入您的应用程序可能不会产生正是想要的效果.有几个考虑因素.这首先要考虑的是您是否想要任何非 RESTful URL与您的 RESTful URL 共存.我们将展示两种配置.这首先假设您想要做的就是 REST.第二个假设你想要在同一个 Struts 2 中保持其他非 RESTful URL 的活动应用.

                Just dropping the plugin's into your application may not produce exactly the desired effect. There are a couple of considerations. The first consideration is whether you want to have any non-RESTful URL's coexisting with your RESTful URL's. We'll show two configurations. The first assumes all you want to do is REST. The second assumes you want to keep other non-RESTful URL's alive in the same Struts 2 application.


                在 Home 的 Struts2 文档中,您将找到开始开发 Struts2 应用程序所需的一切.


                In the Home of Struts2 docs you'll find everything necessary to start developing Struts2 application.

                • Struts 2 Rest Showcase Webapp
                • 创建 java web 应用程序使用 AngularJS 和 Struts2
                • Struts 2 + REST Web 服务集成示例

                这篇关于需要在 Struts2 和 Spring 中实现 RESTful Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)
                        <tbody id='8SHnN'></tbody>
                      <i id='8SHnN'><tr id='8SHnN'><dt id='8SHnN'><q id='8SHnN'><span id='8SHnN'><b id='8SHnN'><form id='8SHnN'><ins id='8SHnN'></ins><ul id='8SHnN'></ul><sub id='8SHnN'></sub></form><legend id='8SHnN'></legend><bdo id='8SHnN'><pre id='8SHnN'><center id='8SHnN'></center></pre></bdo></b><th id='8SHnN'></th></span></q></dt></tr></i><div id='8SHnN'><tfoot id='8SHnN'></tfoot><dl id='8SHnN'><fieldset id='8SHnN'></fieldset></dl></div>
                      <legend id='8SHnN'><style id='8SHnN'><dir id='8SHnN'><q id='8SHnN'></q></dir></style></legend>

                      <small id='8SHnN'></small><noframes id='8SHnN'>

                        <bdo id='8SHnN'></bdo><ul id='8SHnN'></ul>

                        1. <tfoot id='8SHnN'></tfoot>