
stefan.telley
Is there a possibility to use Constant Values in JSP Pages with Java Bean or something like that?
My Problem is, that our customer has multiple Environments (Prod/Test/etc...). To prevent problems with Script Package deploying I would like to use Global or Company Constants to set the SOAP URL in the JSP. Right now I have to modify always the JSP's if I have deployed them on the environments.
Sure I could use predicates on event domain, but this is not really the solution as then I could not just export and import the ScriptPackage, as this is overwriting my predicates.
Thanks Stefan
0
Comments
Please sign in to leave a comment.
Stefan, you've got me stumped. I looked through my handful of jsp pages and I don't see any references to using any constants, global, company or otherwise. The documentation (here doesn't reference any specific methods for getting those constants.
With that said, you might check out the getRequestURL() and/or getServerName(). I'm pretty sure you have access to the "request" variable which is an HttpServletRequest object.
@kevinakey or @markkeisling might have additional insight
Hi Travis,
thank you for your answer. I was checking also the developer reference and I also didn't found any Bean which could help me in that. But I think this would be very helpfull, because you can do then configuration inside the application (xmatters) and do not need changing in any outside scripts.
I think I will check also with our contact at xMatters. If there is a solution I will put it in here.
@Travis no tagging is a bummer in this new community :-/
@Stefan, I seem to remember trying to do something like this at one point, although I looked through all of my custom JSP and I don't see anything. So that doesn't bode well, at least that I was able to find.
We do have something SIMILAR, but not exactly the same. Some of our scripts access the database directly (but if anyone asks they're using the plethora of web services that allow you to perform any function so database access isn't necessary)
So we have a DBConfiguration.jsp that is static in each environment. Then in our other scripts, it references that static page.
<%@ include file="DBConfiguration.jsp"%>
It isn't as clean as you're saying, but might help solve the issue?
Thank you Guys,
for these ideas. I will wait also for an answer from xMatters. If I get a solution I let you know.
Got an answer from xMatters. It is not supported to get out any Constant value (Global,Company/Event) into JSP Page.
They mention, that I should create a property.file and put all Environment specific Variables in there, as Mark already mentioned.
Thank you anyway.