tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@primeradesigns.com
Subject Re: mailer-taglib v1.1 error when changing database
Date Wed, 02 May 2007 19:38:53 GMT
> Hi Philip,
>
> I haven't worked with the mailer-taglib, but I'm familiar with other
> taglibs and some basic concepts of taglibs and also the specific error
> you are getting, I'm not sure if I can help but I'll try.
>
> It would be useful for us to see relevant snippets of code that causes
> this error, in order to diagnose the problem.
>
> Please post the section between
> 	<mt:send>
>
> 	</mt:send>
>
> and also post any other code that you think is relevant.
>
> According to the documentation
> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringIndexOutOfBoundsException.html
> this error java.lang.StringIndexOutOfBoundsException: String index out
> of range: -1 is caused when "..... indicate that an index is either
> negative or greater than the size of the string."
>
> And the above error is occurring when the substring method is invoked
> on something in
> org.apache.taglibs.mailer.SendTag.doStartTag(SendTag.java:265)
>
> Looking at line 265 of SendTag.java would give additional clues.
>
> -Regards
> Rashmi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
Hi Rashmi,

Thanks for your interest:

as follows is info as requested. It is odd because it is exactly same code
as when I use dummy database, which works. I have verified correct mysql
parameters however will look into what the database is actually pulling up
and see if there are problems there.
thanks


-------------------------------------------------------------
block of code around 265:sendtag.java
-------------------------------------------------------------
		// check for more than one address
		if (ref.indexOf(',') != -1) {
		    // position of the start of the error inducing address
		    int pos = ref.substring(0, ae.getPos()).indexOf(',') + 1;
		    // extract the error inducing address
		    ref = ref.substring(pos, ref.indexOf(','));
		}


-------------------------------------------------------------
mt code:
-------------------------------------------------------------
<mt:mail server="mail.strangecargo.org.uk"
to="newsletter@strangecargo.org.uk" authenticate="true"
user="mail.agent@strangecargo.org.uk" password="xxxxxxxx" subject="Strange
Cargo Newsletter" >

<c:forEach var="subs" items="${subscribers.rows}" varStatus="status">
<mt:addrecipient type ="bcc">${subs.subscriberemail}</mt:addrecipient>
</c:forEach>

<mt:from>info@strangecargo.org.uk</mt:from>
<mt:message type="html">
${testhere}</mt:message>
<mt:send/>
</mt:mail>
-------------------------------------------------------------
mt info:
-------------------------------------------------------------
to: is populated
bcc: is populated with correct mysql parameters

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message