Problem using tags as an attribute for other tags.

Hi there,
I'd like to know if there is a way to use a tag as an attribute for an other tag.
Exemple :
<user:testparent param="<user:param param='1' />" >
When doing so, the value of param is <user:param param='1'/>, and not the value that should be returned by the <user:param /> tag.
Is there a way to use the value returned by this tag as a parameter ?
With text, the correct value returned by the tag is used, so I guess it's possible to do so with custom tags.
Thanks.

Okay, here is an example of the process...
I have this Class that acts as the parent to all the tags that I use:
package net.thelukes.steven.scriptbits;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
//Other Imports ...
public abstract class ScriptBitsTag extends BodyTagSupport  {
     public int doAfterBody() throws JspException {
          return TagSupport.SKIP_BODY;
     public int doEndTag() throws JspException {
          return TagSupport.EVAL_PAGE;
     /* All subclasses of ScriptBitsTag should call super.doStartTag()
      * at the begining of their own doStartTag();
     public int doStartTag() throws JspException {
          initAttributes();
          return TagSupport.SKIP_BODY;
     public abstract  void setAttributeValue(String attributeName, String attributeValue);
     public abstract String getAttributeValue(String attributeName);
     /* Use this method to initialize attributes at the start of tag execution */
     public abstract void initAttributes();
     //...So, for example, I will have a sb:slidingFrame tag that looks like this:
package net.thelukes.steven.scriptbits;
// Imports...
public class SlidingFrameTag extends ScriptBitsTag {
     private java.util.Map<SlidingFrameAts,String> attributes =
               new java.util.EnumMap<SlidingFrameAts,String>(SlidingFrameAts.class);
     public int doStartTag() throws JspException {
          super.doStartTag();
          //... Do initialize here
          return TagSupport.EVAL_BODY_INCLUDE;
     public int doEndTag() throws JspException {
          //... Do work that depends on nested parameter values here...          
          return TagSupport.EVAL_PAGE;
     //Normal setXXX methods for attributes... <sb:slidingFram windowID="..." >
     public void setWindowID(String name) {
          windowName = name;
     //Do What should happen when nested tag does its work...
     //     <sb:slidingFrame><sb:attribute .../></slidingFrame>
     //For me, just put values in proper place in map...
     public void setAttributeValue(String name, String value) {
          SlidingFrameAts attrib = SlidingFrameAts.valueOf(name);
          if (attrib == null)
               return;
          else if (attrib == SlidingFrameAts.useDefaultStyleSheet)
               this.setUseDefaultStylesheet(Boolean.valueOf(value));
          else if (attrib == SlidingFrameAts.offX)
               attributes.put(attrib, value);
          else {
               nonDefaultInit = true;
               attributes.put(attrib, value);
     public String getAttributeValue(String name) {
          return attributes.get(SlidingFrameAts.valueOf(name));
     //Set Default values for all attributes.
     public void initAttributes() {
}So now I have a tag that is designed to be nested inside ScriptBitsTags and provide attributes for them:
package net.thelukes.steven.scriptbits;
//includes
public class ScriptBitsAttributeTag extends BodyTagSupport {
     private String attName = null;
     private String attVal  = null;
     //Normal set methods for in tag attribes: <sb:attribute name="..." value="..."/>
     public void setName(String name) {
          attName = name;
     public void setValue(String value) {
          attVal = value;
     public int doEndTag() throws JspException {
          //If value not set yet, it should come from the tag's body
          //<sb:attribute name="...">Some Value</sb:attribute>
          if (attVal == null) {
               if (bodyContent != null && bodyContent.getString() != null) {
                    attVal = bodyContent.getString().trim();
               } else {
                    //If not found in body, then use empty string for value...
                    //(or some appropriate value....)
                    attVal = "";               
          setAttribute();
          return TagSupport.EVAL_PAGE;
     //Assign the attribute to the this tag's parent.
     private void setAttribute() {
          ScriptBitsTag parentTag =
               (ScriptBitsTag)TagSupport.findAncestorWithClass(this, ScriptBitsTag.class);
          parentTag.setAttributeValue(attName, attVal);          
}The TLD has the SlidingFrame tag look like this:
  <tag>
    <description>Sliding Menu Window</description>
    <display-name>SlidingWindow</display-name>
    <name>slidingWindow</name>
    <tag-class>net.thelukes.steven.scriptbits.SlidingFrameTag</tag-class>
    <body-content>jsp</body-content>
    <!-- attributes available for in tag sb:slidingFram windowID="..." for example -->
    <!-- set required to false to allow the attribute to be set by sb:attribute tag -->
  </tag>The rest of the tld is pretty standard... In my JSP I then have:
<sb:slidingFrame windowID="sliding_frame">
  <%-- Attribute Set for this sliding frame --%>
  <sb:attribute name="speed">
    <c:out value="${sessionScope.speedV}"/>
  </sb:attribute>
  <%-- Content of the sliding frame --%>
  Menu Item A<br/>
  Menu Item B<br/>
  Menu Item C<br/>
  <hr/>
  Menu Item A<br/>
</sb:slidingFrame>In this case, instead of doing:
<sb:slidingFrame speed="<sb:attribute value='whatever'/>">I nested the attribute tag between sb:slidingFrame's open and close tag. You have to make sure that any work you want to do that depends on the value of speed is done in the doEndTag so as to make sure it occurs after the nested tag does its work.

Similar Messages

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • Escape attributes for hidden tags

    Hi all,
    We have a migrated app that created escape attributes for some hidden tags.
    ie.
    <jato:hidden name="stBeginningCommission" fireDisplayEvents="true"
    escape="true" /> <br>
    Looking at the jato.tld and the code for HiddenTag.java, the escape
    attribute isn't one that get used for hiddens.
    We did a quick clean up and removed the attribute from the JSP but I though
    I might be worth a mention for future releases.
    It's interesting is tomcat 3.2.1 allows this and 3.2.3 does not.
    Kostas
    org.apache.jasper.compiler.CompileException:
    C:\apps\jakarta-tomcat-3.2.3\webapps\ras\ras\voyager4\pgVoucherOffTheTopNew.
    jsp(473,4) Attribute escape invalid according to the specified TLD
    at
    org.apache.jasper.compiler.TagBeginGenerator.validate(TagBeginGenerator.java
    :170)
    at
    org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:119
    [Non-text portions of this message have been removed]

    Dude,
    How was the holiday? Hope you had a great time. I see iRise have
    you busy again.
    Things are going well over here with bug fixing and the new work, so
    I'm ultra busy...that life. Give me a shout if you are in my part of
    town again, and we can sink a few JDs.
    Harry
    ______________________________ Reply Separator _________________________________
    Subject: [iPlanet-JATO] RE: escape attributes for hidden tags
    Author: kmorfis (kmorfis@i...) at unix,mime
    Date: 25/08/01 02:26
    I take everything back.
    The tag was originally a text field. It was changed after translation to a
    hidden without removing the attribute.
    Kostas
    -----Original Message-----
    From: Kostas Morfis
    Sent: 8/24/01 6:14 PM
    Subject: escape attributes for hidden tags
    Hi all,
    We have a migrated app that created escape attributes for some hidden
    tags.
    ie.
    <jato:hidden name="stBeginningCommission" fireDisplayEvents="true"
    escape="true" /> <br>
    Looking at the jato.tld and the code for HiddenTag.java, the escape
    attribute isn't one that get used for hiddens.
    We did a quick clean up and removed the attribute from the JSP but I
    though I might be worth a mention for future releases.
    It's interesting is tomcat 3.2.1 allows this and 3.2.3 does not.
    Kostas
    org.apache.jasper.compiler.CompileException:
    C:\apps\jakarta-tomcat-3.2.3\webapps\ras\ras\voyager4\pgVoucherOffTheTop
    New.jsp(473,4) Attribute escape invalid according to the specified TLD
    at
    org.apache.jasper.compiler.TagBeginGenerator.validate(TagBeginGenerator.
    java:170)
    at
    org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java
    :119)
    [Non-text portions of this message have been removed]
    [email protected]
    Visit our website at http://www.ubswarburg.com
    This message contains confidential information and is intended only
    for the individual named. If you are not the named addressee you
    should not disseminate, distribute or copy this e-mail. Please
    notify the sender immediately by e-mail if you have received this
    e-mail by mistake and delete this e-mail from your system.
    E-mail transmission cannot be guaranteed to be secure or error-free
    as information could be intercepted, corrupted, lost, destroyed,
    arrive late or incomplete, or contain viruses. The sender therefore
    does not accept liability for any errors or omissions in the contents
    of this message which arise as a result of e-mail transmission. If
    verification is required please request a hard-copy version. This
    message is provided for informational purposes and should not be
    construed as a solicitation or offer to buy or sell any securities or
    related financial instruments.

  • OS is Mountain Lion, upgraded no problems, used an external Hard drive for my time machine, now my iPhoto will not show any of my photo's or ay new ones I import! Help please!!

    OS is Mountain Lion, upgraded no problems, used an external Hard drive for my time machine, now my iPhoto will not show any of my photo's or ay new ones I import! Help please!!

    Do you get this window when you hold down the Command+Option keys and launch iPhoto?
    If not then you're not holding down both keys long enough.
    OT

  • Download attribute for anchor tag in HTML 5 mozilla browser

    There seem to no download attribute for anchor tag been implemented in Mozilla Firefox ... neither desktop nor mobile version for android.
    can seem to download a file generated via javascript with correct name .....it saves with garbage name and with .part extension.
    Will it be implemeted in the future ....

    ''thak123 wrote:''
    Will it be implemeted in the future ....
    See the following link for details.
    * [https://bugzilla.mozilla.org/show_bug.cgi?id=676619 Bug 676619] - Implement proposed download attribute
    If you want a particular feature or fix to be implemented, vote for it instead of commenting on the bug report. See [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla etiquette].

  • Anyway to use the 24" iMacs screen for other computer?

    Anyway to use the 24" iMacs screen for other computer?
    I´d like to hook up another computer to the 24" iMac. I know there´s no hardware way since it´s integrated but maybe by using some magic box over usb or something and a bit of software?
    I´m looking to use it under Windows running Bootcamp.

    See this user tip:
    http://discussions.apple.com/thread.jspa?threadID=1587927

  • Problem Using JSQL level 4 driver for SQL Server 2000

    I am having problem , connecting to my Sql Server 2000 ( deployed on Windows 2000 Professional) using Microsoft JSQL level 4 Deriver .
    I am doing it with following code,
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
         Connection conn = DriverManager.getConnection
    ("jdbc:microsoft:sqlserver://192.168.0.232:1433;databaseName=DBNew;user=nakhter;Password=java;");
    It gives me following Exception ,
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'nakhter'. Reason: Not associated with a trusted SQL Server connection.
         at com.microsoft.jdbc.base.BaseExceptions.createException Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSLoginRequest.processReplyToken(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java:517)
         at java.sql.DriverManager.getConnection(DriverManager.java:177)
    I am usign my windows authentication usrname and password .
    I has tried it with user "sa" but still same exception .
    Could someone help me in this regard ?

    You need to switch SQL server to just use SQL Server authentication or both. The problem is that it is looking for a Windows NT account for nakhter with the password java. We get this all the time on new SQL Server installs if you just take the defaults.

  • Problems using MBP as WiFi router for iPad2 (self-assigned IP address)

    H/W& S/W:
    MBP 15" (model early 2011), running Snow Leopard,
    iPad 2 WiFi only, 64Gb, iOS 4.3.4 (8K2).
    Scenario:
    I am in a location where there is no WiFi. MBP is connected via Ethernet to a DSL network, and has access to the Internet. I turn on Internet sharing, having set the following:
    "Share your connection from" set to "Ethernet" and
    "Share computers using Airport" ticked.
    Previously, I have then connected the iPad 2 via WiFi with the WiFi network created on the MBP, and succesfully worked from the iPad on the Internet (email, browsing, app downloads, ...).
    Problem:
    Now, however, the iPad connects to the MBP's WiFi network, but when I attempt to access the Internet, I get such messages on the iPad  as "Safari is not connected to the Internet" or "Cannot Get Mail ...".
    On investigation, I see that Airport on the MBP is in a YELLOW status: Status On, with the note "Airport has the self-assigned IP address 169.X.y.z, and will not be able to connect to the Internet".
    On the iPad, the WiFi network shows the IP address 169.X.a.b (with a subnet mask (255.255.0.0).
    I have tried:
    1. turning Airport off and on
    2. renewing the DHCP lease on the MBP
    2. configuring IPv4 address in the MBP manually
    3. configuring the IP address manually on the iPad (not expecting anything with this, but ....)
    4. fixed Permissions" on the MBP disk (suggested on another support community web site)
    But none of these make any difference.
    Message was edited by: WKH
    forgot to mention: Firewall is disabled on the MBP.

    Hello,
    I've had the exact same problem on my macbook and it really **** me off ! I tried all of the solutions written in this forum and none worked for me ! I was really starting get mad especially that my macbook is quite new...
    And the thing is i have no Apple Store where i live which is a pretty F***g problem so I had to wait for vacations to go to france where I took my macbook for check at the apple store...
    I just came back right now and my wifi works till now a least far much better than before...The guy was really nice he checked everything and he tried all the solutions on this forum too..Finally he tried to boot from one of '' apple's '' usb that has suberb booting systems...And it worked so finally he re-installed 10.6.5 as it was '' corrupted '' with wifi bugs ! For that he needed to delete everything on my macbook ! GREAT !
    After 15 minutes the installation was done and it started like when you buy a new macbook !
    And VOILA the Wifi came back to normal !
    Hope this helps...
    If you have this problem go and see Apple Store or re-install yourself 10.6.5 !
    Thanks !

  • Using my TM backup disc for other files

    The help file for TM suggests you shouldn't use your TM backup disc for anything else.
    Can anyone tell me why this is? If I have a very large backup disc, what is the downside of storing stuff on it other than the TM backup?
    Thanks

    You can make a separate partition for the other stuff, but you'll need another way to back that up. 
    See #3 in  Time Machine - Frequently Asked Questions.

  • Tag Libraries : multiple classes for same tag

    Hi ,
    I have a tag library like this
    <tag>
    <name>process</name>
    <tagclass>packagea.page1</tagclass>
    <attribute>
    <name>name</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    I have 15 tags like this with the same 'process' name but ofcourse different tagclass files (corresponding to 15 different PAGES)
    Now, while the container encounters the tag on any PAGE (all the tags on all the PAGES will have the same prefix 'process'), how will the container know which class file to pick from out of the 15 different class files ???
    does this happen sequentially or is there some mechanism of caching within the container ... ??

    probably it takes the first, if it's not throwing an exception about it. You should have 1 tag library and multiple tags which should have separate names, not separate tag libs with 1 tag each.

  • How can I get the attributes for this tag?

    THis is the tag:
    <InvoiceQueryRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK">
    But when I do a nodeType() is returns a "1" which is Element. Shouldn't it return Attribute type?
    org.w3c.dom.Document xDoc = xml.parseXML(false);
    Element el = xDoc.getDocumentElement(); //Using DOM API
    NodeList nl = el.getElementsByTagName("InvoiceQueryRs");
    NodeList nl = el.getChildNodes();
    for(int c = 0; c < nl.getLength(); c++) {
    System.out.println(nl.item(c).getAttributes());
    This code returns a "com.ibm.xml.dom.NamedNodeMapImpl@88f03c" for the attributes. I also tried a NamedNodeMap with similar results. Please help if you can!
    THanks
    Bill

    Nevermind, I got it. Thanks.

  • Using Tags, Can i Search for Multiple Tags in One Search Folder?

    Hi forum,
    i would like to set a Search Folder and search using Tags. I would liek to use one such folder and search for everythign i haver tagged last week. How cna i search for 'TAG A' and 'TAG B' in one Search Folder?

    Hi mumbles2701,
    All you need to do is to briefly type in your tag in the search bar and in the drop down menu, you should be able to select a tag, press enter and just repeat this process for as many tags as you like
    Hope I helped!

  • Problem using Aperture as external editor for Photoshop CS5...

    I am having trouble using Aperture as my external editor for Photoshop - if, for example, I select twenty photos and choose "edit in photoshop CS5," for some reason or another, only ten or twelve photos will show up. Some photos are always missing, and there seems to be no rhyme or reason to it. Has anyone else noticed this? It is really frustrating and slowing my workflow down immensely. Any words of advice would be greatly appreciated!

    Hi Casey.
    First lets make sure we have the flow going the correct way.  You are using Aperture, and use PSCS5 as your external editor (external to Aperture).  Right?
    Second, what size are your Masters?  When you use PS directly (not calling it from Aperture) do you regularly open twenty files at a time?
    My Masters are about 25 MPix each.  PS sizes them in the 140 MB range.  Opening twenty of them at once -- for me that's about 3 GB of data -- will probably bog things down.  Does the problem occur if you open just, say, five at a time?  What's your hardware?  How do you have PS set-up?
    And -- my top suggestion for improving your work rate: do in Aperture as much of the work as you can, and send out to PS as little as possible.  You don't say what kind of work you are doing, but Aperture, for many, suffices for almost all of there photograph processing needs.
    Message was edited by: Kirby Krieger -- some minor changes.

  • I'm connected to the wifi at home but no internet access. i was surfing on the same wifi without any problems. and also this issue is for other wifi network.

    hello everyone.
    i was surfing browsing and downloading on my iphone 4 on my home wifi and other places without any problem but today i found out that even though i'm connected to my wifi i got no internet access. i also got this new problem, my led flash is on.  if i tilt the device the flas dims a bit. i tried switching off the device but still the flash is on. i tried using at other wifi network same problem. i tried forget this network, switching off and turning on the device i also tried reseting the network and also hard reseting the device. but still same problem. what can i do about this? and if i send it to apple what are my options? i got warrant coverage so will they be able to repair it ? if they are not able to repair then will they give me new iphone 4 or refurbished iphone 4 for replacement?

    Apple does not repair devices.  If they are covered under warranty, the device is replaced.  You will not get a new phone, you will get a service unit which is as good as if not better than new.
    If all the basic troubleshooting from the User's Guide has been done and the device does not get Internet access via Wi-Fi from multiple locations, the only thing left is to take it to Apple.

  • I have problem using your your VI written for Qnet DCMC

    Hi,
    I am using Qnet DCMC. I just Installed the harware and it works fine. The VI written for position control is aslo working but there is a problem with the VI written for speed control. (lab 01).  When I open the VI for lab01, some parts of the file like "parameter estimation" tab doesn't load into the main VI.
    I just notice that the VIs are written for labview 8 but I am using labview 8.2 . is the problem because of version mismatch ?
    Regards
    Reza Sharif i

    Hey Reza,
        Where did you get these VIs that were written for the Qnet DCMC?  Were they available within our Instrument Driver Network?  I am having trouble locating them myself, so if you could provide me with additional information, I'd love to help out.
    Brian B
    Field Sales Engineer
    Tennessee/Southern Kentucky
    National Instruments

Maybe you are looking for

  • Is there a wifi connection bug in iOS 5.0.1?

    Read the details of my experience in this earlier post of mine, so far unanswered: https://discussions.apple.com/message/17118638#17118638 I'd only like to add that I connected my iPod Touch 3rd gen (32GB) to my own home encrypted wifi (WPA-TKIP) jus

  • HELP - Placing a Multiple Page PDF

    I need help some help for a large job I'm doing at work. You may need to have print shop experience to answer this question or be good at scripting... These pdf's have already been created and are 7"x8.5". I am placing them on a landscape legal size

  • IPod classic and iHome problems...again

    After downloading 1.0.3, my 80G classic worked fine with iHome for app. a week. Now, for some reason, it's reverted back to the old problem. I set my alarm to wake to the iPod, which plays for app. 5 seconds, then iHome changes to the beeping alarm.

  • SBO Mailer, message fails to be sent

    Hi, I try to send invoices via SBO Mailer... the message appears in my SENT ITEMS (in Messages/alerts overview), but with a red X, meaning that there is an error while trying to send the message.  When I try to send messages without attachments, it w

  • Exchange 2010 Hybrig configuration removal

    Our Exchange environment currently consists of an Exchange 2003 and Exchange 2010 SP3 hybrid server. We were looking at moving all mailboxes from our Exchange 2003 server to Office 365 via the Exchange 2010 Hybrid server. Due to business decisions, w