[T5.0.18] event method of actionlink was called twice

2009-02-23 Thread osamuo

Hello,

The event method of ActionLink seems to be called twice.

Is this expected behavior?
If yes, is there any way to let the event method to be called only once?

osamuo
-- 
View this message in context: 
http://www.nabble.com/-T5.0.18--event-method-of-actionlink-was-called-twice-tp22176003p22176003.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



How to change t-error

2008-03-28 Thread osamuo

How can I change the 't-error' defined in 'default.css' to other CSS classes?

Thank you
-- 
View this message in context: 
http://www.nabble.com/How-to-change-t-error-tp16348102p16348102.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to change t-error

2008-03-28 Thread osamuo

Is  the following available?

configuration.add( TapestryConstants.ERROR_CLASS, my-t-error );

Thanks.






Cordenier Christophe wrote:
 
 I think you just have to add this CSS class in your own CSS file.
 To add your own CSS you can use the PageRenderSupport service or use the
 @IncludeStylesheet annotation in your component class.
 
 Hope this helps
 
 Christophe
 
 -Message d'origine-
 De : osamuo [mailto:[EMAIL PROTECTED]
 Envoyé : vendredi 28 mars 2008 10:00
 À : users@tapestry.apache.org
 Objet : How to change t-error
 
 
 How can I change the 't-error' defined in 'default.css' to other CSS
 classes?
 
 Thank you
 --
 View this message in context:
 http://www.nabble.com/How-to-change-t-error-tp16348102p16348102.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 Ce message et les pièces jointes sont confidentiels et réservés à l'usage
 exclusif de ses destinataires. Il peut également être protégé par le
 secret professionnel. Si vous recevez ce message par erreur, merci d'en
 avertir immédiatement l'expéditeur et de le détruire. L'intégrité du
 message ne pouvant être assurée sur Internet, la responsabilité du groupe
 Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien
 que les meilleurs efforts soient faits pour maintenir cette transmission
 exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard
 et sa responsabilité ne saurait être recherchée pour tout dommage
 résultant d'un virus transmis.
 
 This e-mail and the documents attached are confidential and intended
 solely for the addressee; it may also be privileged. If you receive this
 e-mail in error, please notify the sender immediately and destroy it. As
 its integrity cannot be secured on the Internet, the Atos Origin group
 liability cannot be triggered for the message content. Although the sender
 endeavours to maintain a computer virus-free network, the sender does not
 warrant that this transmission is virus-free and will not be liable for
 any damages resulting from any virus transmitted.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-change-t-error-tp16348102p16348989.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How is T5 tutorial?

2008-03-24 Thread osamuo

How long do we have to wait for the completion of T5 tutorial: Chapter 5:
Forms in Tapestry?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/How-is-T5-tutorial--tp16255566p16255566.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Do I have to @persist( session ) input values in verify page?

2008-03-15 Thread osamuo

Register.tml: let a user register a value
Verify.tml: let a user verify a input


Register.tml
---
form t:type=Form t:id=form
  input t:type=TextField t:value=someValue /
  input type=submit /
/form
---

Register.java
---
public class Register{
 
 @Property
 private String someValue;
 
 @InjectPage
 private Verify verifyPage;
 
 public Object onSuccessFromForm()
   verifyPage.setSomeValue( someValue );
   
   return verifyPage;
 }
}



Verify.tml
-
form t:type=Form t:id=form
  input t:type=TextField t:value=someValue /
  input type=submit /
/form
-

Verify.java
-
public class Verify{
  
  @Persist( session ) == I don't want to store this into the session.
  private String someValue;
  
  public String getSomeValue(){
return someValue;
  }
  
  public void setSomeValue( String someValue ){
this.someValue = someValue;
  }
  
  public Object onSuccessFromForm(){
...
  }
}
-


Is there any way to submit someValue in Verify.tml without using @Persist(
session )?
And why don't T5 support t:type=Hidden?

Thanks,
Osamuo




-- 
View this message in context: 
http://www.nabble.com/Do-I-have-to-%40persist%28-%22session%22-%29-input-values-in-verify-page--tp16066687p16066687.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: TransformationException

2008-03-11 Thread osamuo

Hi,

I show you additional information.

When a page class was defined like the following, I got the
'TransformationException'.
If I comment out the code which uses 'ApplicationState' variables, no error
occurs.


public class Index{

  ...

  @ApplicationState
  private UserState userState;

  private boolean userStateExists;
 
 
  ...
 
 
  public Object onSuccessFromForm(){
if( userStateExists == false || userState.getName() == null ){
// if( 1 == 1 ){ == no error occur when this is used instead of the
above
   registerPage.setName( null );
   registerPage.setPassword( null );
   registerPage.setSubject( subject );
   registerPage.setObject( object );

   return registerPage;
}else{
   confirmPage.setSubject( subject );
   confirmPage.setObject( object );

   return confirmPage;
}
  }
} 



osamuo wrote:
 
 Hi,
 
 I got the following error when I defined '@ApplicationState'.
 What's wrong? I can't find anything wrong.
 
 
 -
 # java.lang.RuntimeException
 java.lang.ClassNotFoundException: caught an exception while obtaining a
 class file for test.pages.Index
 # java.lang.ClassNotFoundException
 caught an exception while obtaining a class file for test.pages.Index
 
 exception
 org.apache.tapestry.internal.services.TransformationException: 4
 
 # org.apache.tapestry.internal.services.TransformationException
 4
 
 transformation
 
 InternalClassTransformation[
 public test.pages.Index extends java.lang.Object
   implements org.apache.tapestry.runtime.Component,
 org.apache.tapestry.runtime.RenderCommand
 
 add default method: public void postRenderCleanup()
 default
 
 add default method: public void
 setupRender(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 beginRender(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 afterRenderTemplate(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 beforeRenderBody(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 afterRenderBody(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 afterRender(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public void
 cleanupRender(org.apache.tapestry.MarkupWriter $1,
 org.apache.tapestry.runtime.Event $2)
 default
 
 add default method: public boolean
 dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
 default
 
 add default method: public org.apache.tapestry.ComponentResources
 getComponentResources()
 default
 
 add default method: public void containingPageDidLoad()
 default
 
 add default method: public void containingPageDidDetach()
 default
 
 add default method: public void containingPageDidAttach()
 default
 
 add field: protected final
 org.apache.tapestry.internal.InternalComponentResources _$resources;
 
 replace method: public final org.apache.tapestry.ComponentResources
 getComponentResources()
 return _$resources;
 
 add method: private void
 _$write_form(org.apache.tapestry.corelib.components.Form $1)
 throw new java.lang.RuntimeException(Field test.pages.Index.form is
 read-only.);
 
 replace write form: _$write_form();
 
 extend method: public void containingPageDidLoad()
 form = (org.apache.tapestry.corelib.components.Form)
 _$resources.getEmbeddedComponent(form);
 
 extend method: public boolean
 dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
 {
   if ($1.isAborted()) return $_;
   try
   {
 if ($1.matches(Success, Form, 0))
 {
   $_ = true;
   $1.setMethodDescription(test.pages.Index.onSuccessFromForm()
 (at Index.java:76));
   if ($1.storeResult(($w) onSuccessFromForm())) return true;
 }
 if ($1.matches(ValidateForm, , 0))
 {
   $_ = true;
   $1.setMethodDescription(test.pages.Index.onValidateForm() (at
 Index.java:63));
   onValidateForm();
 }
   }
   catch (RuntimeException ex) { throw ex; }
   catch (Exception ex) { throw new RuntimeException(ex); } 
 }
 
 
 add field: protected final
 org.apache.tapestry.internal.services.RequestPageCache _$requestPageCache;
 
 add method: private test.pages.tan.Confirm_Registration
 _$read_inject_page_confirmPage()
 {
   org.apache.tapestry.internal.structure.Page page

Re: T5: TransformationException

2008-03-11 Thread osamuo

you are right.
no error occur when using jdk1.5 instead of jdk1.6

thanks



Yunhua Sang wrote:
 
 Are you using JDK 1.6?
 
 Try JDK 1.5 if you are.
 
 On 3/11/08, osamuo [EMAIL PROTECTED] wrote:

 Hi,

 I show you additional information.

 When a page class was defined like the following, I got the
 'TransformationException'.
 If I comment out the code which uses 'ApplicationState' variables, no
 error
 occurs.


 public class Index{

  ...

  @ApplicationState
  private UserState userState;

  private boolean userStateExists;


  ...


  public Object onSuccessFromForm(){
if( userStateExists == false || userState.getName() == null ){
// if( 1 == 1 ){ == no error occur when this is used instead of
 the
 above
   registerPage.setName( null );
   registerPage.setPassword( null );
   registerPage.setSubject( subject );
   registerPage.setObject( object );

   return registerPage;
}else{
   confirmPage.setSubject( subject );
   confirmPage.setObject( object );

   return confirmPage;
}
  }
 }



 osamuo wrote:
 
  Hi,
 
  I got the following error when I defined '@ApplicationState'.
  What's wrong? I can't find anything wrong.
 
 
  -
  # java.lang.RuntimeException
  java.lang.ClassNotFoundException: caught an exception while obtaining a
  class file for test.pages.Index
  # java.lang.ClassNotFoundException
  caught an exception while obtaining a class file for test.pages.Index
 
  exception
  org.apache.tapestry.internal.services.TransformationException: 4
 
  # org.apache.tapestry.internal.services.TransformationException
  4
 
  transformation
 
  InternalClassTransformation[
  public test.pages.Index extends java.lang.Object
implements org.apache.tapestry.runtime.Component,
  org.apache.tapestry.runtime.RenderCommand
 
  add default method: public void postRenderCleanup()
  default
 
  add default method: public void
  setupRender(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  beginRender(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  afterRenderTemplate(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  beforeRenderBody(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  afterRenderBody(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  afterRender(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public void
  cleanupRender(org.apache.tapestry.MarkupWriter $1,
  org.apache.tapestry.runtime.Event $2)
  default
 
  add default method: public boolean
  dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
  default
 
  add default method: public org.apache.tapestry.ComponentResources
  getComponentResources()
  default
 
  add default method: public void containingPageDidLoad()
  default
 
  add default method: public void containingPageDidDetach()
  default
 
  add default method: public void containingPageDidAttach()
  default
 
  add field: protected final
  org.apache.tapestry.internal.InternalComponentResources _$resources;
 
  replace method: public final org.apache.tapestry.ComponentResources
  getComponentResources()
  return _$resources;
 
  add method: private void
  _$write_form(org.apache.tapestry.corelib.components.Form $1)
  throw new java.lang.RuntimeException(Field test.pages.Index.form
 is
  read-only.);
 
  replace write form: _$write_form();
 
  extend method: public void containingPageDidLoad()
  form = (org.apache.tapestry.corelib.components.Form)
  _$resources.getEmbeddedComponent(form);
 
  extend method: public boolean
  dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
  {
if ($1.isAborted()) return $_;
try
{
  if ($1.matches(Success, Form, 0))
  {
$_ = true;
$1.setMethodDescription(test.pages.Index.onSuccessFromForm()
  (at Index.java:76));
if ($1.storeResult(($w) onSuccessFromForm())) return true;
  }
  if ($1.matches(ValidateForm, , 0))
  {
$_ = true;
$1.setMethodDescription(test.pages.Index.onValidateForm()
 (at
  Index.java:63));
onValidateForm();
  }
}
catch (RuntimeException ex) { throw ex; }
catch (Exception ex) { throw new

T5: TransformationException

2008-03-10 Thread osamuo

Hi,

I got the following error when I defined '@ApplicationState'.
What's wrong? I can't find anything wrong.


-
# java.lang.RuntimeException
java.lang.ClassNotFoundException: caught an exception while obtaining a
class file for test.pages.Index
# java.lang.ClassNotFoundException
caught an exception while obtaining a class file for test.pages.Index

exception
org.apache.tapestry.internal.services.TransformationException: 4

# org.apache.tapestry.internal.services.TransformationException
4

transformation

InternalClassTransformation[
public test.pages.Index extends java.lang.Object
  implements org.apache.tapestry.runtime.Component,
org.apache.tapestry.runtime.RenderCommand

add default method: public void postRenderCleanup()
default

add default method: public void
setupRender(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
beginRender(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
afterRenderTemplate(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
beforeRenderBody(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
afterRenderBody(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
afterRender(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public void
cleanupRender(org.apache.tapestry.MarkupWriter $1,
org.apache.tapestry.runtime.Event $2)
default

add default method: public boolean
dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
default

add default method: public org.apache.tapestry.ComponentResources
getComponentResources()
default

add default method: public void containingPageDidLoad()
default

add default method: public void containingPageDidDetach()
default

add default method: public void containingPageDidAttach()
default

add field: protected final
org.apache.tapestry.internal.InternalComponentResources _$resources;

replace method: public final org.apache.tapestry.ComponentResources
getComponentResources()
return _$resources;

add method: private void
_$write_form(org.apache.tapestry.corelib.components.Form $1)
throw new java.lang.RuntimeException(Field test.pages.Index.form is
read-only.);

replace write form: _$write_form();

extend method: public void containingPageDidLoad()
form = (org.apache.tapestry.corelib.components.Form)
_$resources.getEmbeddedComponent(form);

extend method: public boolean
dispatchComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
{
  if ($1.isAborted()) return $_;
  try
  {
if ($1.matches(Success, Form, 0))
{
  $_ = true;
  $1.setMethodDescription(test.pages.Index.onSuccessFromForm() (at
Index.java:76));
  if ($1.storeResult(($w) onSuccessFromForm())) return true;
}
if ($1.matches(ValidateForm, , 0))
{
  $_ = true;
  $1.setMethodDescription(test.pages.Index.onValidateForm() (at
Index.java:63));
  onValidateForm();
}
  }
  catch (RuntimeException ex) { throw ex; }
  catch (Exception ex) { throw new RuntimeException(ex); } 
}


add field: protected final
org.apache.tapestry.internal.services.RequestPageCache _$requestPageCache;

add method: private test.pages.tan.Confirm_Registration
_$read_inject_page_confirmPage()
{
  org.apache.tapestry.internal.structure.Page page =
_$requestPageCache.get(tan/Confirm_Registration);
  return (test.pages.tan.Confirm_Registration)
page.getRootElement().getComponent();
}


replace read confirmPage: _$read_inject_page_confirmPage();

add method: private void
_$write_confirmPage(test.pages.tan.Confirm_Registration $1)
throw new java.lang.RuntimeException(Field test.pages.Index.confirmPage
is read-only.);

replace write confirmPage: _$write_confirmPage();

remove field confirmPage;

add method: private test.pages.tan.Register
_$read_inject_page_registerPage()
{
  org.apache.tapestry.internal.structure.Page page =
_$requestPageCache.get(tan/Register);
  return (test.pages.tan.Register) page.getRootElement().getComponent();
}


replace read registerPage: _$read_inject_page_registerPage();

add method: private void _$write_registerPage(test.pages.tan.Register
$1)
throw new java.lang.RuntimeException(Field
test.pages.Index.registerPage is read-only.);

replace write 

T5 : tapestry-hibernate : rollback when exception was thrown

2008-01-20 Thread osamuo

I am using the tapestry-hibernate and 'hibernate.connection.autocommit' in
hibernate.cfg.xml is set to false.

After throwing a exception, transaction was committed.

So I called HibernateSessionManager#abort(), but the transaction was still
committed.

Please tell me how to rollback the current transaction when a exception was
thrown!!!



@Inject
Session session;

public Object onSubmit(){
 User user = new User();
 user.setName( tapestry );
 session.save( user );
 
 throw new RuntimException() // for test
}
-

Osamuo

-- 
View this message in context: 
http://www.nabble.com/T5-%3A-tapestry-hibernate-%3A-rollback-when-exception-was-thrown-tp14990335p14990335.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: tapestry-hibernate: rollback

2008-01-12 Thread osamuo

Hi,

Yes, I have.
I created 'hibernate.cfg.xml' like the following.

--
hibernate-configuration
session-factory

property
name=hibernate.dialectorg.hibernate.dialect.PostgreSQLDialect/property

property
name=hibernate.connection.urljdbc:postgresql://192.168.0.103/Test/property
property name=hibernate.connection.usernametest/property
property name=hibernate.connection.passwordtesttest/property
property
name=hibernate.connection.driver_classorg.postgresql.Driver/property

property
name=hibernate.cache.provider_classnet.sf.ehcache.hibernate.EhCacheProvider/property

property name=hibernate.transaction.auto_close_sessionfalse/property

property name=hibernate.jdbc.use_get_generated_keystrue/property
property name=hibernate.cache.use_query_cachetrue/property
property name=hibernate.bytecode.use_reflection_optimizertrue/property

property name=hibernate.show_sqltrue/property
property name=hibernate.format_sqltrue/property

mapping class=TmpUser /

/session-factory

/hibernate-configuration
--

Thanks,
Osamuo





Sven Homburg wrote:
 
 have you set autocommit to off in hibernate config
 like this:
 
 property name=hibernate.connection.autocommitfalse/property
 
 
 
 
 osamuo wrote:
 
 Hi,
 
 I used the following code in order to rollback the current transaction.
 But its transaction was committed after the calling
 HibernateSessionManager.abort().
 
 What's wrong?
 
 ---
 public class RegisterUser{
 ...
 
 @Inject
 private Session session;
 
 @Inject
 private HibernateSessionManager sessionManager;
 
 
 public Object onSubmit(){
   ...
   TmpUser tmpUser = new TmpUser();
   ...
   
   session.save( tmpUser );
   sessionManager.abort(); // force rollback
 
   return null;
 }
 }
 -
 
 
 Thanks,
 Osamuo
 
 
 Davor Hrg wrote:
 
 HibernateSessionManager
 
 
 On Jan 11, 2008 11:51 AM, Massimo Lusetti [EMAIL PROTECTED] wrote:
 On Jan 11, 2008 10:00 AM, osamuo [EMAIL PROTECTED] wrote:

 
  Hi,
 
  I have noticed that the tapestry-hibernate commits the current
 transaction
  even after an exception occurs.
 
  Is there any way to do rollback its transaction?

 Use the manager ?


 --
 Massimo
 http://meridio.blogspot.com


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14775087.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: tapestry-hibernate: rollback

2008-01-12 Thread osamuo

Hi,

I had mistaken.
I had set 'hibernate.transaction.auto_close_session' instead of
'hibernate.connection.autocommit'.

But I encountered the same condition again when I set
'hibernate.connection.autocommit' to false.

--
hibernate-configuration
session-factory

property
name=hibernate.dialectorg.hibernate.dialect.PostgreSQLDialect/property

property
name=hibernate.connection.urljdbc:postgresql://192.168.0.103/Test/property
property name=hibernate.connection.usernametest/property
property name=hibernate.connection.passwordtesttest/property
property
name=hibernate.connection.driver_classorg.postgresql.Driver/property

property
name=hibernate.cache.provider_classnet.sf.ehcache.hibernate.EhCacheProvider/property

property name=hibernate.connection.autocommitfalse/property

property name=hibernate.jdbc.use_get_generated_keystrue/property
property name=hibernate.cache.use_query_cachetrue/property
property name=hibernate.bytecode.use_reflection_optimizertrue/property

property name=hibernate.show_sqltrue/property
property name=hibernate.format_sqltrue/property

mapping class=TmpUser /

/session-factory

/hibernate-configuration
--

Thanks,
Osamuo




Sven Homburg wrote:
 
 i miss the autocommit property in your config
 
 2008/1/12, osamuo [EMAIL PROTECTED]:


 Hi,

 Yes, I have.
 I created 'hibernate.cfg.xml' like the following.

 --
 hibernate-configuration
 session-factory

 property
 name=hibernate.dialectorg.hibernate.dialect.PostgreSQLDialect
 /property

 property
 name=hibernate.connection.url
 jdbc:postgresql://192.168.0.103/Test/property
 property name=hibernate.connection.usernametest/property
 property name=hibernate.connection.passwordtesttest/property
 property
 name=hibernate.connection.driver_classorg.postgresql.Driver/property

 property
 name=hibernate.cache.provider_class
 net.sf.ehcache.hibernate.EhCacheProvider/property

 property
 name=hibernate.transaction.auto_close_sessionfalse/property

 property name=hibernate.jdbc.use_get_generated_keystrue/property
 property name=hibernate.cache.use_query_cachetrue/property
 property name=hibernate.bytecode.use_reflection_optimizer
 true/property

 property name=hibernate.show_sqltrue/property
 property name=hibernate.format_sqltrue/property

 mapping class=TmpUser /

 /session-factory

 /hibernate-configuration
 --

 Thanks,
 Osamuo





 Sven Homburg wrote:
 
  have you set autocommit to off in hibernate config
  like this:
 
  property name=hibernate.connection.autocommitfalse/property
 
 
 
 
  osamuo wrote:
 
  Hi,
 
  I used the following code in order to rollback the current
 transaction.
  But its transaction was committed after the calling
  HibernateSessionManager.abort().
 
  What's wrong?
 
  ---
  public class RegisterUser{
  ...
 
  @Inject
  private Session session;
 
  @Inject
  private HibernateSessionManager sessionManager;
 
 
  public Object onSubmit(){
...
TmpUser tmpUser = new TmpUser();
...
 
session.save( tmpUser );
sessionManager.abort(); // force rollback
 
return null;
  }
  }
  -
 
 
  Thanks,
  Osamuo
 
 
  Davor Hrg wrote:
 
  HibernateSessionManager
 
 
  On Jan 11, 2008 11:51 AM, Massimo Lusetti [EMAIL PROTECTED] wrote:
  On Jan 11, 2008 10:00 AM, osamuo [EMAIL PROTECTED] wrote:
 
  
   Hi,
  
   I have noticed that the tapestry-hibernate commits the current
  transaction
   even after an exception occurs.
  
   Is there any way to do rollback its transaction?
 
  Use the manager ?
 
 
  --
  Massimo
  http://meridio.blogspot.com
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14775087.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 with regards
 Sven Homburg
 
 
 -
 best regards
 Sven
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14775449.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: tapestry-hibernate: rollback

2008-01-11 Thread osamuo

Hi,

I have noticed that the tapestry-hibernate commits the current transaction
even after an exception occurs.

Is there any way to do rollback its transaction?

Osamuo
-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14752000.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: tapestry-hibernate: rollback

2008-01-11 Thread osamuo

Hi,

I used the following code in order to rollback the current transaction.
But its transaction was committed after the calling
HibernateSessionManager.abort().

What's wrong?

---
public class RegisterUser{
...

@Inject
private Session session;

@Inject
private HibernateSessionManager sessionManager;


public Object onSubmit(){
  ...
  TmpUser tmpUser = new TmpUser();
  ...
  
  session.save( tmpUser );
  sessionManager.abort(); // force rollback

  return null;
}
}
-


Thanks,
Osamuo


Davor Hrg wrote:
 
 HibernateSessionManager
 
 
 On Jan 11, 2008 11:51 AM, Massimo Lusetti [EMAIL PROTECTED] wrote:
 On Jan 11, 2008 10:00 AM, osamuo [EMAIL PROTECTED] wrote:

 
  Hi,
 
  I have noticed that the tapestry-hibernate commits the current
 transaction
  even after an exception occurs.
 
  Is there any way to do rollback its transaction?

 Use the manager ?


 --
 Massimo
 http://meridio.blogspot.com


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14770190.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: 404 http error

2007-12-26 Thread osamuo

Thank you for your advice.
But I still get an exception.



Sven Homburg wrote:
 
 i have never tested it, its only an idea:
 
 Test.java:
 
 public class Test{
   @Inject
   private Response response;
 
   StreamResponse onActivate( Object[] parameters ) throws IOException{
 TextStreamResponse textStream = null;
 
 if( parameters == null || parameters.length != 2 )
 {
   textStream = new TextStreamResponse(text/html, this page doesnt
 exists);
   response.sendError( 404, null );
   textStream.prepareResponse(response);
 }
 return textStream;
   }
 }
 
 
 
 
 
 osamuo wrote:
 
 Hi,
 
 How can I tell T5 to send an 404 error?
 
 Is the following code right way to show 404 error page on T5?
 Because I got an error after calling sendError() in the code.
 
 
 Test.java:
 
 public class Test{
   @Inject
   private Response response;
 
   void onActivate( Object[] parameters ) throws IOException{
 //if( parameters == null || parameters.length != 2 ){
 response.sendError( 404, null );
 return;
 //}
   }
 }
 
 
 Error:
 
 [ERROR] RequestExceptionHandler Processing of request failed with
 uncaught exception: STREAM
 java.lang.IllegalStateException: STREAM
  at org.mortbay.jetty.Response.getWriter(Response.java:571)
  at
 org.apache.tapestry.internal.services.ResponseImpl.getPrintWriter(ResponseImpl.java:47)
  at $Response_1171072b273.getPrintWriter($Response_1171072b273.java)
  at $Response_1171072b240.getPrintWriter($Response_1171072b240.java)
  at
 org.apache.tapestry.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:58)
  at
 $PageResponseRenderer_1171072b261.renderPageResponse($PageResponseRenderer_1171072b261.java)
  at
 org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:87)
  at
 $PageRenderRequestHandler_1171072b25d.handle($PageRenderRequestHandler_1171072b25d.java)
  at
 org.apache.tapestry.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:66)
  at $Dispatcher_1171072b25f.dispatch($Dispatcher_1171072b25f.java)
  at $Dispatcher_1171072b253.dispatch($Dispatcher_1171072b253.java)
  at
 org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:905)
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-404-http-error-tp14493888p14503676.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: 404 http error

2007-12-25 Thread osamuo

Hi,

How can I tell T5 to send an 404 error?

Is the following code right way to show 404 error page on T5?
Because I got an error after calling sendError() in the code.


Test.java:

public class Test{
  @Inject
  private Response response;

  void onActivate( Object[] parameters ) throws IOException{
//if( parameters == null || parameters.length != 2 ){
response.sendError( 404, null );
return;
//}
  }
}


Error:

[ERROR] RequestExceptionHandler Processing of request failed with uncaught
exception: STREAM
java.lang.IllegalStateException: STREAM
at org.mortbay.jetty.Response.getWriter(Response.java:571)
at
org.apache.tapestry.internal.services.ResponseImpl.getPrintWriter(ResponseImpl.java:47)
at $Response_1171072b273.getPrintWriter($Response_1171072b273.java)
at $Response_1171072b240.getPrintWriter($Response_1171072b240.java)
at
org.apache.tapestry.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:58)
at
$PageResponseRenderer_1171072b261.renderPageResponse($PageResponseRenderer_1171072b261.java)
at
org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:87)
at
$PageRenderRequestHandler_1171072b25d.handle($PageRenderRequestHandler_1171072b25d.java)
at
org.apache.tapestry.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:66)
at $Dispatcher_1171072b25f.dispatch($Dispatcher_1171072b25f.java)
at $Dispatcher_1171072b253.dispatch($Dispatcher_1171072b253.java)
at
org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:905)



-- 
View this message in context: 
http://www.nabble.com/T5%3A-404-http-error-tp14493888p14493888.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: onActive()

2007-12-23 Thread osamuo

Hi,

I have encountered the following strange behavior (with 5.0.8-SNAPSHOT).

When I accessed http://localhost:8080/test/1;, onActive( Object parameter
) in Test.java was called two times.

At the first call, the value of the argument was 1.
At the second call, the value of the argument was commons.css. 

Why was commons.css set to the argument?
Is this correct behavior?

Test.tml

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
...
link rel=stylesheet type=text/css href=commons.css /
/head
body
/body
/html
...



Test.java

public class Test{
  public void onActivate( Object parameter ){
  }
}




best regards 
Osamuo


-- 
View this message in context: 
http://www.nabble.com/T5%3A-onActive%28%29-tp14479409p14479409.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]