Apache Tomcat, Servlet, AJAX
来源:互联网 发布:山东博达网络 编辑:程序博客网 时间:2024/05/21 19:22
Apache Tomcat
The Tomcat server does what a regular web server does while also providing an environment for running Servlets, such as JAVA classes, that can receive web requests and generate web responses.
Servlet variables
A servlet is instantiated by Tomcat once at the start of the web application. All incoming requests go to the same servlet. So some variables will take all requests the servlet has received.
Request/Response
The servlet is handed a HttpServletRequest and HttpServletResponse that are used to obtain information about the request and to send back to a response.
Parameters from the request can be accessed; and session information can be accessed.
Session information can be used to identify subsequent requests coming from the same user.
Response can have a variety of types including HTML, XML and JSON. A response may also be a redirection to something else.
AJAX
Asynchronous JavaScript with XML:
HTML or XHTML and CSS for presentation
DOM for dynamic display and interaction with data
XML for interchange of data: not required, could use JavaScript Object Notation (JSON), or simply pre- formatted HTML or plain text
XSLT(Extensible Stylesheet Language Transformation) for manipulation and display of data: only used if using XML as well
XMLHttpRequest object for asynchronous communication
JavaScript (or VBScript) to combine all of above.
AJAX info
Ajax: A new approach to Web Application
XML Matters: Beyond the DOM
Ajax for Java developers: Build dynamic Java applications
Ajax for Java developers: Java object serialisation for Ajax
Synchronous vs Asynchronous
The classic (non-AJAX) model is synchronised with user activity, while AJAX model decouples user activity.
jQuery and JSON web request
The getJSON call is asynchronous; the callback is called when the valid response is received from the server. Be careful is generating more than one outstanding call at a time. If the response is not valid JSON then the callback will not be called.
JSON at the servlet
The JSON request can be handled in the Servlet as a normal request.
The response is JSON formatted.
Drawbacks to AJAX
harder to develop than static pages
not automatically registered in browser history: there are workarounds such as changing the URL fragment identifier(after the #)
makes it difficult to bookmark a state of the application
asynchronous behaviour not obvious to users
not as easy to access for web crawlers
incompatible browsers require fall-back to non-AJAX variation
cross domain access is currently restricted
may significantly increase number of requests to server.
- Apache Tomcat, Servlet, AJAX
- apache,tomcat,servlet概念整理
- Apache Tomcat 5.5 Servlet/JSP 容器
- Apache Tomcat 5.5 Servlet/JSP 容器简介
- The Apache Tomcat 5.5 Servlet/JSP Container
- Tomcat,apache,web服务器,servlet,jsp
- Apache Tomcat 5.5 Servlet/JSP 容器
- Apache,tomcat整合以后,servlet无法解析
- 构建Apache Tomcat 6.0 Servlet/JSP 容器
- 基于tomcat的Ajax + servlet的实现
- tomcat-servlet-AJAX最基础例子
- Apache Tomcat 5.5 Servlet/JSP 容器安装 TOMCAT
- 关于TOMCAT APACHE整合后的servlet应用!
- Apache Tomcat 5.5 Servlet/JSP 容器----中文简介
- Tomcat 清理资源org.apache.commons.fileupload.servlet.FileCleanerCleanup类
- Apache Tomcat(二)Web应用:Servlet、JSP及其他
- apache和 tomcat,jsp,servlet之间是什么关系
- Running The Apache Tomcat 8.0 Servlet/JSP Container
- 字符统计
- Discuz!所有版本通杀 存储型XSS 0day
- android学习_配置启动虚拟机
- myeclipse 8.5安装aptana插件
- C# 代码结构-大小写的区别
- Apache Tomcat, Servlet, AJAX
- make[1]: *** [/usr/local/pcre//Makefile] Error 127
- hdu 4090 bfs+dfs+状态压缩+hash判重
- Uva - 1416 Warfare And Logistics dijkstra维护..题目范围有误..
- 静态和非静态方法
- 警告: Error setting expression 'schance.chc_status' with value '[Ljava.lang.String;@13e6346'
- hdu 1237 简单计算器
- IE核心不支持JSON.parse方法
- Android中的请求码与结果码