Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2941

Provide access to important Struts variables and constants so they could be easily used with JSTL

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Future
    • Component/s: Core, Tag Libraries
    • Labels:
      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jmikus@gmail.com Michael Jouravlev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: