Changeset 11:267cce6b9d77
- Timestamp:
- 05/28/09 23:12:19 (16 years ago)
- Author:
- František Kučera <franta-hg@…>
- Branch:
- default
- Message:
-
Servlet pro zpracování AJAXových požadavků.
- Location:
- java/sql-vyuka
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r10
|
r11
|
|
22 | 22 | <h2><fmt:message key="blok.zadavani"/></h2> |
23 | 23 | <div class="vnitrekBloku"> |
24 | | <form action="#"> |
| 24 | <form action="#" name="aplikace"> |
25 | 25 | <fieldset> |
26 | | <textarea id="vstupniPole" rows="100" cols="1000"><fmt:message key="vychozi.sql"/></textarea> |
| 26 | <textarea id="vstupniPole" name="vstupniPole" rows="100" cols="1000"><fmt:message key="vychozi.sql"/></textarea> |
27 | 27 | <button class="zobrazitHistorii" |
28 | 28 | name="zobrazitHistorii" |
-
r8
|
r11
|
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> |
| 3 | <servlet> |
| 4 | <servlet-name>Servlet</servlet-name> |
| 5 | <servlet-class>cz.frantovo.sql.vyuka.ajax.Servlet</servlet-class> |
| 6 | </servlet> |
| 7 | <servlet-mapping> |
| 8 | <servlet-name>Servlet</servlet-name> |
| 9 | <url-pattern>/ajax</url-pattern> |
| 10 | </servlet-mapping> |
3 | 11 | <session-config> |
4 | 12 | <session-timeout> |
… |
… |
|
8 | 16 | <welcome-file-list> |
9 | 17 | <welcome-file>index.jsp</welcome-file> |
10 | | </welcome-file-list> |
11 | | </web-app> |
| 18 | </welcome-file-list> |
| 19 | </web-app> |
-
r10
|
r11
|
|
28 | 28 | **/ |
29 | 29 | function getSQL() { |
30 | | return document.getElementById(vstupniPole).innerHTML; |
| 30 | return document.aplikace.vstupniPole.value; |
31 | 31 | } |
32 | 32 | |
… |
… |
|
68 | 68 | function ajaxVykonatSQL() { |
69 | 69 | if (ajax.readyState == 4 || ajax.readyState == 0) { |
70 | | ajax.open("GET", 'vysledek.html', true); |
| 70 | ajax.open("POST", 'ajax?akce=vykonat&sql=' + encodeURIComponent(getSQL()), true); |
71 | 71 | ajax.onreadystatechange = vykonatSQLVypis; |
72 | 72 | ajax.send(null); |
… |
… |
|
87 | 87 | function ajaxZobrazitHistorii() { |
88 | 88 | if (ajax.readyState == 4 || ajax.readyState == 0) { |
89 | | ajax.open("GET", 'historie.html', true); |
| 89 | ajax.open("POST", 'historie.html', true); |
90 | 90 | ajax.onreadystatechange = zobrazitHistoriiVypis; |
91 | 91 | ajax.send(null); |