Look in the Tag Library Descriptor, should be in /WEB-INF. Probably
javamail.tld or something similar. That is what would matter in this case.

You can tweak the TLD to allow for runtime values. Try it out and if you
can't get it working send me a e-mail directly: [EMAIL PROTECTED]

Cheers,

Jayson

Daniel Jayapaul wrote:
> The attribute is not static  ....
>
> /*public class MimeBodyPartTag extends BodyTagSupport {
>
>     private String type;
>     private String uri;
>     private String name;
>     private Object o;
>
>     public MimeBodyPartTag() {
>         type = "text/plain";
>         uri = null;
>         name = null;
>         o = null;
>     }
>
>     public void setType(String s) {
>         type = s;
>     }
>
>     public void setUri(String s) {
>         uri = s;
>         System.out.println("The URI "+uri);
>     }
>
>     public void setName(String s) {
>         name = s;
>     }
>
>     public void setContent(String s) {
>         o = super.pageContext.findAttribute(s);
>     }
>
>     public int doEndTag() throws JspTagException {
>         try {
>             if(type.equals("file")) {
>                 MimeBodyPart mimebodypart = new MimeBodyPart();
>                 MimeMessageTag mimemessagetag =
> (MimeMessageTag)TagSupport.findAncestorWithClass(this,
> com.jspinsider.jspkit.javamail.MimeMessageTag.class);
>                 FileDataSource filedatasource = new FileDataSource(uri);
>                 mimebodypart.setDataHandler(new
> DataHandler(filedatasource));
>                 if(name != null)
>                     mimebodypart.setFileName(name);
>                 else
>                     mimebodypart.setFileName(uri);
>                 mimemessagetag.addMimeBodyPart(mimebodypart);
>             } else
>             if(type.equals("url")) {
>                 MimeBodyPart mimebodypart1 = new MimeBodyPart();
>                 MimeMessageTag mimemessagetag1 =
> (MimeMessageTag)TagSupport.findAncestorWithClass(this,
> com.jspinsider.jspkit.javamail.MimeMessageTag.class);
>                 URLDataSource urldatasource = new URLDataSource(new
> URL(uri));
>                 mimebodypart1.setDataHandler(new
> DataHandler(urldatasource));
>                 if(name != null)
>                     mimebodypart1.setFileName(name);
>                 else
>                     mimebodypart1.setFileName(uri);
>                 mimemessagetag1.addMimeBodyPart(mimebodypart1);
>             } else {
>                 BodyContent bodycontent = getBodyContent();
>                 StringWriter stringwriter = new StringWriter();
>                 bodycontent.writeOut(stringwriter);
>                 o = stringwriter.toString();
>                 MimeMessageTag mimemessagetag2 =
> (MimeMessageTag)TagSupport.findAncestorWithClass(this,
> com.jspinsider.jspkit.javamail.MimeMessageTag.class);
>                 MimeBodyPart mimebodypart2 = new MimeBodyPart();
>                 DataHandler datahandler = new DataHandler(o, type);
>                 mimemessagetag2.addMimeBodyPart(mimebodypart2);
>             }
>         }
>         catch(Exception exception) {
>             throw new JspTagException("JSP Kit text tag error:" +
> exception.toString());
>         }
>         return 6;
>     }
> }
> */
>
>
>>Hi Guys
>>
>>I have downloaded this JSP mail from jspinsider.com
>>
>>and I have used this  and I supplied values using
>>varaibles everything works fine but If  I supply
>>the value for the attachment it is not accepting
>>I can pass values to all tags except this
>>    <%  String urlAtt ="c:/example.txt" ; %>
>>
>>   <JavaMail:bodyPart type="file" uri="<%=urlAtt%>"/>
>>
>>This line gives file not found exception
>>
>>Can any one tell me how to pass value to this tag ?
>>
>>If I use like this
>>   <JavaMail:bodyPart type="file" uri="c:/example.txt"/>
>>it works fine..,
>>
>>
>>
>><% String smtp="203.148.249.19"; %>
>>
>> <%@ taglib uri="http://www.jspinsider.com/jspkit/JavaMail";
>>prefix="JavaMail"%>
>> <JavaMail:mimeMessage
>>    server="<%=smtp%>"
>>    from="[EMAIL PROTECTED]"
>>    subject="Test email.">
>><% String [EMAIL PROTECTED] %>
>>   <JavaMail:recipient><%=name%></JavaMail:recipient>
>>   <JavaMail:recipient
>>type="bcc">[EMAIL PROTECTED]</JavaMail:recipient>
>>   <JavaMail:recipient
>>type="cc">[EMAIL PROTECTED]</JavaMail:recipient>
>>
>>    <%  String urlAtt ="c:/example.txt" ; %>
>>
>>   <JavaMail:bodyPart type="file" uri="<%=urlAtt%>"/>
>>
>>   <JavaMail:bodyPart type="url"
>>uri="http://www.jspinsider.com/index.html"/>
>> </JavaMail:mimeMessage>
>>
>> <h2> Message Sent to Following Recipients</h2>
>>
>>
>>E.Daniel Jayapaul
>>Java Team Leader
>>Mustang Technologies Co., Ltd.
>>99/29, Moo 4,Chaengwattana Road
>>Klong Gleua,Pakkred
>>Nonthaburi 1120,Thailand
>>http://www.mustang-technologies.com
>>Tel:   662 583 6161 -5
>>Fax:  662 583 6535
>>
>>
>
> ===========================================================================
>
>>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>
> JSP-INTEREST".
>
>>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>
> DIGEST".
>
>>Some relevant FAQs on JSP/Servlets can be found at:
>>
>> http://archives.java.sun.com/jsp-interest.html
>> http://java.sun.com/products/jsp/faq.html
>> http://www.esperanto.org.nz/jsp/jspfaq.jsp
>> http://www.jguru.com/faq/index.jsp
>> http://www.jspinsider.com
>>
>>
>
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to