• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts-ocnfig.xml

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In my struts-config.xml file, I have done a mapping (/city/introdcution) to invoke a forward path="citydetails.do".

when I do a request.getRequestURI() it gives me the path of citydetails.do

Is there any way to get the /city/introduction path from my request object or anyother related object.

Thanks,
Neeraj.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The forward name is something that Struts keeps track of, but once the page is displayed, all you know is the path name, and you lose all reference to the forward name that was used to call the URL.

It's complicated, but here's one way you could find it:

Get the ModuleConfig object. You can do this with the statement:
Once you have this object, you can get the array of ActionConfig objects using the findActionConfigs() method, and then in each action, get the array of ForwardConfig objects using the findForwardConfigs() method. By iterating through all these forwards, you could find the one that matches the path you want. If there's more than one forward that points to the same path, you're out of luck. There's no way to tell which of the two forwards was invoked.

The above assumes you only have one module. If you have more than one, the code would be different. I'm not sure what the differences are. You'd have to research it.
[ June 09, 2006: Message edited by: Merrill Higginson ]
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for the inputs. Will try it out and inform.

Thanks,
Neeraj.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic