Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
Struts taglib has many tags that encapsulate Struts/servlet constants/variables and expand them into plain HTML tags. As an example, take a look at <html:base> tag.
Consider the "home.jsp" page is located in directory "pages". Let us also consider that application context is defined as "myapp".
An <html:base> tag specified in home.jsp page will generate something like this:
<base href="http://myserver:8080/myapp/pages/home.jsp">
A suggested alternative to <html:base> tag would look like:
<base href="${pageroot}">
Another example, <html:link>.
Instead of
<html:link action="/myAction">My Action</html:link>
one would use
<a href="${contextroot}/myAction">My Action</a>
The benefits:
- Tag library can be simplified
- No need to support proper HTML attributes for different tags; why Struts should care whether HTML developed by a programmer is valid or not?
- The markup looks more like real HTML
- HTML editing software will not choke on custom tags
- No hidden meaning, no side effects, just plain old HTML.
Attachments
Issue Links
- relates to
-
STR-2197 [taglib] new tag to handle relation (html <link>)
- Open