« Return to Thread: Question about embedding

by smartkenny :: Rate this Message:

Reply to Author | View in Thread

Hi, Joe and all,

Sorry to bother you guys. I encountered a problem using DWR 3.0 M1 RC2,
the functionality of uploading files. In the remote method, I uploaded a
file, and try to return a html segment. In firefox, it throws this error:

Incomplete reply from server
Error: unterminated string literal
Source File:
https://localhost:8443/test/dwr/call/htmlcall/DWRAction.upload.dwr
Line: 5, Column: 37
Source Code:
try {
window.parent.dwr.engine._eval("dwr.engine.remote.handleCallback(\"1\",\"0\",{pages:{message:\"\\n\\n<script>alert(\\\"hello!\\\");

The returned html segment is generated by a jsp file:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<script>alert("hello!");</script>
<span style="font-weight:bold; color:red;">Succeed!</span>
<s:fielderror />
<s:actionerror />
<s:actionmessage />

I found that if the line <script>alert("hello!");</script> is removed,
then the invocation can succeed. I also tested without the <input
type="file">, it always succeed, whether it has the <script> or not.

My question is, does the htmlcall (DWR file upload) support returning
page segment which contains <script>? Why the marshalling process failed
in the response?


Thanks a lot.

Kenny


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Question about embedding