javascript - Unable to return an image stream using Struts2 Ajax (Dojo) -
using struts2 2.2.3, tomcat 7
i'm trying show personal profile information (name, address, etc. plus photo) individual dynamically when user selects name list. i'm having trouble returning , displaying photo when use ajax (dojo) calls.
some of photos held in db (and not in file), want return , display photos image stream. can return , display image stream (using action stream result) when send tomcat non-ajax request page containing this:
<img id="photo" src= "" /> <script type="text/javascript">document.getelementbyid("photo").src = "profilephotoaction?mynumber=" + new date().gettime();</script> the script gets executed, action found, , stream returned.
however, when trigger ajax request content includes above within sx:div, script not executed; i've tried 'executescripts' attribute of sx:div set both true , false.
i've tried build img tag in other ways well, example:
<img src= "<s:url action = "profilephotoaction"/>" /> this produces error: "could not find action or result /chhs/alumni/ there no action mapped namespace /alumni , action name ."
in case, '/chhs/alumni' correct prefix, appears dojo has somehow lost track of action name specified in s:url. i'm sure struts2 action specified , configured correctly (as stream result) since works in non-ajax case (see above).
any clues might overlooking appreciated.
Comments
Post a Comment