• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts2 properties file reload

 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i have in my struts.properties

also in my struts.xml

but when i make any changes to my global.properties file, it does not show any reflection on jsp pages, all i need is to reload my properties file.
i have gone thru the instructions form http://struts.apache.org/2.x/docs/devmode.html but i didnot understand what i am missing.
i have search entire coderanch for help, but not able to solve the problem.

any help would be appreciated.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,

i have found one link, where the properties files are reloaded each time you make any changes
http://www.nabisoft.com/tutorials/struts2/basic-struts2-project-setup

but i am not able to do so in my application.

please suggest me what i am missing.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put log4j in debug mode and check whether it is hitting to ConfigurationManager class or not on each and every request.

DEBUG ConfigurationManager:68 - Checking ConfigurationProviders for reload. Like this you can find the message in console.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohana Rao,

i have log4j.xml which is like

but it does not shows that properties file are reloading on every request, but my point is when i have "struts.i18n.reload=true" then why the properties file is not reloading on each request because as per the struts2 documentation i am correct.
what i am missing
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post your debug messages let me check what's going wrong.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohana,

my welcome.jsp is like

global.properites

welcome.java

struts.xml

struts.properties

log4j is already pasted above. when i make any changes to properties file, it does not show any changes in my application unless i compile and deloy the war. if you find what i am missing, do let me know.
here is the struts2 document link http://struts.apache.org/2.x/docs/devmode.html




 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which browser you are using? Because if you are using IE it will send the request to the action class if it's already requested trying to get the data from the cache. if you are using IE use ctrl + F5 to make a new request.

And once try this example http://struts.apache.org/2.2.1/docs/message-resource-files.html.

And try to declare in different level like package level class level.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohana,

i have checked using IE 7/8, FireFox5/6, Safari 5.1 and chrome, the problem remains the same.
also thanks for the link, but it seem like i have missing something.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post console messages and put log4j in debug mode.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,

i have tried all these but don't know what to do.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i was using struts 2.1.8.1, instead of this when i use struts 2.2.3.1, the problem is soved.
this issue is solved in the latest version of struts2.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic