RE: Question about Mailer Tag library.

2004-08-04 Thread Vianen, Jeroen van
Hi Bing,

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 04, 2004 22:14
> To: [EMAIL PROTECTED]
> Subject: Question about Mailer Tag library.
> 
> 
> 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? 

You might want to try the new mailer2 tag library from
jakarta-taglibs-sandbox that has been uploaded recently. It is currently
only available from CVS. See http://jakarta.apache.org/site/cvsindex.html
for details.

Good luck and best regards,


Jeroen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Feature request in ?

2003-10-07 Thread Vianen, Jeroen van
To be able to write correct XHTML &'s in the querystring need to be escaped.
To do so, I use the following code:







">Link to whatever

This will return a correctly XML / XHTML escaped URL:

...

Would it be possible in a future version of the JSTL to combine these two
tags as follows:






What do you think?


Jeroen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JSTP & Resin

2002-01-22 Thread Vianen, Jeroen van
Hi Yuri,

> -Original Message-
> From: Yuri Peter Kazakov [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 22, 2002 07:23
> To: '[EMAIL PROTECTED]'
> Subject: JSTP & Resin
> 
> 
> Hello,
> 
> I downloaded JSP Standard Tag Library from Sun and installed 
> it under Resin.
> But I can't run Examples (see error message at the end of the mail).
> It looks like web app listener specified in web.xml doesn't work...
> (no application object are created for examples)
> 
> Is  tag in web.xml (Servlet 2.3 Spec) supported by 
> Resin 2.0.3?
> Should I register something in resin.conf?

Please try the latest Resin snapshot and CVS taglibs snapshot. Both contain
fixes you need to run the examples properly. Don't know about listener's
though.

Regards,


Jeroen

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


[standard] Patch for source attribute to also honor URLs

2002-01-02 Thread Vianen, Jeroen van

Hi,

I had the following problem with the  standard tag: when importing
an XML file like this:

http://hostname/path/to/file.xml"; var="xml"/>


Where the (externally generated) XML file contains a reference to a DTD (and
hence the file should be validated). The parse statement should be able to
know where to find the DTD, but it couldn't as the DTD was relative to the
XML file being imported.

Below is a patch that will allow a user to do the following:

http://hostname/path/to/file.xml"; var="doc" />

It will read the file from the URL and perform any validation as necessary.
So, no more  necessary.

Of course, this might not be entirely the right way to use the source
attribute, but I saw no other way to do it.

Please review.

Here's the patch for org.apache.taglibs.standard.tag.xml.ParseSupport.java:

*** ParseSupport.java.orig  Wed Jan  2 16:33:33 2002
--- ParseSupport.java   Wed Jan  2 17:17:40 2002
***
*** 56,61 
--- 56,63 
  package org.apache.taglibs.standard.tag.common.xml;
  
  import java.io.*;
+ import java.net.URL;
+ import java.net.MalformedURLException;
  import javax.servlet.jsp.*;
  import javax.servlet.jsp.tagext.*;
  import javax.xml.parsers.*;
***
*** 198,203 
--- 200,215 
  
  /** Parses the given String into a Document. */
  private Document parseString(String s) throws SAXException,
IOException {
+ /* Is the source attribute a URL? */
+ try {
+ URL url = new URL(s);
+ /* Yes, parse the URL */
+ return db.parse(new InputSource(s));
+ } catch (MalformedURLException ex) {
+ // Ignore
+ }
+ 
+ /* No, it's XML */
  StringReader r = new StringReader(s);
  return parseReader(r);
  }



Cheers,


Jeroen

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[standard] Null in Javascript scope patch

2001-12-20 Thread Vianen, Jeroen van

Hi,

I tried to use the EA3 release of the JSTL standard tag library in Resin
2.0.4.

My JSP more or less looks like this:

<%@ taglib uri="http://java.sun.com/jstl/ea/core"; prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/ea/xml"; prefix="x" %>

http://localhost/path/to/file.xml"; var="xml"/>



... and some more XPath expressions



I was unable to get this to work due to the following exception:

TypeError: Cannot convert null to an object.
at org.mozilla.javascript.NativeGlobal.constructError(Unknown
Source)
at org.mozilla.javascript.NativeGlobal.constructError(Unknown
Source)
at org.mozilla.javascript.NativeGlobal.typeError0(Unknown Source)
at org.mozilla.javascript.ScriptRuntime.toObject(Unknown Source)
at org.mozilla.javascript.Context.toObject(Unknown Source)
at
org.apache.taglibs.standard.lang.javascript.JavascriptExpressionEvaluator.pu
tAttributesInScope(JavascriptExpressionEvaluator.java:159)
at
org.apache.taglibs.standard.lang.javascript.JavascriptExpressionEvaluator.ev
aluate(JavascriptExpressionEvaluator.java:104)
at
org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate
(ExpressionEvaluatorManager.java:200)
at
org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(Expressio
nUtil.java:85)
at
org.apache.taglibs.standard.tag.el.core.ImportTag.evaluateExpressions(Import
Tag.java:150)
at
org.apache.taglibs.standard.tag.el.core.ImportTag.doStartTag(ImportTag.java:
101)
at _traffic2__jsp._jspService(/pda/traffic2.jsp:19)
at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
at com.caucho.jsp.Page.subservice(Page.java:485)
at
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:176)
at com.caucho.server.http.Invocation.service(Invocation.java:278)
at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129)
at
com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:847)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213)
at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)


It turned out that a null pointer was stored somewhere in the JavaScript
scope for the (null) attribute "caucho.authenticator", which is a built-in
Resin attribute.

Below is a patch for
.../standard/src/org/apache/taglibs/standard/lang/javascript/JavascriptExpre
ssionEvaluator.java that fixed this bug for me. I don't know whether this is
the correct fix, but at least I was able to have my JSP working as I
expected.


--- JavascriptExpressionEvaluator.java.orig Thu Dec 20 15:48:57 2001
+++ JavascriptExpressionEvaluator.java  Thu Dec 20 15:57:09 2001
@@ -156,7 +156,9 @@
 while (attributes !=null && attributes.hasMoreElements()) {
 attribute = (String)attributes.nextElement();
 value = pageContext.getAttribute(attribute, scope);
-rhinoScope.put(attribute, rhinoScope,
rhinoContext.toObject(value, rhinoScope));
+if (value != null) {
+rhinoScope.put(attribute, rhinoScope,
rhinoContext.toObject(value, rhinoScope));
+}
 }
 }
 
@@ -174,7 +176,9 @@
 while (attributes !=null && attributes.hasMoreElements()) {
 attribute = (String)attributes.nextElement();
 value = (pageContext.getRequest()).getParameter(attribute);
-rhinoScope.put(attribute, rhinoScope,
rhinoContext.toObject(value, rhinoScope));
+if (value != null) {
+rhinoScope.put(attribute, rhinoScope,
rhinoContext.toObject(value, rhinoScope));
+}
 }
 }
 }


Please review,


Jeroen

--
To unsubscribe, e-mail:   
For additional commands, e-mail: