Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Create a js file at web application startup  RSS feed

 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would i create a file called menu.js when the web application inits?
thanks nick
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create? As in, generate it under Java control using file I/O?
And if this is the case, I'm assuming that it is the triggering at web app start that's the question?
If so, I'd write up a servlet that creates the file to your liking and load it via the web.xml deployment descriptor.
Odd thing to be doing. Why do you need to generate the file at web app init? If you just need some dynamic content, it might be easier to use the JSP mechanism in your js file to effect dynamic JS content.
hth,
bear
 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an off the wall idea and I need to create several objects inside the application object at startup only
 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which tag do I assign it under the index or which one?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have an off the wall idea and I need to create several objects inside the application object at startup only

I'm confused as to what that has to do with Javascript.
bear
 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well I'm creating menus dynamically with js and then will change often so I decided to go the hard route. learn more
so what would be the answer to the above question about which tag do I use to designate the start up servlet.
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!