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;
  | 
  | 
  | 
  | @Stateless
  | @Name("editcustomer")
  | public class EditCustomerAction implements EditCustomer {
  | 
  | 
  |     @In
  |     @Valid
  |     private Customer customer;
  |     
  |     @PersistenceContext
  |     private EntityManager em;
  |     
  |     @Resource
  |     SessionContext ctx;
  |     
  |     @IfInvalid(outcome=Outcome.REDISPLAY)
  |     public String register() {
  |             
  |           List existing = em.createQuery("select customerId from Customer c 
where c.customerId=:cid")
  |              .setParameter("cid", customer.getCustomerId())
  |              .getResultList();
  |           if (existing.size()==0)
  |           {
  |              em.persist(customer);
  |              return "/success.jsp";
  |           }
  |           else
  |           {
  |              FacesMessages.instance().add("Customer already exists");
  |              return null;
  |           }
  |        
  |     }       
  | }
  | 

JSP calls this session bean is

  | <!--
  |     entry.jsp
  | -->
  | 
  | <%@ 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" %>
  | 
  | <html>
  | <head></head>
  | <f:view>
  | <body>
  |   <h:form>
  |   <table>
  |     <tr><td>ID:</td>
  |     <td><h:inputText value="#{customer.customerId}"/></td></tr>
  |     <tr><td>FirstName:</td>
  |     <td><h:inputText value="#{customer.firstName}"/></td></tr>
  |     <tr><td>LastName:</td>
  |     <td><h:inputText value="#{customer.lastName}"/></td></tr>
  |    </table>
  |    <h:messages/>
  |    <h:commandButton type="submit" value="Register" 
action="#{editcustomer.register}" />
  |    </h:form>
  | 
  | 
  | </body>
  | </f:view>
  | 
  | </html>
  | 

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


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956533#3956533

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956533


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to