Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get result page from remote struts action call

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I asked a similar question in another forum but now I think it is related to struts. If I have an existing web application, and I developed a new struts application in a separate .ear. On a page of the existing web application, can I make a link using complete URL to call the new struts application action and let the action return a JSP result page, then I append that JSP page to the current page (current page is in the scope of existing application) ? I don't know if this idea works, I know a action path call can take you to some new page, but here I am sort of looking to get the result page back from struts and plug in to the current EAR's web page. Does it work ?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax.

Back-end technology isn't relevant.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Ajax.

Back-end technology isn't relevant.


Thanks. I don't know Ajax. Do you mean Ajax can do this ?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Yes.


If We don't use Ajax, does it work ? for instance, can I just invoke the new struts application and append its JSP to the exisiting application's page without using Ajax. I want to know if this mechanism works. Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I *guess* you could use HttpClient or the equivalent to do this.

Seems like a really, really horrible idea.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe the <c:import> tag? I don't recall how it works.

In any case--this still isn't a Struts question.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Maybe the <c:import> tag? I don't recall how it works.

In any case--this still isn't a Struts question.


Thanks David for your information. You said couple of times this is not a struts issue. Let's assume <c:import...> works in the <c:import> tag's URL part I give
the url for this struts action. My question is ---

In struts.xml file, I can still simply do

<action name="..." class=".." method="..">
<result name="success" >success.jsp</result>
<result name="failure" >failure.jsp</result>
</action>

if it succeeds, remote application gets "success.jsp" otherwise gets "failure.jsp".

Correct ?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The back end does not care how the request is made, or where it comes from.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:The back end does not care how the request is made, or where it comes from.


I think I understand the meaning of your sentence. But I am not smart enough to inference out the second half ---- So, is the approach I said in my last thread correct ??
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you basically asking how to configure Struts 2 results?
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Are you basically asking how to configure Struts 2 results?


My question was indeed confusing, I know... Even myself is confused when I look at it again.
I was not asking the basic struts setting. I was just not feeling confident that kind setting would work for this type approach. I thought sometimes from one action we can set it to redirect another action, and so on, eventually to a JSP. So I was not sure finally the application that calls the struts will get the JSP. I was just not confident (or stupid), now I think it should be fine. No matter how many layers of forwarding, as long as it finally forward to a JSP, the calling end will get the JSP.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic