• 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

Multiple Properties files in web.xml (Struts 1.0.2)

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

I need to use two different properties files in my struts project and im facing problem while configuring them in web.xml( im following struts 1.0.2 where the properties file configuration is made in web.xml instead of struts-config.xml)

i tried to use,

....
<init-param>
<param-name>application</param-name>
<param-value>ABCResources</param-value>
</init-param>

<init-param>
<param-name>application</param-name>
<param-value>XYZResources</param-value>
</init-param>
.....

where ABCResources and XYZResources are the names of my two different properites files which i have kept under classes folder.

But the above approach doesnt work and throws xml parsing error during server bootup (unmarshall exception)in weblogic 9.2 , I believe its mainly because of the duplicate 'application' entry.But the same approach worked fine in weblogic 8.1 . Please suggest if there is any work around for weblogic 9.2. Thanks
[ July 25, 2008: Message edited by: Siva Ramky ]
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Siva Ramky:
Hi,

In my project i need to use to different properties files and im facing problem while configuring them in web.xml( im following struts 1.0.2 where the properties file configuration is made in web.xml instead of struts-config.xml)



I never used Struts 1.0, but can you put those .propertise files in struts-config file using <message-resources parameter="MessageResources"/> tag and change your dtd definition to this :



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

Thanks for your post

I have already tried that approach by moving the properties entries to struts-config .. but there i encountered a different error as shown below..

<Servlet: "action" failed to preload on startup in Web application: "webapp".
javax.servlet.UnavailableException: Input/output error reading configuration from resource path /WEB-INF/struts-config.xml
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:278)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)


This is an age-old project which needs some enhancement now. Still im looking for a workaround.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I googled this topic and not find any great help .

The init-param are used to get application scoped values, with param-name as a parameter ,So you can change the param name to , say app1 and app2 and used in you application as parameter !
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't believe Struts 1.0.2 supports multiple properties files. If you want that feature, you will have to upgrade your project to at least 1.1.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic