Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Define Constants

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to define my custom constants, not finding any link on how to do it - Anyone has any insight to it.

Also, how can I upload custom settings for different installations, say, Dev and Production, with each having it's own constants/settings.

Thanks!

Gurcharan
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Custom constants for what? If you want to allow user value changes keep them in a database.

I'm not sure how this is related to Struts yet.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gurcharan, This can be done if you are using Ant for building your application. Define custom values as place holders and in ant script replace these values with real one depends upon environment. Ant has its own task to replace it.

-Sunil
 
gurcharan singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:Custom constants for what? If you want to allow user value changes keep them in a database.

I'm not sure how this is related to Struts yet.



This is my first app with Struts. In past I'd worked with different framework in other programming languages, like, DJango where we can define different settings files and based on our installation (Dev, Prod) we used to refer the specific settings. So I was exploring do Struts provide this kind of freedom.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In general this kind of thing isn't really related to Struts itself, and would be handled via JNDI, property files, Spring, or compilation/execution properties.

If you have an example of the kinds of constants you're thinking about we might be able to help better, or direct you to a more appropriate forum.
 
gurcharan singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:In general this kind of thing isn't really related to Struts itself, and would be handled via JNDI, property files, Spring, or compilation/execution properties.

If you have an example of the kinds of constants you're thinking about we might be able to help better, or direct you to a more appropriate forum.



The settings can be - Whom to email in different mode, Don't send specific emails in dev mode, A specific set of validations need not to be performed if the installation is dev.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Custom Constant : the simple solution is Properties File[As David Suggested]
 
gurcharan singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the insight!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic