Re: Conditional formatting elements of a collection in c:forEach
On Wed, Feb 11, 2009 at 8:53 AM, Rashmi rashmi@gmail.com wrote: Hello everyone, I'm trying to display a list of items in a collection using JSTL. Each item in the collection has x, y, z and id variables. The user can choose whether he wants the display order (of the items in the collection) to be 1) x y z 2) z y x As far as I know the display ordering can be accomplished in two ways: 1) as shown in the code snippet below, create two different loops for each display format. The drawback with this approach is that a lot of the common stuff is duplicated between the two loops. 2) Have a c:choose , selection within a single loop, which decides between the two formats. The drawback is that the the same condition checking repeats for each loop iteration. Is there a way to set the formatting outside the loop , and use that format in the loop to address the two drawbacks above. Assuming you have a resource bundle around somewhere, add two format strings to the bundle, one for each of your two display orders; use a condition ('when', 'if' or whatever) to set a variable with the appropriate key; then use that variable to specify the key to fmt:message within your loop. -- Martin Cooper %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % html head title/title /head body c:choose c:when test=${param.listBy == 'xFirst' } c:forEach var=item items=${requestScope.items} ${item.x} ${item.y} ${item.z} a href=/show?id=${item.id}show item/a a href=/edit?id=${item.id}edit item/a a href=/delete?id=${item.id}delete item/a /c:forEach /c:when c:otherwise c:forEach var=item items=${requestScope.items} ${item.z} ${item.y} ${item.x} a href=/show?id=${item.id}show item/a a href=/edit?id=${item.id}edit item/a a href=/delete?id=${item.id}delete item/a /c:forEach /c:otherwise /c:choose /body /html Any input is appreciated. -Rashmi - To unsubscribe, e-mail: taglibs-user-unsubscr...@jakarta.apache.org For additional commands, e-mail: taglibs-user-h...@jakarta.apache.org
Re: XTags download
On Mon, Apr 14, 2008 at 9:10 PM, Vijay [EMAIL PROTECTED] wrote: Hi Henri, Thanks for your reply, I have gone through these links http://jakarta.apache.org/taglibs/doc/xtags-doc/intro.html http://jakarta.apache.org/taglibs/doc/xtags-doc/index.html and tried to do some simple xslt application with xtags, but i am unable to download tld fies from the download links specified. If xtags is deprecated, kindly let me know the latest release for the same. XTags was deprecated in favour of JSTL, which includes XSLT functionality. -- Martin Cooper Rgds, Vijay Henri Yandell wrote: I think your only option is to check the code out from http://svn.apache.org/repos/asf/jakarta/taglibs/deprecated/xtags/trunk/ using subversion. I don't believe there was ever a release of xtags, and we've subsequently deprecated it. Hen On Mon, Apr 14, 2008 at 5:32 AM, Vijay [EMAIL PROTECTED] wrote: Hi there, I am unable to download XTags i tried both these links http://people.apache.org/builds/jakarta-taglibs/nightly/src/ http://people.apache.org/builds/jakarta-taglibs/nightly/ i get page not found error. pls help me to download XTags. Thank you, Vijay. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:url and context path completion
On Nov 28, 2007 1:01 PM, Trenton Adams [EMAIL PROTECTED] wrote: Kris Schneider wrote: On 11/28/07, Trenton Adams [EMAIL PROTECTED] wrote: Kris Schneider wrote: On 11/28/07, Trenton Adams [EMAIL PROTECTED] wrote: I was sure that I had read somewhere that c:url value=/images/pluslittle.gif/ usage would automatically cause the context path to be entered into the output of c:url. Is that not correct? Because it's not working! From the JSTL 1.1 Spec for c:url: As a consequence, an implementation must prepend the context path to a URL that starts with a slash (e.g. /page2.jsp) so that such URLs can be properly interpreted by a client browser. So, yes, the context should be prepended. What output are you actually seeing? I'm seeing it produce /images/pluslittle.gif, and it completely ignores the context path. I'm using tomcat 6 and java 1.5 This wouldn't happen to be a JSP sitting in webapps/ROOT, would it? Just checking... No, it's sitting in webapps/appname/WEB-INF/jsp/otherdir/somejsp.jsp Well, that's very likely the cause of what you're seeing. Anything under WEB-INF is not permitted to be accessed directly (i.e. from outside the web app itself), so the context is irrelevant for such files, since it could never be used to access them. -- Martin Cooper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug
On 4/28/07, Venu Madhav.Yelamanchili [EMAIL PROTECTED] wrote: Rashmi Rubdi wrote: Hi Venu, What version of JSTL are you using? This might be a configuration issue, according to the documentation here: http://jakarta.apache.org/taglibs/sandbox/doc/datagrid-doc/index.html#requirements This custom tag library requires a servlet container that supports the JavaServer Pages Specification, version 1.2 or higher. It also requires the Jakarta JSTL Tag Libraries 1.0 and the Common Math Library 1.0. -Regards Rashmi On 4/28/07, Venu Madhav.Yelamanchili [EMAIL PROTECTED] wrote: Hi, I tried to use the datagrid tags provided by apache. I found a code segment like ui:dataGrid items=${alist}. But this is not working for me. bcoz the items attribute in gridtaglib is not accepting runtime expressions. please provide the correct usage of your grid taglibs. ? -- Regards, Venu madhav.Yelamanchili - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi, Am using every thing according to specifications. After opening link below http://jakarta.apache.org/taglibs/sandbox/doc/datagrid-doc/index.html#requirements go to TagReference. There in the first row it was given as attribute items wont support RunTime ExpressionEvaluation. But in the example below that table it was given as |ui:dataGrid *items=${employees}* var=employee name=datagrid1 cellPadding=0 cellSpacing=0 How is it possible. when i copied the same copied into my editor and executed . I got an error which states that the attribute ITEM will not accept expressions. | *item* or *items*? What is the *exact* error message, and what is the *exact* syntax you are using? The Runtime Expression Evaluation column in the documentation refers to JSP scripting expressions, not the expression language you are using. If you're not already using JSP 2.x, I would recommending doing so and ensuring that your web.xml file is referencing Servlets 2.4 and not an earlier version. -- Martin Cooper -- Regards, Venu madhav.Yelamanchili Software Trainee Miracle Software Systems Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug
Like I said before, make sure your web.xml file is referencing Servlets 2.4or later. You can have all the latest software, but if your web.xml file is referencing an earlier version of the spec, it won't make any difference. -- Martin Cooper On 4/28/07, Venu Madhav.Yelamanchili [EMAIL PROTECTED] wrote: Rashmi Rubdi wrote: I'm sorry for mentioning a conflicting configuration of JSP, JSTL in my post above. The latest nightly release of DataGrid was on 20060829, which is much more recent than the thread I referred to above which was dated on 2004. So, please ignore my replies above. With very limited information of the problem it is difficult to offer a solution, as Martin has mentioned please provide relevant details. Post the versions JSP, Servlet, Web Server you are using. Also post full relevant code that will help us in recreating the problem. -Rashmi On 4/28/07, Martin Cooper [EMAIL PROTECTED] wrote: *item* or *items*? What is the *exact* error message, and what is the *exact* syntax you are using? The Runtime Expression Evaluation column in the documentation refers to JSP scripting expressions, not the expression language you are using. If you're not already using JSP 2.x, I would recommending doing so and ensuring that your web.xml file is referencing Servlets 2.4 and not an earlier version. -- Martin Cooper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Am using JDK 5.0 and JEE 1.4 with Servlet Spec:2.5 JSP spec:2.1 Server : Apache Tomcat 5.5.17 JSTL:1.1 I tried to use one of your datagrid examples. But all the examples showed the same problem. The code is shown below. The code fragment marked in bold red gave problem for me. html head titleJakarta Data Grid Taglib Example 4/title style th a:link { text-decoration: none; color: #3C4D81 } th a:visited { text-decoration: none; color: #3C4D81 } .item { background-color: #303D66; color: white; font-weight: bold } .hiliterows{ background-color: #CDBD4F } .alternaterows { background-color: #D3C971; border: 1px solid #00 } .header{ background-color: #F4F7FC; border-top: 2px solid #D7E1F2; border-bottom: 2px solid #D7E1F2 } .footer{ background-color: #F4F7FC; border-top: 2px solid #D7E1F2; border-bottom: 2px solid #D7E1F2 } .datagrid { border: 1px solid #AEBBD4; color: #3C4D81; font-family: arial; font-size: 10pt; font-weight: bold } /style meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body h3Example 4/h3 ui:dataGrid* items=${employees}* var=employee name=datagrid1 cellPadding=0 cellSpacing=0 scroll=true width=600 height=100 styleClass=datagrid columnscolumn width=100 header value=Select hAlign=center styleClass=header/ item hAlign=center styleClass=item ![CDATA[ input type=radio name=employee value=${employee.firstName} ${employee.lastName}/ ]] /item footer styleClass=footer/ /column column width=100 order=true header value=Name hAlign=center styleClass=header/ item value=${employee.firstName} ${employee.lastName} hAlign=left styleClass=item/ aggregate function=count var=total/ footer value=Total ${total} hAlign=left styleClass=footer/ /column column width=200 order=true header value=Salary hAlign=center styleClass=header/ item value=${employee.salary} hAlign=right pattern=$#,##0.00 styleClass=item/ aggregate function=avg pattern=$#,##0.00 var=total/ footer value=Average ${total} hAlign=right styleClass=footer/ /column column width=200 order=true header value=Bonus hAlign=center styleClass=header/ item value=${employee.bonus} hAlign=right pattern=$#,##0.00 styleClass=item/ aggregate function=avg pattern=$#,##0.00 var=total/ footer value=Average ${total} hAlign=right styleClass=footer/ /column /columns footershow=true/ rows hiliteStyleClass=hiliterows/ order imgAsc=up.gif imgDesc=down.gif/ /ui:dataGrid pa href=index.jspBack to index/a/p /body /html -- Regards, Venu madhav.Yelamanchili Software Trainee Miracle Software Systems Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.taglibs.standard.tag.el.fmt.FormatDateTag question
On 1/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thank you Rashmi. Yes, I found the FormatDateTag.class following your suggestions... My other question is since the way Daylight Savings Time changes in 2007, will this class need to be updated to reflect this change? No, the fix for that will be in the JDK / JRE you use. -- Martin Cooper -Original Message- From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Sent: Monday, January 22, 2007 11:28 AM To: Tag Libraries Users List Subject: Re: org.apache.taglibs.standard.tag.el.fmt.FormatDateTag question The latest stable release is here: http://www.apache.org/dist/jakarta/taglibs/standard/ Download: jakarta-taglibs-standard-current.zip After unzipping the file, look under \jakarta-taglibs-standard-current\jakarta-taglibs-standard-1.1.2\lib\ I think if you are upgrading standard.jar, you may also need to upgrade jstl.jar - which is also in the same directory. -Rashmi - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: taglibs-user@jakarta.apache.org Sent: Monday, January 22, 2007 11:18:35 AM Subject: org.apache.taglibs.standard.tag.el.fmt.FormatDateTag question I did do a search before I post this message, I did not find what I am looking for. A project I am working on use tag libraries. In one of the tld files, it has the following: tag nameformatDate/name tag-classorg.apache.taglibs.standard.tag.el.fmt.FormatDateTag/tag-cla ss ... I found the FormatDateTag.class in a jar file called standard.jar (maybe renamed by a previous developer) on the server. The timestamp of FormatDateTag.class is 7/19/2004. I want to find an updated version of this jar file. I did not find anything on this web site. Google did not give me much help either. Where can I find an updated version for this jar file? What should I download? Thank you for your help, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.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: Var for c:forEach loop is always null
On 12/11/06, Neil Aggarwal [EMAIL PROTECTED] wrote: Hello: According to the c:forEach doc, the var attribute of the c:forEach tag has nested visibility. What does that mean? From the spec: Nested scoped variables are only visible within the body of the action and are stored in page scope. I am trying to access the current object of the iteration and always getting null. Here is an example: [EMAIL PROTECTED] language=java % [EMAIL PROTECTED] import=java.util.* % [EMAIL PROTECTED] uri=http://java.sun.com/jsp/jstl/core; prefix=c % % HashSetString mySet = new HashSetString(); mySet.add(Str1); mySet.add(Str2); mySet.add(Str3); mySet.add(Str4); mySet.add(Str5); mySet.add(Str6); mySet.add(Str7); request.setAttribute(mySet,mySet); % c:forEach var=str items=${mySet} % String str = (String)request.getAttribute(str); % p %= str % /c:forEach The value of str is always null. How can I fix this? Well, for starters, var is page scoped and not request scoped. But why are you using JSTL for your loop and then using scripting expressions to access the iterator values? If you use c:out value=${str}/ or even just ${str} you won't see this kind of problem. -- Martin Cooper Thanks, Neil -- Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Are there plans for a Jakarta implementation of the JSTL 1.2 spec
On 10/17/06, Joe Bohn [EMAIL PROTECTED] wrote: Is there currently work underway on a Jakarta implementation of the JSTL 1.2 spec (JSR 52, JEE5 requirement)? There isn't currently, and there isn't likely to be. JSTL development now happens over in the Glassfish project. -- Martin Cooper Assuming there is (or soon will be), does somebody have a guesstimate on when that might be available? Thanks, Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with DisplayTag
The Display tag library is not part of Jakarta Taglibs. It's an independent tag library, with its own web site and its own mailing lists. See: http://displaytag.sourceforge.net/11/ -- Martin Cooper On 6/21/06, Juan Jose Lema Cundins [EMAIL PROTECTED] wrote: Hi, I am using DisplayTag Library and I would like to hide the header banner, I mean, the line which shows the number of obtained results. Ex: 5 items found, displaying 1 to 3. [First/Prev] 1, 2 [ Next/ Last] I need delete 5 items found, displaying 1 to 3 and and keep [First/Prev] 1, 2 [ Next/ Last] Thank you in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: looping on a list of lists (or accessing custom attributes of a list)
On 6/3/06, Luca Passani [EMAIL PROTECTED] wrote: Hi guys, here is my big problem today. I have a list the items of two kinds (with and without icons) which gets turned into a list of lists. [x , x, y, x,y, y, y, y,x, x,y] becomes [[x,x],[y],[x],[y,y,y,y],[x],[y]] When I render the list of lists in my JSP, I need to understand which kind of list it is I am dealing with. That's when I had a brilliant idea. Hmm... ;-) Two suggestions: 1) Instead of extending ArrayList, just encapsulate it. In other words, add a property to LinkWithIconList for the list, so that you can access the list explicitly using ${sub_list.list} or something. This seems like the simplest approach. 2) The Unstandard taglib in the Taglibs sandbox has an 'instanceOf' tag that might be useful to you. -- Martin Cooper I defined to subclasses of ArrayList: public class LinkWithIconList extends ArrayList { public boolean isLinkWithIconList() { return true; } public boolean isLinkWithoutIconList() { return false; } } (you can probably guess what the other class looks like :). And each sublist is an object of the respective subclasses. The rationale was to be able to do something like: c:forEach var=sub_list items=${list_of_lists} c:choose c:when test=${sub_list.linkWithIconList} render list with icons /c:when c:when test=${sub_list.linkWithoutIconList} render list without icons /c:when /c:choose /c:forEach Unfortunately this doesn't work. ${sub_list.linkWithIconList} is interpreted as an attempt to access to an item of the collection (and not one of its properties): javax.servlet.ServletException: The . operator was supplied with an index value of type java.lang.String to be applied to a List or array, but that value cannot be converted to an integer. So, the question for this respactable forum is: - is there an easy way to achieve what I am trying to achieve? - are there other ways to achieve my goals? Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime expressions with img:image
On 5/17/06, Robert Bowen [EMAIL PROTECTED] wrote: Well how do you like that. Perhaps I should have mentioned I am a JSTL newbie, but I guess you already got that. No, path = ${path} does not work. I am using JSTL 1.0 and Servlet 2.4. So can I do this? ...Without changing versions of JSTL / Servlet? img:image src='c:out value=${path}/' / -- Martin Cooper Thanks buckets, Bob Hassan Schroeder [EMAIL PROTECTED] wrote: Robert Bowen wrote: Is this possible? According to the docs it is. But when I try the following: The page fails saying File Not Found: '${path}'. Meaning it's not interpreting the path variable, but rather just spitting it back out as plain text. Yes, I have the core jstl libraries working properly, since the following statement: path is is meaningless :-) -- does path is ${path} work? If not, you're not using JSTL 1.1 and/or Servlet 2.4, where the *container* interprets/expands EL statements. A more precise answer would be possible with actual information about your configuration... HTH! -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com opinion: webtuitive.blogspot.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.
Re: Runtime expressions with img:image
On 5/17/06, Hassan Schroeder [EMAIL PROTECTED] wrote: Robert Bowen wrote: No, path = ${path} does not work. I am using JSTL 1.0 and Servlet 2.4. So can I do this? ...Without changing versions of JSTL / Servlet? short answer: no. Though I'm not sure where that img:... tag comes from, haven't used it myself. Uh, that would be HTML... -- Martin Cooper But if you're using a 2.4 deployment descriptor -- check what's at the beginning of your application's web.xml -- upgrading to JSTL 1.1 is as simple as downloading and replacing a couple of jar files... And well worth it, IMO -- replacing all those `c:out value=${path}/` statements with `${path}` cleans up a workspace most wonderfully :-) FWIW! -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com opinion: webtuitive.blogspot.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with fn:substringBefore
On 3/17/06, Jean-Pierre Astier [EMAIL PROTECTED] wrote: Hello all, I've got a problem with this jsp code in NetBeans 5 : c:choose c:when test=${recherche[1]== (fn:substringBefore(commerciaux,__))} option selected=selected value=$ {fn:substringBefore(commerciaux,__)}${fn:substringAfter (commerciaux,__)}/option /c:when c:otherwise option value=${fn:substringBefore (commerciaux,__)}${fn:substringAfter(commerciaux,__)}/option /c:otherwise /c:choose This line : c:when test=${recherche[1]==(fn:substringBefore(commerciaux,__))} get this error in netbeans :equal symbol expected Any ideas You have nested double quotes. Try changing the outer set of quotes to single quotes. c:when test='${recherche[1]==(fn:substringBefore(commerciaux,__))}' -- Martin Cooper Jean-Pierre Astier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL-EL question (instanceOf)
On 3/16/06, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: Not with just EL, but see: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#instanceOf that seems powerful. Thanks. Is there an example of usage somewhere? how do I combine this with c:if test? Dunno. Sorry. I haven't used it, I just knew it was there. ;-) -- Martin Cooper Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File download custom tag or bean
Not a tag, but if you're using Struts, you can use DownloadAction: http://struts.apache.org/struts-extras/apidocs/org/apache/struts/actions/DownloadAction.html -- Martin Cooper On 3/5/06, T. Lamine Ba [EMAIL PROTECTED] wrote: I know that you can download a file from a specific location within your webapp by writing a servlet using OutputStream services. However, it has been done so many times, somebody must have created a custom tag or bean for this feature. Where can I find a custom tag or bean that would allow me to download PDF and PPT files from my webapp and via a dialog box that would allow you to either open the file from the browser or store it in your desktop? Thanks, Lamine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and test for file existence
On 11/25/05, Luca Passani [EMAIL PROTECTED] wrote: Hi guys, Is there a way to test for file existence with JSTL? I don't believe so, and I'd be rather surprised if there was. Remember that there is no guarantee that there even *is* a file system in a webapp environment, so providing access to such a thing in a standard way doesn't really make sense. Of course, you can always create your own function to do this. -- Martin Cooper I would like to do something like: c:if test=exists( $pic) img src=pics/c:out value=$pic/ / /c:if Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:import for dynamic content
On 11/3/05, Robert Butera [EMAIL PROTECTED] wrote: I am attempting to import a JSP file into a JSP using the c:import tag. The line looks something like this: ... c:import url=file://c:/dira/dirb/imported-file.jsp/ .. imported-file.jsp is being found ok, but it is not being processed as a JSP, it is appearing as static text. That's because, since you are using a file URL, the request is not being made via HTTP, and thus is not being processed by a container as a JSP page request. You'll need to use an HTTP (or HTTPS) URL to get the file processed as JSP. -- Martin Cooper I am using some struts tags in imported-file.jsp that are just getting sent to the browser. Is there something I'm doing wrong here? Is there something I need to place around the c:import to make the imported file get processed? I am running this on jboss 4.0.1 (tomcat 5.0) with JSTL 1.1. Any help would be greatly appreciated. Rob
Re: Votes needed for a bug possibly affecting all tag libs which access the session. Definitely affecting JSTL and Session tag libs
Your crusade would do better to advocate fixing the issue in Tomcat, IMO, and therefore voting for the Tomcat bug instead (or in addition). -- Martin Cooper On 9/13/05, Wade Chandler [EMAIL PROTECTED] wrote: Please see bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=36586 for more details. This definitely is affecting JSTL and Session tag libs. I have not looked through the source for the others. Thanks, Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL TLD confusion
On 9/7/05, Woodchuck [EMAIL PROTECTED] wrote: hihi all, in the Struts (1.2.7) distribution it includes what i thought was everything you would need to use JSTL. namely, the standard.jar and jstl.jar (found under the struts/contrib/struts-el/lib folder). however, these jars are missing functions.tld file. then i discovered that the Jakarta Standard 1.1 Taglib distribution also comes with it's own versions of standard.jar and jstl.jar, and it has a fn.tld which contains the JSTL functions i want to use. Struts 1.2.x ships with JSTL 1.0.2, which is why it's missing the functions taglib. That was only added in JSTL 1.1. also, i noticed the Struts JSTL tlds have URIs like this: urihttp://java.sun.com/jstl/core/uri while the Jakarta Standard 1.1 Taglib JSTL have slightly different URIs like this: urihttp://java.sun.com/jsp/jstl/core/uri which is the 'official' version we should be using? why are there such differences between these versions? Because the JSTL spec defines different URLs for JSTL 1.0 and JSTL 1.1. ;-) -- Martin Cooper woodchuck __ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL, struts and pagination
On 8/31/05, Chandramohan Mani [EMAIL PROTECTED] wrote: pagination is not a part of view... I beg to differ. If you're going to divide the world up into M, V and C, it is certainly part of the view, since it has to do with which part of the model is being presented to the user, and how to navigate within a portion of model data. This, and the first link from the comments, is an interesting discussion of Web MVC: http://osteele.com/archives/2004/08/web-mvc -- Martin Cooper On 9/1/05, Luca Passani [EMAIL PROTECTED] wrote: people, what's the elegant way to do pagination with JSTL? I am using struts, my Action generates a LinkedList which a JSP page is supposed to visualize: c:forEach var=item items=${content_list} c:out value=${item.name http://item.name http://item.name}/br / /c:forEach I'd like the JSP to recognize long lists and split it in pages, possibly with backward and forward navigation. I would really like to avoid scriptlets. BTW is pagination part of the view or is it part of the business logic according to struts? Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Chandramohan Mani vMoksha Technologies., [EMAIL PROTECTED] +91 (80) 25053500 ext 364 Many of life's failure are people who did not realize how close they were to success when they gave up - Thomas Edison
Re: JSTL and Java Constants
On 8/31/05, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: Done. I think. At least, everything seems to have worked out, so it should be available in the next nightly build of Unstandard. will I need to wait tomorrow to download? great. I am eager to try it. Urk. I just checked, and it looks like Unstandard is not included in the nighly builds. Glenn, if you're reading this, could you add it please? In the meantime, I've put my local build up here: http://people.apache.org/~martinc/taglibs/unstandard/ One little doubt: |un:useConstants var=const className=java.lang.Integer / The constants are defined in an interface (not a class). || public interface ContentType { public static final int FOLDER = 1;|| public static final int URL = 2; : } ||Will the tag work the same? Yes, it will work the same. -- Martin Cooper Thanks Luca || | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Views outside the servlet container
On 8/31/05, Karianne Berg [EMAIL PROTECTED] wrote: Hi, I'm not sure if this is the right forum to ask this question, but I'll try anyway. I'm working on an application that requires me to place some of the JSPs outside of the servlet container, or at least in another context than the webapp itself. However, I can't find a way to do this. I have tried to use core:import, but this doesn't work, as the page at the url given is first rendered and then imported into the page. I need something that permits use of the variables sent to the including page in the included page. I tried with jsp:include, but this could only include pages in the app context. If anyone has any suggestions, I would greatly appriciate them. This isn't exactly a taglibs question... I'm pretty sure there's no way to do this. JSP pages compile to servlets, and those really need a servlet container around to operate properly. One of the main purposes of web apps and war files is to make the applications self-contained, but it seems that's working against what you are trying to do. When you refer to another context than the web app itself, what do you mean, exactly? If putting the presentation in a jar file that lives outside the web app meets this, and JSP is not mandatory, then you could try using Velocity instead, and putting the templates in a jar somewhere. Exactly where you can put this would depend on the particular servlet container you're using. -- Martin Cooper Best regards, Karianne Berg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and Java Constants
Take a look at the 'bind' tag in the Jakarta Taglibs Unstandard tag library. See: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#bind I have a useConstants tag that I've been meaning to donate that exposes all of the constants in a class, but I haven't got around to that yet. -- Martin Cooper On 8/30/05, Luca Passani [EMAIL PROTECTED] wrote: Hi there, here is my big problem today. I am using JSTL in some JSPs. SInce this is a struts project, I would like to keep my views totally separated from the Java APIs. For this reason, I need your advice about the most elegant to compare a given object type (an int constant) with the possible values using the COSTANT name, instead of the corresponding int. The API defines the types of my object as: public interface ContentType { public static final int FOLDER = 1; public static final int URL = 2; } in my JSP I have (loop over collection of items with getType() returning the type int) c:forEach var=item items=${content_list} c:choose c:when test=${item.type == 2} a href=${item.value}c:out value=${item.name http://item.name }//a /c:when : I would like to do something like: a) c:when test=${item.type == ContentType.URL} This won't work. I could hack it around with a scriptlet and an import at the top of my JSP, but that seems to me like violating the separation between View and Control b) I could do something like this in my action: String type_url = 5; request.setAttribute(url, type_url); and then c:when test=${item.type == url} but makes me wonder if having this code in the action really makes sense. Any ideas? Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and Java Constants
On 8/30/05, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: Take a look at the 'bind' tag in the Jakarta Taglibs Unstandard tag library. See: http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#bind interesting. Do you have an example of how that should be used? I believe it's something like: un:bind var=TheConstant type=com.yourco.ContentType field=URL / and then you can use 'TheConstant' when you want the value. My useConstants tag works like this: un:useConstants var=TheConstants className=com.yourco.ContentType / and then 'TheConstants' contains a map of all constants in the class, so you can use, for example: ${TheConstants.URL} -- Martin Cooper Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and Java Constants
On 8/30/05, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: and then 'TheConstants' contains a map of all constants in the class, so you can use, for example: ${TheConstants.URL} bang on. That would be cool. I have worked my problem around in my application, but your solution would be better, since it would decouple my action from the underlying API. Should I hold my breath? Well, I might have a go at adding it tonight, if I have time. It's been a *long* time since I've tried to build Taglibs, though, so if I have trouble with that, it might not happen, since I don't want to break the nightly builds. -- Martin Cooper Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and Java Constants
On 8/30/05, Martin Cooper [EMAIL PROTECTED] wrote: On 8/30/05, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: and then 'TheConstants' contains a map of all constants in the class, so you can use, for example: ${TheConstants.URL} bang on. That would be cool. I have worked my problem around in my application, but your solution would be better, since it would decouple my action from the underlying API. Should I hold my breath? Well, I might have a go at adding it tonight, if I have time. It's been a *long* time since I've tried to build Taglibs, though, so if I have trouble with that, it might not happen, since I don't want to break the nightly builds. Done. I think. At least, everything seems to have worked out, so it should be available in the next nightly build of Unstandard. -- Martin Cooper -- Martin Cooper Thanks Luca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Urgent: urgent jstl foreach tag is not working
You need to define getters for the properties you want to access via JSTL. -- Martin Cooper On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hello All, I would like to thank you all who answered my question . I have jakarta-taglibs-standard-1.1.2 jars and tlds copied onto my webserver. But still I am getting error when I run my jsp As you all suggested I fixed my jsp syntactical errors and tag errors. Here is my updated code. %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=f% %! public class Payment{ public int amount; public String checkDate; public int checkNumber; public Payment() { } public Payment(int amount,String checkDate,int checkNumber) { this.amount = amount; this.checkDate = checkDate; this.checkNumber = checkNumber; } } Payment pmtone = new Payment(100,08/12/2005,1000); Payment pmttwo = new Payment(200,08/13/2005,2000); Payment pmtthree = new Payment(300,08/15/2005,3000); Payment[] pmts = {pmtone,pmttwo,pmtthree}; % % pageContext.setAttribute(pmts,pmts); for(int i=0;ipmts.length;i++) { System.out.println(pmts[i].amount); } % c:forEach var=pmt items=${pmts} varStatus=curr c:set var=amount value=${pmt.amount}/ c:set var=checkdate value=${pmt.checkdate}/ c:set var=checknumber value=${pmt.checknumber}/ c:out value=${amount}/ c:out value=${checkdate}/ c:out value=${checknumber}/ /c:forEach And now I am getting error javax.servlet.ServletException: An error occurred while evaluating custom action attribute value with value ${pmt.amount}: Unable to find a value for amount in object of class org.apache.jsp.view.unmatchedPayments_jsp$Payment using operator . (null) org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:781) org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.view.un matchedPayments_jsp:464) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 22) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:81) root cause Can anyone please help me out? Thanks, Suneetha. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Urgent: urgent jstl foreach tag is not working
On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hi Martin, Thanks for the response. I defined my Usebean for the class I am trying to access You don't need that. As I said, what you _do_ need is getters. Like: public int getAmount() { return amount; } -- Martin Cooper jsp:useBean id=pmt class=scinsurers.server.interfaces.Payment / .But still I am getting error javax.servlet.ServletException: An error occurred while evaluating custom action attribute value with value ${pmt.amount}: Unable to find a value for amount in object of class scinsurers.server.interfaces.Payment using operator . (null) org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:781) org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.view.un matchedPayments_jsp:457) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 22) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:81) Thanks, Suneetha. -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 2:18 PM To: Tag Libraries Users List Subject: Re: Urgent: urgent jstl foreach tag is not working You need to define getters for the properties you want to access via JSTL. -- Martin Cooper On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hello All, I would like to thank you all who answered my question . I have jakarta-taglibs-standard-1.1.2 jars and tlds copied onto my webserver. But still I am getting error when I run my jsp As you all suggested I fixed my jsp syntactical errors and tag errors. Here is my updated code. %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=f% %! public class Payment{ public int amount; public String checkDate; public int checkNumber; public Payment() { } public Payment(int amount,String checkDate,int checkNumber) { this.amount = amount; this.checkDate = checkDate; this.checkNumber = checkNumber; } } Payment pmtone = new Payment(100,08/12/2005,1000); Payment pmttwo = new Payment(200,08/13/2005,2000); Payment pmtthree = new Payment(300,08/15/2005,3000); Payment[] pmts = {pmtone,pmttwo,pmtthree}; % % pageContext.setAttribute(pmts,pmts); for(int i=0;ipmts.length;i++) { System.out.println(pmts[i].amount); } % c:forEach var=pmt items=${pmts} varStatus=curr c:set var=amount value=${pmt.amount}/ c:set var=checkdate value=${pmt.checkdate}/ c:set var=checknumber value=${pmt.checknumber}/ c:out value=${amount}/ c:out value=${checkdate}/ c:out value=${checknumber}/ /c:forEach And now I am getting error javax.servlet.ServletException: An error occurred while evaluating custom action attribute value with value ${pmt.amount}: Unable to find a value for amount in object of class org.apache.jsp.view.unmatchedPayments_jsp$Payment using operator . (null) org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:781) org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.view.un matchedPayments_jsp:464) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 22) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810
Re: Urgent: urgent jstl foreach tag is not working
On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hi All, Great. Thank you very much . I got it resolved by adding getters method to my class as suggested by Martin. Thanks Martin. I have one more problem. My core tags are working in the same page but function tags values are not printing That's because you're using JSTL 1.0 URIs but trying to use JSTL 1.1 functionality. If you correct your URIs, it should work (assuming you actually have a JSTL 1.1 implementation). -- Martin Cooper %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=fn% c:set var=tempStr value=I love Java an www.java2s.com/ ${fn:length(tempStr)} Payments length = ${fn:length(pmts)} Can anyone please help me out? Thanks, Suneetha. -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 2:32 PM To: Tag Libraries Users List Subject: Re: Urgent: urgent jstl foreach tag is not working On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hi Martin, Thanks for the response. I defined my Usebean for the class I am trying to access You don't need that. As I said, what you _do_ need is getters. Like: public int getAmount() { return amount; } -- Martin Cooper jsp:useBean id=pmt class=scinsurers.server.interfaces.Payment / .But still I am getting error javax.servlet.ServletException: An error occurred while evaluating custom action attribute value with value ${pmt.amount}: Unable to find a value for amount in object of class scinsurers.server.interfaces.Payment using operator . (null) org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:781) org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.view.un matchedPayments_jsp:457) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 22) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:81) Thanks, Suneetha. -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 2:18 PM To: Tag Libraries Users List Subject: Re: Urgent: urgent jstl foreach tag is not working You need to define getters for the properties you want to access via JSTL. -- Martin Cooper On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hello All, I would like to thank you all who answered my question . I have jakarta-taglibs-standard-1.1.2 jars and tlds copied onto my webserver. But still I am getting error when I run my jsp As you all suggested I fixed my jsp syntactical errors and tag errors. Here is my updated code. %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=f% %! public class Payment{ public int amount; public String checkDate; public int checkNumber; public Payment() { } public Payment(int amount,String checkDate,int checkNumber) { this.amount = amount; this.checkDate = checkDate; this.checkNumber = checkNumber; } } Payment pmtone = new Payment(100,08/12/2005,1000); Payment pmttwo = new Payment(200,08/13/2005,2000); Payment pmtthree = new Payment(300,08/15/2005,3000); Payment[] pmts = {pmtone,pmttwo,pmtthree}; % % pageContext.setAttribute(pmts,pmts); for(int i=0;ipmts.length;i++) { System.out.println(pmts[i].amount); } % c:forEach var=pmt items=${pmts} varStatus=curr c:set var=amount value=${pmt.amount}/ c:set var=checkdate value=${pmt.checkdate}/ c:set var=checknumber value=${pmt.checknumber}/ c:out value=${amount}/ c:out value=${checkdate
Re: Urgent: urgent jstl foreach tag is not working
On 8/25/05, Dima Gutzeit [EMAIL PROTECTED] wrote: Actually it will work outside of c:out/ since it is EL expression. Assuming a JSP 2.0 container, yes. Not on JSP 1.2, though (and of course functions won't work in an earlier container, either). My guess at this point is that Suneetha is not using a JSP 2.0 container, hence the problems. -- Martin Cooper - Original Message - From: Long, Robert [EMAIL PROTECTED] To: Tag Libraries Users List taglibs-user@jakarta.apache.org Sent: Thursday, August 25, 2005 9:56 PM Subject: RE: Urgent: urgent jstl foreach tag is not working None of tags will work .They will just print out ${amount} and {fn.length(pmts)} instead of values I assume you're putting them within a c:out... and not just expecting ${amount} to print something in the JSP. -Original Message- From: Kurakula, Suneetha (HCF) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 2:47 PM To: 'Tag Libraries Users List' Subject: RE: Urgent: urgent jstl foreach tag is not working Hi, I am sorry for pestering you. But I need your help desperately. Please let me clarify with you about my JSTL setup. 1.Downloaded jakarta-taglibs-standard-1.1.2 2.Copied jstl.jsr,standard.jar to web-inf/lib 3.Copied tlds to web-inf/tlds folder 4.Added taglibs to web.xml as below taglib taglib-urihttp://java.sun.com/jsp/jstl/core/taglib-uri taglib-location/WEB-INF/tlds/c.tld/taglib-location /taglib taglib taglib-urihttp://java.sun.com/jsp/jstl/functions/taglib-uri taglib-location/WEB-INF/tlds/fn.tld/taglib-location /taglib If I use below tag uris %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn% None of tags will work .They will just print out ${amount} and {fn.length(pmts)} instead of values And if I use %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=fn% Alteast core tags are working and prints values and function tags they just print {fn.length(pmts)}. Can anyone let me know if I am missing anything in my configuration? Thanks Suneetha -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 3:29 PM To: Tag Libraries Users List Subject: Re: Urgent: urgent jstl foreach tag is not working On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hi All, Great. Thank you very much . I got it resolved by adding getters method to my class as suggested by Martin. Thanks Martin. I have one more problem. My core tags are working in the same page but function tags values are not printing That's because you're using JSTL 1.0 URIs but trying to use JSTL 1.1 functionality. If you correct your URIs, it should work (assuming you actually have a JSTL 1.1 implementation). -- Martin Cooper %@ taglib uri=http://java.sun.com/jstl/core; prefix=c% %@ taglib uri=http://java.sun.com/jstl/functions; prefix=fn% c:set var=tempStr value=I love Java an www.java2s.com/ ${fn:length(tempStr)} Payments length = ${fn:length(pmts)} Can anyone please help me out? Thanks, Suneetha. -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 2:32 PM To: Tag Libraries Users List Subject: Re: Urgent: urgent jstl foreach tag is not working On 8/25/05, Kurakula, Suneetha (HCF) [EMAIL PROTECTED] wrote: Hi Martin, Thanks for the response. I defined my Usebean for the class I am trying to access You don't need that. As I said, what you _do_ need is getters. Like: public int getAmount() { return amount; } -- Martin Cooper jsp:useBean id=pmt class=scinsurers.server.interfaces.Payment / .But still I am getting error javax.servlet.ServletException: An error occurred while evaluating custom action attribute value with value ${pmt.amount}: Unable to find a value for amount in object of class scinsurers.server.interfaces.Payment using operator . (null) org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont extI mpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImp l.java:781) org.apache.jsp.view.unmatchedPayments_jsp._jspService(org.apache.jsp.vie w.un matchedPayments_jsp:457) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:3 22) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810
Re: JSTL 1.0 problem with Bayern Ch 11 example...
On 8/3/05, Givler, Eric [EMAIL PROTECTED] wrote: I'm having a heck of a time trying to get the Bayern example from chapter 11 working, and I'm really not sure why It looks like there's a bug in your container. I just tried out your code on Resin 3.0.14, and everything works as expected. -- Martin Cooper I created an enterNumber.jsp page: %@ page contentType=text/html;charset=windows-1252% html head meta http-equiv=Content-Type content=text/html; charset=windows-1252 titleuntitled/title /head body form action=parseNumberCarefully.jsp method=post Enter your favorite number input type=text name=favorite/ br/input type=submit name=submit value=Submit/ /form /body /html I created an parseNumberCarefully.jsp page: %@ taglib prefix=c uri=http://java.sun.com/jstl/core% %@ taglib prefix=fmt uri=http://java.sun.com/jstl/fmt% html head titleparseNumberCarefully.jsp/title /head body pYou entered c:out value=${param.favorite}//p c:catch var=parsingError fmt:parseNumber var=fav value=${param.favorite}/ pAs far as I can tell, this corresponds to the number c:out value=${fav}/. /p pIf you multiply this number by 2 and add 1, you get c:out value=${fav * 2 + 1}/. I like that number better. /p /c:catch c:if test=${not empty parsingError} Sorry, this doesnrsquo;t look like a number to me. Perhaps yoursquo;re in the wrong country? /c:if /body /html If I run the first page, enter a valid#, then click [submit], I get correct results. If I run the first page, enter an invalid # (i.e. abcd), then click [submit], I get correct results. However, if I enter an invalid#, click [back], then enter a valid number, I keep getting parse errors. It's as if the catch keeps RECREATING the parsingError exception on subsequent requests even though the data has changed and is valid. The reason I tried to do this simple example was that I was creating a multi-record entry form, and trying to validate with JSTL. When I did this, as soon as the form would detect bad data, every record after it would be considered invalid data. In these cases, I'd end up either clearing the rest of the data, or it would retain the first good data and ovewrite all subsequent records, or I'd get a stack trace. I thought all of the code that I was writing was syntactically correct, but it did not produce the results that I wanted. If parseNumberCarefully.jsp has an errorPage attribute defined, and you remove the c:catch tag, and enter an invalid value, an error page is displayed. Now, if you hit [back] to goto the entry page, and enter a valid value, it works fine. What am I missing? I'd appreciate any assistance on this. I'm running this against Oc4J (oracle jdeveloper's embedded server) for Jdeveloper 10g, version 10.1.2, on a Windows 2000 box. - 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: how to do this with JSTL
On 7/26/05, Marco Mistroni [EMAIL PROTECTED] wrote: hello david thanx for your reply... there's still something i am missing about this expression language.. html:options collection=${EXPENSE_TYPES} property=id labelProperty=description/ does this means that i have to have in the request - a parameter named EXPENSE_TYPES An *attribute* named EXPENSE_TYPES, not a parameter. If you want to use the name constant from your Java class, you might want to look at the unstandard:bind tag in the Taglibs sandbox. -- Martin Cooper - a parameter under a constant named EXPENSE_TYPES (whose real value can be anything..)? i thought that also the second option will do... thanks in advance and regards marco -Original Message- From: Marco Mistroni [mailto:[EMAIL PROTECTED] Sent: Monday, July 25, 2005 12:08 PM To: Tag Libraries Users List Subject: how to do this with JSTL hello all, i am trying to port my application from using struts tag towards using JSTL tags, but i got stuck in a point where i have to display a selectable list.. below was the original struts code.. html:select name=entry property=type html:options collection=%= Constants.EXPENSE_TYPES% property=id labelProperty=description/ /html:select Basically,thi swill lproduce a selectable list where the selected value is the one corresponding to thep roperty.. am i correct that, if i want ot use JSTL, i have to use a c:forEach for displaying the collection, and a c:if to test teh value for each value in teh collection? anyone can give any hints? thanx and regards marco - 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] - 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: TagSupport vs BodyTagSupport
Once again, please ask questions about Struts on the Struts mailing lists, rather than here. -- Martin Cooper On 7/23/05, Luca Passani [EMAIL PROTECTED] wrote: Hello, I would love to hear about some taglib theory here. My understanding is that, when creating a new tag, I can inherit from either TagSupport or BodyTagSupport depending on whether I need to manipulate the tag content or not. For this reason, most of my tags (WALL library) inherit from TagSupport with the exception of one (which inherits from BodyTag). Looking at the code for the Struts html tag-lib, I see that most tag inherit from BaseHandlerTag (which looks totally reasonable to me), which, in turn, inherits from BodyTagSupport, even for tags that have no particular reason to do so,. in fact, in moost cases, doAfterBody() ends up doing domething as simple as, if (bodyContent != null) { String value = bodyContent.getString().trim(); if (value.length() 0) { text = value; } } i..e, just comsmetic for the returned source markup. My question is, in general, what is the rationale for inheriting from BodyTagSupport everywhere? what is the performance hit when inheriting from BodyTagSupport as compared to TagSupport? Thank you Luca - 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: TagSupport vs BodyTagSupport
On 7/23/05, Luca Passani [EMAIL PROTECTED] wrote: ooops, I felt this was a general taglib question, more than a Struts question. It only takes struts as an example, but the question is is there a reason why it makes sense to always subclass BodyTagSupport in a tag-library? Sorry, I read it as why are almost all of the Struts tags based on BodyTagSupport?, which would be a question for the Struts list. But I guess I'll go ahead and answer that anyway, since it's probably the simplest way to answer what you're asking. The reason is exactly what you noted - that almost all of the tags extend BaseHandlerTag, which has quite a lot of stuff in it. We needed a common base class so that we could share all of that code, and not have to reimplement the common attributes for each tag, and since some of the tags process their bodies, there's no alternative but for that base class to extend BodyTagSupport. We could have used two base classes, but that would have meant duplicating code, and would no doubt have led to the tags getting out of sync. Rahul mentioned SimpleTagSupport, and that would have been nice, but that came along long after the Struts tags, and indeed the Struts tags still need to support earlier versions of JSP. Hope that helps. -- Martin Cooper Luca Martin Cooper wrote: Once again, please ask questions about Struts on the Struts mailing lists, rather than here. -- Martin Cooper On 7/23/05, Luca Passani [EMAIL PROTECTED] wrote: Hello, I would love to hear about some taglib theory here. My understanding is that, when creating a new tag, I can inherit from either TagSupport or BodyTagSupport depending on whether I need to manipulate the tag content or not. For this reason, most of my tags (WALL library) inherit from TagSupport with the exception of one (which inherits from BodyTag). Looking at the code for the Struts html tag-lib, I see that most tag inherit from BaseHandlerTag (which looks totally reasonable to me), which, in turn, inherits from BodyTagSupport, even for tags that have no particular reason to do so,. in fact, in moost cases, doAfterBody() ends up doing domething as simple as, if (bodyContent != null) { String value = bodyContent.getString().trim(); if (value.length() 0) { text = value; } } i..e, just comsmetic for the returned source markup. My question is, in general, what is the rationale for inheriting from BodyTagSupport everywhere? what is the performance hit when inheriting from BodyTagSupport as compared to TagSupport? Thank you Luca - 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: Optimizing tag-lib performance
On 7/23/05, Luca Passani [EMAIL PROTECTED] wrote: Hello again, I would like to improve the performance of a tag-lib I have created. What I would recommend is extracting the work of your tags into methods that do not depend on the container being around. Then you can write simple JUnit tests for that code, and profile it without the container. For example, in your refactored code below, pull all of the code that builds up the string buffer into a separate method, and then only do the out.print() from the JSP API method. -- Martin Cooper Some obvious optimizations would be to turn things like: --- out.print( href=\+href+\); //title is optional if (!title.equals()) { out.print( title=\+title+\); } --- into (is this what they call string internalization?): --- final static String HREF_ATT = href=\; final static String TITLE_ATT = title=\; : StringBuffer sb = new StringBuffer(); : sb.append(HREF_ATT); : out.print(sb.toString()); --- Before I start applying these changes, though, I would like to be able to sort of measure the improvements. I tried something as basic as: % long startTime = System.currentTimeMillis(); %%@ taglib uri=/WEB-INF/tld/wall.tld prefix=wall %wall:documentwall:xmlpidtd / : wall:body wall:menu colorize=true autonumber=true wall:a href=http://url1; title=GamesGames/wall:a wall:a href=http://url2; title=HorosHoroscopes/wall:a wall:a href=http://url1; title=KidsKids/wall:a wall:a href=http://url2; title=Movieswall:bMovies/wall:b/wall:a wall:a href=http://url1; title=MusicMusic/wall:a wall:a href=http://url2; title=RadioRadio/wall:a wall:a href=http://url2; title=TVTV/wall:a /wall:menu /wall:body /wall:document % long stopTime = System.currentTimeMillis(); long elapsedTime = stopTime - startTime; System.out.println(elapsedTime); % the problem is that when I reload the page, the number of milliseconds is zero and occasionally 8,9 or 10 (I see output in the tomcat console running on my laptop, so I am sure that the browser is not caching). Questions: - is there something I am getting basically wrong? - is my tag-lib optimized enough that I don't need to care about further optimization? possibly because the compiler/JVM already did the optimization for me? - are there better ways/tools to measure tag-lib performance? Thanks Luca - 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: Integrating Struts with my taglib
On 7/19/05, Luca Passani [EMAIL PROTECTED] wrote: Martin Cooper wrote: Pointer 1 would be to ask about this on the Struts lists rather than the Taglibs lists, since the Struts taglibs are part of, uh, Struts, not Taglibs. ;-) you are right of course. It's just that I knew that you (one of the major authors behind the Struts taglibs) are on this list too :) Um, I'm also on the Struts lists, believe it or not... ;-) Pointer 2 would be to create your tag by extending the Struts html:link tag. See: http://struts.apache.org/userGuide/struts-html.html#link this does not really apply, I am afraid. WALL is for creating apps for mobile devices, i.e. multiserving WML, XHTML-MP and CHTML to mobile devices, i.e. not HTML. http://wurfl.sourceforge.net/java/tutorial.php Please note that wall:a href=url could turn into an hyperlink for some devices and into an option onpick=url for other (WML) devices. There is no point for me requiring that WALL users install Struts.The to things are independent. What I really want is to mimic in my tag what html:link does behind the scenes to turn the link to an action into an actual link. You probably want to look at the way the Struts tags are implemented, and especially the latest code in 'trunk'. The code you want has most likely already been extracted into the RequestUtils and TagUtils classes, outside the tags themselves. -- Martin Cooper Thanks Luca - 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: Integrating Struts with my taglib
On 7/19/05, Luca Passani [EMAIL PROTECTED] wrote: Hello, I have developed a JSP tag-library to fix mark-ups on mobile phones (WALL). Some people are using it with struts and they request that my anchor tag wall:a integrates with Struts by being able to mimic the behavior of the struts html:link tag: http://struts.apache.org/userGuide/struts-html.html#link question: where do I start? right now I use my tag like this: wall:a href=urlText/wall:a how do I integrate this so that I can do things like: wall:a href=/do/setUpEmployeeFormAdd An Employee/wall:a I'm ready to do my reading, but a few pointers in the right direction would definitely help. Pointer 1 would be to ask about this on the Struts lists rather than the Taglibs lists, since the Struts taglibs are part of, uh, Struts, not Taglibs. ;-) Pointer 2 would be to create your tag by extending the Struts html:link tag. See: http://struts.apache.org/userGuide/struts-html.html#link -- Martin Cooper Thanks Luca - 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: Simple (but free) calendar tag library
On 7/17/05, Thomas Gaudin [EMAIL PROTECTED] wrote: Hi folks, I've been searching for quite some time and I haven't been able to find a free JSP tag library to display calendars. I found some, but none was flexible enough to handle all the calendars I had to cope with in some projects. So I created mine : http://www.thogau.net/myFuse/tgcalendar/ It is simple, customizable and free. After the announcement, the question : I want to distribute it under apache licence 2.0. I put the license.txt file found on apache website in the root of the downloadable archive, is it enough or do I have to do something else? See the instructions on the web site: http://www.apache.org/dev/apply-license.html -- Martin Cooper Cheers, thogau - 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: URL for String TagLib source code
On 7/15/05, Robert Taylor [EMAIL PROTECTED] wrote: It seems I'm having difficulty finding the source code for the String Taglib. I go here: http://jakarta.apache.org/taglibs/index.html#Downloads Click on the link labeled as http://jakarta.apache.org/site/sourceindex.html.;. You would choose the *last* source link in that section. ;-) Both of the previous source links will get you the source code, for Taglibs and Taglibs Sandbox. Alternatively, you can retrieve the sources directly from Subversion at: http://svn.apache.org/repos/asf/jakarta/taglibs/ -- Martin Cooper Which directs me to http://jakarta.apache.org/site/downloads/index.html. I click on Taglibs and am taken here: http://jakarta.apache.org/site/downloads/downloads_taglibs.html I click on String Taglib and am taken here: http://jakarta.apache.org/site/downloads/downloads_taglibs-string.cgi But do not see a source code distribution. Any ideas? /robert - 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: Retrieve a session attribute
On 4/14/05, Vernon [EMAIL PROTECTED] wrote: In Servlet, I have request.getSession().getAttribute(cc); The code returns the right result. In JSP, when I have fmt:message key=cc.${sessionScope.cc}/ I get java.lang.IllegalStateException: Cannot access session scope in page that does not participate in any session I think the reason is that I have %@ page session=false% in the JSP file. By specifying that the page does not participate in a session, you are deliberately stating that no session be accessible from the page. If you want to access the session, you need to change this to true. -- Martin Cooper I have tried to retrieve the session attribute in some other ways like the follogins I can think with a success. What is the right way to get the attribute with the JSTL? fmt:message key=cc.${requestScope.session.cc}/ fmt:message key=cc.${pageContext.session.cc}/ The both yeild ??cc.?? Thanks. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - 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: Retrieve a session attribute
On 4/14/05, Vernon [EMAIL PROTECTED] wrote: --- Don Albertson [EMAIL PROTECTED] wrote: Vernon wrote: In Servlet, I have request.getSession().getAttribute(cc); The code returns the right result. In JSP, when I have fmt:message key=cc.${sessionScope.cc}/ I get java.lang.IllegalStateException: Cannot access session scope in page that does not participate in any session I think the reason is that I have %@ page session=false% in the JSP file. Is there a reason why you are trying to use session scope when there is no session? My understanding of how the servlet works in term of a session creation is that the container will create a session every time when a new user access the server. It seems to be correct from my short test with the session ID. A session exists before accessing the JSP file. In a servlet, a session will be created on a call to getSession() or getSession(true) if one did not already exist. In a JSP, if a session does not exist and the page has session=true, one will be created. -- Martin Cooper I have tried to retrieve the session attribute in some other ways like the follogins I can think with a success. What is the right way to get the attribute with the JSTL? fmt:message key=cc.${requestScope.session.cc}/ fmt:message key=cc.${pageContext.session.cc}/ The both yeild ??cc.?? Thanks. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- In the elder days of art Builders wrought with greatest care Each minute and unseen part For the Gods are everywhere. Longfellow. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - 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: Retrieve a session attribute
On 4/14/05, Vernon [EMAIL PROTECTED] wrote: --- Martin Cooper [EMAIL PROTECTED] wrote: In a servlet, a session will be created on a call to getSession() or getSession(true) if one did not already exist. In a JSP, if a session does not exist and the page has session=true, one will be created. -- I thought a JSP would share the same session within the servlet if a session already exists in the container. JSP is eventually translated into servlet code, doesn't it? Yes, they share the session. It really wouldn't make much sense otherwise. ;-) But by specifying 'session=false' you have asked the JSP container to deny that page access to the session, even if it exists. -- Martin Cooper I insert the log message code in the servlet before getting to the JSP and find that a session already exists at the point. If a session in JSP is unrelated with a session in servlet, how these two share session attributes? __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts integration
On Mon, 17 Jan 2005 21:05:58 +0100, luca [EMAIL PROTECTED] wrote: Hallo everyone again, I maintain and develop a tag-library (WALL) Among other things I have a tag called a (wall:a href=url). Someone told me that they would like to use WALL with struts, but they have no easy way to invoke actions (wall:a action=/logon). Unfortunately, I have no idea about how to go about doing this kind of integrations (also, I don't really know if I want to do it. It depends on how tightly I would need to couple my lib with struts). I imagine that I need to ask some Struts class to return a URL, given an action name. Am I right? anyone who has pointers to where I can look? For good measure I just downloaded the struts source code... That's a good start. Depending on what you are trying to accomplish, you might want to look at how the Struts-EL tags are built, as an example of how to extend the existing Struts tags. Questions about Struts, and the Struts taglibs, though, are much better asked on the Struts mailing lists than here. They really don't have any relation to the Jakarta Taglibs project. -- Martin Cooper Thanks Luca PS: Martin, thanks for your answer to the other question. - 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: Struts integration
On Mon, 17 Jan 2005 22:17:43 +0100, luca [EMAIL PROTECTED] wrote: apologies if I continue this thread on this list. Martin, what's the name of the Struts list you mentioned? http://struts.apache.org/using.html#Lists -- Martin Cooper Rahul P Akolkar wrote: I will assume that you want to give differential treatment for struts vs. non-struts hrefs (though I can't be sure this is even required without looking at the code). well, how else would I know if that's just a string I need to send verbatim to the client, or if I need to retieve the actual URL another way? of course, the resul will be an href attribute sent to the client anyway. Given that you have are planning on having different attribute names (href, action), you should be able to simply do this when provided with an action attribute: ((PageContext) getJspContext()).forward(action); are you saying that I don't need to import any Struts specific Jars? The RDC tag library in the jakarta-taglibs sandbox has a rdc:struts-submit tag that does something similar. The important part of that piece of code however, is equivalent to the above line. More importantly, a struts submit will also have associated form data that is passed along to the ActionForm via the request, so your anchor tag should submit the appropriate data as well. thank you, Rahul Luca - 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: question about integration with log4j
On Sun, 16 Jan 2005 22:12:44 +0100, luca [EMAIL PROTECTED] wrote: Hallo everyone, I maintain and develop a tag-library (WALL: http://wurfl.sourceforge.net/java/tutorial.php). Lately someone asked me why I don't enable log4j in my tags. The reason why I don't do it is performance. Without being a log4J expert, here is my thinking: A WALL JSP average page could easily generate 1 or 2.000 log messages. I would say that is your problem right there. You should take another look at your logging requirements and log what you need, when you need it. This sounds like you're logging every action that ever happens, all the time. Since deep into the log4J lib, there must be an if..then..else to decide if a message should be logged depending on the debug level, that would mean that those 2000 if..then are executed for each request to the JSP. Questions for you: - am I missing something about the way log4j works? Other than that it's really fast and you shouldn't have to worry about it, probably not. But consider that logging is generally not going to be happening unless something goes wrong, or you have debugging enabled. - do the Struts tags use log4J? Struts uses Commons Logging, so whether or not it uses Log4j is up to you. ;-) - if not, do struts tag use some other strategy for logging? - where do I find the source code of the Struts tag? I guess I could probably learn a lot by looking at them :) Um, in the Struts project. ;-) http://struts.apache.org/ -- Martin Cooper Thanks Luca - 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: question about integration with Tiles
A long time ago, we had the exact same issue with the Struts html:form tag, since the form element tags wanted to talk to the form tag itself. The problem also manifests itself when using jsp:include, as well as Tiles. The solution we chose was similar to what you suggested, except that we didn't bother with the findAncestorWithClass() step. I would recommend that you do the same. Just have your 'document' tag store itself in request scope. There's no advantage to looking for the class directly using findAncestorWithClass(), and there is some performance hit for doing so. -- Martin Cooper On Thu, 06 Jan 2005 19:20:06 +0100, luca [EMAIL PROTECTED] wrote: Hallo everyone, I maintain and develop a tag-library (WALL: http://wurfl.sourceforge.net/java/tutorial.php). Lately someone asked me if there is any way WALL can be used with tiles. My problem is that in order to do its magic WALL tags need to talk to one another. In particular, many tags communicate with the containing top-level wall:document tag. When a tag in a tile does a findAncestorWithClass(this, WallDocument.class) to find the document tag, this obvously fails, because the tag is not there. I think I have a workaround to this, but since tiles are not my speciality and performance traps are always there, I am about to ask this honorable forum for advice. My workaround would be to have the document tag perform: pageContext.setAttribute(wall-doc-ref-key, this,PageContext.REQUEST_SCOPE) all the tags which need to refer to 'wall:document', could get a reference to the tag through: WallDocument document = (WallDocument) findAncestorWithClass(this, WallDocument.class); if (document == null) { document = (WallDocument)pageContext.getAttribute(wall-doc-ref-key,PageContext.REQUEST_SCOPE)); if (document == null) { throw new JspTagException(tag 'menu' must be nested inside a 'document' tag); } } Questions: - Will this work, as far as you can tell? - is there a performance hit in doing this? - can someone think of other solutions? Thank you Luca - 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: img vs. html:img onclick result
On Wed, 10 Nov 2004 11:10:48 -0800, Cook, Lori A [EMAIL PROTECTED] wrote: I am experiencing difficulty using tag libraries and the passing through of scripting variables in attributes. Specifically I'm trying to add an onclick value to an html:img tag but this is generic for any tag in the Struts libraries where the user can supply a value to an attribute. When the following markup is used in a jsp: img src=minor.gif alt= onclick=confirmAction(%= pathParam %); / img src=minor.gif alt= onclick=%= \confirmAction( + pathParam + );\ % / The resulting HTML is: img src=minor.gif alt= onclick=confirmAction(Foo); / img src=minor.gif alt= onclick=confirmAction(Foo); / As you can see either one of the jsp versions 'work' to create a good onclick method. But when the code is changed to use the html:img tag it doesn't work. That is with the following jsp markup: html:img src=normal.gif alt= onclick=confirmAction(%= pathParam %); / This doesn't work because it is not legal to mix literals and expressions in the value of an attribute. If part of it needs to be an expression, then all of it needs to be an expression, as you tried to do below. html:img src=normal.gif alt= onclick=%= \confirmAction( + pathParam + );\ % / You have the right idea here, but you have the quotes in the wrong place. Try this instead: html:img src=normal.gif alt= onclick='%= confirmAction( + pathParam + ); %' / -- Martin Cooper The resulting HTML is: img src=normal.gif alt= onclick=confirmAction(%= pathParam %); html:img src=normal.gif alt= onclick=confirmAction(Foo); / While the first instance of html:img gets changed into the img markup the scripting variable pathParam does not get resolved. In the second case the scripting variable gets resolved but the html:img does not get changed into its appropriate img. Why? And how do you get the correct behavior? Any help is greatly appreciated. Lori Cook - 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: source code
On Mon, 8 Nov 2004 08:50:12 -0800, glennm2 [EMAIL PROTECTED] wrote: Where is the source code, ie. .java code for the examples in JSTL IN ACTION? I need to see the code where the data is read and saved. See page xxvi. -- Martin Cooper Thanks. Marge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: standard taglib documentation
Well, there's the spec itself, which is actually very readable. There's also the (freely available) Appendix A from Shawn Bayern's JSTL In Action, which is what I tend to use: http://www.manning.com/bayern -- Martin Cooper On Tue, 2 Nov 2004 16:30:48 -0500, Chris Gow [EMAIL PROTECTED] wrote: On November 2, 2004 04:18 pm, Bill Siggelkow wrote: http://www.jadecove.com/jstl-quick-reference.pdf Cool. Thanks. Chris Gow wrote: Hi: I've just recently started using/learning JSTL and I'm trying to locate some sort of documentation describing what the various tags are and their attributes etc (sort of like a Javadoc for taglibs). I noticed that some of the taglibs in the sandbox have a link to their own taglib documentation but I can't seem to find any for the standard ones (eg. the out tag does XXX and has the following attributes YYY, ZZZ) that sort of thing. The binary distribution just appears to include only Javadoc. If someone could point me in the right direction, I'd really appreciate it. Not to be anal or anything, but shouldn't this sort of documentation be part of the binary distribution? Not a quick reference guide in pdf format, but some sort of HTML documentation like javadoc? In any case, thanks for the link. It'll come in handy as learn how to use it. -- chris - 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: fmt:message not using correct locale
On Sat, 16 Oct 2004 11:15:26 -0600, Kumar V Kadiyala [EMAIL PROTECTED] wrote: Hi Martin, Thanks for the response. I use struts as the controller in my webapp (for my Action classes). When you say struts and jstl should not be mixed are you talking about the view? In my jsps I use jstl and struts-el. This is where I should be sticking to one approach? I don't understand how jstl can pick up the correct resources when I don't use struts. I didn't mean Struts and JSTL shouldn't be mixed, I meant that you should either have Struts load your resources and use Struts tags to access them, or use JSTL to load them and use JSTL tags to access them. Otherwise it's just fine - and in fact recommended - to use JSTL for anything else in your Struts apps. -- Martin Cooper Kumar Please respond to Tag Libraries Users List [EMAIL PROTECTED] To: Tag Libraries Users List [EMAIL PROTECTED] cc: Subject:Re: fmt:message not using correct locale JSTL and Struts use different mechanisms to load their resource bundles, and cache them under different attribute keys, so it's not surprising that JSTL tags do not pick up Struts resource bundles. I would recommend that you pick one approach and stick with it, rather than trying to mix the two approaches. -- Martin Cooper On Fri, 15 Oct 2004 15:23:37 -0600, Kumar V Kadiyala [EMAIL PROTECTED] wrote: Hello, I have a webapp which uses struts and jstl. I use the following code snippet to display localized strings %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jstl/fmt; prefix=fmt % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el% fmt:message key=label.help/ My resource file is specified in struts-config.xml as follows: message-resources parameter=com.ibm.psdui.resources.PSDText/ I currently have the base file PSDText.properties and a German version PSDText.properties_de. If I have the language setting in my browser to de, I see the German strings. However if I set the languages to en-us followed by German, I still see the German strings. It seems like fmt:message is using the wrong locale. Just out of curiosity I replaced fmt:message to bean:message and I see the right localized strings. I have to use fmt:message. Am I missing some configuration setting or something? Thanks in advance, Kumar - 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: fmt:message not using correct locale
JSTL and Struts use different mechanisms to load their resource bundles, and cache them under different attribute keys, so it's not surprising that JSTL tags do not pick up Struts resource bundles. I would recommend that you pick one approach and stick with it, rather than trying to mix the two approaches. -- Martin Cooper On Fri, 15 Oct 2004 15:23:37 -0600, Kumar V Kadiyala [EMAIL PROTECTED] wrote: Hello, I have a webapp which uses struts and jstl. I use the following code snippet to display localized strings %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jstl/fmt; prefix=fmt % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el% fmt:message key=label.help/ My resource file is specified in struts-config.xml as follows: message-resources parameter=com.ibm.psdui.resources.PSDText/ I currently have the base file PSDText.properties and a German version PSDText.properties_de. If I have the language setting in my browser to de, I see the German strings. However if I set the languages to en-us followed by German, I still see the German strings. It seems like fmt:message is using the wrong locale. Just out of curiosity I replaced fmt:message to bean:message and I see the right localized strings. I have to use fmt:message. Am I missing some configuration setting or something? Thanks in advance, Kumar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: POP3 tag?
On Tue, 28 Sep 2004 19:03:00 +0100, Digby [EMAIL PROTECTED] wrote: Hi, I may have missed it, but I've search Google for ages - is there are good taglib for reading POP3 accounts? I'm very surprised thare aren't tons of them, and that there isn't a Jakarta Taglib one. The only one I could find was the ColdTags one, which I didn't like much (it doesn't seem very polished). I'm not at all surprised that there isn't one, since, IMHO, this is not something that you should be doing from within a JSP page in the first place. You'd be much better off putting this kind of code in a servlet than in a JSP. -- Martin Cooper I might try writing one, but if there is one out there...that's what it's for. TIA Digby - 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: last element in collection
On Wed, 22 Sep 2004 15:43:09 -0400, Kris Schneider [EMAIL PROTECTED] wrote: c:forEach var=entry status=status items=${myList} That would be 'varStatus' rather than 'status'. ;-) -- Martin Cooper ... c:if test=${status.last} ... /c:if /c:forEach Quoting Ben Anderson [EMAIL PROTECTED]: Hi, Is there a way for me to tell when I'm in the last iteration of a forEach? %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % jsp:useBean id=myList class=java.util.ArrayList/ % myList.add(1); myList.add(2); myList.add(3); % c:forEach var=entry items=${myList} !-- This is the last time through c:if test= do something special /c:if -- c:out value=${entry}/ br / /c:forEach I know it'd be better if my logic didn't need to know this, but I'm just wondering if there's a way to do it. I thought maybe I could get the size and stick it in a var like c:set var=size value=myList.xxx/ c:forEach var=entry items=${myList} end=${size} but the size() method on java.util.Collection is just that, not getSize(). Any ideas? Thanks, Ben -- 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: Looping with paramValues
On Tue, 14 Sep 2004 13:31:22 -0400, Kris Schneider [EMAIL PROTECTED] wrote: Well, even if you could do it cleanly, there's no guarantee on the ordering of request parameters. Although the Servlet spec doesn't state it explicitly, it does actually specify that the order of values for a given parameter, as returned by getParameterValues(), is the same as the order in which they are submitted. -- Martin Cooper Are you really just checking to see if a particular parameter has been passed? If so, you should be able to do that with just: c:if test=${param.nameOfTheParameter} ... /c:if Quoting Nic Werner [EMAIL PROTECTED]: Thanks everyone for the help. I ended up taking your examples, and just 'on the side' iterating through the paramValues until I found the matching one, and then setting a temp flag. Its unfortunate that I couldn't just use an index to access the nth param and its nth value. - Nic. Helios Alonso wrote: Oops. Exactly. At 11:56 13/09/2004 -0400, you wrote: Helios, Small correction (I think), did you mean ... c:forEach var='entry' items='${params}' c:if test=${entry.key == 'test1' c:out value=${entry.value}/ /c:if /c:forEach Note: I switched var and items values. -- 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: Looping with paramValues
On Tue, 14 Sep 2004 15:18:24 -0400, Kris Schneider [EMAIL PROTECTED] wrote: I was thinking more along the lines of the HTTP spec not guaranteeing the order. So that if you made the same request with parameters foo and bar, in some cases foo might be first and in other cases it might be bar. Clearly the HTTP spec can't say anything about the order; that wouldn't be meaningful. However, the HTML spec does state that the order of parameters is preserved. Taken together with the Servlet spec requirements, that does state that the order of parameters as received by the servlet is the same as the order of fields in the submitted form. -- Martin Cooper Quoting Martin Cooper [EMAIL PROTECTED]: On Tue, 14 Sep 2004 13:31:22 -0400, Kris Schneider [EMAIL PROTECTED] wrote: Well, even if you could do it cleanly, there's no guarantee on the ordering of request parameters. Although the Servlet spec doesn't state it explicitly, it does actually specify that the order of values for a given parameter, as returned by getParameterValues(), is the same as the order in which they are submitted. -- Martin Cooper Are you really just checking to see if a particular parameter has been passed? If so, you should be able to do that with just: c:if test=${param.nameOfTheParameter} ... /c:if Quoting Nic Werner [EMAIL PROTECTED]: Thanks everyone for the help. I ended up taking your examples, and just 'on the side' iterating through the paramValues until I found the matching one, and then setting a temp flag. Its unfortunate that I couldn't just use an index to access the nth param and its nth value. - Nic. Helios Alonso wrote: Oops. Exactly. At 11:56 13/09/2004 -0400, you wrote: Helios, Small correction (I think), did you mean ... c:forEach var='entry' items='${params}' c:if test=${entry.key == 'test1' c:out value=${entry.value}/ /c:if /c:forEach Note: I switched var and items values. -- 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: Looping with paramValues
On Tue, 14 Sep 2004 17:31:17 -0400, Ross, Douglas [EMAIL PROTECTED] wrote: Nic, I don't know how Struts or JSTL deals with arrays of request parameters but the following might be helpful: form brinput name=colors value=Red brinput name=colors value=Blue brinput name=colors value=Orange brinput name=textures value=Smooth brinput name=textures value=Rough brinput type=submit /form On the server, you can access the arrays as follows: % String[] colors = request.getParameterValues(colors); String[] textures = request.getParameterValues(textures); if(null != colors){ for(int i=0; icolors.length; i++){ %brcolor[%=String.valueOf(i)%] is %=colors[i]%% }} if(null != textures){ for(int i=0; itextures.length; i++){ %brtexture[%=String.valueOf(i)%] is %=textures[i]%% }} % I would like to know how to access these in Struts, the ActionForm, if anyone knows if this is possible. Yes, it's possible. Just make your action form properties string arrays instead of strings, and it will just work. ;-) -- Martin Cooper Thanks, Doug -Original Message- From: Nic Werner [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 5:08 PM To: Tag Libraries Users List Subject: Re: Looping with paramValues I had to depend on the order in my instance. I had 15 params that were repeated three times (each for a different variant), so I wanted to loop through each param, and also know if I was on the first,second or third set of data. So basically, I wanted param.currentparam[current_set].value. I couldn't merely name each param with a signifier in front, ie X-param,Y-param,Z-param because (as asked previously), there is no way to dynamically create a variable name and then access its data - Nic. Helios Alonso wrote: In this case, ignoring the order the order is not defensive programming (avoiding not expectable bad cases) but avoiding coupling with the implementation of the server (Tomcat) and avoiding extra requiriments for the calling entity (call me with this params *and in this order*). [9] works if the implementation of params implements List (or is an array). At 16:20 14/09/2004 -0400, you wrote: Defensive programming might suggest that one presume the worst not the spec. At any rate, presuming you intend and design the nth element is *always* the one you use from the request, does the following work? c:out value=${params[9].value} / I don't use el enough to remember all the nuances. Doug -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 4:02 PM To: Kris Schneider Cc: Tag Libraries Users List Subject: Re: Looping with paramValues On Tue, 14 Sep 2004 15:18:24 -0400, Kris Schneider [EMAIL PROTECTED] wrote: I was thinking more along the lines of the HTTP spec not guaranteeing the order. So that if you made the same request with parameters foo and bar, in some cases foo might be first and in other cases it might be bar. Clearly the HTTP spec can't say anything about the order; that wouldn't be meaningful. However, the HTML spec does state that the order of parameters is preserved. Taken together with the Servlet spec requirements, that does state that the order of parameters as received by the servlet is the same as the order of fields in the submitted form. -- Martin Cooper Quoting Martin Cooper [EMAIL PROTECTED]: On Tue, 14 Sep 2004 13:31:22 -0400, Kris Schneider [EMAIL PROTECTED] wrote: Well, even if you could do it cleanly, there's no guarantee on the ordering of request parameters. Although the Servlet spec doesn't state it explicitly, it does actually specify that the order of values for a given parameter, as returned by getParameterValues(), is the same as the order in which they are submitted. -- Martin Cooper Are you really just checking to see if a particular parameter has been passed? If so, you should be able to do that with just: c:if test=${param.nameOfTheParameter} ... /c:if Quoting Nic Werner [EMAIL PROTECTED]: Thanks everyone for the help. I ended up taking your examples, and just 'on the side' iterating through the paramValues until I found the matching one, and then setting a temp flag. Its unfortunate that I couldn't just use an index to access the nth param and its nth value. - Nic. Helios Alonso wrote: Oops. Exactly. At 11:56 13/09/2004 -0400, you wrote: Helios, Small correction (I think), did you mean ... c:forEach var='entry' items='${params}' c:if test=${entry.key == 'test1' c:out value=${entry.value
Re: Looping with paramValues
I'm not totally sure what you're asking either, but you should note that the only difference between 'param' and 'paramValues' is that the values in 'param' are strings while the values in 'paramValues' are arrays of strings. In all other respects, they are the same. -- Martin Cooper On Fri, 10 Sep 2004 10:23:14 -0700, Nic Werner [EMAIL PROTECTED] wrote: Hi, Is there a '.key' accessor for paramValues? Basically I only want to access the variables that match a certain index and do comparison work with them I'm familiar with accessing data using paramValues.var_name[index], and I'm familiar with looping through params with only one value: c:forEach items=${param} var=params varStatus=status c:out value=${params.key} -- ${params.value}/BR /c:forEach The problem with paramValues is that I have to specify a variable name, while params lets me use '.key'. Thanks for your help, - Nic - 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: taglib: tags embedded in output
Really the only way to do this is by modifying your own tag to incorporate the functionality of the Struts tags. It's not possible to output JSP code from a tag and have that evaluated. We had the same discussion a couple of days ago in a separate thread: http://www.mail-archive.com/taglibs-user%40jakarta.apache.org/msg07615.html -- Martin Cooper On Thu, 2 Sep 2004 18:47:42 +0530, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have written a customized taglib and there is a tag say ABC. If my tag ABC returns a struts tag embedded in the writer output (here in this example html taglib) for a page, then can JSP container evaluate this tag? Example... my tag ABC evaluates to: html:select property=cd_interest_paid_option html:option value= key=Choose One/ /html:select I have used TagSupport class, it returns the above string to the JSP, but I want the output of it to be displayed. How to do that? Regards, Kalika P. Patil DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:out inside value attribute of c:set
I'm not sure what you're trying to accomplish with the c:out embedded in the attribute value. Don't you just want the value of the variable you set in the first line? c:set var=_data1 value=${sessionScope.modelRoot.financialBenefit.FBTypeMap['1'].FBEntries[_id1].id} / -- Martin Cooper On Wed, 01 Sep 2004 09:47:41 -0700, Somashish Gupta [EMAIL PROTECTED] wrote: Hi, Can I use a c:out ... / inside the value attribute of another c:out / or c:set ... / tag. For ex the following code c:set var=_id1 value=${financialBenefitStateItem.id} / c:set var=_data1 value=${sessionScope.modelRoot.financialBenefit.FBTypeMap['1'].FBEntries['c:out value='${_id1}'/'].id} / doesnt seem to work. In the second line I am trying to use c:out inside the value attribute of c:set . However it is not evaluating that c:out. Any clue how to solve this problem? Thanks Somashish - 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: Processing output x:transform as JSP
It may be complicated, but it's the only way it's going to work. ;-) That is, short of modifying the container itself... If you think about it, it's not all that surprising. The page compiler generates Java code from the JSP page, and that Java code is compiled into a servlet. What you are asking for is the resultant servlet itself to have the capability to dynamically (at execution time) run the page compiler and then the Java compiler without actually having source files to start from, or class files to write to. Theoretically possible, but a huge amount of work - and a lot more complicated than generating JSP pages and running them through the container in the normal way! ;-) -- Martin Cooper On Tue, 31 Aug 2004 20:01:25 +0100, Graeme Andrews [EMAIL PROTECTED] wrote: Try saving the output to another jsp file (dynamic.jsp) and redirecting the client to that page It would be complicated to save the output to another jsp file and redirect to that because: (a) the output from x:transform is only a fragment of an XHTML page (b) in a multiuser environment I would be creating separate temporary files for each session and that starts to sound like maintenance nightmare. Graeme - 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: String custom tag library. Capitalize work erroneously.
That would be a bug. Looking at the source code, I see that the code for capitalize and capitalizeAllWords is actually identical, so I'm not surprised that they behave the same way. ;-) If you could file a bug in the bug database, that would ensure that the problem doesn't get forgotten. -- Martin Cooper On Sat, 21 Aug 2004 09:51:52 +0300, lis [EMAIL PROTECTED] wrote: Hi all! %@ page pageEncoding=UTF-8 contentType=text/html;charset=UTF-8 language=java % %@ taglib prefix=str uri=http://jakarta.apache.org/taglibs/string-1.1; % str:capitalizebeautiful life/str:capitalize produce: Beautiful Lifeinstead of expected: Beautiful life in other words str:capitalize behave as str:capitalizeAllWords any suggestions ? -- Best regards, lis mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested expressions
Uh, your condition is what's wrong. The parameter key is *always* going to be either not 'view' or not 'perPage' - it can't be both at the same time. I think you mean AND instead of OR... -- Martin Cooper On Fri, 20 Aug 2004 09:33:32 -0700, Nic Werner [EMAIL PROTECTED] wrote: You'd think it would, but JSTL is still allowing them to pass through. Anyone want to point out where I'm just missing this? This code is generating the url string to be used later, but stripping out two of the params. If I don't use the OR, one will always strip out, but put it in and it ignores it. c:forEach items=${param} var=params varStatus=status c:if test=${params.key != 'view' || params.key != 'perPage'} c:set var=urlc:out value=${url}${params.key}=${params.value} escapeXml=false//c:set c:out value=${params.key}=${params.value} escapeXml=false/ %-- Output to test --% /c:if /c:forEach Any suggestions guys? You've never failed me before! Thanks, - Nic. Derek wrote: You were on the right path. This should do it... c:if test=${params.key != 'view' || params.key != 'perPage'} Derek On Aug 19, 2004, at 7:47 PM, Nic Werner wrote: I'm sure I'm just looking at this the wrong way, and I can't find it in Shawns book, but I want to evaluate two variables with an OR condition: c:if test=${params.key != ('view' || 'perPage')} Basically, if params.key doesn't equal the words 'view' or 'perPage', go ahead... What am I doing wrong here?! Thanks, - Nic - 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] - 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: Question about Mailer Tag library.
I'm not in a position to try this out right now, but you should be able to do this, since the address strings are passed directly to InternetAddress.parse(). You will need to be careful with the '' and '' characters, though, so that they're not interpreted as HTML or XML. -- Martin Cooper On Wed, 4 Aug 2004 15:14:16 -0500 , [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, all, I am writing a simple jsp making use of the Mailer Tag Library to send out emails.My question is: Is there any way to put the sender email address in a format like: Myname [EMAIL PROTECTED] instead of [EMAIL PROTECTED] only? I tried the former one but the tag library complained about the unknown format of a email address, is there any way to do that? Thanks. Bing - 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: Cannot load class error
You haven't exactly given us much to go on... ;-) My first guess is that you don't have all of the JSTL 1.0.x jars in your WEB-INF/lib directory, as required. Beyond that, we're going to need more information about what the exact error is, and what your app config looks like, before we can help you. Unfortunately, most of us are not mind-readers. ;-) -- Martin Cooper On Mon, 02 Aug 2004 05:17:35 +, emily chen [EMAIL PROTECTED] wrote: Hi there, when I use c:set in my jsp code,( on apache2 and tomcat4.1.30) it has Cannot load class set error. It's not because of the c.tld cannot be found, I've checked path and it's a different error if c.tld cannot be found. Anyone know how to solve this? Thanks, Emily _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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: javax.servlet.jsp.tagext package binary download
On Fri, 9 Jul 2004, Puneet Monga wrote: Â I browsed jakarta's apache site. I have downloaded the JSTL and that supports JSTL1.1 and JSP2.0. But i didnt found the tagext package in it. Please forward me the appropriate download link for this package or for the tag lib that contains this package As you might expect from the package name (javax.servlet...), this is part of the servlet / JSP API, and so is not part of any particular taglib. Note that packages from Jakarta Taglibs would be org.apache... anyway. As for where to get this, it will be included as part of your container, but the specific jar name depends on the container you are using. You can also download the servlet / JSP API from the Tomcat distribution directories - see the Tomcat web site for details. -- Martin Cooper Thanx in advance Puneet Monga - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Xtags Id Variable is Obscured
I don't know how to solve your problem, I'm afraid. I just wanted to point out that I've noticed similar behaviour when using the c:catch tag, and not using xtags. I believe there is something odd happening under the covers when c:catch is used that can interfere with the behaviour of subsequent parts of the page. It's probably worth filing a bug, if you have a brief example that demonstrates the problem that you could include in the bug report. -- Martin Cooper On Thu, 8 Jul 2004, Malcolm Cowe wrote: I am trying to wrap an xtags:parse command in a catch tag, so that I can trap errors without Tomcat hurling all over the browser. This is fine, but I need to apply an XSL stylesheet to the parsed document, and this fails if the c:catch tag is in place. Code fragment follows: c:catch var=xmlerr xtags:parse url=http://some/place/x.xml; id=x/ /c:catch %-- Some intermediate XML processing stuff deleted --% xtags:style document=%= x % xsl=y.xsl/ How can I reference the id x from the xtags:style tag? I parse the XML file in this way in order that I can manipulate the XML before sending it to the XSL processor. Unfortunately, the manipulation cannot be accommodated by XSLT. Take the c:catch tag away and everything works fine. Regards, Malcolm Cowe. - 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: Jsp 2.0 taglib conversion problem
On Mon, 5 Jul 2004, Bruce Dempsey wrote: Hi, Thank you for your response. Using my original code which was working before the upgade, we now get the following error: [7/5/04 9:42:01:318 EDT] 68e72fa4 WebGroup E SRVE0026E: [Servlet Error]-[javax/servlet/jsp/JspContext]: java.lang.NoClassDefFoundError: javax/servlet/jsp/JspContext Any ideas as to what caused this or where to look? You must not be using your original code. The JspContext class was introduced with JSP 2.0, and so does not exist in JSP 1.2. As someone else mentioned, WebSphere 5.1 supports only JSP 1.2, and not JSP 2.0. -- Martin Cooper Thank you, Bruce Dempsey Systems Analyst Food Directorate / Direction des aliments Health Canada / Santé Canada Tel. (613) 954-9430 Fax (613) 957-1574 Martin van Dijken [EMAIL PROTECTED] 07/05/2004 08:46 AM Please respond to Tag Libraries Users List To: 'Tag Libraries Users List' [EMAIL PROTECTED] cc: Subject:RE: Jsp 2.0 taglib conversion problem Hey Bruce, Not entirely certain, but isn't it WS 6.0 that supports JSP 2.0? I was under the impression that WS 5.x only supports version 1.2 of JSP, which still works with a doctype and a dtd. Grtz, Martin -Original Message- From: Bruce Dempsey [mailto:[EMAIL PROTECTED] Sent: maandag 5 juli 2004 13:58 To: [EMAIL PROTECTED] Subject: Jsp 2.0 taglib conversion problem Our Websphere server was upgraded to 5.1.3 and we are now using JDK 1.4 and JSP 2. Our taglibraries have stopped working. I am tryin to upgrade the libraries to use the SimpleTagSupport classes, etc but am having a problem with our tld descriptor Is this the proper way to declare the V2.0 of the taglibrary? The error I am getting is: Error JspTranslate: : XML parsing error on file /WEB-INF/tagLib.tld: (line 3, col 117): Document root element taglib, must match DOCTYPE root null.. e_accountSignup.jsp ZSERIES_HCCFIA/WebContent line 8 Any ideas are greatly appreciated?? ?xml version=1.0 encoding=UTF-8? taglib xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xs d version=2.0 tlib-version1.0/tlib-version short-nameHCCFIA Tag Library/short-name tag nameisElements/name tag-classtaglib.IsElementsHandler/tag-class body-contentJSP/body-content attribute namelistName/name requiredtrue/required /attribute /tag tag namegetMessage/name tag-classtaglib.getMessageHandler/tag-class body-contentempty/body-content /tag tag namegetReqParam/name tag-classtaglib.getReqParamHandler/tag-class body-contentempty/body-content attribute namename/name requiredtrue/required /attribute /tag tag namegetParam/name tag-classtaglib.getParamHandler/tag-class body-contentempty/body-content attribute namefield/name requiredtrue/required /attribute attribute nameobject/name requiredtrue/required /attribute /tag tag nameinitializeList/name tag-classtaglib.InitializeListHandler/tag-class body-contentempty/body-content attribute namelistName/name requiredtrue/required /attribute attribute nametype/name requiredfalse/required /attribute /tag tag nameisChecked/name tag-classtaglib.IsCheckedHandler/tag-class body-contentempty/body-content attribute namelistName/name requiredtrue/required /attribute attribute nametype/name requiredfalse/required /attribute /tag tag nameisSelected/name tag-classtaglib.IsSelectedHandler/tag-class body-contentempty/body-content attribute namelistName/name requiredtrue/required /attribute attribute nametype/name requiredfalse/required /attribute /tag tag nameiterateOverObjects/name tag-classtaglib.IterateOverObjectsHandler/tag-class body-contentJSP/body-content attribute namelistName/name requiredtrue/required /attribute attribute namesplitList/name requiredfalse/required /attribute /tag tag namegetObjectMessage/name tag-classtaglib.getObjectMessageHandler/tag-class body-contentempty/body-content attribute namelistName/name requiredtrue/required /attribute attribute namefieldName/name requiredtrue/required /attribute attribute nametype/name requiredfalse/required /attribute /tag tag nameisNew/name tag-classtaglib.IsNewHandler/tag-class body-contentJSP/body-content attribute namedoctype/name requiredtrue/required /attribute /tag tag namealternateColors/name tag-classtaglib.alternateColorsHandler/tag-class body-contentempty/body-content /tag tag nameisLoggedIn/name tag-classtaglib.IsLoggedInHandler/tag-class body-contentJSP/body-content attribute namecurrentPage/name requiredtrue/required /attribute attribute namecheckStatus/name requiredfalse/required /attribute /tag tag nameisRoleEnabled/name tag-classtaglib.IsRoleEnabledHandler/tag-class body-contentJSP/body-content attribute nameroleName/name requiredtrue/required /attribute/tag tag nameHideSearchArrow/name tag-classtaglib.HideSearchArrowHandler/tag-class body-contentJSP/body-content attribute namearrowType/name requiredtrue/required /attribute attribute namelistName/name requiredtrue/required /attribute
Re: Using struts-nested tags
I would recommend asking Struts questions on the Struts mailing lists, since there are likely many more people there who will understand the issue you are trying to resolve, and be able to help you solve it. -- Martin Cooper On Tue, 6 Jul 2004, Paride Perazzolo wrote: thanks for your answer. 1) The bean is placed in the page as part of an action form and exists because it is declared in the associated action. UseBean is not normally used to create struts FormBeans. the point is: 1) beanContainer was put into session by another jsp previously. 2)I need to fetch his values, display them in a form, let the user modifying them. 3) Finally, I have to post data to an action which will make some stuff and update beanContainer into session. 2) Nothing initializes the ArrayList except the default constructor - you are better off a map based method than a DynaValidatorActionForm I will try this solution, even if, as I told you before, I'm dealing with a pre-existent bean the property of which I need to read/modify is a ArrayList. 3) Not of this discussion makes sense without more of struts config and the resultant page what I'm trying to realize is accessing a Collection-typed property of a session scope bean, visualize it to the user, let the user modifying it and finally submitting the changes the struts way (using a form-bean as trait d'union between my jsp and the controller) and update the bean in session. I'm looking for a elegant procedure to make it, ie I'd like to use DynaActionForms. But if that isn't possible I'm ready to define a form of my own. But I need first to understand if and how the session beanContainer's listaDanneggiati property is mapped onto the form-bean defined into my struts-config.xml. My suspect is that they are two different objects and that they will never be managed automatically. Maybe I should define a form which 1) populates an ArrayList whith that extracted from session 2) use it to make stuff 3) finally update the form in session with data submitted by the user thanks -- Paride Perazzolo [EMAIL PROTECTED] - 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: Undeterministic Reflection Exception, Using EL, JSTL, and Torque Objects
Something doesn't jibe here. You are saying that the evaluation of ${User.userName} is failing, but the stack trace you provide shows ArraySuffix in the call stack. I can't see how that class could be involved in evaluating the expression you give. Are you sure that is the expression that's failing? -- Martin Cooper On Thu, 24 Jun 2004, Georg Filios wrote: Hi, I do hope that I am here in the right group. I have a unpleasent error, for which I havent found a solution on several days research. Here is my Scenario: I do have a bug i.e. an Exception which occurs ocassionally but not always. Using Tomcat 5.0.24 and Servlet 2.4 I try to display a User-Object with the c:out tag. The User-Object was generated with Torque, has different getters and setters. The setters in my User-Object class are Torque generated. I have listed these setters below. Only 3 of them have different parameters for the same Name - the setPrimaryKey setters, which I cant unfortunately not change (since generated by Torque). Sometimes, but not always, I get during the display with c:out value=${User.userName} / a java.lang.NoClassDefFoundError Exception. Any Ideas how to solve this and what might be the cause?? This is a bit annoying, since I I dont want to wrap all my Torque Classes. Thanks, Georg Here is the exception: 2004-06-24 20:26:18 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception java.lang.NoClassDefFoundError at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:314) at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145) at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluat orImpl.java:263) at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluat orImpl.java:190) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContex tImpl.java:899) at org.apache.jsp.WEB_002dINF.jsp.app.security.manage.user_jsp._jspx_meth_c _out_0(user_jsp.java:338) Here are the setters setAccessCounterForSessionOUT=void IN=int setAccessCounterOUT=void IN=int setCityOUT=void IN=java.lang.String setConfirmedBoolOUT=void IN=boolean setConfirmedOUT=void IN=java.lang.String setCountryOUT=void IN=java.lang.String setCreateDateOUT=void IN=java.util.Date setEmailOUT=void IN=java.lang.String setFirstNameOUT=void IN=java.lang.String setIdOUT=void IN=int setLastAccessDateOUT=void IN= setLastAccessDateOUT=void IN=java.util.Date setLastLoginOUT=void IN=java.util.Date setLastModifiedOUT=void IN=java.util.Date setLastNameOUT=void IN=java.lang.String setLoggedInOUT=void IN=boolean setModifiedOUT=void IN=boolean setNameOUT=void IN=java.lang.String setNewOUT=void IN=boolean setPasswordOUT=void IN=java.lang.String setPhoneOUT=void IN=java.lang.String setPostCodeOUT=void IN=java.lang.String setPrimaryKeyOUT=void IN=[Lorg.apache.torque.om.SimpleKey; setPrimaryKeyOUT=void IN=java.lang.String setPrimaryKeyOUT=void IN=org.apache.torque.om.ObjectKey setStreetOUT=void IN=java.lang.String setUserIdOUT=void IN=int setUserNameOUT=void IN=java.lang.String - 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: What is the method of direct acces to an array element?
On Thu, 24 Jun 2004, Wendy Smoak wrote: From: Sergei P. Volin [mailto:[EMAIL PROTECTED] I have a set of arrays of the same length and i want to iterate over all of them in a turn. So what is the best practice to do this? Is there any direct method of direct acces to the element of an array? Like this: c:out value=$myArray[i] Are you sure this is the best design? If the arrays belong together, then they probably shouldn't be lying around loose. Are they properties of some object? If this is the best design (or you can't change it), I think you can use the 'varStatus' of c:forEach to address the other arrays. Off the top of my head, and probably not quite correct... c:forEach items=${firstArray} var=myItem varStatus=myLoopIndex c:out value=${myItem}/ c:out value=${secondArray[myLoopIndex]}/ c:out value=${thirdArray[myLoopIndex]}/ /c:forEach It might need single quotes around 'myLoopIndex'. Or not, play around with it and see what works! At the very least, you'll want to change the 'varStatus' value to 'status' and change the 'myLoopIndex' usage to 'status.index'. The 'varStatus' attribute exposes a structure rather than an index. -- Martin Cooper -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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: Where is the Input tag library?
-Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 01, 2004 8:22 AM To: Tag Libraries Users List Subject: Where is the Input tag library? Where may I find the Input tag library binary distribution? The Input tag library is absent from the following Taglibs mirrors: http://apache.sunsite.ualberta.ca/jakarta/taglibs/input/ http://apache.mirror.mcgill.ca/jakarta/taglibs/input/binaries/ Good question. It's actually missing from the main Apache site, which is why it's missing from the mirrors. It's not the only one that's missing, either - at least io and i18n, and quite possibly others, are also missing. I have no idea where they went (assuming they were really there at some point). Anyone have any ideas? (Copying -dev so all the committers see this.) -- Martin Cooper Derek NOTICE: This email contains privileged and confidential information and is intended only for the individual to whom it is addressed. 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 transmission by mistake and delete this communication from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. AVIS: Le prisent courriel contient des renseignements de nature priviligiie et confidentielle et nest destini qu'` la personne ` qui il est adressi. Si vous njtes pas le destinataire privu, vous jtes par les prisentes avisis que toute diffusion, distribution ou reproduction de cette communication est strictement interdite. Si vous avez regu ce courriel par erreur, veuillez en aviser immidiatement lexpiditeur et le supprimer de votre systhme. Notez que la transmission de courriel ne peut en aucun cas jtre considiri comme inviolable ou exempt derreur puisque les informations quil contient pourraient jtre interceptis, corrompues, perdues, ditruites, arrivies en retard ou incomplhtes ou contenir un virus. - 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: xmlrpc and parse
Benedetto Dell'Ariccia [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is it goog even for XML-RPC? Are you sure? XTags parses and manipulates XML. The JSTL XML tags parse and manipulate XML. There's no difference there, except in the details of the individual tags, and that the latter is standard, and will work in Tomcat. If you use the IO tags for the XML-RPC part of what you're doing, there should be no question of whether or not JSTL is good for XML-RPC, any more than there's a question of whether or nor XTags is good for XML-RPC. -- Martin Cooper Benny Martin Cooper wrote: Benedetto Dell'Ariccia [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I need to call an XML-RPC url and parse the output. I use tomcat 5.018 (genrally 5.xx) I tried with the IO and XTAGS library but there is a problem of incompatibility between XTAGS and TOMCAT, could you suggest me another solution? If the IO taglib works for the XML-RPC invocation, then you should be able to use JSTL instead of XTags to parse the output. -- Martin Cooper Tnx Benny - 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: xmlrpc and parse
Benedetto Dell'Ariccia [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I need to call an XML-RPC url and parse the output. I use tomcat 5.018 (genrally 5.xx) I tried with the IO and XTAGS library but there is a problem of incompatibility between XTAGS and TOMCAT, could you suggest me another solution? If the IO taglib works for the XML-RPC invocation, then you should be able to use JSTL instead of XTags to parse the output. -- Martin Cooper Tnx Benny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jspc
This is a question for tomcat-user, not taglibs-user (assuming you mean Tomcat 5.0.19, since the major version number isn't up to 9 yet! ;). -- Martin Cooper Martin Nad [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! I run win-bin-Tomcat 9.0.19 and there is not jspc in tomcat/bin/!!!??? How can i get jspc! Cheers __ Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢ http://photos.yahoo.com/ph/print_splash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ${param.something} ... feature or bug?
-Original Message- From: Andrew Stevens [mailto:[EMAIL PROTECTED] Sent: Sunday, April 18, 2004 11:13 PM To: '[EMAIL PROTECTED]' Subject: ${param.something} ... feature or bug? Hi, I am used to accessing form and URL parameters from JSTL using ${param.something}. However, I've found if a form is enctype=multipart/form-data then the parameters defined within the form tags are not accessible. Say if I had a form field that was type=text (or hidden) then the value is always empty when accessed from the JSTL. I can see why this might be the case, due to the multi part and binary files. Can anyone confirm that I will not ever be able to access these simple form fields using JSLT when writing mlutipart forms? Or is there an alternate syntax to do so? The issue is that the Servlet spec does not address handling of multipart requests, and so containers, in general, do not include transparent support for that. Unless your container does have built-in support, or you have some other pre-processor in place for multipart requests, you're not going to be able to access parameters in such requests in the usual manner in JSTL. -- Martin Cooper Thanks in advance, AS GOLDMAN SACHS JBWERE PTY LTD DISCLAIMER Goldman Sachs JBWere Pty Ltd and its related entities distributing this document and each of their respective directors, officers and agents (the Goldman Sachs JBWere Group) believe that the information contained in this document is correct and that any estimates, opinions, conclusions or recommendations contained in this document are reasonably held or made as at the time of compilation. However, no warranty is made as to the accuracy or reliability of any estimates, opinions, conclusions, recommendations (which may change without notice) or other information contained in this document and, to the maximum extent permitted by law, the Goldman Sachs JBWere Group disclaims all liability and responsibility for any direct or indirect loss or damage which may be suffered by any recipient through relying on anything contained or omitted from this document. Goldman Sachs JBWere does not represent or warrant the attached files are free from computer viruses or other defects. The attached files are provided, and may only be used, on the basis that the user assumes all responsibility for any loss, damage or consequence resulting directly or indirectly from use. - 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: IOException: Stream closed error when using custom tags
Without seeing any of your JSP page or the code for your custom tag, it's a little hard for us to help you out... ;-) If you could provide more information, we might be able to help. -- Martin Cooper shanmugampl [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All, I have a custom tag, which iterates through a data and provides a url to be included during every iteration. When i display the url as a string, everything works fine. But when i try to include it through the jsp:include tag i am getting the following error. java.io.IOException: Stream closed org.apache.jasper.runtime.BodyContentImpl.ensureOpen(BodyContentImpl.java:62 4) Once i get this error, reverting back to the old case(displaying the url as a string) also throws the same error. I cannot figure out the problem. Also i have disabled tagpooling. Can anyone help me out on this. Thanks Shanmugam PL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: String TagLib Dynamic String Replacement
It's not legal to mix string literals and scripting expressions in the value of a single attribute. The value must be one or the other. Paraphrasing your example a bit, to simplify, you have something like this: str:truncateNicely ... appendToEnd=foo%= bar %baz ... which mixes the two, so you need to convert it entirely to a scripting expression like this: str:truncateNicely ... appendToEnd='%= foo + bar + baz %' ... -- Martin Cooper -Original Message- From: Joe Dittmann [mailto:[EMAIL PROTECTED] Sent: Thursday, April 15, 2004 2:27 PM To: [EMAIL PROTECTED] Subject: String TagLib Dynamic String Replacement Hello, I am having a problem replacing data dynamically in a string. str:truncateNicely upper=140 appendToEnd=... a href=\productGroupInfo.html?groupId=%= 5 %\ class=\more\More /a%=childGroup.getDescription()%/str:truncateNicely None of the scriptlets are evaluated. Throwing this error: /tiles/productCategory_content.jsp(120,14) jsp.error.unterminated.tag' Here is the tld: tag nametruncateNicely/name tagclassorg.apache.taglibs.string.TruncateNicelyTag/tagclass bodycontentJSP/bodycontent attribute namevar/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namelower/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute nameupper/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute nameappendToEnd/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Many thanks in advance, Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL Tags Vs. JavaBeans
-Original Message- From: Jeff Brewer [mailto:[EMAIL PROTECTED] Sent: Sunday, April 11, 2004 11:27 AM To: [EMAIL PROTECTED] Subject: JSTL Tags Vs. JavaBeans In the process of trying to get my site up and running I came across a page that I'd written a year ago (not a big site--just a slow programmer) before I learned about JSTL that uses JavaBeans, which led me to ask the question Should I redo this page using JSTL tags? What's the current State of the (JSP) Art with respect to JSTL vs. JavaBeans? Is one preferred over the other? I'm not sure what you mean. JSTL can use and manipulate JavaBeans - they're complimentary technologies, rather than alternatives. Perhaps if you could describe a little about what your page is doing, or even provide a piece of it for us to look at, we'd be able to better help you decide on the best approach. -- Martin Cooper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jstl output
Depending on your usage, you might be able to put a whitespace-stripping filter in front of your JSP pages, to collapse all this down. Alternatively, you could adopt the funky JSP coding style I've seen some people use, ensuring that you don't have whitespace between your tags. So instead of this: tl:one a=a/ tl:two b=b/ you would do this: tl:one a=a/tl:two b=b/ The first example causes the line break between the tags to be output into your page, which is where a lot of your \rs are coming from. The second example ensures that there is no whitespace between the tags. The obvious downside to this is the substantial decrease in readability... -- Martin Cooper -Original Message- From: Lorenzo Sicilia [mailto:[EMAIL PROTECTED] Sent: Friday, April 09, 2004 3:28 AM To: Tag Libraries Users List Subject: jstl output Hi to the list, I have a jsp with jstl. The goal is generate a 100% xml ouput. In Macromedia flash I get this output from jstl: \r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\t\r\r \r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\t\t \r\r\t\t\t\t \r\r\t\t\t\r\r\r\r\r\r\r\r\r\r\r\r\r\r\t\r\r\t\r\r\t\r\r\t\r\r\t\t \r\r\t\t\r\r\t\t\r\r\t\t\t\r\r\t\t\t\t\r\r\t\t\t\t\r\r\t\t\t\t\r\r \t\t\t\r\r\t\t\t\t\r\r\t\t\t\t\r\r\t\t\t\t\r\r\t\t\t\t\r\r\t\t\t\t \r\r\t\t\t\t\r\r\t\t\t\t\t\r\r\t\t\t\t\t\t\r\r\t\t\t\t\t\t\r\r\t\t \t\t\t\t\r\r\t\t\t\t\t \r\r\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\r\r\t\t\t\t \t\t\t\r\r\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\r\r\t\t \t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t \r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t \t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\t\r\r\t\t\t\t \t\t\t\t\r\r\t\t\t\t\t\t\t\r\r\t\t\t\t\t\t\t\r\r\t\t\t\t\t\r\r\t\t \t\t\t\r\r\t\t\t\t\t\t\t\t\t\t\r\r\t\t\t\r\r\t\t\t\r\r\t\t\r\r\t\r \r\t\r\r\t\r\r\t\r\r\t\r\r\t\t\t\r\r\t\r\r\t\r\r\r\r\r\r\r\r\r\rpacket type=\1\params /responsesresponse name=\ticket\ code=\\ value=\0.5415515086218432\ /response name=\session\ code=\\ value=\true\ //responsesdata./data/packet\r Does it is possible remove newline chars in jstl? Thanks in advance regards Lorenzo - 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: how to nest a taglib in another taglib?
-Original Message- From: Ricky Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 7:58 PM To: [EMAIL PROTECTED] Subject: how to nest a taglib in another taglib? hi, thanks for reading.. i have a problem about nest a taglib in another taglib, just like this, what should i do? the attribute in the page context. forum:hasContent content=c:out value=${attribute} //forum:hasContent This is not legal JSP (or XML) syntax. You cannot use an element as the value of an attribute. i know that has a way to do like this: bean:define id=new_id name=attribute/ forum:hasContent content==new_id.toString()/forum:hasContent but there is another way to do it? That depends on how the forum:hasContent tag is implemented. If that is your own tag, and you are free to modify it, you could EL-enable that tag, which would allow you to do: forum:hasContent content=${attribute}/ A good example of how to EL-enable tags can be seen in the Struts-EL tag library, the source code for which is available here: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/contrib/struts-el/ On the other hand, if the forum:hasContent tag is not under your control, then you're probably stuck with providing a scripting expression (rtexpr), which would look just like the example you give above. -- Martin Cooper please help methanks! __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ - 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: creating a list from a query resultset
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED] Sent: Saturday, April 03, 2004 6:31 AM To: [EMAIL PROTECTED] Subject: creating a list from a query resultset I have a query that returns 1 or more columns. What i want to create is a delimited (comma) list of values from one of those columns. Is there a correct way of doing that? I tried just c:forEach over the rows of that column, and kept adding the values to a var, but it doesn't feel right. IMHO, the right way to do that would be in Java code, instead of trying to do it using tags in a JSP page. ;-) But if you really want to do it in the JSP page, what you're doing now is probably as right as it's going to get. ;-) -- Martin Cooper Help? Thanks. :) Anuj. __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ - 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: DynaActionForm problem
Since this is a Struts issue, it should be taken up on the struts-user list rather than here. However, since this looks like it could be a bug, please file a bug report against the Struts taglibs instead, here: http://issues.apache.org/bugzilla/ -- Martin Cooper -Original Message- From: MARU, SOHIL (SBCSI) [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 3:43 PM To: Tag Libraries Users List Subject: DynaActionForm problem Hello All, I was trying to use Dyanmic forms with my struts application. However the page blows up with the following exception javax.servlet.jsp.JspException: Exception creating bean of class org.apache.struts.validator.DynaValidatorForm: {1} org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:563) org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:520) org.apache.jsp.jsp.xsl.index_005fxsl_jsp._jspx_meth_html_form_0(in dex_005fxsl_jsp.java:129) org.apache.jsp.jsp.xsl.index_005fxsl_jsp._jspService(index_005fxsl _jsp.java:86) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrap per.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireS tring(ImportSupport.java:314) org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag (ImportSupport.java:176) org.apache.jsp.jsp.index_jsp._jspx_meth_c_import_0(index_jsp.java:102) org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:66) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrap per.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) I debugged into the source and found that in DynaActionFormClass, the following method is causing the problem public DynaBean newInstance() throws IllegalAccessException, InstantiationException { DynaActionForm dynaBean = (DynaActionForm) getBeanClass().newInstance(); dynaBean.setDynaActionFormClass(this); FormPropertyConfig props[] = config.findFormPropertyConfigs(); for (int i = 0; i props.length; i++) { dynaBean.set(props[i].getName(), props[i].initial()); } return (dynaBean); } because the method setDynaActionFormClass is not defined in the DynaActionForm class. I am using struts1.1 with Tomcat 5.0. I looked for solutions on the net but did not see this problem anywhere. Any guidance will be greatly appreciated. Thanks, Sohil My strutsConfig.xml has the following form-bean definition form-beans form-bean name=LoginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=loginName type=java.lang.String / form-property name=password type=java.lang.String / /form-bean /form-beans - 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: Finding a string within a string
-Original Message- From: David Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 1:03 PM To: Jakarta Taglibs help (E-mail) Subject: Finding a string within a string I'm using jstl 1.2 with tomcat 4.1.24 Using the EL, is there a way to search for a string within a string? For example, I want to find there in the string hello there world. (something like indexOf(String str) ) Not in JSTL 1.0, but you could do this with the Jakarta String Taglib. See the str:countMatches tag: http://jakarta.apache.org/taglibs/doc/string-doc/string-1.0.1/index.html#cou ntMatches -- Martin Cooper David Schwartz - 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: Novice question about using Constants in when tags
-Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow Sent: Wednesday, March 31, 2004 6:32 PM To: [EMAIL PROTECTED] Subject: Re: Novice question about using Constants in when tags Good question, Jeff. Unfortunately, there is not a direct way of doing this. There are generally two approaches: 1) Store the values of the constants as application context variables with the context being initialized through a startup servlet (or via a Plugin if you were using Struts) In the startup servlet you would have: this.getServletContext().setAttribute(INTRO, new Integer(1)); then your JSTL would look like: c:when test=${er.updateStatus == INTRO} 2) store a Map of these values in the application context -- something like: Map constants = new HashMap(); constants.put(INTRO, new Integer(1)); //... this.getServletContext().setAttribute(Constants, constants); then your JSTL would look like: c:when test=${er.updateStatus == Constants.INTRO} 3) Use the 'bind' tag from the Jakarta Unstandard Taglib to bind the Java constants to scoped attributes. For example: un:bind var=INTRO type=com.foo.YourClass field=INTRO/ Note, however, that Unstandard is still in the sandbox, and therefore unreleased and subject to change. -- Martin Cooper Jeff Brewer wrote: I'm new to Java and JSP and Tag Libraries and ran into what is probably more of a style question than a technical question. I'm using something like this in my JSP page: c:choose c:when test=${er.updateStatus == 1} pmessage one/p /c:when c:when test=${er.updateStatus == 2} pmessage two/p /c:when c:when test=${er.updateStatus == 3} pmessage three/p /c:when /c:choose ... but I wasn't content because a week from now when I come back and look at this code I'm not going to remember what 1, 2, or 3 means. Then I got the bright idea of trying to define some constants in my er class something like this public static final int INTRO = 1; public static final int MISSING_EMAIL_ADDRESS = 2; public static final int INVALID_EMAIL_ADDRESS = 3; ... so that I could do something like this... c:choose c:when test=${er.updateStatus == er.INTRO} pmessage one/p /c:when c:when test=${er.updateStatus == er.MISSING_EMAIL_ADDRESS} pmessage two/p /c:when c:when test=${er.updateStatus == er.INVALID_EMAIL_ADDRESS} pmessage three/p /c:when /c:choose ...which I thought would greatly improve the readability and maintainability of my JSP page (it's easy to see that message 2 should be displayed if a Missing Email Address situation exists). Those of you very familiar with jstl will no doubt recognize that this won't work (something I discovered through trial and error). Is there some way I can rewrite my expressions that works with these constants? Have you run into a similar situation and can you suggest a way to make my crude code a bit more friendly? Thanks in advance, Jeff - 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: finding current page's URL
-Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 11:58 AM To: Tag Libraries Users List Subject: Re: finding current page's URL I was looking for a way to do it via taglib, not using scriptlets. Did i misunderstand your suggestion? You can get the values Serge referred to through JSTL as well. c:set var=url value=${pageContext.request.requestURL}/ c:set var=qs value=${pageContext.request.queryString}/ -- Martin Cooper Thanks. Anuj. --- Serge Knystautas [EMAIL PROTECTED] wrote: Anuj Agrawal wrote: This may be a rather simple question. But i couldn't find any info online (maybe i'm looking in the wrong places). I'd like my jsp page to be able to access it's URL. What i mean is this: If i arrived at test.jsp by going to http://mydomain.com/test.jsp?id=1s=2, then i would like to know how to display the full url (http://mydomain.com/test.jsp?id=1s=2) on the page or at least have access to it in some variable. The servlet spec would be useful for this. You'd want to start with request.getRequestURL(), and then add request.getQueryString() if there was one. -- Serge Knystautas President Lokitech software . strategy . design http://www.lokitech.com p. 301.656.5501 e. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ - 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: jstl read raw data
-Original Message- From: Lorenzo Sicilia [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 6:17 AM To: Tag Libraries Users List Subject: jstl read raw data hi list, I need read some xml data in post. I have found some example in jsp that show raw data post: http://www.sci.usq.edu.au/courses/csc8409/src/ShowPost.jsp Do I can with jstl read raw data? I send xml object from flash with XML.sendAndLoad(mypage.jsp, POST); Thanks in advance for any idea. Since what you want to read is XML, you can do this as long as you actually want to parse the XML as well. Try this: x:parse var=parsedXml xml=${pageContext.request.reader}/ I'm not aware of any way of getting the raw content of the reader in JSTL, though. -- Martin Cooper Lorenzo - 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: JSP development environments
On Thu, 25 Mar 2004, Roy Benjamin wrote: I develop on SuSE linux only, so may bias my choices. I've been using Netbeans for years, primarily for Java server, networking, and Swing development.. last couple of years doing all jsp development though. Netbeans 3.5 - Ok, but with some nearly fatal flaws. Netbeans 3.6 - A Beta, I'm using it now with very good results. I have seen no trouble with it. I recommend you give this one a try. I tried eclipse, but if I can't figure out an IDE in the first 10 minutes or so, at least basic functions, then I don't use it. Very popular though, so I'm sure I'll try again someday. Heh. This is exactly why I gave up on NetBeans some time ago and now use Eclipse and IDEA. I guess different strokes for different folks is true after all. ;-) -- Martin Cooper - 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: mailer taglib
On Fri, 26 Mar 2004, Arora, Avinash wrote: Hi, I am using mailer1.1. yes the documentation indicates that run time expression is not allowed. So is there any solution or I always have to hardcode the email address in to and from field. Instead of specifying the addresses as attributes of the mail tag, you can specify them with the setrecipient tag, where you can use the body of the tag for the address, like this: mt:mail ... mt:setrecipient type=to %=c.getDnsRecieverEmail()% /mt:setrecipient mt:setrecipient type=cc %=c.getDnsSenderEmail()% /mt:setrecipient /mt:mail -- Martin Cooper Avinash Arora -Original Message- From: Marc Guillemot [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 2:17 AM To: [EMAIL PROTECTED] Subject: Re: mailer taglib What version are you using? Is it possible that the tld indicates that runtime expressions are not allowed? Marc. Arora, Avinash wrote: Hi, I am trying to use the mailer1.1 taglibs to send email. If I hardcode the values of to and from field, the email can be send. But when I use a java class to print the value inside to: the mail can not be send. I have checked the value obtained by java class by printing it out. It is correct value. Below is the code that I am using with mail tags. mt:mail server=1.1.1.1 to=%=c.getDnsRecieverEmail()% from=%=c.getDnsSenderEmail()% subject=test mail. mt:messageCongrats u got the mail./mt:message mt:send/ /mt:mail Please let me know what is wrong with the to: and from: in this case. Also how can I rectify this problem. Thanks. Avinash Arora - 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: Internal Servlet Error using Taglibs-image on Tomcat 3.2.3 andj2sdk1.4.1_06
On Wed, 17 Mar 2004 [EMAIL PROTECTED] wrote: I still have the distribution that I used to install Tomcat. I replaced the jar files with those of the dist and I got the same thing. I tried Tomcat 5 and the taglisb-image-exemples is working. Upgrading to a newer Tomcat version would be much more dificult than trying to work around the taglibs itself, because I have to upgrade my applications too that are already developped and deployed under tomcat 3.2.3. Tomcat 3.2.3 really is quite ancient. How about trying Tomcat 3.3.2, which is the latest version of that era of Tomcat, released recently? Unless you're doing something rather unusual, you shouldn't have to upgrade your apps just to use a newer version of Tomcat. -- Martin Cooper -Original Message- From: Roy Benjamin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 1:54 PM To: Tag Libraries Users List Subject: Re: Internal Servlet Error using Taglibs-image on Tomcat 3.2.3 andj2sdk1.4.1_06 Not sure if this is helpful, but I'd be very reluctant to adopt a 'replace all methods' approach. Event if it were to work, you probably have not actually found the problem. The first thing I would do is to grab another copy (download) of Tomcat and untar it into a temp directory. Then I'd check to be sure the various jar files are all exactly the same between your failing run-time and the fresh download. I've occasionally had trouble with corrupted jar files... Then I'd try the same with a later version of Tomcat, possibly this might help? Or try reinstalling Tomcat again. Roy On Tue, 2004-03-16 at 09:07, [EMAIL PROTECTED] wrote: Hi ! I'm reposting the emai and hoping that someone could finaly help me to resolve the problem. I installed the image-examples under webapps in Tomcat v3.2.3 using j2sdk1.4.1_06 and I when I run http://myserver/image-examples/index.jsp I get an Internal Servlet Error with a root cause: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getRequestURL()Ljava/lang/StringBuffer ; I think the problem is with the servlet.jar that comes with tomcat 3.2.3. I made a quick search in google and I found that someone suggested to replace all methods javax.servlet.http.HttpServletRequest.getRequestURL() with javax.servlet.http.HttpUtils.getRequestURL(request) http://mail.sourceid.org/pipermail/sso-users/2003-May/000119.html I don't know if this will work if I do this in taglibs-source code, but is there any work around already available without the need to upgrade my tomcat webserver or JDK to a newer version? thank you for your help. - 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] - 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: Where I can find jstl.jar 1.0 and standard.jar 1.0
Try here: http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/intro.html -- Martin Cooper -Original Message- From: niksa_os [mailto:[EMAIL PROTECTED] Sent: Sunday, March 07, 2004 11:31 PM To: [EMAIL PROTECTED] Subject: Where I can find jstl.jar 1.0 and standard.jar 1.0 Where? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: taglibs i/o or jstl core library
On Thu, 5 Feb 2004, Chris Daly wrote: yes. i have an application with an include header.jsp file, and its using the c:redirect/ tag to go to the remote site then nothing happens in terms of header.jsp tag, this is missing from the browser page and appears to return nothing. That's not surprising. The redirect goes back to the browser, which will then request that page directly. Any output from the original request will be discarded, and replaced by the response from the redirected-to URL. in terms of the c:import tag it works ok if the url is simply entered into teh browser but if teh url is in an include tag then any relative image references are not to the imported url (which would be ok), but to the header include it seems. Is the page you're trying to include plain HTML, or is it also a JSP page? I'm wondering if there's something going on in a JSP page related to the original request URL that might be confusing things. -- Martin Cooper cheers At 08:19 05.02.2004 -0500, you wrote: Hang on, you lost me with the redirect problem. Are you saying that a JSP with something like: c:redirect url=http://java.sun.com// isn't working for you? I don't understand what you mean by, the app doesn't recognise it. Quoting Chris Daly [EMAIL PROTECTED]: thanks, i tried this on opera 6 for windows and it does not compute the base URI of the document per Section 14.14 of rfc2616. i tried using the jstl redirect tag but the app doesn't recognise it the header returns a blank and whats within the body tags takes up the space. it looks like a frameset within the header.jsp page is the only option. any other ideas ? cheers chris At 12:14 04.02.2004 -0500, you wrote: I've never used the IO taglib so I can't comment on it's abilities. The quick test I performed with JSTL's c:import failed to do what I think you're asking for (even when setting the Content-Location header). If you have access to either the Amaya or Opera browsers (as pointed to in the link I provided), you can verify if this is a browser issue. As for base: http://www.htmlhelp.com/reference/html40/head/base.html Quoting Chris Daly [EMAIL PROTECTED]: hi what i've done is imprt teh i/o tag library from http://jakarta.apache.org/taglibs/doc/io-doc/intro.htmland and am trying to use an existing include jsp to pull in the remote url and all relative image links using the io:request tag. I'm now looking at the jstl and url related actions and the c:import tag - would this work where io:request hasn't ? what do you mean by a resource that uses a base element - can you give an example ? cheers chris At 09:10 04.02.2004 -0500, you wrote: In theory, you might be able to do this by setting the Content-Location header to match the resource you're importing. In practice, however, this doesn't seem to be too well supported: http://jigsaw.w3.org/HTTP/CL/ Have you tried imorting a resource that uses a base element to see if that works? -- 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] - 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: [Q]i18n
On Thu, 5 Feb 2004, Jean Charles Jabouille wrote: hi, i have a struts application and i use jtsl taglibs. In order to internationalise my webpage, i use the taglibs-i18n taglib. I make my file correctly like -ApplicationResources.properties -ApplicationResources_fr.properties Just curious - since you're using Struts and JSTL already, both of which include their own means of internationalizing your pages, is there a reason you're introducing a third way of doing this in you app? I'd like to know how i18n choose the appropriate language between the browther language and the locale(java). If you use the Struts i18n capabilities, Struts will do this for you by default, setting up the locale based on what it receives from the browser. -- Martin Cooper Help appreciated! djice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL: POST vs GET
On Fri, 6 Feb 2004, Evgeny Gesin wrote: Hi, I will provide a little more information, may be that will be important. 1. I use an in-house developed Tiles, similar to Struts, so each page is make up of of dinamically included pages, for example, header, content and footer JSPs. 2. I use only i18n from JSTL package, so web.xml have a single declaration for that JSTL library as below taglib taglib-urifmt/taglib-uri taglib-location/WEB-INF/tld/fmt-1_0-rt.tld/taglib-location /taglib 3. A wrapper Tile page declares %@ page language=java contentType=text/html; charset=UTF-8 % All of your JSP pages should include this, not just your wrapper. Otherwise your included pages will be including ISO-8859-1 content into your UTF-8 wrapper. -- Martin Cooper 4. A template Tile page declares META HTTP-EQUIV=content-type CONTENT=text/html; charset=UTF-8 / 5. Each included JSP page has these lines %@ taglib uri='fmt' prefix='fmt' % jsp:useBean id=locale scope=session class=java.util.Locale / fmt:setLocale value=%= locale % / fmt:bundle basename=bundle TABLE fmt:message key=header / FORM ACTION=anAction METHOD=GET ... -- here are all JSP/HTML tags /FORM /TABLE /fmt:bundle JSP may also use fmt: to format numbers and currencies. Please ask if you need more information. You can visit http://www.javadesk.com and see that all pages are UTF-8 encoded. A characterEncodingFilter sets encoding request.setCharacterEncoding(UTF-8); response.setContentType(text/html; charset=UTF-8); Now, if I submit the above web page, all UTF-8 encoded data became gibberish. If I replace FORM ACTION=anAction METHOD=GET with FORM ACTION=anAction METHOD=POST everything works fine. What is wrong ? Evgeny Gesin Javadesk CEO / Founder --- Kris Schneider [EMAIL PROTECTED] wrote: Can you post a little more detail on what you mean by adding JSTL? Which tags are you using? Quoting Evgeny Gesin [EMAIL PROTECTED]: After adding JSTL to UTF-8 encoded JSP pages all form data sent via GET are gibberish. The POST does work. What can be the problem? Evgeny /Javadesk/ -- 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! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - 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: Problems with JSTL 1.1 and Tomcat 5 : UnresolvableException: $prefix:javax.servlet.include.query_string
I think this is what I was seeing when I was running JDK 1.4.1 instead of 1.4.2. I *thought* I was running 1.4.2, but it turned out that my path and my JAVA_HOME environment variable didn't both say the same thing... -- Martin Cooper On Wed, 4 Feb 2004 [EMAIL PROTECTED] wrote: I tried the nightly build of TC 5 20040203. Now I get a javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.IllegalStateException: can't declare any more prefixes in this context org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:864) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:800) org.apache.jsp.WEB_002dINF.pages.JobSearch_jsp._jspService(JobSearch_jsp.jav a:172) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 11) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 69) org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso r.java:274) org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:455) org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ estProcessor.java:320) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) javax.servlet.http.HttpServlet.service(HttpServlet.java:743) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) when I hit an x:transform c:import var=xslt url=/WEB-INF/xsl/onet3.xsl / x:transform xml=${onet3_titles_xml} xslt=${xslt} x:param name=Znode value=${onet3} / /x:transform There seems to near nothing on this exception in google. TIA -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 12:44 PM To: Tag Libraries Users List Subject: Re: Problems with JSTL 1.1 and Tomcat 5 : UnresolvableException: $prefix:javax.servlet.include.query_string Try a nightly build of TC 5. See: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26611 And this recent thread: http://marc.theaimsgroup.com/?t=10754069598 Quoting Aadi Deshpande [EMAIL PROTECTED]: Hi, I'm tryin to use Tomcat 5 and the newly released JSTL 1.1 and I get the following error whenever I try to do a x:anything? I've gotten this same error under the Beta 1 running under Tomcat 5. Does anyone have any insight into why I would be getting this error? I thought the JSTL was tested under Tomcat 5, so I'm not sure what I am doing wrong. Thanks in advance for any help, -a org.apache.taglibs.standard.tag.common.xml.UnresolvableException: $prefix:javax.servlet.include.query_string org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.not ull(Unknown Source) org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.get VariableValue(Unknown Source) org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.get VariableOrParam(Unknown Source) org.apache.taglibs.standard.tag.common.xml.XPathUtil.fillVarStack(Unknown Source) org.apache.taglibs.standard.tag.common.xml.XPathUtil.selectNodes(Unknown Source) org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(Unknown Source) javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(Unknown Source) org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspx_meth_x_fo rEach_0(mom_005frewards_005fcallout_jsp.java:2138) org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspx_meth_cms_ randomSet_0(mom_005frewards_005fcallout_jsp.java:2113) org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspService(mom _005frewards_005fcallout_jsp.java:134) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 11) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(Unkn own Source) org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unknown Source
Re: Where is the guid lines for writing tags.
On Tue, 27 Jan 2004, Antony Paul wrote: I found it here. http://jakarta.apache.org/taglibs/guidelines.html I got the link from Tomcat bug database. If this link is not provided in any of the taglibs site documentation please include it. That page is linked to from the following Taglibs pages: http://jakarta.apache.org/taglibs/addtaglib.html http://jakarta.apache.org/taglibs/newprojectsubmission.html http://jakarta.apache.org/taglibs/binarydist.html http://jakarta.apache.org/taglibs/sourcedist.html -- Martin Cooper rgds Antony Paul - Original Message - From: Antony Paul [EMAIL PROTECTED] To: Tag Libraries Users List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 11:17 AM Subject: Where is the guid lines for writing tags. Hi all, A few weeks ago I read a document explaining guidelines on writing custom tags. I remember I found it on taglibs site but now I cannot find it there. Also is there any FAQ section there ? rgds Antony Paul - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tiles breaks x:forEach
Something's not matching up properly. The code below is for the very first c:set in the JSP code you posted, setting the statesxml variable. That doesn't correspond to the stack trace, since there's no XPath usage in that JSP code at all. Let's see if we can eliminate - or point the finger at - Tiles. Can you try accessing the page using a jsp:include from another page, and see what happens? I believe all Tiles is doing internally is an include (using PageContext.include()), so this might provide some illumination (or not!). -- Martin Cooper On Fri, 30 Jan 2004 [EMAIL PROTECTED] wrote: Here is the entire function from the compiled JSP 769-800 private boolean _jspx_meth_c_set_12(javax.servlet.jsp.tagext.JspTag _jspx_th_c_if_7, PageContext pageContext) throws Throwable { JspWriter out = pageContext.getOut(); // c:set org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_12 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _jspx_tagPool_c_set_var.get(org.apache.taglibs.standard.tag.rt.core.SetTag.c lass); _jspx_th_c_set_12.setPageContext(pageContext); _jspx_th_c_set_12.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_if_7); _jspx_th_c_set_12.setVar(statesxml); int _jspx_eval_c_set_12 = _jspx_th_c_set_12.doStartTag(); if (_jspx_eval_c_set_12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { if (_jspx_eval_c_set_12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) { out = pageContext.pushBody(); _jspx_th_c_set_12.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out); _jspx_th_c_set_12.doInitBody(); } do { out.write(\r\n\t\t); if (_jspx_meth_c_out_1(_jspx_th_c_set_12, pageContext)) return true; out.write(\t\t\r\n\t); int evalDoAfterBody = _jspx_th_c_set_12.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); if (_jspx_eval_c_set_12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) out = pageContext.popBody(); } if (_jspx_th_c_set_12.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_set_var.reuse(_jspx_th_c_set_12); return false; } -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Friday, January 30, 2004 2:07 PM To: Tag Libraries Users List Subject: RE: tiles breaks x:forEach Well, I'm not sure this is helping you any, but I'm curious to see where it leads ;-). I wish I knew a bit more about Tiles internals, I haven't really used it all that much. Anyway, the stack trace is still making me scratch my head (order of execution): JobSearch_jsp._jspx_meth_c_set_10(JobSearch_jsp.java:769) JobSearch_jsp._jspx_meth_x_out_0(JobSearch_jsp.java:793) ... XPathUtil$JstlVariableContext.getVariableValue XPathUtil$JstlVariableContext.notNull and the exception is thrown with message: $prefix:javax.servlet.forward.request_uri Which, AFAICT, means getVariableValue was trying to do something like: return notNull(pageContext.findAttribute(javax.servlet.forward.request_uri), null, javax.servlet.forward.request_uri); Can you correlate lines 769 and 793 of the generated code with JobSearch.jsp? Huh, there seems to be a bug in the 1.1.0-B1 version of XPathUtil. JstlVariableContext.notNull essentially looks like: private Object notNull(Object o, String prefix, String localName) throws UnresolvableException { if (o == null) { throw new UnresolvableException($ + (prefix==null?:prefix+:) + localName); } return o; } Which means that instead of seeing the *value* of prefix in the exception message (when it's non-null), you'll see the literal prefix. So it should probably be: private Object notNull(Object o, String prefix, String localName) throws UnresolvableException { if (o == null) { throw new UnresolvableException($ + (prefix==null?:prefix+:) + localName); } return o; } Obviously, that shouldn't be impacting your app at all, but you never know what you'll find when you go rooting through code... Quoting [EMAIL PROTECTED]: I'll take that into consideration but it doesn't solve the problem of the forEach and out tags failing. I really need to be able to to use these tags to select into an xml source for other reasons besides building options for a select. In ongoing research into this an x:parse fails with the same exception on another page. Again if I change my struts action to directly reference the jsp it works instead of a tile definition. So I tried one step further and tried two different tiles definitions
Re: QUESTION ABOUT XML
On Fri, 23 Jan 2004, satish wrote: All, I need some help with XML parsing and retrieving values. My XML element is as follows entity eid=5769562 nametest/name address123 main st/address /entity How do I x:out the value of eid , For example 5769562 in this case. If you've parsed the above XML into a variable named 'xml', you would use this: x:out select=$xml/entity/@eid/ -- Martin Cooper Please help me out. Thanks satish - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: exception report
On Thu, 15 Jan 2004, Eddie Barna wrote: I have a few jsp pages with jstl tags embeded in them. I have tested this pages with tomcat 4.1.29 n my local machine and everything works fine. Once i uploaded my pages to my host all sort of weird things started to happen.. None the less i've worked my way through most of them but the following error has me vexed. Any help would be appreciated.. Given that the exception indicates a mismatched tag in your JSP page, it would be a whole lot easier for us to help you if we could see what the relevant portion of your JSP page looks like... ;-) -- Martin Cooper Thanks Eddie B. type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /site/user/clients_insert.jsp(540,20) The end tag /c:if is unbalanced org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:170) org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1744) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1599) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100) org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100) org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100) org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598) org.apache.jasper.compiler.Parser.parse(Parser.java:171) org.apache.jasper.compiler.ParserController.parse(ParserController.java:247) org.apache.jasper.compiler.ParserController.parse(ParserController.java:149) org.apache.jasper.compiler.ParserController.parse(ParserController.java:135) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237) org.apache.jasper.compiler.Compiler.compile(Compiler.java:456) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs. Apache Tomcat/5.0.16 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp-version is an unexpected element
As the exception makes clear, the problem is with the permittedTaglibs.tld file. It might help us to help you if you could show us that. However, I suspect that the problem is that you have the elements of your TLD file in an incorrect order, or you have a missing element. Check your TLD against the DTD before you do anything else. -- Martin Cooper On Wed, 21 Jan 2004, Barnett, Brian W. wrote: Having a problem with a simple index.jsp file in Resin. Here is my welcome-file-list: welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list and here is my index.jsp (as per Ted Husted): %@ taglib uri=struts-logic.tld prefix=logic % logic:redirect forward=home/ and here is the error I get when I open a browser to my web site: 500 Servlet Exception /index.jsp:1: com.caucho.util.Registry$SAXCompileException: META-INF/permittedTaglibs.tld:12: jsp-version is an unexpected element (parent taglib starts at 7). short-name is expected. Resin 3.0.2-beta (built Mon Aug 4 13:55:26 PDT 2003) Does anyone know what I need to do to make this work? Thanks, Brian Barnett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Variables for attributes in own tags
On Mon, 5 Jan 2004, Matthias Winkler wrote: Hello, I have some tags that create X+V form elements (mixed XHTML and VXML). To name my form elements I want to use names passed by an application. They are available inside a bean. (struts application - values passed by action form) Along with the name more information is passed on to the user. When the form is filled out the values of the fields have to be sent back with the same bean. If I use % out.write() % to write down my tag and add the information from the bean, my tag will not be evaluatet. JSTL uses the ${} syntax to access information from a bean and use it inside a jsp page. I would like to do something similar but I do not know, how to access the information from the bean when I evaluate my tag. At the end I would like to be able to do something like: xv:input id=${mybean.name} ... /. Where can I find information on how jstl handels this problem? This isn't hard to do, assuming you're OK with using the Jakarta Taglibs implementation of JSTL. For an example, you might want to take a look at the implementation of the Struts-EL tag libraries. These are just like the regular Struts tags except that they allow you to use JSTL expressions in the attribute values. You can get the Struts-EL code by downloading the Struts source distro, and looking under contrib/struts-el. Hope this helps. -- Martin Cooper Maybe there is another, easier solution to this problem? Best regards. Matthias Winkler __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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]