[jboss-user] [JBoss Seam] - why do the getRestrictions method in List Bean be invoked se

2007-12-03 Thread chlol
the getRestrictions method in List Bean is invoked seven time when the 
getResultList method is invoked?

jboss-4.2.0.GA+jboss seam2.0GA

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4110068#4110068

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4110068
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - why do the getRestrictions method in List Bean be invoked se

2007-12-03 Thread chlol
jboss-4.2.0.GA + jboss seam2.0GA


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4110067#4110067

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4110067
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Myseam, the jboss seam2.0GA's expander framework, offers

2007-11-22 Thread chlol
to explain 1 and 2:
1). for example, i have three tables:sys_role,sys_user,rs_resource,in 
myseam,configurate the generate as the following:
?xml version=1.0 encoding=UTF-8?
  | gen4db
  | !-- module configuration --
  | !--
  | one applicatin cant have more than one modules,and in one 
module 
  | can have more than one tables separated by comma
  | --
  | modules 
  | module name=common
  | sys_user,sys_role
  | /module
  | module name=resource
  | rs_resource
  | /module
  | /modules
  | !-- the all tables prefix,separated by comma --
  | prefixsys,rs/prefix
  | !-- the primary key generation type,the value must be in 
IDENTITY,SEQUENCE,TABLE,AUTO --
  | primaryKeyTypeIDENTITY/primaryKeyType
  | /gen4db

and the base package is com.googlecode.myproject,then the model class of  
sys_user and sys_role will be generated into 
com.googlecode.myproject.model.common,and rs_resource's model will be generated 
into com.googlecode.myproject.model.resource,and the Home bean and list bean 
will be generated into com.googlecode.myproject.service.common and 
com.googlecode.myproject.service.resource,and the view will be generated into 
common and resource.

2).the all code generated don't constain the table prefix,sys and rs,including 
their name.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4107226#4107226

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4107226
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Myseam, the jboss seam2.0GA's expander framework, offers

2007-11-22 Thread chlol
complementarity for 2:
the name of the code generated as the following:
model:User,Role,Resource
home:UserHome,RoleHome,ResourceHome
list:UserList,RoleList,ResourceList
view:UserEdit.xml,RoleEdit.xml,ResourceEdit.xml,eg.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4107227#4107227

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4107227
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Myseam, the jboss seam2.0GA's expander framework, offers

2007-11-20 Thread chlol
to 1 and 2,hibernate tools can not support these two functions too,but we need 
them very much ,so i developped myseam.I love jboss seam very much,but if it 
can add more characters of appfuse 1.9.x,it'll become more and more perfect.I 
have to say myseam was supplied to my own company to use at first,and after we 
used it we found it's very convenient ,so i share it now.if needed,i'd also 
like to do something to contribute to jboss seam.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4106586#4106586

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4106586
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Myseam, the jboss seam2.0GA's expander framework, offers

2007-11-19 Thread chlol
The aim of myseam is providing many ways to use jboss seam and sharing some 
using experience.These often are not attentioned by framework itself,because 
different people or companies are different in ways and habits of using jboss 
seam.Myseam is just the tools that let people to use jbossseam more flexsible 
and convenient.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4106028#4106028

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4106028
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Myseam, the jboss seam2.0GA's expander framework, offers new

2007-11-18 Thread chlol
new feature that the jboss seam don't contain:
1. the Home Bean,List Bean,entity can be generated into difference package,and 
the view can be generated into difference directory. 
  | 2. the table prefix can be get off when generating code 
  | 3. the label value in page be config in resource file and generated by 
tools. 
  | 4. use datascroller tag to scroll the page for listing data. 
  | 5. user rich:calendar for timestamp property. 
  | 6. format date for the view and list page and the format be config in 
resource file. 
  | 7. the value of getMaxResults be config in resource file.
  | 8. add user and role management module
  | 
  | http://myseam.googlecode.com

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4105885#4105885

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4105885
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-24 Thread chlol
thank you,pete! 
as you said,the method is invoked once,but i cann't still understand:
1.how the page know the method usersByManager in UserList?
2.if i have the same factory method in another class,what's the result?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4098628#4098628

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4098628
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-23 Thread chlol
up

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4098096#4098096

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4098096
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-22 Thread chlol
look forward to anybody help on edge !

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4097673#4097673

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4097673
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration DEPLOYMENT] - Re: throws

2007-10-19 Thread chlol
config as idle-timeout-minutes180/idle-timeout-minutes 
then the question is solved

the reason:
in mysql,default global.wait_timeout is 28800 second,if the value of 
idle-timeout-minutes more than global.wait_timeout,and when mysql close the
idle connection,the connection still in the jboss connection pool.then if jboss
application get the connection from pool,however the connection in not exist.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4096829#4096829

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4096829
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-18 Thread chlol
i use the @Factory,but can't solve the question

my list bean generated jboss gen:
package cn.sh.guanghua.manhour.service.admin;
  | 
  | import org.jboss.seam.Component;
  | import org.jboss.seam.ScopeType;
  | import org.jboss.seam.annotations.Factory;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.framework.EntityQuery;
  | 
  | import java.util.ArrayList;
  | import java.util.List;
  | import java.util.Arrays;
  | 
  | import javax.faces.model.SelectItem;
  | import javax.persistence.Query;
  | 
  | import cn.sh.guanghua.manhour.common.Constants;
  | import cn.sh.guanghua.manhour.model.admin.User;
  | import cn.sh.guanghua.manhour.service.Authenticator;
  | 
  | @Name(userList)
  | public class UserList extends EntityQuery {
  | 
  | 
  | private long projectId = -1;
  | 
  | /**
  |  * 
  |  */
  | private static final long serialVersionUID = -4312632636363206451L;
  | 
  | private static final String[] RESTRICTIONS = {
  | lower(user.username) like 
concat('%',concat(lower(#{userList.user.username}),'%')),
  | lower(user.name) like 
concat('%',concat(lower(#{userList.user.name}),'%'))};
  | 
  | private User user = new User();
  | 
  | @Override
  | public String getEjbql() {
  | return select user from User user where username  
'admin';
  | }
  | 
  | @Override
  | public Integer getMaxResults() {
  | return 15;
  | }
  | 
  | public User getUser() {
  | return user;
  | }
  | 
  | @Override
  | public ListString getRestrictions() {
  | ListString list = new ArrayListString();
  | 
  | if (this.getUser().getState() == 0) {
  | list.add(lower(user.state) = #{userList.user.state});
  | }
  | else if (this.getUser().getState() == 1) {
  | list.add(lower(user.state) = #{userList.user.state});
  | }
  | else {
  | //do nothing
  | }
  | list.addAll(Arrays.asList(RESTRICTIONS));
  | return list;
  | }
  | 
  | /**
  |  * @return
  |  */
  | @SuppressWarnings(unchecked)
  | @Factory(scope=ScopeType.CONVERSATION)
  | public ListSelectItem getUsersByManager() {
  | Authenticator authenticator = (Authenticator) 
Component.getInstance(authenticator);
  | User loginUser = authenticator.getUser();
  | ListSelectItem list = new ArrayListSelectItem();
  | list.add(new SelectItem(loginUser.getId(), 
loginUser.getName()));
  | 
  | Query query = getEntityManager().createQuery(select user from 
User user  +
  | where user.username  'admin' and user.state 
= 0  +
  |  and user.userManager.id= + loginUser.getId() 
+  and user.id   + loginUser.getId());
  | ListUser users = query.getResultList();
  | for (User user : users) {
  | list.add(new SelectItem(user.getId(), user.getName()));
  | }   
  | return list;
  | }
  | 
  | 
  | 
  | }
  | 

my page code invoking the method:
h:selectOneMenu id=principalId value=#{activityList.principalId} 
onchange=javascript:document.getElementById('weekActivity').submit();
  | f:selectItems value=#{userList.usersByManager}/
  | /h:selectOneMenu

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4096797#4096797

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4096797
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - the method invoked twice, when render the page once!

2007-10-17 Thread chlol
in my page ,only one place to inove the method,but it excuted twice,when render 
the page once
i search the solution in jboss forum and google,but i cann't solve it.

the code piece:

  | s:decorate template=layout/display.xhtml
  | ui:define name=label#{messages['task.principal']}/ui:define
  | h:selectOneMenu id=userByPrincipalId 
value=#{taskList.task.userByPrincipal.id}
  | f:selectItem itemValue=-1 
itemLabel=#{messages['label.selectItem.message']}/
  | f:selectItems value=#{userList.selectItem}/ 
  | /h:selectOneMenu
  | /s:decorate
  | 

when the page render,the method getSelectItem in UserList invoked twice

my page 

  | !DOCTYPE composition PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
  |  
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  | 
  | ui:composition xmlns=http://www.w3.org/1999/xhtml;
  | xmlns:s=http://jboss.com/products/seam/taglib;
  | xmlns:ui=http://java.sun.com/jsf/facelets;
  | xmlns:f=http://java.sun.com/jsf/core;
  | xmlns:h=http://java.sun.com/jsf/html;
  | xmlns:a=https://ajax4jsf.dev.java.net/ajax;
  | xmlns:rich=http://richfaces.ajax4jsf.org/rich;
  | template=layout/template.xhtml
  | 
  | ui:define name=body
  | 
  | h:messages globalOnly=true styleClass=message 
id=globalMessages /
  | 
  | h:form id=taskSearch styleClass=edit
  | 
  | rich:simpleTogglePanel
  | label=#{messages['subproject']} / 
#{messages['task']} #{messages['label.searchCondition.title']}
  | switchType=ajax
  | h:panelGrid columns=4 
columnClass=gridContent width=80% algin=left
  | s:decorate 
template=layout/display.xhtml
  | ui:define 
name=label#{messages['task.name']}/ui:define
  | h:inputText id=name 
value=#{taskList.task.name}/
  | /s:decorate
  | s:decorate 
template=layout/display.xhtml
  | ui:define 
name=label#{messages['task.belongProject']}/ui:define
  | h:selectOneMenu id=projectId 
value=#{taskList.task.project.id}
  | f:selectItem 
itemValue=-1 itemLabel=#{messages['label.selectItem.message']}/
  | f:selectItems 
value=#{projectList.selectItemByOrdinary}/
  | /h:selectOneMenu
  | /s:decorate
  | 
  | 
  | /h:panelGrid
  | 
  | h:panelGrid columns=4 
columnClass=gridContent width=80% algin=left
  | 
  | s:decorate 
template=layout/display.xhtml
  | ui:define 
name=label#{messages['task.creator']}/ui:define
  | h:selectOneMenu 
id=userByCreatorId value=#{taskList.task.userByCreator.id}
  | f:selectItem 
itemValue=-1 itemLabel=#{messages['label.selectItem.message']}/
  | f:selectItems 
value=#{userList.selectItem}/
  | /h:selectOneMenu
  | /s:decorate
  | 
  | s:decorate 
template=layout/display.xhtml
  | ui:define 
name=label#{messages['task.principal']}/ui:define
  | h:selectOneMenu 
id=userByPrincipalId value=#{taskList.task.userByPrincipal.id}
  | f:selectItem 
itemValue=-1 itemLabel=#{messages['label.selectItem.message']}/
  | f:selectItems 
value=#{userList.selectItem}/ 
  | /h:selectOneMenu
  | /s:decorate
  | /h:panelGrid
  | 
  | 
  | h:panelGrid columns=4 
columnClass=gridContent width=80% algin=left
  | 
  | s:decorate 
template=layout/display.xhtml
  | ui:define 
name=label#{messages['task.type']}/ui:define
  | h:selectOneMenu id=type 
value=#{taskList.task.leafFlag}
  | f:selectItem 
itemValue=-1 itemLabel=#{messages['label.selectItem.message']}/
  |  

[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-17 Thread chlol
thank you,amitev!
The getters are invoked more than once per request,the first,i think it is 
not a good idea,
the second in f:selectItems value=#{userList.selectItem}/  ,the expression 
only accept the getter method.

and in my project,i have many getter method,in which having expensive logic.
what can i do?
thank you again!


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4096346#4096346

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4096346
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Installation, Configuration DEPLOYMENT] - throws Software caused connection abort: socket write error

2007-10-17 Thread chlol
jboss seam 2 rc1 application running on jboss 4.2 + mysql5
the application runs every two days,it throws Software caused connection abort: 
socket write error
the exception detail:
5:09:24,609 ERROR [JDBCExceptionReporter] No operations allowed after 
connection closed.Connection was implicitly closed due to underlying 
exception/error:
  | 
  | 
  | ** BEGIN NESTED EXCEPTION ** 
  | 
  | com.mysql.jdbc.CommunicationsException
  | MESSAGE: Communications link failure due to underlying exception: 
  | 
  | ** BEGIN NESTED EXCEPTION ** 
  | 
  | java.net.SocketException
  | MESSAGE: Software caused connection abort: socket write error
  | 
  | STACKTRACE:
  | 
  | java.net.SocketException: Software caused connection abort: socket write 
error
  | at java.net.SocketOutputStream.socketWrite0(Native Method)
  | at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
  | at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
  | at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
  | at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
  | at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
  | at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
  | at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
  | at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
  | at 
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
  | at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
  | at 
org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
  | at 
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
  | at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
  | at org.hibernate.loader.Loader.doQuery(Loader.java:674)
  | at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
  | at org.hibernate.loader.Loader.doList(Loader.java:2220)
  | at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
  | at org.hibernate.loader.Loader.list(Loader.java:2099)
  | at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
  | at 
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
  | at 
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
  | at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
  | at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
  | at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:80)
  | at 
cn.sh.guanghua.manhour.service.Authenticator.authenticate(Authenticator.java:35)
  | at sun.reflect.GeneratedMethodAccessor1394.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
  | at 
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
  | at 
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | at 
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | at 
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | at 
org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | at 
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
  | at 
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
  | at 
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
  | at 
cn.sh.guanghua.manhour.service.Authenticator_$$_javassist_0.authenticate(Authenticator_$$_javassist_0.java)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:597)
  | at 
org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
  | at 
org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
  | at 

[jboss-user] [JBoss Seam] - Re: the method invoked twice, when render the page once!

2007-10-17 Thread chlol
when using the non-get method,the method  are invoked more than once per 
request!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4096370#4096370

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4096370
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the intercept component don't work!

2007-08-30 Thread chlol
that's ok,thank you!

but how to define a seam component? Is not it to use @Name to define?

pardon my prolixity!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4079425#4079425

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079425
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the intercept component don't work!

2007-08-30 Thread chlol
i understand
thank you very much again!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4079816#4079816

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079816
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the intercept component don't work!

2007-08-29 Thread chlol
my test intercept: 
@Name(interceptsTest)
  | @Interceptor
  | public class InterceptsTest {
  | @Logger
  | Log log;
  | 
  | 
  | @AroundInvoke
  | public Object doLogs(InvocationContext inv) throws Exception {
  | 
  | int methodModify = inv.getMethod().getModifiers();
  | String methodName = inv.getMethod().getName();
  | 
  | if (methodModify == Modifier.PUBLIC 
  |  (methodName.startsWith(create) 
  | || 
methodName.startsWith(update)
  | || 
methodName.startsWith(persist)
  | || 
methodName.startsWith(remove))) {
  | 
  | Map data = inv.getContextData();
  | Object target = inv.getTarget();
  | log.debug(ContextData: + data);
  | log.debug(Target: + target);
  | }
  | 
  | return inv.proceed();
  | }
  | 
  | }
my invoke intercept class: 

@Name(useIntercept)
  | @Interceptors(InterceptsTest.class)
  | public class UseIntercept {
  | 
  | public void persist() {
  | System.out.println( do persist() );
  | }
  | 
  | }

help me,please
thank you

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4079000#4079000

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079000
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: the intercept component don't work!

2007-08-29 Thread chlol
thank your reply!
i use a test case to call the persist method,the following is code:

@Test
  | public void testIntercept() throws Exception {
  | new ComponentTest() {
  | protected void testComponents() throws Exception {  

  | invokeMethod(#{useIntercept.persist});
  | }
  | }.run();
  | }

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4079069#4079069

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079069
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - submit username and password for towice to login successfull

2007-08-28 Thread chlol
my env:jboss-4.2.0.GA + jboss-seam-2.0.0.BETA1

after the jboss  start ,i can login to my application's home page for once,then 
i logout to login page,but here i must submit the username and password 
towice,then login to the home page,why?

can you help me? thank you!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4078594#4078594

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078594
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - is it rich:menuItem bug ?

2007-08-28 Thread chlol
my menu source code:
rich:menuItem submitMode=ajax value=update action=/UserEdit.xhtml
f:param name=userId 
value=#{authenticator.user.id}/
/rich:menuItem

the Authenticator class:

@Name(authenticator)
@Scope(ScopeType.SESSION)
public class Authenticator {
@Logger
Log log;
@In
Identity identity;
@In
EntityManager entityManager;

private User user = new User();

public boolean authenticate() {
log.info(authenticating #0, identity.getUsername());
// write your authentication logic here,
// return true if the authentication was
// successful, false otherwise
try {
user = (User) entityManager
.createQuery(
from User where 
username = :username and password = :password)
.setParameter(username, 
identity.getUsername())
.setParameter(password, 
identity.getPassword())
.getSingleResult();
if (user.getUserRoles() != null) {
for (UserRole role : user.getUserRoles()) {

identity.addRole(role.getRole().getName());
}
}
return true;
} catch (NoResultException ex) {
return false;
}

}

@Out
public User getUser() {
return user;
}
}


i login to the home page ,then drop the menu update,the url is 
manhour/UserEdit.seam?cid=37
but the edit page has no the user info,but when i drop the menu update 
again,the url is manhour/UserEdit.seam?userId=1cid=38,here the user info 
appear,i can't understant that.

can you help me?


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4078602#4078602

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078602
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: add my own interceptor with problems

2007-08-17 Thread chlol
i meet the same question,but can't resolve it

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4075150#4075150

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4075150
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Interceptor for seam component

2007-08-17 Thread chlol
i do it as the doc,but i can't invoke the interceptor,my code is the following

theinterceptor:
package cn.sh.guanghua.manhour.service.manhour;

import java.lang.reflect.Modifier;
import java.util.Map;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;
import org.jboss.seam.log.Log;

import cn.sh.guanghua.manhour.model.manhour.Logs;

@Name(logsHome)
public class LogsHome extends EntityHome {
@Logger
Log log;

public void setLogsId(Long id) {
setId(id);
}

public Long getLogsId() {
return (Long) getId();
}

@Override
protected Logs createInstance() {
Logs logs = new Logs();
return logs;
}

public void wire() {
}

public boolean isWired() {
return true;
}

public Logs getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}

@AroundInvoke
public Object doLogs(InvocationContext inv) throws Exception {
int methodModify = inv.getMethod().getModifiers();
String methodName = inv.getMethod().getName();

System.out.println(111);
if (methodModify == Modifier.PUBLIC 
 (methodName.startsWith(create) 
|| 
methodName.startsWith(update)
|| 
methodName.startsWith(persist)
|| 
methodName.startsWith(remove))) {

Map data = inv.getContextData();
Object target = inv.getTarget();
log.debug(ContextData: + data);
log.debug(Target: + target);
}

return inv.proceed();
}

}


the invoke interceptor class:
package cn.sh.guanghua.manhour.service.admin;

import java.util.ArrayList;
import java.util.List;

import javax.interceptor.Interceptors;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

import cn.sh.guanghua.manhour.model.admin.Role;
import cn.sh.guanghua.manhour.model.admin.RoleResource;
import cn.sh.guanghua.manhour.service.manhour.LogsHome;

@Name(roleHome)
@Interceptors(LogsHome.class)
public class RoleHome extends EntityHome {

public void setRoleId(Long id) {
setId(id);
}

public Long getRoleId() {
return (Long) getId();
}

@Override
protected Role createInstance() {
Role role = new Role();
return role;
}

public void wire() {
}

public boolean isWired() {
return true;
}

public Role getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}

public List getRoleResources() {
return getInstance() == null ? null : new ArrayList(
getInstance().getRoleResources());
}

}

but when RoleHome excute the persist method,the interceptor don't work

thank you!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4075146#4075146

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4075146
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - how to generate all code to many module using seam-gen?

2007-02-22 Thread chlol
eg:
i have 20 tables,i want to generate 1-5 tables code to admin module,and 6-10 
tables code to system module, and 10-20 tables code to forum module.

but in current version,jboss-seam generate all tables code to only one 
direction,include entity,session and view.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4020549#4020549

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4020549
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - How to generate all code to many package?

2007-02-22 Thread chlol
eg: 
i have 20 tables,i want to generate 1-5 tables code to admin module,and 6-10 
tables code to system module, and 10-20 tables code to forum module. 

but in current version,jboss-seam generate all tables code to only one 
directory,include entity,session and view.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4020934#4020934

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4020934
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: May i generate a full application by seam-gen in a datab

2006-12-05 Thread chlol
[EMAIL PROTECTED] wrote : yes.
  | 
  | http://docs.jboss.com/seam/1.1CR2/reference/en/html/gettingstarted.html

thank you gavin!
but if i want to use icefaces ,the seam don't generate the view ,and the file 
generatd put into a directory,Can i put it into difference directory in 
obedience to my business module  by seam-gen?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3991516#3991516

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3991516
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - May i generate a full application by seam-gen in a databae e

2006-12-04 Thread chlol
i had tables in a database,i want to generate entity bean,action bean,view once 
and the generated application can be run.
Can seam 1.x do that? 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3991181#3991181

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3991181
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user