Thanks guys I was able to make some forward progress based on your suggestions. 
Turns out I was looking at examples from the CVS and using the beta1 code (so I 
could use 4.0.3SP1). Seems (no pun intended) that it's a rather confusing time 
right now to start with beta2 about to go out, but only working with 4.0.4 
currently.

Anyway I got my page to load up. New road block.


  | 0:22:23,020 INFO  [EARDeployer] Started J2EE application: 
file:/C:/jboss-4.0.3SP1/server/default/deploy/phone-log.ear
  | 10:22:35,426 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:35,426 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:35,426 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:35,473 INFO  [MyfacesConfig] No context init parameter 
'org.apache.myfaces.PRETTY_HTML' found, using default value true
  | 10:22:35,473 INFO  [MyfacesConfig] No context init parameter 
'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
  | 10:22:35,473 INFO  [MyfacesConfig] No context init parameter 
'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
  | 10:22:35,473 INFO  [MyfacesConfig] No context init parameter 
'org.apache.myfaces.AUTO_SCROLL' found, using default value false
  | 10:22:54,833 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,849 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 10:22:54,942 WARN  [VariableResolverImpl] Variable 'userutils' could not be 
resolved.
  | 10:22:54,958 WARN  [VariableResolverImpl] Variable 'user' could not be 
resolved.
  | 
  | 

Thats what the console dumps.

web.xml 


  | <?xml version="1.0" encoding="UTF-8"?>
  | <web-app version="2.4" 
  |     xmlns="http://java.sun.com/xml/ns/j2ee";
  |     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  |     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
  | 
  |     <!-- Seam -->
  |    
  |     <listener>
  |         <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
  |     </listener>
  |     
  |     <!-- 120 second conversation timeout -->
  |     <context-param>
  |         
<param-name>org.jboss.seam.core.manager.conversationTimeout</param-name>
  |         <param-value>120000</param-value>
  |     </context-param>
  | 
  |     <!-- TODO: Not working yet unless you disable repository scoped 
classloading by deleting jboss-app.xml -->
  |     <!-- context-param>
  |         
<param-name>org.jboss.seam.core.init.clientSideConversations</param-name>
  |         <param-value>true</param-value>
  |     </context-param-->
  | 
  |     <!-- MyFaces -->
  | 
  |     <listener>
  |         
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  |     </listener>
  | 
  |     <context-param>
  |         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  |         <param-value>client</param-value>
  |     </context-param>
  | 
  |     <context-param>
  |         <param-name>facelets.DEVELOPMENT</param-name>
  |         <param-value>true</param-value>
  |     </context-param>
  | 
  |     <context-param>
  |         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  |         <param-value>.jsp</param-value>
  |     </context-param>
  | 
  |     <servlet>
  |         <servlet-name>Faces Servlet</servlet-name>
  |         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  |         <load-on-startup>1</load-on-startup>
  |     </servlet>
  | 
  |     <!-- Faces Servlet Mapping -->
  | 
  |     <servlet-mapping>
  |         <servlet-name>Faces Servlet</servlet-name>
  |         <url-pattern>*.seam</url-pattern>
  |     </servlet-mapping>
  | 
  | 
  | </web-app>
  | 

UserUtilsAction.java


  | package org.transaria.noc;
  | 
  | import javax.ejb.Local;
  | 
  | @Local
  | 
  | public interface UserUtils {
  |     
  |     public String createUser();
  |     
  |     }
  | 

UserUtilsAction.java


  | package org.transaria.noc;
  | 
  | import static org.jboss.seam.ScopeType.EVENT;
  | 
  | import java.util.List;
  | import javax.ejb.Interceptor;
  | 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.annotations.Scope;
  | 
  | import javax.faces.application.FacesMessage;
  | import javax.faces.context.FacesContext;
  | import org.jboss.seam.ejb.SeamInterceptor;
  | 
  | @Stateless
  | @Scope(EVENT)
  | @Name("userutils")
  | @Interceptor(SeamInterceptor.class)
  | public class UserUtilsAction implements UserUtils {
  |     
  |     @In @Valid
  |     private User user;
  |     
  |     @PersistenceContext
  |     private EntityManager em;
  |     
  |     @In
  |     private FacesContext facesContext;
  |     
  |     @IfInvalid(outcome=Outcome.REDISPLAY) 
  |     public String createUser() {
  |             List existing = em.createQuery("select username from User where 
username=:username")
  |             .setParameter("username", user.getUsername())
  |             .getResultList();
  |             
  |             if (existing.size()==0)
  |             {
  |                     em.persist(user);
  |                     return "created";
  |             }
  |             else
  |             {
  |                     facesContext.addMessage(null, new 
FacesMessage("username already exists"));
  |                     return null;
  |             }
  |     }
  | 
  | }
  | 

User.java


  | 
  | package org.transaria.noc;
  | 
  | import static javax.persistence.GeneratorType.AUTO;
  | import static org.jboss.seam.ScopeType.SESSION;
  | 
  | import java.io.Serializable;
  | import java.util.Date;
  | import javax.persistence.Entity;
  | import javax.persistence.Id;
  | import javax.persistence.Table;
  | import org.hibernate.validator.NotNull;
  | import org.jboss.seam.annotations.*;
  | 
  | @Entity
  | @Name("user")
  | @Scope(SESSION)
  | @Table(name="users")
  | 
  | public class User implements Serializable {
  | 
  |     private static final long serialVersionUID = 5139654161684162176L;
  |     private long id;
  |     private String first;
  |     private String last;
  |     private String username;
  |     private String password;
  |     private Date createdate;
  |     
  |     public User (String first, String last, String username, String 
password) {
  |              this.first = first;
  |              this.last = last;
  |              this.username = username;
  |              this.password = password;
  |              createdate = new Date();               
  |     }
  |     
  |     public User () {
  |             
  |     }
  |     
  |     @NotNull
  |     public Date getCreatedate() {
  |             return createdate;
  |     }
  |     public void setCreatedate(Date createdate) {
  |             this.createdate = createdate;
  |     }
  |     @NotNull
  |     public String getFirst() {
  |             return first;
  |     }
  |     public void setFirst(String first) {
  |             this.first = first;
  |     }
  |     @Id(generate=AUTO) @NotNull
  |     public long getId() {
  |             return id;
  |     }
  |     public void setId(long id) {
  |             this.id = id;
  |     }
  |     @NotNull
  |     public String getLast() {
  |             return last;
  |     }
  |     public void setLast(String last) {
  |             this.last = last;
  |     }
  |     @NotNull
  |     public String getPassword() {
  |             return password;
  |     }
  |     public void setPassword(String password) {
  |             this.password = password;
  |     }
  |     @NotNull
  |     public String getUsername() {
  |             return username;
  |     }
  |     public void setUsername(String username) {
  |             this.username = username;
  |     }
  |     
  |     
  | 
  | }
  | 

usercreate.jsp


  | 
  | <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h" %>
  | <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f" %>
  | <html>
  |  <head>
  |   <title>Create New User</title>
  |  </head>
  |  <body>
  |   <f:view>
  |    <h:form>
  |      <table border="0">
  |        <tr>
  |          <td>Username</td>
  |          <td><h:inputText value="#{user.username}"/></td>
  |        </tr>
  |        <tr>
  |          <td>First Name</td>
  |          <td><h:inputText value="#{user.first}"/></td>
  |        </tr>
  |        <tr>
  |          <td>Last Name</td>
  |          <td><h:inputText value="#{user.last}"/></td>
  |        </tr>
  |        <tr>
  |          <td>Password</td>
  |          <td><h:inputSecret value="#{user.password}"/></td>
  |        </tr>
  |      </table>
  |      <h:messages/>
  |      <h:commandButton type="submit" value="Register" 
action="#{userutils.createUser}"/>
  |    </h:form>
  |   </f:view>
  |  </body>
  | </html>
  | 
  | 



Thanks in advance to anyone who can point me in the right direction...I've gone 
though all the examples and I must be missing something...

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to