Current Position:Home > How to render custom JSP tags

How to render custom JSP tags

Update:11-30Source: network consolidation
Advertisement
We have our own custom JSP tag libraries (some of them extend the Struts tags, but many do not) and want those to render correctly in the design view.
Is that supported by NitroX Struts, or will it only work with built-in Struts tags?
If it is supported, how does one get NitroX to run the custom tags?

The Best Answer

Advertisement
It is possible to customize many aspects of the rendering of a custom tag. This is done using a combination of an M7 specific metadata, and standard css rules.
For example, you can change the label, icon and border of a custom tag by doing the following steps:
1) Create a folder named "nitrox" where your tld file is located. For example if you have "/WEB-INF/app.tld" then create a
folder "/WEB-INF/nitrox/".
2) In the nitrox folder created above, create a file named "app.tlei" (for Tag Library Extra Information). The file name used here should match the name of the tld file. In this case "app".
3) Paste the following content in the app.tlei file:
<taglib-extrainfo>
<css-uri>app.css</css-uri> <!-- an optional css file relative to this tlei file -->
<tag name="myTag">
<display-name>My Tag</display-name> <!-- The name displayed in the Tag Libraries view -->
<rendering-label>{tag-name} ({name})</rendering-label> <!-- This will display the value of the "name" attribute in addition to the tag name in the tag view in the JSP design editor. -->
<small-icon>images/myTag.gif</small-icon> <!-- The image uri relative to this tlei file. This is used in the Tag Libraries view and in the JSP design editor.-->
</tag>
</taglib-extrainfo>
All customization tags are optional.
4) Create the css file referenced from the tlei file above (in this example app.css in the same directory containing the tlei file).
5) Paste the following content in the app.css file:
myTag {border: 1 solid red; display: "inline"}
This will render the tag as inline (i.e as one graphical object) even if the tag has nested content.
In addition, you can use any standard css style property.
You can customize other tags in the same fashion.
If a custom tag inherits from a Struts tag, then the tag can inherit the full built-in tag customization as shown in the following example:
Suppose you have a tag named "myText" that extends the Struts html:text form field tag. To inherit the NitroX html:text customization you follow the steps:
1) insert the following in the tlei file described above:
<tag name="myText">
<inherit taglib-uid="http://jakarta.apache.org/struts/tags-html" tag-name="text" />
</tag>
2) Insert the following css rule in the css file referenced from the tlei file:
myText {m7-inherit: "input-text"; display: inline}
This will inherit the built-in css style for form text fields.
Likewise, you can inherit the other Struts tags css styles by using the following rules:
myPassword {m7-inherit: "input-password"; display: inline}
myCancel {m7-inherit: "input-submit"; display: inline}
myCheckbox {m7-inherit: "input-checkbox"; display: inline}
myRadio {m7-inherit: "input-radio"; display: inline}
mySelect {m7-inherit: "select"; display: inline}
myTextarea {m7-inherit: "textarea"; display: inline}
3) The inherited tag library file (in this example the struts-html.tld), must also be present under the WEB-INF directory.
M7 Support
  • How to render custom JSP tags Update:11-30

    We have our own custom JSP tag libraries (some of them extend the Struts tags, but many do not) and want those to render correctly in the design view. Is that supported by NitroX Struts, or will it only work with built-in Struts tags? If it is suppor

  • Problems in developing custom JSP tags Update:10-11

    I have problems in debugging custom JSP tags. Sometimes the doStartTag is not called on tags but the doEndTag is called. I don't know why. Thanks.Fahr-- A word of caution -- NetUI did not ship a JSP tag SDK in 8.x, and we're making no compatibility g

  • Custom JSP Tags for Weblogic Update:10-11

    Hi,           I have several questions regarding this topic:           1) Does Weblogic 5.1 supports Custom Tags ? If so, are there any known           problems ?           2) Does Weblogic come with any tag libraries (for loops, if, etc) and where  

  • Problems with custom JSP Tag, can someone offer some advice? Update:11-30

    Greetings, I have a problem here that I am stumped on. I am trying to create a custom JSP tag, I created a simple "Hello World" JSP, however, I am coming up a bit short. I am running Apache Tomcat 6.0 on a Win XP environment. The code I have is

  • Error compiling expressions in custom JSP tags Update:11-30

    We had the same problem and we have found the same solution. Not to nice.           Jan           Here is what I have set up: custom.jsp: <%@ taglib uri="/WEB-INF/tlds/mytags.tld" prefix="my" %> <!-- <%@ taglib uri="my

  • Error with custom JSP tags Update:11-30

    Firstly, thanks for any assistance. The problem I'm facing is that I am using this open source tag library in WebLogic Platform v8.1.5 and it is showing an error when viewed within Workshop. The problematic custom tag was underlined in red by Worksho

  • How to pass a server side value to an attribute of a custom jsp tag Update:11-30

    Hi All: I needed to passed an integer value from the following code: <%=ic.getTotalNumOfRecords()%> to an attribute of a custom tag <inquiry:tableClaimHistory numberOfRecords="5" dataAction="claimHistoryViewData.do" emptyKey=&

  • Custom jsp tags Update:10-11

    Is ther anyway to get a custom tag to accetp ${variableName} syntax instead of <%= variableName %>? Im working with a DynaValidatorForm and the form values don't seem to be accessible via <%= %> calls. If there is no other way ot getting varia

  • Unable to add Custom JSP 1.2 Tag Library to Project Update:11-30

    I am trying to upgrade to a newer version of JDeveloper (10.1.3.0.4) but am having a problem with projects that use custom JSP tag libraries. After converting the project (.jpr) files to the new version, I double click and go to "JSP Tag Libraries.&q

  • Problem with boolean attribute of JSP tag Update:10-11

    Hi, I've being trying to use a custom JSP tag, which has a boolean attribute, declared in the TLD as follows: <attribute> <name>checked</name> <required>false</required> <rtexprvalue>true</rtexprvalue> <type>