You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Thorne <je...@yahoo.com> on 2005/10/05 00:22:16 UTC

action class that responds to javascript request from another domain

I am trying to allow users of my site to incorporate some of my sites content in their blog. I am letting them paste the following code in their site:

 

<script type="text/javascript" src="http://mysite.com/blog/mypostings.jsp?id=23330"> </script>

 

I need my action class to send the following back to the javascript request.

 

 

document.write('<div id="posts"><ul><li><a href="http://mysite.com/service.jsp?post=21377" target="_blank">Post Title</a></li></ul></div>');

 

How can I set up an action class to do this. can this be done with an action forward?

 

Thanks for the help,

Jeff

 


Re: action class that responds to javascript request from another domain

Posted by Michael Jouravlev <jm...@gmail.com>.
http://struts.apache.org/api/org/apache/struts/action/Action.html#execute(org.apache.struts.action.ActionMapping,%20org.apache.struts.action.ActionForm,%20javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse)

Basically, take HttpResponse from execute() arguments, write to it,
and return null from execute().

Michael.

On 10/4/05, Jeff Thorne <je...@yahoo.com> wrote:
>
> I am trying to allow users of my site to incorporate some of my sites content in their blog. I am letting them paste the following code in their site:
>
>
>
> <script type="text/javascript" src="http://mysite.com/blog/mypostings.jsp?id=23330"> </script>
>
>
>
> I need my action class to send the following back to the javascript request.
>
>
>
>
>
> document.write('<div id="posts"><ul><li><a href="http://mysite.com/service.jsp?post=21377" target="_blank">Post Title</a></li></ul></div>');
>
>
>
> How can I set up an action class to do this. can this be done with an action forward?
>
>
>
> Thanks for the help,
>
> Jeff
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org