RE: nested tags
have you tried looking at the generated .java files? At worst you might be able to decompile the .class generated for this jsp -Original Message- From: luca [mailto:[EMAIL PROTECTED] Sent: 18 November 2004 13:45 To: Tag Libraries Users List Subject: nested tags Hallo, I have implemented a tag lib with some cases of nested cooperating tags. For ex: wall:img src=pix/cinema.gif alt=Cinema wall:alternate_img src=pix/cinema_big.gif test=${bool} / /wall:img wall:img src=pix/games.gif alt=Games wall:alternate_img src=pix/games_big.gif test=${bool} / /wall:img (complete example of usage: http://wurfl.sourceforge.net/java/coolmenu.php) My big problem is that I just found out this doesn't work on Weblogic 8.1 and, what's worse it does not produce any significant diagnostics in the weblogic logs. The JSP starts rendering and fails as soon as the second instance of the img tag is encountered. Error msg (in the browser window): {Exception in myjsp.jsp] null On Tomcat 4 it works no problem. Of course, I suspect that the problem could be due to different strategies that the two appserver employ to reuse tag instances, but I am not sure how I can fix this. I do have some instance variables (necessary to allow the two tags too cooperate), but I make sure they are initialized by doStartTag(). I attach the code of the two tags, if this can help... thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested tags
People, I fixed the problem. I'll post anyway the msg I was about to send to the list right before I relalized it was a banal NullPointerException that for some reason did not produce any diagnostics. This may be interesting for those who have similar problems in then future and to show how differently app servers may behave thank you Luca === Sorry to be a pain, but maybe someone has a clue about this absolute mistery with Weblogic and nested tags. First I created a minimal JSP with just two tags: wall:img src=/images/wbmp/categories.wbmp alt= wall:alternate_img src=http://server/categories.gif; test=${capabilities.gif} / /wall:img wall:img src=/images/wbmp/homeaccess.wbmp alt= wall:alternate_img src=http://server/odmpix/homeaccess.gif; test=${capabilities.gif} / /wall:img then I modified the taglib code to print messages the console to know the sequence on which doStartTag() and release() were invoked. In addition, I added messages along the way, such as (doStartTag() of alternate_img): System.out.println(still exist 10); //one and only one attribute at the time (apart from 'test' which is compulsory) int c = 0; if (!src.equals()) c++; if (!eu_imode_icon.equals()) c++; if (!ja_imode_icon.equals()) c++; if (!opwv_icon.equals()) c++; if (nopicture) c++; System.out.println(still exist 20); What I got in the console seems unesplicable. It's like if the tag was garbage collected while its code is running! img: doStartTag() setting src on alternate_img tag:http://server/odmpix/categories.gif alternate_img: doStartTag() still exist 10 still exist 20 still exist 30 forund parent img [EMAIL PROTECTED] still exist 40 still exist 50 test !src.equals() = true about to img.Src2(http://server/odmpix/categories.gif). img= [EMAIL PROTECTED] alternate_img: release() img: release() img: doStartTag() setting src on alternate_img tag:http://server/odmpix/homeaccess.gif alternate_img: doStartTag() still exist 10 alternate_img: release() img: release() The Alternative_img.doStartTag() code stops running in the middle of nowhere special and I don't get any diagnostics. Isn't that weird? what am I missing? Thanks Luca luca wrote: Hallo, I have implemented a tag lib with some cases of nested cooperating tags. For ex: wall:img src=pix/cinema.gif alt=Cinema wall:alternate_img src=pix/cinema_big.gif test=${bool} / /wall:img wall:img src=pix/games.gif alt=Games wall:alternate_img src=pix/games_big.gif test=${bool} / /wall:img (complete example of usage: http://wurfl.sourceforge.net/java/coolmenu.php) My big problem is that I just found out this doesn't work on Weblogic 8.1 and, what's worse it does not produce any significant diagnostics in the weblogic logs. The JSP starts rendering and fails as soon as the second instance of the img tag is encountered. Error msg (in the browser window): {Exception in myjsp.jsp] null On Tomcat 4 it works no problem. Of course, I suspect that the problem could be due to different strategies that the two appserver employ to reuse tag instances, but I am not sure how I can fix this. I do have some instance variables (necessary to allow the two tags too cooperate), but I make sure they are initialized by doStartTag(). I attach the code of the two tags, if this can help... thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested Tags Question
You can't use one tag as an attribute value for another tag... Quoting kalyan inuganti [EMAIL PROTECTED]: Hi, I have some thing like - c:choose c:when test='${registrationForm.dobYear != }' date:complete monthName=dobMonth dayName=dobDay yearName=dobYear dayValue=c:out value='${registrationForm.dobDay}'/ monthValue=c:out value='${registrationForm.dobMonth}'/ yearValue=c:out value='${registrationForm.dobYear}'/ / /c:when c:otherwise date:complete monthName=dobMonth dayName=dobDay yearName=dobYear / /c:otherwise /c:choose However, the value that is being passed to the date:complete tag for dayValue, monthValue, and yearValue are the exact strings eg. c:out value='${registrationForm.dobMonth}'/. If i print the same thing out on the page it prints the value. It looks pretty obvious to me that nesting the tags is blocking interpretation of the inner tag. Any suggestions please? Thanks, -kalyan -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested Tags Question
Would it work? c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ At 08:18 24/08/2004 -0400, you wrote: You can't use one tag as an attribute value for another tag... Quoting kalyan inuganti [EMAIL PROTECTED]: Hi, I have some thing like - c:choose c:when test='${registrationForm.dobYear != }' date:complete monthName=dobMonth dayName=dobDay yearName=dobYear dayValue=c:out value='${registrationForm.dobDay}'/ monthValue=c:out value='${registrationForm.dobMonth}'/ yearValue=c:out value='${registrationForm.dobYear}'/ / /c:when c:otherwise date:complete monthName=dobMonth dayName=dobDay yearName=dobYear / /c:otherwise /c:choose However, the value that is being passed to the date:complete tag for dayValue, monthValue, and yearValue are the exact strings eg. c:out value='${registrationForm.dobMonth}'/. If i print the same thing out on the page it prints the value. It looks pretty obvious to me that nesting the tags is blocking interpretation of the inner tag. Any suggestions please? Thanks, -kalyan -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested Tags Question
Yes. In that case, aux will be a page-scoped variable whose value is the result of trimming the string produced by the thevaluetag/ tag. Quoting Helios Alonso [EMAIL PROTECTED]: Would it work? c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ At 08:18 24/08/2004 -0400, you wrote: You can't use one tag as an attribute value for another tag... Quoting kalyan inuganti [EMAIL PROTECTED]: Hi, I have some thing like - c:choose c:when test='${registrationForm.dobYear != }' date:complete monthName=dobMonth dayName=dobDay yearName=dobYear dayValue=c:out value='${registrationForm.dobDay}'/ monthValue=c:out value='${registrationForm.dobMonth}'/ yearValue=c:out value='${registrationForm.dobYear}'/ / /c:when c:otherwise date:complete monthName=dobMonth dayName=dobDay yearName=dobYear / /c:otherwise /c:choose However, the value that is being passed to the date:complete tag for dayValue, monthValue, and yearValue are the exact strings eg. c:out value='${registrationForm.dobMonth}'/. If i print the same thing out on the page it prints the value. It looks pretty obvious to me that nesting the tags is blocking interpretation of the inner tag. Any suggestions please? Thanks, -kalyan -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested Tags Question
Guys - Thanks for the response but in the below example, c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ the othertag is literally taking the String ${aux} instead of its value. I do have rtexprvaluetrue/rtexprvalue for that particular attribute set. Any thoughts? Thanks --- Kris Schneider [EMAIL PROTECTED] wrote: Yes. In that case, aux will be a page-scoped variable whose value is the result of trimming the string produced by the thevaluetag/ tag. Quoting Helios Alonso [EMAIL PROTECTED]: Would it work? c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ At 08:18 24/08/2004 -0400, you wrote: You can't use one tag as an attribute value for another tag... Quoting kalyan inuganti [EMAIL PROTECTED]: Hi, I have some thing like - c:choose c:when test='${registrationForm.dobYear != }' date:complete monthName=dobMonth dayName=dobDay yearName=dobYear dayValue=c:out value='${registrationForm.dobDay}'/ monthValue=c:out value='${registrationForm.dobMonth}'/ yearValue=c:out value='${registrationForm.dobYear}'/ / /c:when c:otherwise date:complete monthName=dobMonth dayName=dobDay yearName=dobYear / /c:otherwise /c:choose However, the value that is being passed to the date:complete tag for dayValue, monthValue, and yearValue are the exact strings eg. c:out value='${registrationForm.dobMonth}'/. If i print the same thing out on the page it prints the value. It looks pretty obvious to me that nesting the tags is blocking interpretation of the inner tag. Any suggestions please? Thanks, -kalyan -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested Tags Question
For JSP 1.2 and earlier, rtexprvalue means an attribute can take an expression of the form %= ... % as its value. It's not until JSP 2.0 that the container provides the same level of built-in support for EL expressions. If you want to use EL expressions for attribute values in your own tags you have to handle it yourself and set rtexprvalue to false. See the following for an example: http://www.onjava.com/pub/a/onjava/2002/10/30/jstl3.html Quoting kalyan inuganti [EMAIL PROTECTED]: Guys - Thanks for the response but in the below example, c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ the othertag is literally taking the String ${aux} instead of its value. I do have rtexprvaluetrue/rtexprvalue for that particular attribute set. Any thoughts? Thanks --- Kris Schneider [EMAIL PROTECTED] wrote: Yes. In that case, aux will be a page-scoped variable whose value is the result of trimming the string produced by the thevaluetag/ tag. Quoting Helios Alonso [EMAIL PROTECTED]: Would it work? c:set var=auxthevaluetag//c:set othertag attibute=${aux}/ At 08:18 24/08/2004 -0400, you wrote: You can't use one tag as an attribute value for another tag... Quoting kalyan inuganti [EMAIL PROTECTED]: Hi, I have some thing like - c:choose c:when test='${registrationForm.dobYear != }' date:complete monthName=dobMonth dayName=dobDay yearName=dobYear dayValue=c:out value='${registrationForm.dobDay}'/ monthValue=c:out value='${registrationForm.dobMonth}'/ yearValue=c:out value='${registrationForm.dobYear}'/ / /c:when c:otherwise date:complete monthName=dobMonth dayName=dobDay yearName=dobYear / /c:otherwise /c:choose However, the value that is being passed to the date:complete tag for dayValue, monthValue, and yearValue are the exact strings eg. c:out value='${registrationForm.dobMonth}'/. If i print the same thing out on the page it prints the value. It looks pretty obvious to me that nesting the tags is blocking interpretation of the inner tag. Any suggestions please? Thanks, -kalyan -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested tags syntax
The JSTL tags have the ability to read the parameters. You need to sit down with the Spec or a decent book on JSTL. A couple of hours now will save you tons later. This will get the job done: c:set var=password value=${param.password} / R - Original Message - From: Mike Steigerwald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 20, 2003 10:08 AM Subject: Nested tags syntax Hi, all, I'm relatively new at tag syntax, and I'm struggling to 'nest' two attributes that must be quoted. I'm hoping this will be a simple question for the more experienced users. I'm trying to set a page variable to be equal to the value of a page parameter using the c:set and req:parameter tags. I haven't been able to figure out the correct combingation of quotes, brackets, and braces. Essentially, this is my best guess at setting the variable 'password' to the parameter of the same name: c:set value= req:parameter name='password'/ var=password/ Can anyone help me find the error in the above syntax? Many thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]