PDA

View Full Version : HTML problem in JSP page


brad211987
06-25-2007, 10:38 PM
I'm using an outside application to create charts and graphs, inside of my JSP page. This application takes parameters, creates a flash movie(the graph) and passes back a html fragment that you can display on your page to load the flash movie. My problem is, there is a '/' character in a path variable that needs to be removed from this fragment. For example:

<OBJECT width=600
height=300
classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0">
<param name=movie value="/charts_cache/46801A53-CACEDA20.swf">
<param name=quality value=high>
<EMBED src="/charts_cache/46801A53-CACEDA20.swf"
width=600
height=300
quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash">
</EMBED>
</OBJECT>

This is the html fragment passed back to the application. In both of these places:

<param name=movie value="/charts_cache/46801A53-CACEDA20.swf">
and
<EMBED src="/charts_cache/46801A53-CACEDA20.swf"

I need to remove the '/' before "charts_cache" for this to display properly in my application.

Does anyone have any ideas for plucking out that one character? I have the entire tag stored in a String variable. I tried to do String test = chartString.replaceAll("/charts_cache","charts_cache"); and then load the new string but it doesn't seem to be doing anything.

Aradon
06-26-2007, 12:41 AM
have you tried to do a substring on it?


"string".substring(0);

will take off the first character and return the rest.

javabits
06-26-2007, 12:45 AM
Well it looks like you're calling replaceAll correctly. So you must be doing something else wrong. Are you putting the string back. You may need to provide more information or show us the rest of your code.

Perhaps you should try:

chartString = chartString.replaceAll("/charts_cache","charts_cache");

semper fi...