简体   繁体   English

RESTLET从HTML页面获取参数

[英]RESTLET get parameters from HTML page

I want to develop an web application using RESTLET where i want to send arguments from jsp page. 我想使用RESTLET开发一个Web应用程序,在这里我想从jsp页面发送参数。 as far as server side code is concerned i have written resource classes in RESTLET. 就服务器端代码而言,我已经在RESTLET中编写了资源类。

But the main point is RESTLEt uses xml for communication, how can we communicate with RESTLET from jsp/html page. 但是要点是RESTLEt使用xml进行通信,我们如何从jsp / html页面与RESTLET通信。

RESTLET uses XML/JSON over HTTP and JSP/HTML are capable to do HTTP communication. RESTLET通过HTTP使用XML / JSON,并且JSP / HTML能够进行HTTP通信。 XML will basically go inside the body of HTTP messages. XML基本上会进入HTTP消息主体。 So there are no compatibility issues, simply follow any tutorial to learn about sending HTTP requests from JSP to your REST server. 因此,不存在兼容性问题,只需按照任何教程来学习有关将JSP中的HTTP请求发送到REST服务器的知识。

RESTlet can additionally return HTML (or any number of other formats) over HTTP if that is what you require to display, it could even be able to parse jsps to create the HTML with a little work. 如果您需要显示,RESTlet还可以通过HTTP返回HTML(或任何其他格式),它甚至可以解析jsps来创建HTML。 Basically at an initial level Restlet is largely format agnostic providing you with the HTTP protocol support. 基本上在初始级别,Restlet在很大程度上与格式无关,为您提供HTTP协议支持。 You communicate with the restlet server by passing HTTP requests in exactly the same way that you would from any HTML page to any other server generating the JSP. 通过与将HTTP请求传递到与任何HTML页面到生成JSP的任何其他服务器完全相同的方式传递HTTP请求,可以与Restlet服务器进行通信。 the exact details of how and when you need to do this will depend greatly on what you want to use it for, and how, do you want to use the traditional client server model or are you looking for AJAX queries? 如何以及何时需要执行此操作的确切详细信息在很大程度上取决于您要使用它的目的,以及如何,如何使用传统的客户端服务器模型,或者您正在寻找AJAX查询?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM