Hi All,
(Many thanks for providing the XWIKI RC2 release)
I have created a servlet which return an XML document. The servlet was
placed in the WEB_INF/classes. So it work correctly but returns in some
situation strange content. According to my tests, the servlet code is
correct but the wrong content is maybe related to the cache.
First situation, the servlet:
----------------------------
- It open a connection to database (XWIKI databased)
- The servlet receive a parameter which is the name of an existing
XWiki document
- It send a SQL request for retrieving the content of the specified
document: select XWIKI_CONTENT FROM ...WHERE XWIKI_NAME = XXXX), XXXX =
is the full name of a document.
- According to the content of my XWiki database the SQL request return
only one document.
- Then it process the document and return an XML document
RESULT:
- I got a correct result = <?xml version="1.0"
encoding="UTF-8"?> + 'A' (whether I refresh the content in the
internet explorer the result is the same)
(the XML header + the content)
Another situation:
------------------
- It open a connection to database
- The servlet receive a parameter which is similar to the name
of a set of existing XWiki document
- It send a SQL request for retrieving the content of these documents:
select XWIKI_CONTENT FROM ...WHERE XWIKI_NAME like "%YYYY%"),
YYYY is 'string' for retrieving a set of documents
- The result is one document which is correct result according to
the content of my database
- It retrieve the content in an while loop
- process the the content
- return the XML document
Here the is JAVA code:
ResultSet st = .....;
String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
while (st.next()){
content = content + processContent(st.getString(XWD_CONTENT));
}
...
this.writeResponse(resp, content); // content is an XML
document
***
RESULT:
- First content (in the explorer) = <?xml version="1.0"
encoding="UTF-8"?> A (correct)
- When I refresh the explorer = <?xml version="1.0"
encoding="UTF-8"?> A A
- I refresh again the explorer = <?xml version="1.0"
encoding="UTF-8"?> A A A
...
- N refresh = <?xml version="1.0" encoding="UTF-8"?> A A
A ...A (N times)
(where A is the same content as the first situation)
The servlet was transformed to class with main method and it return
correct result...!!!
I have also made test under the last version 'XWIKI RC2' but got the
same problem.
Is it related to the cache memory?
I spend two days trying to solve it but without success....
Any help will be deeply appreciated.
Thanks in advance.
Cheers
----------
Youcef Bey