• 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

init -param in struts-config.xml file ????

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i want to place some init param associated to the action class of my struts-config.xml? is to possible? like i wnat to give my dbjndi name in struts-config.xml file for that action class? if possible syntax will help.

Thanks
aziz
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no standard way to specify init argument to action class neither in action element nor in action-mapping element. as you know actions are beans and are constructed by default constructor

... you may wish to add init parameter to ActionServlet and retrieve it using 'getInitParameter("name")' you can always do that if it helps you.

if you are concern about dbjndi name you can use data-sources entries in struts-config.xml
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should you put those init parameter in web.xml instead of struts-config.xml? As seems there is no *place* for you to specify init param for a particular action.

In addition, the JNDI for database can be set in the data source tag:


HTH.

Nick
 
reply
    Bookmark Topic Watch Topic
  • New Topic