Re: Help with Tapestry IoC

2010-01-26 Thread Ashwanth Kumar
Thanks Thiago,

I got it working. Thanks a lot!! :)

 - Ashwanth Kumar

On Tue, Jan 26, 2010 at 4:00 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Tue, 26 Jan 2010 05:10:56 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com wrote:

  Hello,


 Hi!


  I'm now, trying to do a desktop client for which i need some CRUD actions,
 and since, being a user of Tapestry, i thought i could use Tapestry IoC
 standalone for my app. Can anyone provide me some light on using Tapestry
 IoC, on an offline app.


 Tapestry-IoC works exactly the same with or without Tapestry. In your case,
 you just need to start the Registry yourself. It's documented here:
 http://tapestry.apache.org/tapestry5.1/tapestry-ioc/run.html. To load
 modules from the classpath and add them to your RegistryBuilder, just call
 IOCUtilities.addDefaultModules(builder);.

 Simple example:


 RegistryBuilder builder = new RegistryBuilder();
 builder.add(ModuleClass1.class, ModuleClass2.class);
 IOCUtilities.addDefaultModules(builder);
 final Registry registry = builder.build();

 SomeService service = registry.getService(SomeService.class);

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with Tapestry IoC

2010-01-26 Thread Ashwanth Kumar
Thiago,

I get the following error:

2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
proxy provider when there's already an existing provider. This may indicate
that you have multiple IoC Registries.

I've only one instance of Registry running!!??

 - Ashwanth Kumar

On Tue, Jan 26, 2010 at 4:00 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Tue, 26 Jan 2010 05:10:56 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com wrote:

  Hello,


 Hi!


  I'm now, trying to do a desktop client for which i need some CRUD actions,
 and since, being a user of Tapestry, i thought i could use Tapestry IoC
 standalone for my app. Can anyone provide me some light on using Tapestry
 IoC, on an offline app.


 Tapestry-IoC works exactly the same with or without Tapestry. In your case,
 you just need to start the Registry yourself. It's documented here:
 http://tapestry.apache.org/tapestry5.1/tapestry-ioc/run.html. To load
 modules from the classpath and add them to your RegistryBuilder, just call
 IOCUtilities.addDefaultModules(builder);.

 Simple example:


 RegistryBuilder builder = new RegistryBuilder();
 builder.add(ModuleClass1.class, ModuleClass2.class);
 IOCUtilities.addDefaultModules(builder);
 final Registry registry = builder.build();

 SomeService service = registry.getService(SomeService.class);

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with Tapestry IoC

2010-01-26 Thread Ashwanth Kumar
This is my class:

package reformists.util;

import org.apache.tapestry5.ioc.IOCUtilities;
import org.apache.tapestry5.ioc.Registry;
import org.apache.tapestry5.ioc.RegistryBuilder;

import reformists.services.BtmyModule;

public class URegistry {

private static final Registry registry;
 static {
System.out.println(Im building the Registry!);
RegistryBuilder builder = new RegistryBuilder();
 // builder.add(Session.class);
builder.add(BtmyModule.class);
IOCUtilities.addDefaultModules(builder);
 registry = builder.build();
registry.performRegistryStartup();
}

public static Registry getRegistry() {
return registry;
}

}

Do u find any problems with that?

 - Ashwanth Kumar

On Tue, Jan 26, 2010 at 5:01 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com wrote:

  Thiago,

 I get the following error:

 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
 proxy provider when there's already an existing provider. This may
 indicate
 that you have multiple IoC Registries.

 I've only one instance of Registry running!!??


 I've never had that error message. Please post your code.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with Tapestry IoC

2010-01-26 Thread Ashwanth Kumar
Actually,

I'm trying to build a frontend interface using Vaadin, (though i was using
tapestry, i just want to give it a try).. And I got used to accessing my
database, from hibernate and tapestry:

@Inject
private Session _session;

From Tapestry, I just want the same, for this app too. Thats y, i wanted to
use Tapestry IoC, with Tapestry Hibernate package.

And i get that, ERROR Message, but Database access works fine for me.. I
just get that error message in console window..

 - Ashwanth Kumar

On Tue, Jan 26, 2010 at 5:01 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Tue, 26 Jan 2010 09:16:19 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com wrote:

  Thiago,

 I get the following error:

 2010-01-26 16:43:11,453 ERROR [SerializationSupport] Setting a new service
 proxy provider when there's already an existing provider. This may
 indicate
 that you have multiple IoC Registries.

 I've only one instance of Registry running!!??


 I've never had that error message. Please post your code.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Help with Tapestry IoC

2010-01-25 Thread Ashwanth Kumar
Hello,

I'm now, trying to do a desktop client for which i need some CRUD actions,
and since, being a user of Tapestry, i thought i could use Tapestry IoC
standalone for my app. Can anyone provide me some light on using Tapestry
IoC, on an offline app.

 - Ashwanth Kumar


Help with Tapestry Page and iText

2009-12-31 Thread Ashwanth Kumar
Hello,

Happy new year to all!! (Its new year here in India)..

Okay, i need a small help! I want to generate a PDF file, based on the
generated page in Tapestry.. I've plans of using iText to generate PDF. Can
any one help me? How to get it done!!

PS: On cliking Download PDF link, the PDF should be generated on the fly,
and then sent to user.

 - Ashwanth Kumar


Re: Help with using DWR with Tapestry

2009-12-30 Thread Ashwanth Kumar
Well, My use here is a typical example of User Registration and User
authentication! I'm trying to extend the entire app of Tapestry to be AJAX
driven, with all the pages served through AJAX.

Imagine u can use sought of AJAX capabilities with DWR and Tapestry!

 - Ashwanth Kumar

On Tue, Dec 29, 2009 at 10:34 PM, Vangel V. Ajanovski a...@ii.edu.mkwrote:

 I am a bit curious and never had such a scenario, so can you or anyone
 else elaborate a bit more or give an example of a use-case where this
 interaction between DWR and tapestry-hibernate is useful?
 Thanks

 On 29.12.2009 17:24, Ashwanth Kumar wrote:
  Hey, Thanks a lot!!
 
  I got the Tapestry Hibernate Working with DWR!! U made my life easy!!
 
 





Re: demo aplication

2009-12-30 Thread Ashwanth Kumar
Well, Do we need a Demo app?? I mean, we already've one: JumpStart(
http://jumpstart.doublenegative.com.au:8080/jumpstart/) hosted, so..

Do u wish to re-consider ur idea??

 - Ashwanth Kumar

On Wed, Dec 30, 2009 at 9:09 PM, Alfonso Quiroga alfonsose...@gmail.comwrote:

 Hi! going back again to the idea of publishing demo aplication for
 starters (always is easier to see something working and copy from
 that, than building an app from scratch, looking for docs, etc).

 Is there some idea of how the demo app should be? I'm NOT a T5 expert
 but I can do it if it's simple.
 a) The first question is... if we have a t5-starter-demo-app, where
 will be hosted?
 b) What does the app need? I was thinking in very basic, 2 o 3 pages,
 using web-security with annotations, storing data in session... a
 t:zone example.. and I don't know what else, any suggestions?

 I think this idea contribute to new users adopting t5, maybe sounds
 stupid, but when you start.. if you have almost nothing to see, a lot
 of users can be discarding t5.
 thanks

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




Re: Help with using DWR with Tapestry

2009-12-30 Thread Ashwanth Kumar
Hello Guys,

Okay, i give up! I'm very new here! And i'm just a 2nd year college student!
I'm learning java only now! And more-over when i hunter the WWW for some
good framework to build my WebApp in J2EE. I had to keep my hands on many
things. Its during that, i actually got in Tapestry and DWR. Though i
stumbled on DWR first, i finally rested with Tapestry, as it actually made
my life simpler!

And using DWR (soley for 1 reason), i wanted to do, some live username
availability checking, (may be u can do it with a custom Component
from Scriptaculous, as i told u, i'm very very new here in java and
Tapestry, to DWR too).

I'm too young in experience to say advantages of DWR over Tapestry or the
vice versa. It just makes begineers like me, open my JAW fall.. ;)  Nothing
more..

No offense, just wanted to learn some things.. at a rapid pace.. thats it..
:)

 - Ashwanth Kumar

On Wed, Dec 30, 2009 at 9:48 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 30 Dec 2009 14:14:12 -0200, Vangel V. Ajanovski a...@ii.edu.mk
 escreveu:


  OK let me see if I get the point. If I build user registration for me
 it's a simple form, username and email and such and for example I bind
 javascript code on the username that will check if it already exists,
 before I even fill the entire registration form and certainly before I
 submit it.


 I implemented this using Tapestry itself and JavaScript. Just a few lines
 of code. I'm curious too why Ashwanth is using DWR instead of Tapestry
 itself for AJAX things stuff.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with using DWR with Tapestry

2009-12-29 Thread Ashwanth Kumar
Hello,

On Tue, Dec 22, 2009 at 5:05 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java lance.j...@googlemail.com
 escreveu:


  One more thing to note is that DWR supports ajax filters which are
 basically interceptors on DWR services. You may want to duplicate some of
 the
 TapestryFilter's functionality in an AjaxFilter.


 There's no need to do that. TapestryFilter puts the Registry in the servlet
 context under the org.apache.tapestry5.application-registry attribute. Then
 you can get the HibernateSessionManager and get a Session through its
 getSession() method. I haven't tested it, but that's what I would try.


But, sorry how am i to get HibernateSessionManager?? from the attribute, can
u tell me that plz.. I'm breaking my head here.. for almost a week.



 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br


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


 - Ashwanth Kumar


Re: Help with using DWR with Tapestry

2009-12-29 Thread Ashwanth Kumar
Hey, Thanks a lot!!

I got the Tapestry Hibernate Working with DWR!! U made my life easy!!

 - Ashwanth Kumar

On Tue, Dec 29, 2009 at 9:52 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Tue, 29 Dec 2009 13:48:40 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:

  Hello,


 Hi!


  But, sorry how am i to get HibernateSessionManager?? from the attribute,
 can u tell me that plz.. I'm breaking my head here.. for almost a week.


 Get the registry from that servlet context attribute. It's an Registry
 instance. Use Registry.getService(HibernateSessionManager.class) to get a
 HibernateSessionManager instance.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with onActivate Page

2009-12-27 Thread Ashwanth Kumar
Piero,

Thanks a lot!! It worked!

  - Ashwanth

On Sun, Dec 27, 2009 at 6:17 PM, Piero Sartini li...@pierosartini.dewrote:

2. If No, help me with the following scenario in my project.
I need to show a page a page to the user, only when it has a context
 with
it! Else i need to redirect the user to another page. Though i  link
 the
page, only with the t:context, i just need to confirm no one has ever
bookmarked the page, and is seeing it.

 Instead of using 2 onActivate() methods, you may also make use of
 EventContext. It's often less verbose and better to read:

 --
 Object onActivate(EventContext eventContext) {
  switch (eventContext.getCount()) {
  case 0:
return NoContextPage.class;
  case 1:
this.myparameterstring = eventContext.get(String.class, 1);
  break;
  }
 }
 --


   Piero

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




Help with onActivate Page

2009-12-26 Thread Ashwanth Kumar
Hello,

I have a small doubt. I need some clarification regarding the onActivate()
of every Page class..

   1. Is it Overloadable? (I know, it has some internal type casting, still
   wanted to know?)
   2. If No, help me with the following scenario in my project.
   I need to show a page a page to the user, only when it has a context with
   it! Else i need to redirect the user to another page. Though i  link the
   page, only with the t:context, i just need to confirm no one has ever
   bookmarked the page, and is seeing it.


 - Ashwanth Kumar


Re: Help with onActivate Page

2009-12-26 Thread Ashwanth Kumar
Thanks Keneth,

That helps a lot!

 - Ashwanth Kumar

On Sun, Dec 27, 2009 at 9:24 AM, Kenneth CH, LEE klch...@gmail.com wrote:

 Hi,

 You can have multiple event handler for the same event:

  http://tapestry.apache.org/tapestry5/guide/event.html

 The one with the same no. of arguments as the no. of context
 parameters will get called, as well as the no-arg one. I figured that
 out with my own experiment.

 Hope that helps.

 Kenneth


 2009/12/27 Ashwanth Kumar ashwanth.ku...@gmail.com:
  Hello,
 
  I have a small doubt. I need some clarification regarding the
 onActivate()
  of every Page class..
 
1. Is it Overloadable? (I know, it has some internal type casting,
 still
wanted to know?)
2. If No, help me with the following scenario in my project.
I need to show a page a page to the user, only when it has a context
 with
it! Else i need to redirect the user to another page. Though i  link
 the
page, only with the t:context, i just need to confirm no one has ever
bookmarked the page, and is seeing it.
 
 
   - Ashwanth Kumar
 

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




Re: [newbie] Intercepting client-side form validation/submission

2009-12-23 Thread Ashwanth Kumar
Use Event.observe for the form and use the validation with custom JS of
urs...

HTH
 - Ashwanth Kumar

On Wed, Dec 23, 2009 at 3:48 PM, Kenneth CH, LEE klch...@gmail.com wrote:

 There is a submit button within the form. I could not attach the code
 in onclick handler because I want it to run only if the form is valid.

 2009/12/22 Ashwanth Kumar ashwanth.ku...@gmail.com:
  On Tue, Dec 22, 2009 at 6:14 PM, Kenneth CH, LEE klch...@gmail.com
 wrote:
 
  Hi there,
 
 
  Hello,
 
 
 
  Is there any existing facilities to trigger some custom Javascript
  code _after_ validating the form?
 
  I'm now doing it with some Javascript tricks:
  ===
  form t:type=form t:id=myform
  ...
  script type=text/javascript
  Event.observe(window, load, function() {
 var f = $(myform).onsubmit;
 $(myform).onsubmit = function(e) {
 return f(e)  customFunction();
 };
  });
  /script
  /form
  ...
  script type=text/javascript
  function customFunction() {
   //return true to submit
  }
  /script
  ===
 
 
  When exactly do u submit ur form??
 
 
  Notice that the custom function is only called _after_ validation
  _and_ only if it was successful.
 
 
  Well, if  you want to do a custom JS, u can do a Zone Update of the Form,
  then observe Tapestry.ZONE_UPDATED_EVENT, for doing some some custom JS!
  But, that happens only after form submission and not before that!
 
  HTH
   - Ashwanth Kumar
 

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




Re: Help with using DWR with Tapestry

2009-12-22 Thread Ashwanth Kumar
Can u provide an example! I dont find any good example on the site!

 - Ashwanth Kumar

On Tue, Dec 22, 2009 at 5:10 PM, Lance Java lance.j...@googlemail.comwrote:

 Ah... great.

 The TapestryCreator can access the servlet context using:
 org.directwebremoting.WebContextFactory.get().getServletContext();

 http://directwebremoting.org/dwr/server/javaapi.html

 2009/12/22 Thiago H. de Paula Figueiredo thiag...@gmail.com

  Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java 
 lance.j...@googlemail.com
  escreveu:
 
 
  One more thing to note is that DWR supports ajax filters which are
  basically interceptors on DWR services. You may want to duplicate some
 of
  the
  TapestryFilter's functionality in an AjaxFilter.
 
 
  There's no need to do that. TapestryFilter puts the Registry in the
 servlet
  context under the org.apache.tapestry5.application-registry attribute.
 Then
  you can get the HibernateSessionManager and get a Session through its
  getSession() method. I haven't tested it, but that's what I would try.
 
  --
  Thiago H. de Paula Figueiredo
  Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
  and instructor
  Owner, software architect and developer, Ars Machina Tecnologia da
  Informação Ltda.
  http://www.arsmachina.com.br
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 



Re: Help with using DWR with Tapestry

2009-12-22 Thread Ashwanth Kumar
Sure,

Thanks a lot! I'll post my code, once i get it working!

 - Ashwanth Kumar

On Tue, Dec 22, 2009 at 5:32 PM, Lance Java lance.j...@googlemail.comwrote:

 The tapestry creator will look something like...

 public class TapestryCreator extends AbstractCreator {
private String beanName;

public String getBeanName() {
return beanName;
}

// set by config in dwr.xml (see my prev email)
public void setBeanName(String beanName) {
this.beanName = beanName;
}

   public Object getInstance() {
  // Use this instead of WebContextFactory (suggested in my prev email)
  ServletContext servletContext =
 org.directwebremoting.ServerContextFactory.get().getServletContext();
  Object bean = getTapestryBean(servletContext, getbeanName);
   }

   protected Object getTapestryBean(ServletContext servletContext, String
 beanName) {
  // look up the bean from the tapestry registry
   }

   public Class getType() {
  return getInstance().getClass();
   }
 }

 You will then use a dwr config similar to my previous email to define the
 TapestryCreator and map it to a named service in the tapestry registry. As
 I
 said, please download the DWR source and take a look at the SpringCreator
 for inspiration.

 2009/12/22 Ashwanth Kumar ashwanth.ku...@gmail.com

  Can u provide an example! I dont find any good example on the site!
 
   - Ashwanth Kumar
 
  On Tue, Dec 22, 2009 at 5:10 PM, Lance Java lance.j...@googlemail.com
  wrote:
 
   Ah... great.
  
   The TapestryCreator can access the servlet context using:
   org.directwebremoting.WebContextFactory.get().getServletContext();
  
   http://directwebremoting.org/dwr/server/javaapi.html
  
   2009/12/22 Thiago H. de Paula Figueiredo thiag...@gmail.com
  
Em Tue, 22 Dec 2009 09:27:26 -0200, Lance Java 
   lance.j...@googlemail.com
escreveu:
   
   
One more thing to note is that DWR supports ajax filters which are
basically interceptors on DWR services. You may want to duplicate
 some
   of
the
TapestryFilter's functionality in an AjaxFilter.
   
   
There's no need to do that. TapestryFilter puts the Registry in the
   servlet
context under the org.apache.tapestry5.application-registry
 attribute.
   Then
you can get the HibernateSessionManager and get a Session through its
getSession() method. I haven't tested it, but that's what I would
 try.
   
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant,
  developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
   
   
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
   
   
  
 



Help with using DWR with Tapestry

2009-12-21 Thread Ashwanth Kumar
Hello,

In my project, i would like to use DWR along with Tapestry! But i've a
probelm. Its like i need to access the DB, i use Hibernate with Tapestry. In
my class i've:

@Inject
private Session _session;

when i access this class from DWR, Tapestry doesn't interfere at all. But,
i'm getting a null pointer exception where i first start using the Session.
How and what should be done for this?

 - Ashwanth Kumar


Re: Passing a value from a page to another

2009-12-18 Thread Ashwanth Kumar
Well, did u try using @Persist for UserProfile page's UserID value?

HTH
 - Ashwanth

On Fri, Dec 18, 2009 at 2:53 PM, Alessandro Bottoni
alexbott...@gmail.comwrote:

 I'm trying to pass a value from a page called Register to a page
 called UserProfile following the instruction supplied by A. Kolesnikov
 in his Tapestry 5 book (pages 59 - 62).

 The value I want to pass is just a simple String Id. Here is (a
 simplified version of) my code:

 public class Register {
 // this class is used by a BeanEditor-based page template

private String id = Id From Register;

@InjectPage
private UserProfile userProfile;

Object onSuccess(){
// this call does not work...
userProfile.setUserId(id);
return userProfile;
}
 }

 public class UserProfile {

private String UserId = Id from UserProfile;

// this method is not invoked as expected..
public void setUserId(String MyUserId){
this.UserId = Id received form Register;
}

// later used in a ${UserId} expansion on the target page
public String getUserId() {
return this.UserId;
}
 }

 The Id Value is not passed from the first page to the second one (that
 is: I always get the default string Id from UserProfile as the Id
 rendered on the UserProfile page).

 What can be wrong in such trivial code?

 --

 Alessandro Bottoni
 Website: http://www.alessandrobottoni.it/

 Life is a sexually transmitted disease, and it's 100% fatal.
 -- Unknown



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



Help with @Inject in onEvent Handler Object

2009-12-17 Thread Ashwanth Kumar
Hi,

I've a problem. I'm using a page which has an actionlink like this:

a t:type=actionlink t:id=alidLink Text/a

And i've an @OnEvent handler in my Page Class, as follows:

@OnEvent(component=alid)
void function() {
 DBConnect db = new DBConnect();
System.out.println(db.getLine());
}

Till, this i've no problem. I've an object called DBConnect which has the
class as follows:

public class DBConnect {
 @Inject
 Session _session;

 public String getLine() {
*  List _news = _session.createCriteria(RNews.class).list();*
  return _news.getText();
 }
}

When i run the actionlink, i get an NullPointer Exception at the bolder line
above (at the _session.createCriteria(RNews.class).list()).. Why does this
happen? Isn't this mean, @Inject is not working, hence the _session is not
initialized??

 - Ashwanth Kumar


Re: Help with Form Submission and OnActivate Handler

2009-12-17 Thread Ashwanth Kumar
Thanks Ma, Its working now! Thanks a lot!

 - Ashwanth

On Wed, Dec 16, 2009 at 9:29 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 16 Dec 2009 13:47:09 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:


  Sorry,

 I dont understand. I'm a newbie here. So, mind explaining what exactly
 i've to do?
 I've onPassivate() with no argument in my page too.


 Well, I haven't understood your problem, as I never had any problems with
 Form submissions interfering onActivate(). An onActivate() with one
 parameter will only be invoked when the page is requested without an
 activation contet (unless the parameter is a List, an Object[] or an
 EventContext).


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with @Inject in onEvent Handler Object

2009-12-17 Thread Ashwanth Kumar
Hey Thanks Guys!

 Its working cool!

 - Ashwanth Kumar

On Thu, Dec 17, 2009 at 6:21 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Thu, 17 Dec 2009 10:17:15 -0200, Joost Schouten (ml) 
 joost...@jsportal.com escreveu:


  Your DBConnect object is probably not in one of the tapestry controlled
 packages and thus inject doesn't work. You can inject the Session directly
 into your page, or turn your DBConnect object into a tapestry service by
 adding it to the services package, and changing the Session into a
 constructor argument.


 You can also declare DBConnect as a Tapestry service. Doing this, you can
 @Inject DBConnect and the @Inject annotation inside it will work.

 In your AppModule, add this method if you don't have it already:

 public static void bind(ServiceBinder binder) {
binder.bind(DBConnect.class);
 }

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br


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




Help with link in head for RSS AutoDiscovery

2009-12-17 Thread Ashwanth Kumar
Hey,

I've a doubt! I've a page, and wish to have RSS Autodiscovery for the page!
How do i do it? I mean i know the syntax is as this:

link rel=alternate type=application/rss+xml title=RSS Feed
href=/rss/ /

But, i need to've an href attribute, and what should i do for that? ( what
value should i give there?)

PS: I've a component, which acts as a MasterTemplate Layout for the
application and it contains this!

 - Ashwanth Kumar


Help with Hibernate Data Fetch and Print

2009-12-17 Thread Ashwanth Kumar
Hello,

I need to fetch a Post from the Database and print them in an HTML. All
works fine, expect for the fact that, the printed text contains the HTML
tags as in the Post from the DB. How do i print the post text by parsing the
HTML tags.

 - Ashwanth Kumar


Re: Help with Hibernate Data Fetch and Print

2009-12-17 Thread Ashwanth Kumar
Oh! I'm so sorry, i totally forgot about this! Thanks yar!

 - Ashwanth Kumar

On Thu, Dec 17, 2009 at 8:09 PM, cordenier christophe 
christophe.corden...@gmail.com wrote:

 Hi

 Use t:outputRaw component.

 2009/12/17 Ashwanth Kumar ashwanth.ku...@gmail.com

  Hello,
 
  I need to fetch a Post from the Database and print them in an HTML. All
  works fine, expect for the fact that, the printed text contains the HTML
  tags as in the Post from the DB. How do i print the post text by parsing
  the
  HTML tags.
 
   - Ashwanth Kumar
 



Re: Help with link in head for RSS AutoDiscovery

2009-12-17 Thread Ashwanth Kumar
Oh!

Okay, but just out of curiosity, isn't there a way we could refer to a
ActionLink dynamically on a page, by any means? I mean, if i could refer it
like that, it would do the trick right?

Anyways, i would take that suggesstion!

 - Ashwanth Kumar

On Thu, Dec 17, 2009 at 8:48 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Thu, 17 Dec 2009 11:21:40 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:


  I know that, All i want to know is to which href i must point it to? I
 mean, i've an RSS generated in the Tempalte on an ActionLink.


 The best way to do that is to have a separate page (and URL) to generate
 the RSS.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with link in head for RSS AutoDiscovery

2009-12-17 Thread Ashwanth Kumar
I'll stick to creation of a new Page as u said. Thanks!

 - Ashwanth Kumar

On Thu, Dec 17, 2009 at 10:25 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Thu, 17 Dec 2009 14:38:49 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:


  Okay, but just out of curiosity, isn't there a way we could refer to a
 ActionLink dynamically on a page, by any means? I mean, if i could refer
 it like that, it would do the trick right?


 It would, but action links aren't supposed to be used by outside
 applications, just inside. It is a bad solution when a way better one
 exists.

 @Inject ComponentResources and use the Link createEventLink(String
 eventType, Object... context) method to create a Link. Use it as the href
 attribute.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Help with Form Submission and OnActivate Handler

2009-12-16 Thread Ashwanth Kumar
Hello,

I've a small doubt! Why is that, when i've a onActivate (Integer) handler in
a page, i'm not able to submit the form to the same page?

Is there any work around for this?

 - Ashwanth Kumar


Re: Help with Form Submission and OnActivate Handler

2009-12-16 Thread Ashwanth Kumar
Sorry,

I dont understand. I'm a newbie here. So, mind explaining what exactly i've
to do?

I've onPassivate() with no argument in my page too.

 - Ashwanth

On Wed, Dec 16, 2009 at 8:56 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 16 Dec 2009 13:08:59 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:

  Hello,


 Hi!


  I've a small doubt! Why is that, when i've a onActivate (Integer) handler
 in a page, i'm not able to submit the form to the same page?


 You need to have an onPassivate() to return the pages's activation context.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: [newbie] EventListener in Tapestry 5 ?

2009-12-14 Thread Ashwanth Kumar
Well, if you want Mouse and Text field (key press events), use Java Script
on the client side, its very useful and efficient. If you're very
particular, use DWR to map JS events to a Java Class @ server side, but with
in-built ajax support, Tapestry doesn't require it though.

Protoype can help u with JS: http://www.prototypejs.org/api/event

http://www.prototypejs.org/api/event - Ashwanth Kumar

On Mon, Dec 14, 2009 at 7:25 PM, marioosh.net marioosh@gmail.comwrote:




 Olle Hallin-2 wrote:
 
  I forgot to paste in the JavaDocs link:
 
 http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/OnEvent.html
 

 Yes, I know this annotation but...
 i think it doesn't work for events like: mouseover, mouseout, change
 (textfield)...

 http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/EventConstants.html


 --
 View this message in context:
 http://n2.nabble.com/newbie-EventListener-in-Tapestry-5-tp4163378p4164188.html
 Sent from the Tapestry Users 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




Re: T5.1.0.5 Return Page with many blocks in a zone?

2009-12-13 Thread Ashwanth Kumar
Well, I dont think you can return Page A, into Page B. If u want so, instead
of Blocks, why not use iframes?

If you cant use iframes then, try converting you Page A, into a component
and add it to page B, onDemand! After all, Tapestry is all about that r8?

HTH
 - Ashwanth Kumar

On Mon, Dec 14, 2009 at 6:22 AM, alanearl alan-lua...@dash.com.ph wrote:


 Im making a page zone in Tapestry 5.1.0.5.
 I know how to use page links.

 PageLink
 EventLink
 ActionLink

 But my problem is how will i return a pages into it specific block?

 I can directly return page a into page b.
 But i cannot return from page a into page b.1 or page b.2 or page b.3.

 Any ideas?


 --
 View this message in context:
 http://old.nabble.com/T5.1.0.5-Return-Page-with-many-blocks-in-a-zone--tp26771630p26771630.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




Help with t:loop

2009-12-12 Thread Ashwanth Kumar
Hi,

I'm currently trying to create looping structure in one of my pages. The
source attribute is an object (an entity). The entity, has a value, which
refers to the ID of the other Entity's reference. Its like i've a column -
postedBy - this has UID (an Integer) from another entity. My question is,
when i use a loop to generate the content. How do i refer to the other
entity's other column, using this ID in this entity?

 - Ashwanth Kumar


Re: Help with t:loop

2009-12-12 Thread Ashwanth Kumar
Thanks, sorry for being so dumb! I used the setter of the value attribute's
object to set the name and then display it!

 - Ashwanth Kumar

On Sat, Dec 12, 2009 at 5:27 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Sat, 12 Dec 2009 09:07:51 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:

  Hi,


 Hi!

  I'm currently trying to create looping structure in one of my pages. The
 source attribute is an object (an entity).


 It is an object that must be an array or an Iterable (Collection, List,
 ...).


  The entity, has a value, which
 refers to the ID of the other Entity's reference.


 Why doesn't it have a direct reference to the other entity instead of using
 its id? This doesn't sound object-oriented to me.


  Its like i've a column postedBy - this has UID (an Integer) from another
 entity. My question is,
 when i use a loop to generate the content. How do i refer to the other
 entity's other column, using this ID in this entity?


 Remember classes don't have columns, they have fields and properties.
 Suppose this other entity class has a name property.
 Create a method getName() that returns the name and use ${name} to print it
 in the generated HTML.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: [beginner] - PageLink doesn't work

2009-12-09 Thread Ashwanth Kumar
Did u chk the source??

 - Ashwanth

On Wed, Dec 9, 2009 at 4:55 PM, marioosh.net marioosh@gmail.com wrote:

 I have PageLink like that:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_2.xsd;
 ...
 a href=# jwcid=@PageLink page=Page2go page2/a
 ...
 /html

 I see link, but nothing happens when i click on it.

 --
 Pozdrawiam,
 Mariusz

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




Re: [beginner] - PageLink doesn't work

2009-12-09 Thread Ashwanth Kumar
Use this: http://tapestry.apache.org/schema/tapestry_5_0_0.xsd

 - Ashwanth

On Wed, Dec 9, 2009 at 4:55 PM, marioosh.net marioosh@gmail.com wrote:

 I have PageLink like that:

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_2.xsd;
 ...
 a href=# jwcid=@PageLink page=Page2go page2/a
 ...
 /html

 I see link, but nothing happens when i click on it.

 --
 Pozdrawiam,
 Mariusz

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




Re: Help with ZoneUpdate

2009-12-05 Thread Ashwanth Kumar
Hey,

Can you give me an example? I'm new to, Prototype!

Thanks
 - Ashwanth Kumar

On Sat, Dec 5, 2009 at 3:05 PM, Juan E. Maya maya.j...@gmail.com wrote:

 The Zone raises a JS event when is updated. This is explained in the
 Zone documentation:


 http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html

 After the client-side content is updated, a client-side event is
 fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT
 can be used to listen to the event.

 You just need to provide a Prototype listener for that event in your page.

 On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar ashwanth.ku...@gmail.com
 wrote:
  Thanks Josh,
 
  That worked like a charm!! I dont know if there could be anything better
  than this?? :)
 
   - Ashwanth Kumar
 
 
  On 12/5/09, Josh Canfield j...@thedailytube.com wrote:
 
  Last time I was hunting around for a solution for this I came up with
 this:
 
  Tapestry.ElementEffect.myshowfunc = function(element) {
 // do special stuff
 return new Effect.Highlight(element);
  }
 
  t:zone show=myshowfunc/
 
  There may be a better method that I'm not aware of though.
 
  Josh
 
  On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar 
 ashwanth.ku...@gmail.com
  wrote:
   Hi,
  
   I've a question. How do i invoke a custom JS from the Page,
 immediately
   after a ZoneUpate!
   For instance, i need to apply a markitUp on a TextArea, after it has
 been
   created by the ZoneUpdate event in Tapestry.
  
   How do i invoke it sync with the ZoneUpdate. Currently i use the
 onClick
   event of the TextArea to show, but its not good enough. So, asny help
   regarding this would be appreciated!
  
- Ashwanth Kumar
  
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos on the internet
  delivered fresh to your inbox.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

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




Help with ZoneUpdate

2009-12-04 Thread Ashwanth Kumar
Hi,

I've a question. How do i invoke a custom JS from the Page, immediately
after a ZoneUpate!
For instance, i need to apply a markitUp on a TextArea, after it has been
created by the ZoneUpdate event in Tapestry.

How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
event of the TextArea to show, but its not good enough. So, asny help
regarding this would be appreciated!

 - Ashwanth Kumar


Re: Help with ZoneUpdate

2009-12-04 Thread Ashwanth Kumar
Thanks Josh,

That worked like a charm!! I dont know if there could be anything better
than this?? :)

 - Ashwanth Kumar


On 12/5/09, Josh Canfield j...@thedailytube.com wrote:

 Last time I was hunting around for a solution for this I came up with this:

 Tapestry.ElementEffect.myshowfunc = function(element) {
// do special stuff
return new Effect.Highlight(element);
 }

 t:zone show=myshowfunc/

 There may be a better method that I'm not aware of though.

 Josh

 On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar ashwanth.ku...@gmail.com
 wrote:
  Hi,
 
  I've a question. How do i invoke a custom JS from the Page, immediately
  after a ZoneUpate!
  For instance, i need to apply a markitUp on a TextArea, after it has been
  created by the ZoneUpdate event in Tapestry.
 
  How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
  event of the TextArea to show, but its not good enough. So, asny help
  regarding this would be appreciated!
 
   - Ashwanth Kumar
 



 --
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.

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




Re: Help with HttpRequest Handling

2009-12-02 Thread Ashwanth Kumar
But Thiago,

I tired, but each and every time, i do so, i get just 1 each time!! Plz
help!

 - Ashwanth

On Wed, Dec 2, 2009 at 4:42 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 02 Dec 2009 02:38:05 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:

  Thiago,


 Hi!


  Thanks for the reply. As u said, i did use sessions. But my problem, how
 am i to access it? I mean, if i use RequestGlobals, i get per request
 session.
 And, if i use Request service also, i get the same thing! How am i access
 it? (Actually thats wat i tired to mean by non-threaded stuff, sorry!)


 There's no such thing as a per request session. Just @Inject Request and
 get the session. It'll work.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Help with HttpRequest Handling

2009-12-02 Thread Ashwanth Kumar
Thanks yar,

I tired this, and got it working! :)

@Inject
private HttpServletRequest _request;

Now, i'm able to access the Session info, across all sessions! Thanks a lot,
for the help! I did get to know, better!

 - Ashwanth

On Wed, Dec 2, 2009 at 5:59 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 02 Dec 2009 09:57:50 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:


  But Thiago,
 I tired, but each and every time, i do so, i get just 1 each time!! Plz
 help!


 Every Tapestry service (including Request) is wrapped by a proxy. When the
 service is per thread, this proxy invokes the methods in the correct object
 for that thread. It is a little bit strange at first, but it works.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Help with HttpRequest Handling

2009-12-01 Thread Ashwanth Kumar
Hi,

I want to write a simple component, which will say the number of users
online! But, to do, that i need to access the non-threaded version of
HttpServletRequest of the Tapestry servlet, how do i do that? Please help
me!

 - Ashwanth


Re: Help with HttpRequest Handling

2009-12-01 Thread Ashwanth Kumar
Thiago,

Thanks for the reply. As u said, i did use sessions. But my problem, how am
i to access it? I mean, if i use RequestGlobals, i get per request session.
And, if i use Request service also, i get the same thing! How am i access
it? (Actually thats wat i tired to mean by non-threaded stuff, sorry!)

 - Ashwanth

On Wed, Dec 2, 2009 at 7:55 AM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Tue, 01 Dec 2009 23:59:48 -0200, Ashwanth Kumar 
 ashwanth.ku...@gmail.com escreveu:

  Hi,


 Hi!

  I want to write a simple component, which will say the number of users
 online! But, to do, that i need to access the non-threaded version of
 HttpServletRequest of the Tapestry servlet, how do i do that? Please help
 me!


 Some points:

 1) Tapestry is a servlet filter, not a servlet.

 2) There isn't a non-threaded version of HttpServletRequest, as it is
 created for every request received.

 3) As far as I know, it's not possible to count the number of concurrent
 users without using the session, as HTTP is a stateless protocol. You'll
 need to count open sessions. To do that, you'll need a service to hold the
 number of open sesions and an HttpSessionListener.

 I hope I gave you some pointers.


 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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




Re: Redirect to 401 page.

2009-11-29 Thread Ashwanth Kumar
Pierre,

Wouldn't it as simple as this?

Ur Page Code:

@InjectPage
private Page401 user_err;

..

Object check_user() {
 if(not authenticated) {
  return user_err;
 } else {
  // continue processing the page, or just return null
 }
}



HTH
Ashwanth Kumar


On Sun, Nov 29, 2009 at 2:09 PM, Pierre DEVREUX melboui...@yahoo.fr wrote:


 Hi as I've not found post dealing with my problem, I expose to you my
 problem.
 I have set my own contribution for PageRenderAccessHandler.
 Before a page is displayed, I check in handle method, if user is
 authenticated (call to my business layer).

 If not, I would redirect user to page 401 (Unauthorized page), I won't
 redirect to my own page 401, but to the one served by Tomcat.

 How can I manage this ?

 Thanks for you replies.

 Pierre.
 --
 View this message in context:
 http://old.nabble.com/Redirect-to-401-page.-tp26560171p26560171.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




Help with Tapestry i18n

2009-11-07 Thread Ashwanth Kumar
Hey,

People, I've a problem using inbuilt, i18n support of Tapestry (I use
5.0.18). K, When i use persistentLocale and set it to Locale(hi), hi -
Hindi, its not picking up the page, Home_hi.tml or Home_hi.properties.

Instead, it uses any page like, Home.tml or Home_en.tml

Also, the same problem for the Indic lang., like Locale(ta), etc.

Is there any workaround for this?? I want my app, to read from the
Home_hi.tml and Home_ta.tml files while creating the markup.

I tired, removing the en from the Supported Locales, from the AppModule
Class, also.. My Lines are follows:

public static void contributeApplicationDefaults(
 MappedConfigurationString, String configuration) {

 configuration.add(SymbolConstants.SUPPORTED_LOCALES, ta,hi);
 configuration.add(SymbolConstants.PRODUCTION_MODE, false);
 }

For, the Home.java, here goes the code:

public class Home {
@Inject
 private PersistentLocale persistentLocale;
 private String locale;

public Home() {
 persistentLocale.set(new Locale(hi)); //
 setLocale(persistentLocale.get().getDisplayName()); // This text displays
the Name as Hindi, but renders the Home_en.tml or Home.tml page only
 }
 /**
 * @param locale the locale to set
 */
 public void setLocale(String locale) {
 this.locale = locale;
 }
 /**
 * @return the locale
 */
 public String getLocale() {
 return locale;
 }
}



Please help me, with the i18n in tapestry plz..

Regards,
Ashwanth Kumar


Help with i18n in Tapestry 5.0.18

2009-11-07 Thread Ashwanth Kumar
Hey,

I'm using Tapestry 5.0.18, and trying to add a localization to my app. I
found, that, Tapestry supports Localization for only certain languages, like
the static fields, in the Locale class. It works for Japanese, German,
French, etc., But, does not support indic languages, like Hindi(hi) or Tamil
(ta), etc.. Though i tired giving Index_hi or Index_ta *.properties, and
*.tml files, both doesn't work. In both the cases, it searches only for
Index_en or Index *.properties, and *.tml files.?? Is this a limitation of
Tapestry or am i doing something wrong here?

I also added the supported locales constants in the AppModule class, in
the contributeApplicationDefaults method.

Please help me, I'm new to Tapestry!!

 - Ashwanth Kumar


Help with HTML and Tapestry 5.0.10

2009-11-05 Thread Ashwanth Kumar
Hey,

I just started working with TAPESTRY v5.0.10, and found one problem, while
defining my template (Home.tml), and characters like:

  - nbsp;
  - raquo;

etc., and any other HTML characters are treated as entities, and giving me
an error. How do i workaround this? Please Help!

Thanks,
Ashwanth Kumar


Help with HTML and Tapestry 5.0.10

2009-11-05 Thread Ashwanth Kumar
 Hey,

I just started working with TAPESTRY v5.0.10, and found one problem, while
defining my template (Home.tml), and characters like:

  - nbsp;
  - raquo;

etc., and any other HTML characters are treated as entities, and giving me
an error. How do i workaround this? Please Help!

Thanks,
Ashwanth Kumar


Re: Help with HTML and Tapestry 5.0.10

2009-11-05 Thread Ashwanth Kumar
Hey thanks, that solved the problem!!

 - Ashwanth Kumar

On Fri, Nov 6, 2009 at 12:10 PM, Angelo Chen angelochen...@yahoo.com.hkwrote:


 how about using , put following in the first line:

  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;


 Ashwanth Kumar wrote:
 
   Hey,
 
  I just started working with TAPESTRY v5.0.10, and found one problem,
 while
  defining my template (Home.tml), and characters like:
 
-
- »
 
  etc., and any other HTML characters are treated as entities, and giving
 me
  an error. How do i workaround this? Please Help!
 
  Thanks,
  Ashwanth Kumar
 
 

 --
 View this message in context:
 http://old.nabble.com/Help-with-HTML-and-Tapestry-5.0.10-tp26227277p26227555.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