• 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

Accessing param in Struts.xml Action Mapping

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to access the param property in url tag... plese see the following code for details...

<s:url action="manageModules" id="getModules" namespace="/secure" method="getModules">
<s:param name="page">modulesList.jsp</s:param>
</s:url>

<s:a href="%{getModules}" theme="ajax" targets="mainContainer" cssClass="menuTbLink" indicator="loadingImg" showLoadingText="false">
<div class="menuTb">Modules</div>
</s:a>

I want to access the moduleList.jsp param in above jsp code to my struts.xml file to forward to a jsp page as follows

<action name="manageRoles" method="{1}" class="secure.ManageModule">
<result name="success">/view/${page}</result>
</action>

But it does not work. So can you please help me ?

Thanks

Rahul

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Here what does method="{1}" mean?? You've not used wildcard mapping in your action. The result seems to be fine to me, it will use the property named page in your action to decide the success mapping of this action. Everything that you need to know in this regard is covered in action configuration, wildcard mapping and result configuration...
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Ankit,

Thanks for reply...

{1} represents the method name which we have received through the id in url tag...

My action is executed successfully, but i didn't get the JSP page.

Thanks

Rahul
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But like he said, you're not using wildcard mapping, so that won't work (and I wouldn't like it anyway).

Does your action have a "page" property? Is the HTML rendering as you'd expect?

This seems like a really klunky way to do things, though.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Extremely Sorry for Late Reply....

It's working now... I have forgotten to add property to my Action....

Thanks

Rahul
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic