• 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

-D option like when start a simple Java with init params

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i need to know if it is possible to use for JSP the same -D option like in java
java -Dtest=yes test
to set init parameters for JSP VM.
If yes how i can do this?
$Regards
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

IMO, it is NOT possible to use -D option for JSP's.
Sorry.....

regds.
- satya
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Makro,
Do you want to setup some common init params for your web appln? If so we can configure ...WEB-INF/web.xml file like this. Include <context-param> xml tag under <web-app> xml tag. This means, all <param-name>'s are globally known in ALL servlets and ALL jsps in this particular web application.
To grab this init param values in servlets/ jsps just write this code.
String value = getServletContext().getInitParameter("webmaster");
regds
maha anna
 
marko markovic
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would do as in java with -D attribut then when i use System.getProperty(test) get the value of this parameter that i set when i do the java ....
it is important to me know if this is possible and how if is?
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, although it is server-dependent. In the .bat file that starts the JVM, you simply add the -Dvar=value entry on that line.
If you are using Tomcat 3.x, you can set the TOMCAT_OPTS environment variable to "-Dvar=value" before running startup.bat. Tomcat 4.0 has a similar variable CATALINA_OPTS.
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
 
marko markovic
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's work Thanks a lot.
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic