Yes, well, my concern is that we have duplicate code doing the same
thing.  I assume computURL was added after the code for ImgTag was
written, and then perhaps overlooked.

I changed the '&' to "&" in the ImgTag and my tests are now passing.

That sounds fine until you actually look at the test.

I use computeURL in my tests to verify that Tags are calculating URLs
correctly when using:
Map defined by name in any scope 
Map defined by name and property in any scope
Map defined by name in application scope 
Map defined by name and property in application scope
Map defined by name in session scope 
Map defined by name and property in session scope
Map defined by name in request scope 
Map defined by name and property in request scope


I don't believe refactoring it would help speed-wise, but I just hate
seeing duplicate code out there.


--
James Mitchell
Software Developer/Struts Evangelist
http://jakarta.apache.org/struts

"People demand freedom of speech to make up for the freedom of thought
which they avoid."
    - Soren Aabye Kierkegaard (1813-1855)




> -----Original Message-----
> From: Kris Schneider [mailto:[EMAIL PROTECTED] 
> Sent: Monday, March 10, 2003 11:13 AM
> To: Struts Developers List
> Subject: RE: RequestUtils.computeURL()
> 
> 
> Except that the doc for <html:img> says:
> 
> Renders an HTML <img> element with the image at the specified 
> URL. Like the link
> tag, URL rewriting will be applied automatically to the value 
> specified in src
> or page, to maintain session state in the absence of cookies. 
> This will allow
> dynamic generation of an image where the content displayed 
> for this image will
> be taken from the attributes of this tag.
> 
> So ImgTag already does URL rewriting, doesn't it?
> 
> Quoting James Mitchell <[EMAIL PROTECTED]>:
> 
> > That was my initial thought, but wanted to bounce it off a few other
> > people first.
> > 
> > 
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://jakarta.apache.org/struts
> > 
> > "People demand freedom of speech to make up for the freedom 
> of thought
> > which they avoid."
> >     - Soren Aabye Kierkegaard (1813-1855)
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: David Graham [mailto:[EMAIL PROTECTED] 
> > > Sent: Monday, March 10, 2003 10:28 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: RequestUtils.computeURL()
> > > 
> > > 
> > > >Is there any reason that any tag should NOT call computeURL when
> > > >evaluating a URL that needs a parameter of Map entries added?
> > > 
> > > computeURL also encodes the url with session information 
> which isn't 
> > > desirable for images.  Maybe ImgTag should just replace & 
> > > with &amp; itself 
> > > without calling computeURL.
> > > 
> > > David
> > > 
> > > _________________________________________________________________
> > > Protect your PC - get McAfee.com VirusScan Online  
> > > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> > > 
> > > 
> > > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: 
> [EMAIL PROTECTED]
> > > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> -- 
> Kris Schneider <mailto:[EMAIL PROTECTED]>
> D.O.Tech       <http://www.dotech.com/>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to