[JBoss Seam] - inline image email attachment
by sandy_brydon
i'm am resurrecting my old post http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100391#4100391
which i got little traction (probably because i just hung it off another chain).
----------------
I am having trouble with how an inline attachment is supposed to work since it doesn't seem to be creating a boundary with Content-Type: multipart/related around the attachment, it merely relies on the outer multipart/mixed boundary defined in the header of the email.
The effect is that my email client (Thunderbird) is treating the image as an attachment and is not placing it inline.
| ...
| <m:attachment
| value="#{emailService.params.get('img_logo')}"
| fileName="logo.gif"
| status="logo"
| disposition="inline" />
| <img src="cid:#{logo.contentId}" alt="logo" />
| ...
|
(the attachment value references a java.net.URL - i doubt this matters, but just in case)
everything else appears to be correct:
- the header for the logo:
| Content-Type: image/gif; charset=ISO-8859-1; name=logo.gif
| Content-Transfer-Encoding: base64
| Content-ID: <ckgkyystehilrvoyfavc>
| Content-Disposition: inline; filename=logo.gif
|
- the corresponding img tag:
| <img src="cid:ckgkyystehilrvoyfavc" alt="logo" />
|
is this incorrect? perhaps i have misconfigured something?
jboss-4.2.1.GA
jboss-seam-2.0.0.CR3
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122813#4122813
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122813
18 years, 6 months
[JBoss Seam] - Re: Ending default scope SFSB's needed?
by Oberiko
Yeah, but I'm not explictly calling @Start or @End on any of my methods. How does Seam determine when I'm finished with this session bean?
| package org.domain.myProject.session;
|
| import static javax.persistence.PersistenceContextType.EXTENDED;
|
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.ejb.Stateless;
| import javax.persistence.EntityManager;
|
| import javax.persistence.PersistenceContext;
|
| import org.domain.myProject.entity.EmailAddress;
| import org.domain.myProject.entity.Person;
| import org.domain.myProject.session.local.EditPersonLocal;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.contexts.Context;
| import org.jboss.seam.contexts.Contexts;
| import org.jboss.seam.faces.FacesMessages;
| import org.jboss.seam.log.Log;
|
| @Stateful
| @Name("editPerson")
| //(a)Scope(ScopeType.EVENT)
| public class EditPersonForm implements EditPersonLocal {
|
| @Logger
| private Log log;
|
| @In
| FacesMessages facesMessages;
|
| @PersistenceContext(type = EXTENDED)
| private EntityManager em;
|
| @In(required=false)
| @Out(scope=ScopeType.PAGE)
| private Person person;
|
| @In(required=false)
| @Out(required=false)
| private EmailAddress emailAddress;
|
| public void addEmail() {
| person.addEmailAddress(emailAddress);
|
| log.info("Email address " +emailAddress.getUrl() + " Added to "+ person.getName());
|
| emailAddress = new EmailAddress();
| }
|
| public void removeEmail(EmailAddress emailAddress) {
| log.info("Removing Email address " +emailAddress.getUrl());
| person.removeEmailAddress(emailAddress);
| }
|
| public void savePerson() {
| if (person.getId()!=null)
| em.merge(person);
| else
| em.persist(person);
|
| //Note that the id of our person was generated and populated.
| facesMessages.add("Person was saved with an id of "+ person.getId());
|
| log.info(person.getName() +" was saved.");
| }
|
| public void editPerson(Person person) {
| log.info("Getting Id: " + person.getId());
| person = (Person) em.createQuery("from Person p where p.id =" +person.getId()).getSingleResult();
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122810#4122810
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122810
18 years, 6 months
[JBoss Seam] - Pageflow recurence
by blabno
I have following pages :
1)/locations/browseLocations.jspx
2)/locations/addCountry.jspx
3)/locations/complete.jspx
I want to add country to DB. So I place button on browseLocations.jspx :
<s:button value="Add" view="/locations/addCountry.jspx"/>
Now the page flow should start. But when there is a problem during countryCreator.addCountry method invocation, then I want to stay on addCountry.jspx but if I write transition to /locations/addCountry.jspx then I get Exception :
ERROR [SeamPhaseListener] uncaught exception
| java.lang.IllegalStateException: begin() called from long-running conversation, try join=true
addCountry.jpdl.xml
<?xml version="1.0"?>
| <pageflow-definition
| xmlns="http://jboss.com/products/seam/pageflow"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.0.xsd"
| name="addCountry">
|
| <start-page name="addCountry" view-id="/locations/addCountry.jspx">
| <redirect/>
| <transition name="next" to="evaluateSuccess">
| <action expression="#{countryCreator.addCountry}" />
| </transition>
| <transition name="cancel" to="cancel"/>
| </start-page>
| <decision name="evaluateSuccess" expression="#{countryCreator.error}">
| <transition name="false" to="complete"/>
| <transition name="true" to="addCountry"/>
| </decision>
| <page name="complete" view-id="/locations/complete.jspx" no-conversation-view-id="/locations/browseLocations.jspx">
| <redirect/>
| </page>
| <page name="cancel" view-id="/locations/browseLocations.jspx">
| <end-conversation before-redirect="true"/>
| <redirect/>
| </page>
| </pageflow-definition>
pages.xml
<pages>
| <page view-id="/locations/addCountry.jspx">
| <begin-conversation pageflow="addCountry"/>
| </page>
| </pages>
Now, if I cut out everything from pages.xml then there is no conversation at all, and I cannot add anything, nor can display FacesMessages.
Is there other solution than introducing <start-state> and inserting method annotated with @Begin(pageflow="addCountry") in countryCreator bean ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122805#4122805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122805
18 years, 6 months