3 Replies Latest reply on Aug 1, 2006 1:11 PM by Patrick Smith

    Post Again:File download dialog apprears instead of page red

    Susumu Majima Newbie

      I post it again. This time the deference is I used delivered seam-example folder to build my test program.

      I copied registration build file,application.xml,ejb-jar.xml,jboss-app.xml,persistence.xml,faces-config.xml and web.xml.

      I modified application.xml. I used eclipse and did build deploy.
      It succeeded. I tried again my sample,but File download dialog of IE appeared and no page redirection.
      The dialog asked me to donwload success.seam or not.

      Does anybody have the same experience?
      Could you tell me what's wrong?

      My code is

      package seam.register;
      import java.util.List;
      import javax.annotation.Resource;
      import javax.ejb.SessionContext;
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import org.hibernate.validator.Valid;
      import org.jboss.seam.annotations.IfInvalid;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Outcome;
      import org.jboss.seam.core.FacesMessages;
      public class EditCustomerAction implements EditCustomer {
       private Customer customer;
       private EntityManager em;
       SessionContext ctx;
       public String register() {
       List existing = em.createQuery("select customerId from Customer c where c.customerId=:cid")
       .setParameter("cid", customer.getCustomerId())
       if (existing.size()==0)
       return "/success.jsp";
       FacesMessages.instance().add("Customer already exists");
       return null;

      JSP calls this session bean is
      <%@ page contentType="text/html;charset=WINDOWS-31J" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
       <td><h:inputText value="#{customer.customerId}"/></td></tr>
       <td><h:inputText value="#{customer.firstName}"/></td></tr>
       <td><h:inputText value="#{customer.lastName}"/></td></tr>
       <h:commandButton type="submit" value="Register" action="#{editcustomer.register}" />

      The JSP above was executed but dialog apeared.
      I don't think the problem is not in build.xml.