Re: Embed picture in HTML email
Would hopefully be the same for the Mailer taglib. It's cool that Mozilla supports the cid stuff, maybe it's even some kind of published standard out there, and things like Notes and Groupwise might support it too [must think who I can mail to test *grin*]. Hen On Mon, 5 Apr 2004, Jason Lea wrote: Here is an example of how to do it with JavaMail API (not as an jsp tag) http://java.sun.com/developer/onlineTraining/JavaMail/exercises/MailHtml/ It seems mail clients like Outlook and Mozila Mail/Thunderbird (and probably other email clients that display html) can use the img src=cid:myattachmentname; instead of the server etc. It will look for the attachment with the Content-ID of 'myattachmentname' and display that. Henri Yandell wrote: You can't embed pictures in emails. You can have img src=foo etc in them, but the picture will be obtained from a server of some kind. Some mail clients [okay, Outlook is the only one I know of] allow for some proprietary xml-ish tags to be in your emails which will load resources from attachments. I usually send from Outlook to Pine to see this, but I'm sure there are ways to see what the html really looks like in Outlook. Save it or something. Anyway, you'll see lots of special tags that exist. I've never really played with them though. I'd definitely be interested in seeing any info which details the pseudo-library of extra tags that Outlook converses in, but have never really gone looking for them. Maybe it's possible to write a Java library for creating Outlook-HTML pages and then sending it as a mime-type that only Outlook responds to (?). We could then send 3 versions of every mail, plain-text, html and outlook-html. Just some thoughts... Hen On Mon, 5 Apr 2004, Edsard Vegter wrote: Hi, Using the JSP mailer tags, I can send an HTML emails. Now I'd like to to go one step further and have a picture in the email as well. Is it possible to embed a jpg of gif in the message??? And if so, how do I do this - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea - 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]
JSTL Function Library
I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library?
Re: JSTL Function Library
Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- 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: JSTL Function Library
Thanks. Someone on this board told me that before. When I use : %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % followed by c:out value = '${param.search}'/, the outout is ${param.search} instead of the search parameter value. When I use the other library it works as expected. Any ideas why? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:16 AM To: Tag Libraries Users List Subject: Re: JSTL Function Library Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- 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: JSTL Function Library
Make sure you're also using a Servlet 2.4 web.xml: web-app 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-app_2_4.xsd; version=2.4 ... /web-app Quoting [EMAIL PROTECTED]: Thanks. Someone on this board told me that before. When I use : %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % followed by c:out value = '${param.search}'/, the outout is ${param.search} instead of the search parameter value. When I use the other library it works as expected. Any ideas why? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:16 AM To: Tag Libraries Users List Subject: Re: JSTL Function Library Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- 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: JSTL Function Library
Thank you. I've changed both the conf web.xml file and the local we.xml file within WEB-INF. I've restarted and still have the same problem. The book I bought on JSTL must be old because it does not mention JSTL 1.1. It was the only book in the bookstore. Is there a web page that will tell me how to prepare my server for JSTL 1.1? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:36 AM To: Tag Libraries Users List Subject: RE: JSTL Function Library Make sure you're also using a Servlet 2.4 web.xml: web-app 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-app_2_4.xsd; version=2.4 ... /web-app Quoting [EMAIL PROTECTED]: Thanks. Someone on this board told me that before. When I use : %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % followed by c:out value = '${param.search}'/, the outout is ${param.search} instead of the search parameter value. When I use the other library it works as expected. Any ideas why? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:16 AM To: Tag Libraries Users List Subject: Re: JSTL Function Library Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- 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]
RE: JSTL Function Library
There's really nothing you need to do to the server*, just make sure it supports JSP 2.0. You appear to be using Tomcat 5, so you should be fine (you might want to make sure you've got the latest version: 5.0.19). As for your app, all you should need to do is download Standard-1.1 and place jstl.jar and standard.jar in WEB-INF/lib. Make sure you're using a Servlet 2.4 web.xml and that you're using the proper URIs in your taglib directives: http://java.sun.com/jsp/jstl/core http://java.sun.com/jsp/jstl/xml http://java.sun.com/jsp/jstl/fmt http://java.sun.com/jsp/jstl/sql http://java.sun.com/jsp/jstl/functions *If you want to make use of the XML/XSLT tags, you'll probably want to download the latest version of Apache's Xalan and place xalan.jar and xercesImpl.jar in $CATALINA_HOME/common/endorsed. Quoting [EMAIL PROTECTED]: Thank you. I've changed both the conf web.xml file and the local we.xml file within WEB-INF. I've restarted and still have the same problem. The book I bought on JSTL must be old because it does not mention JSTL 1.1. It was the only book in the bookstore. Is there a web page that will tell me how to prepare my server for JSTL 1.1? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:36 AM To: Tag Libraries Users List Subject: RE: JSTL Function Library Make sure you're also using a Servlet 2.4 web.xml: web-app 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-app_2_4.xsd; version=2.4 ... /web-app Quoting [EMAIL PROTECTED]: Thanks. Someone on this board told me that before. When I use : %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % followed by c:out value = '${param.search}'/, the outout is ${param.search} instead of the search parameter value. When I use the other library it works as expected. Any ideas why? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:16 AM To: Tag Libraries Users List Subject: Re: JSTL Function Library Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL Function Library
I have Tomcat 5.0.19. I have downloaded the Standard-1.1 file. I have put jstl.jar and standard.jar in the WEB-INF/lib folder. I have copied your code for creating a Servlet 2.4 web.xml file I am using the taglib directives as you have written: http://java.sun.com/jsp/jstl/core I've restarted Tomcat a few times. Do I lose anything important by staying with the old JSTL? I haven't had much success with setting up JSTL and consider it a miracle that I got any part of it to work. -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 12:20 PM To: Tag Libraries Users List Subject: RE: JSTL Function Library There's really nothing you need to do to the server*, just make sure it supports JSP 2.0. You appear to be using Tomcat 5, so you should be fine (you might want to make sure you've got the latest version: 5.0.19). As for your app, all you should need to do is download Standard-1.1 and place jstl.jar and standard.jar in WEB-INF/lib. Make sure you're using a Servlet 2.4 web.xml and that you're using the proper URIs in your taglib directives: http://java.sun.com/jsp/jstl/core http://java.sun.com/jsp/jstl/xml http://java.sun.com/jsp/jstl/fmt http://java.sun.com/jsp/jstl/sql http://java.sun.com/jsp/jstl/functions *If you want to make use of the XML/XSLT tags, you'll probably want to download the latest version of Apache's Xalan and place xalan.jar and xercesImpl.jar in $CATALINA_HOME/common/endorsed. Quoting [EMAIL PROTECTED]: Thank you. I've changed both the conf web.xml file and the local we.xml file within WEB-INF. I've restarted and still have the same problem. The book I bought on JSTL must be old because it does not mention JSTL 1.1. It was the only book in the bookstore. Is there a web page that will tell me how to prepare my server for JSTL 1.1? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:36 AM To: Tag Libraries Users List Subject: RE: JSTL Function Library Make sure you're also using a Servlet 2.4 web.xml: web-app 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-app_2_4.xsd; version=2.4 ... /web-app Quoting [EMAIL PROTECTED]: Thanks. Someone on this board told me that before. When I use : %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % followed by c:out value = '${param.search}'/, the outout is ${param.search} instead of the search parameter value. When I use the other library it works as expected. Any ideas why? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 11:16 AM To: Tag Libraries Users List Subject: Re: JSTL Function Library Make sure you're using JSTL 1.1. %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % Functions are really part of the EL, so use them within an EL expression: ${fn:trim(row.user_id)} Quoting [EMAIL PROTECTED]: I am using Tomcat 5.X. I'm not sure which version of JSTL I have, but here is my jsp reference: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % I wanted to trim a variable I get from a database. I've searched the Sun website and have found the function library. %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % I'm having trouble using this. Here is the tag: fn:trim(row.user_id)/ Here is the error: No tag trim(row.user_id) defined in tag library imported with prefix fn I'm not sure if it is a version thing or what. Do I need to make a tld file for this? I can't find this library on the Jakarta web site. Should I just use Jakarta's String library? -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
redirect to a target?
Is there any way to specify that a redirect go into another frame??? We have an outer frame holding a menu, then an inner frame that loads our pages and each page has a security header. If the session times out, we get redirected (via our security header) to our logon page - BUT, our menu still remains rendered. What we want is, if our session has timed out (all vars are empty), then we want to redirect to our logon page into the TOP frame in the frameset - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Embed picture in HTML email
Chris, I can generate a perfect Go Gadget Go sample with what I have. But where do the pictures come into play? Your sample does not have and gif of jpg's in it. Have a look at my code (note I do not use core tags). Issue is that the picture is not showing when emailed to the user. What's the trick to get the picture in the email?? %@ taglib uri=http://jakarta.apache.org/taglibs/mailer-1.1; prefix=mt % mt:mail mt:servervincent/mt:server mt:setrecipient type=to%=FName % %=SName % %=Email %/mt:setrecipient mt:fromEdsard [EMAIL PROTECTED]/mt:from mt:subjectSubject here /mt:subject mt:message type=html html body h1 go go gadget legs /h1 img src=file:///C:/tomcat/webapps/monitor/picture.gif width=122 height=35 /body /html /mt:message mt:send pThe following errors occuredbr/br/ mt:error id=err jsp:getProperty name=err property=error/br/ /mt:error br/Please back up a page, fix the error and resubmit./p /mt:send /mt:mail Regards, Edsard McCormack, Chris [EMAIL PROTECTED] 06/04/2004 07:56 p.m. Please respond to Tag Libraries Users List [EMAIL PROTECTED] To Tag Libraries Users List [EMAIL PROTECTED] cc Subject RE: Embed picture in HTML email Its pretty simple from the docs included with mailer taglib but, heres how it works with some examples : First page is a simple html:form that collects the data. The javascript:validate() method on that page forwards on to another html page (the page that goes in to the body of your html email) which has these tags in : -- %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib uri=http://jakarta.apache.org/taglibs/mailer-1.1; prefix=mail % mail:mail mail:serverc:out value=${mailhost} escapeXml=false //mail:server mail:fromc:out value=${sender} escapeXml=false / c:out value=${sender} escapeXml=false //mail:from mail:setrecipient type=toc:out value=${recipient} escapeXml=false //mail:setrecipient mail:subjectsubject here/mail:subject mail:message type=html html body h1 go go gadget legs /h1 /body /html /mail:message mail:send/ /mail:mail c:redirect url=nextPage.do / -- The user only sees the form page and nextPage.do and recieves a nice big 'go go gadget legs' in their email. Chris McCormack -Original Message- From: Edsard Vegter [mailto:[EMAIL PROTECTED] Sent: 05 April 2004 21:30 To: Tag Libraries Users List Subject: RE: Embed picture in HTML email Hi Chris, The emails from your web page work great. I still have trouble getting the desired result, would you be able to give me some simple sample code??? Regards, Edsard McCormack, Chris [EMAIL PROTECTED] 05/04/2004 08:01 p.m. Please respond to Tag Libraries Users List [EMAIL PROTECTED] To Tag Libraries Users List [EMAIL PROTECTED] cc Subject RE: Embed picture in HTML email I used the mailer tag lib to generate the email sent from this page : http://www.index.co.uk/rf/navigation/product.do?SN=versionid=723categoryid=149949126thisprod=179469156product=179469156D=189121345 click the button 'e-mail this item to a friend' on the middle right of the page and enter your details to receive the mail. It sends html including css and images etc. The trick is to generate a normal html page and then send the built page as the body part of the mailer tag. Chris McCormack -Original Message- From: Henri Yandell [mailto:[EMAIL PROTECTED] Sent: 04 April 2004 23:28 To: Tag Libraries Users List Subject: Re: Embed picture in HTML email You can't embed pictures in emails. You can have img src=foo etc in them, but the picture will be obtained from a server of some kind. Some mail clients [okay, Outlook is the only one I know of] allow for some proprietary xml-ish tags to be in your emails which will load resources from attachments. I usually send from Outlook to Pine to see this, but I'm sure there are ways to see what the html really looks like in Outlook. Save it or something. Anyway, you'll see lots of special tags that exist. I've never really played with them though. I'd definitely be interested in seeing any info which details the pseudo-library of extra tags that Outlook converses in, but have never really gone looking for them. Maybe it's possible to write a Java library for creating Outlook-HTML pages and then sending it as a mime-type that only Outlook responds to (?). We could then send 3 versions of every mail, plain-text, html and outlook-html. Just some thoughts... Hen On Mon, 5 Apr 2004, Edsard Vegter wrote: Hi, Using the JSP mailer tags, I can send an HTML emails. Now I'd like to to go one step further and have a picture in the email as well. Is it possible to embed a jpg of gif in the message??? And if so, how do I do this
RE: Beans static method in non static way
Hi Bill, Thanks again for your reply. This JavaBeans component model specification seems quite hard to locate. I did find a PDF from 1997 on the Sun site (ver 1.01). Is this the only point of reference? Can you provide me with any recent JavaBeans Spec documentation? I suppose I am struggling to find the meaning/advantages of excluding access to static methods (accessed in a non static way). My knowledge is limited with AWT, reflection, intraspection etc, but I'm guessing that using these while doing GUI development (other than web) would allow/enable access to these types of methods. Cheers, AS -Original Message- From: Bill Siggelkow [SMTP:[EMAIL PROTECTED] Sent: Tuesday, 6 April 2004 12:50 To: 'Tag Libraries Users List' Subject:RE: Beans static method in non static way Thanks for the clarification, Andrew. JSTL is predicated on the JavaBeans component model and is such getter methods are expected to be instance variables. And I certainly understand your limitations as far as the code. I think in a lot of cases, a getMaxLength() method would be an instance method that uses a static field. However, since you indicated that you cannot change these things -- if you are using a JSP 2.0 container like Tomcat 5 than you could use JSPs support for static methods described here: http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag-p2.html If you do not or cannot do this then another option is to load your static data into the servlet context using a servlet. Bill Siggelkow [EMAIL PROTECTED] -Original Message- From: Andrew Stevens [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 10:30 PM To: 'Tag Libraries Users List' Subject: RE: Beans static method in non static way Thanks v.much for your reply. To the contrary, I don't have a lot of static methods, but many objects each with one or two static methods. For example: we have a class called 'Subject' (yep nothing special - building HTML forms here). Classes like Subject are provided to me in a package. Subject has static getMaxLength(). If this was accessible in JSTL it will make my life as the web guy a lot simpler. Instead I have to create a class like SubjectHolder which has a Subject property and a method which calls this.subject.getMaxLength(). (This is starting to sound like Struts Form Beans etc... but I have found them limiting and for now choose to avoid them) Then JSTL also starts to look like ${thing.subjectHolder.subject.maxLength}. If Subject class has a max length, any instance also has a max length. I don't see how this suggests state? Can you elaborate? I can't really dictate the way these classes are designed. Wrappers it may have to be (in the order of 10's to 100's!). Cheers, AS -Original Message- From: Bill Siggelkow [SMTP:[EMAIL PROTECTED] Sent: Tuesday, 6 April 2004 11:31 To: 'Tag Libraries Users List' Subject:RE: Beans static method in non static way Well, I don't mean to sound like a OO-snob, but I have to say that if you have a lot of static methods than it means that your code is written more like a procedural language than an object-oriented one. That being said, if you have to de4al with thte static methods than the best way I would think is to use the wrappers like you are doing. I mean, the method you access with JSTL are object properties -- properties mean state -- so, static methods mean no state -- since I think it is completely reasonable to not be able to access static methods -- aside from the technical/implementation reasons. Another approach is to turn your classes with the static methods into singletons and change the static methods to instance methods on the singleton. That is all I can say for now as I need to get back to watching my the Jackets! Bill Siggelkow [EMAIL PROTECTED] -Original Message- From: Andrew Stevens [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 9:08 PM To: '[EMAIL PROTECTED]' Subject: Beans static method in non static way Hello, I have read most of the discussion on JSTL1.0/1.1. Especially concerning static
RE: Beans static method in non static way
My 2 cents: Although static methods are valid code applied to instances of the class; this is a matter of parsing and code generation. Static methods are logically methods of that instance's class object. In either case Java's reflecton mechanism doesn't seem to provide API access to invoking a static method. Though I don't recall having tried such... Roy On Tue, 2004-04-06 at 17:06, Andrew Stevens wrote: Hi Bill, Thanks again for your reply. This JavaBeans component model specification seems quite hard to locate. I did find a PDF from 1997 on the Sun site (ver 1.01). Is this the only point of reference? Can you provide me with any recent JavaBeans Spec documentation? I suppose I am struggling to find the meaning/advantages of excluding access to static methods (accessed in a non static way). My knowledge is limited with AWT, reflection, intraspection etc, but I'm guessing that using these while doing GUI development (other than web) would allow/enable access to these types of methods. Cheers, AS -Original Message- From: Bill Siggelkow [SMTP:[EMAIL PROTECTED] Sent: Tuesday, 6 April 2004 12:50 To: 'Tag Libraries Users List' Subject:RE: Beans static method in non static way Thanks for the clarification, Andrew. JSTL is predicated on the JavaBeans component model and is such getter methods are expected to be instance variables. And I certainly understand your limitations as far as the code. I think in a lot of cases, a getMaxLength() method would be an instance method that uses a static field. However, since you indicated that you cannot change these things -- if you are using a JSP 2.0 container like Tomcat 5 than you could use JSPs support for static methods described here: http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag-p2.html If you do not or cannot do this then another option is to load your static data into the servlet context using a servlet. Bill Siggelkow [EMAIL PROTECTED] -Original Message- From: Andrew Stevens [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 10:30 PM To: 'Tag Libraries Users List' Subject: RE: Beans static method in non static way Thanks v.much for your reply. To the contrary, I don't have a lot of static methods, but many objects each with one or two static methods. For example: we have a class called 'Subject' (yep nothing special - building HTML forms here). Classes like Subject are provided to me in a package. Subject has static getMaxLength(). If this was accessible in JSTL it will make my life as the web guy a lot simpler. Instead I have to create a class like SubjectHolder which has a Subject property and a method which calls this.subject.getMaxLength(). (This is starting to sound like Struts Form Beans etc... but I have found them limiting and for now choose to avoid them) Then JSTL also starts to look like ${thing.subjectHolder.subject.maxLength}. If Subject class has a max length, any instance also has a max length. I don't see how this suggests state? Can you elaborate? I can't really dictate the way these classes are designed. Wrappers it may have to be (in the order of 10's to 100's!). Cheers, AS -Original Message- From: Bill Siggelkow [SMTP:[EMAIL PROTECTED] Sent: Tuesday, 6 April 2004 11:31 To: 'Tag Libraries Users List' Subject:RE: Beans static method in non static way Well, I don't mean to sound like a OO-snob, but I have to say that if you have a lot of static methods than it means that your code is written more like a procedural language than an object-oriented one. That being said, if you have to de4al with thte static methods than the best way I would think is to use the wrappers like you are doing. I mean, the method you access with JSTL are object properties -- properties mean state -- so, static methods mean no state -- since I think it is completely reasonable to not be able to access static methods -- aside from the technical/implementation reasons. Another approach is to turn your classes with the static methods into singletons and change the static methods to instance methods on the singleton. That is all I can say for now as I need to get back to watching my the Jackets! Bill Siggelkow [EMAIL PROTECTED]
week ending on date
What mechanisms in JSTL (or even the datetime taglibs) are there to perform date calculations? So far i've only seen formatting options. Essentially i'm looking to calculate the Friday (or Saturday) date for the current week (and eventually be able to generate a list of dates representing week ending...). I'm using the following to obtain today's date. jsp:useBean id=now class=java.util.Date / and formatting it using fmt:formatDate value=${now} pattern=MM/dd// 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]
Re: week ending on date
Hi Anuj, Youcan use the Calender Class to get the dates but my choice is use Jcommon.jar package from jfree.org where u have a number of functions to manipulate dates regards srinivas Anuj Agrawal [EMAIL PROTECTED] wrote: What mechanisms in JSTL (or even the datetime taglibs) are there to perform date calculations? So far i've only seen formatting options. Essentially i'm looking to calculate the Friday (or Saturday) date for the current week (and eventually be able to generate a list of dates representing week ending...). I'm using the following to obtain today's date. and formatting it using 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] - Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today
Re: week ending on date
Hey Srinivas - Thanks for your email. I was really looking to use taglibs only - kinda like the way the EL functions make string-related functions available. Anuj. --- chekuri raju [EMAIL PROTECTED] wrote: Hi Anuj, Youcan use the Calender Class to get the dates but my choice is use Jcommon.jar package from jfree.org where u have a number of functions to manipulate dates regards srinivas Anuj Agrawal [EMAIL PROTECTED] wrote: What mechanisms in JSTL (or even the datetime taglibs) are there to perform date calculations? So far i've only seen formatting options. Essentially i'm looking to calculate the Friday (or Saturday) date for the current week (and eventually be able to generate a list of dates representing week ending...). I'm using the following to obtain today's date. and formatting it using __ 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]
Re: week ending on date
Anuj try this taglib its called time interval taglib at www.servletsuite.com/servlets/tdifftag.htm srinivas Anuj Agrawal [EMAIL PROTECTED] wrote: Hey Srinivas - Thanks for your email. I was really looking to use taglibs only - kinda like the way the EL functions make string-related functions available. Anuj. --- chekuri raju wrote: Hi Anuj, Youcan use the Calender Class to get the dates but my choice is use Jcommon.jar package from jfree.org where u have a number of functions to manipulate dates regards srinivas Anuj Agrawal wrote: What mechanisms in JSTL (or even the datetime taglibs) are there to perform date calculations? So far i've only seen formatting options. Essentially i'm looking to calculate the Friday (or Saturday) date for the current week (and eventually be able to generate a list of dates representing week ending...). I'm using the following to obtain today's date. and formatting it using __ 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] - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!