DEVFYI - Developer Resource - FYI

Why does the <html:link> tag URL-encode javascript and mailto links?

Struts Questions and Answers


(Continued from previous question...)

52. Why does the <html:link> tag URL-encode javascript and mailto links?

The <html:link> tag is not intended for use with client-side references like those used to launch Javascripts or email clients. The purpose of link tag is to interject the context (or module) path into the URI so that your server-side links are not dependent on your context (or module) name. It also encodes the link, as needed, to maintain the client's session on the server. Neither feature applies to client-side links, so there is no reason to use the <html:link> tag. Simply markup the client-side links using the standard tag.

(Continued on next question...)

Other Interview Questions