This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Return from Action to a non-jsp Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Return from Action to a non-jsp Page" Watch "Return from Action to a non-jsp Page" New topic
Author

Return from Action to a non-jsp Page

Dajin Sulman
Greenhorn

Joined: Apr 28, 2003
Posts: 11
Hey there,
I got a small problem to figure out:
I want my struts action to send dynamic-generated xml content to an application that just understands HTTP. My problem: Action-classes need a "return forward" to a jsp-Page, but I need to return the generated xml-file to that application.
What do you suggest? Extend Struts? How? Dump Struts and write a controller myself?
Any hints, links etc are really appreciated right now I am clueless about the best approach
Thanks!
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

You are under the wrong impression about the Struts forward. Yes, the framework needs to return an ActionForward from the execute() method but the ActionForward is a logical mapping so it can be mapped to any resource you need it to be mapped to; it is not limited to JSPs. In the mapping, set the path attribute to whatever resource you need to forward to generate the XML.


Junilu - [How to Ask Questions] [How to Answer Questions]
Dajin Sulman
Greenhorn

Joined: Apr 28, 2003
Posts: 11
Thanks a lot!!
Those misconceptions could cost one's head....
 
jQuery in Action, 2nd edition
 
subject: Return from Action to a non-jsp Page
 
Similar Threads
Getting duplicate records when the page refreshes.
Migrating Application - From Struts with AJAX to JSF with AJAX
Converting JSP to XML
Error!!!! Need Help Urgent[INFO] PropertyMessageResources - -Initializing, config=
Problem refreshing page