• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Custom Action Forward in Struts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

Is there any way we can use a custom forward in struts Action forward?

I have a senario where I am dynamically generating a URL in my action class, I have some logic which is executed in my action class to generate this dynamic URL.

This URL hits a new web address.

I tried to use return new ActionForward(path) but I guess struts puts a forward slash (/) before the path. Since the URL hits completly new web adderss (not related to my web application), I get a JSP error saying it couldn't find the page.

Any suggestions on this issue?
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the motive behind calling a different application?
Are you trying hit some servlet running on the URL and get the data? or simple forward?

In any case the custom forward will not help you. It will be altogether different solution. Please let us know what you want to achieve by calling an outside application.
 
Omi Kir
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am actually creating some dynamic crystal reports. These reports accept parameters passed through a URL to generate a custom report.

The crystal server is different, and the request URL looks something like this


I found the solution, I had to pass return new ActionForward(path, true)
By default struts redirects with in the application. we need to pass boolean true to redirect to actual path.

Find more about this in Struts API Doc
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic