Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
java file
System
Hi,
I'm trying to access database values into the dcr through a java file called through the inline command. it works fine if the values in the database don't have "&" between 2 values.
it's erroring out if there is an "&" between 2 values. for eg: Trinidad & Tobago - gives an error with "&" .
How can i code in the java file so that "&" in the database values gets replaced with "and" , then the values are pulled into the dct?
Any immediate responses are greatly appreciated.
Thanks
Find more posts tagged with
Comments
Bill Klish
You should either encode the values when you return them, causing the & to be returned as & because the & is causing the HTML to be invalid in the templating window. There probably is an encoding / decoding routine you can borrow from some java class out there. If you want to just do a replace, there is a replace function in the Jakarta common string utils class on the apache.org site.
Another approach would be to use perl DBI/DBD and do simple regular expression replacement, but I am not sure if that is an option.