Re: Re: [Taspetry IoC] Using Tapestry IoC with JavaFX

2010-05-27 Thread Antoine Mischler
The link to the corresponding JIRA entry:
https://issues.apache.org/jira/browse/TAP5-1171 (which I created by cloning
the groovy issue, sorry about that, apparently it was not the best way to do
it, but it should be correctly filled now)

Antoine

On Wed, May 26, 2010 at 2:28 PM, Antoine Mischler anto...@dooapp.comwrote:

 Hi,

 Thanks for your answers. I tried with Taspestry 5.2.0 but I still get the
 problem. After some investigations it looks like that the unrecognized
 methods are not synthetic. Actually, every JavaFX object extends the
 com.sun.javafx.runtime.FXBase class bringing those unrecognized methods. So
 the problem is slightly different than for Groovy. I'll create a JIRA about
 this.

 Cheers,
 Antoine

 On Wed, May 26, 2010 at 9:22 AM, Kristian Marinkovic 
 kristian.marinko...@porsche.co.at wrote:

 hi,

 there was a issue that already has been fixed:
 https://issues.apache.org/jira/browse/TAP5-839

 g,
 kris



 Von:Thiago H. de Paula Figueiredo thiag...@gmail.com
 An: Tapestry users users@tapestry.apache.org
 Datum:  25.05.2010 15:06
 Betreff:Re: [Taspetry IoC] Using Tapestry IoC with JavaFX



 On Tue, 25 May 2010 08:50:45 -0300, Antoine Mischler anto...@dooapp.com
 wrote:

  Hi guys,

 Hi!

  followed by a bunch of unrecognized methods. I think these methods are
  automatically generated by the javafx compiler.
  So my question is: is there a way to make the registry less sensible to
  unrecognized methods?

 There was the same problem with writing module classes in Scala or Groovy,

 I don't remember exactly. This was already addressed in Tapestry-IoC with
 some explicit checks. Post a JIRA about it so the committers can take a
 look at it. Please include a sample project to speed up the process.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, 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





 --
 Antoine Mischler
 www.dooapp.com
 +33 (0)6 50 90 72 94




-- 
Antoine Mischler
www.dooapp.com
+33 (0)6 50 90 72 94


Tapestry 5 Validation on Form Submit

2010-05-27 Thread Claude Dubois

Hello Guys,

I'm developping a Tapestry5 app, and I need to validate some fields on form
submit.

I am using the @Validate annotation, which do what I want, except that the
field is validated on blur, e.g. when the user focuses on another field.

I have many fields on my page, and it's quite unpleasant.

Would anyone know how to realize fields validation only when the form is
submitted?

Thanks

-
Claude Dubois
-- 
View this message in context: 
http://old.nabble.com/Tapestry-5-Validation-on-Form-Submit-tp28691739p28691739.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



Re: Tapestry 5 Validation on Form Submit

2010-05-27 Thread Christophe Cordenier
Hi

The only solution i see is to disable default clientvalidation and implement
your own. I think tapestry will still trigger an event on validate so you
can implement your own strategy on submit only.

Regards,
Christophe Cordenier.

2010/5/27 Claude Dubois cduboi...@gmail.com


 Hello Guys,

 I'm developping a Tapestry5 app, and I need to validate some fields on form
 submit.

 I am using the @Validate annotation, which do what I want, except that the
 field is validated on blur, e.g. when the user focuses on another field.

 I have many fields on my page, and it's quite unpleasant.

 Would anyone know how to realize fields validation only when the form is
 submitted?

 Thanks

 -
 Claude Dubois
 --
 View this message in context:
 http://old.nabble.com/Tapestry-5-Validation-on-Form-Submit-tp28691739p28691739.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




-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com


Re: DateField not working in updated Form (IE only)

2010-05-27 Thread peter ricke

Hi Anton,
no, i was not able to fix , still on my todo-list ;-(
If you find a way, please let me know

Peter


Hello Peter!

I am running into the same problem! Were you able to fix it?

Thanks,
Anton
  



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



Re: Tapestry 5 Validation on Form Submit

2010-05-27 Thread Stephan Windmüller

On 27.05.2010 11:49, Christophe Cordenier wrote:


The only solution i see is to disable default clientvalidation and implement
your own.


Is this possible for the select component, too? As far as I see it is 
not possible to disable the validation which checks if the component has 
the empty value selected.


- Stephan

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



Re: Tapestry 5 Validation on Form Submit

2010-05-27 Thread Christophe Cordenier
Hi

After more investigation, it does not sound like a good idea to disable
client validation. Maybe you can remove observers on the
Tapestry.FOCUS_CHANGE_EVENT event in the document element to avoid field
validation on focus lost.

Regards
Christophe.

2010/5/27 Claude Dubois cduboi...@gmail.com


 Hello Guys,

 I'm developping a Tapestry5 app, and I need to validate some fields on form
 submit.

 I am using the @Validate annotation, which do what I want, except that the
 field is validated on blur, e.g. when the user focuses on another field.

 I have many fields on my page, and it's quite unpleasant.

 Would anyone know how to realize fields validation only when the form is
 submitted?

 Thanks

 -
 Claude Dubois
 --
 View this message in context:
 http://old.nabble.com/Tapestry-5-Validation-on-Form-Submit-tp28691739p28691739.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




-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com


Re: [T5.1]generated Event Links and zone

2010-05-27 Thread blueboy6

Hi,

tnx for links,

ok so now I have js that create html for infoWindows at google map...

inside gmap infowindow I have html:

page:event/context link 

page:event/context is generated with
componentResources.createEventLink(event, context).toAbsoluteURI()

I can generate this in afterRender but how do I bind zone to it?

I have zone name and I could call linkZone but I don't have element id of
anchor?
Can i catch it somehow?

I need to learn more JS :(

Please Help




Josh Canfield wrote:
 
 problem, event links that are generated with
 componentResources.createEventLink(eventName, context); dont have zone
 parameter set... and I'm getting absoluteURI from them and using them in
 my
 page...
 
 The zone information isn't attached to the Link (or URL) that you
 generate but to the element on the page that generates the event, such
 as the anchor tag ( ... ) or form. Take a look at the linkZone
 function in tapestry.js and beginRender in AbstractComponentEventLink.
 
 Josh
 
 On Wed, May 26, 2010 at 5:27 AM, blueboy6 blueb...@gmail.com wrote:

 Hello ppl,

 Long time since I needed to post a question here, but this is really
 making
 me crazy...

 I have event links generated with component resources, lots of them...
 200-300 of them. and I have zone that all of them should update...

 problem, event links that are generated with
 componentResources.createEventLink(eventName, context); dont have zone
 parameter set... and I'm getting absoluteURI from them and using them in
 my
 page...

 And all of the links are generated in setupRender faze and I can't access
 them in after render...

 Any ideas?

 Thanks
 Bojan Cincur
 --
 View this message in context:
 http://old.nabble.com/-T5.1-generated-Event-Links-and-zone-tp28680025p28680025.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


 
 
 
 -- 
 --
 http://www.bodylabgym.com - a private, by appointment only, one-on-one
 health and fitness facility.
 --
 http://www.ectransition.com - Quality Electronic Cigarettes at a
 reasonable price!
 --
 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
 
 
 

-- 
View this message in context: 
http://old.nabble.com/-T5.1-generated-Event-Links-and-zone-tp28680025p28692638.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



Re: [T5.1]generated Event Links and zone

2010-05-27 Thread Josh Canfield
I have zone name and I could call linkZone but I don't have element  
id of

anchor?
Can i catch it somehow?


How are you creating the a href= that you want to link to the  
zone. Please be specific, and if you can show the actual code that  
would be helpful.


-- Josh

On May 27, 2010, at 4:25 AM, blueboy6 blueb...@gmail.com wrote:



Hi,

tnx for links,

ok so now I have js that create html for infoWindows at google map...

inside gmap infowindow I have html:

page:event/context link

page:event/context is generated with
componentResources.createEventLink(event, context).toAbsoluteURI()

I can generate this in afterRender but how do I bind zone to it?

I have zone name and I could call linkZone but I don't have element  
id of

anchor?
Can i catch it somehow?

I need to learn more JS :(

Please Help




Josh Canfield wrote:



problem, event links that are generated with
componentResources.createEventLink(eventName, context); dont  
have zone
parameter set... and I'm getting absoluteURI from them and using  
them in

my
page...


The zone information isn't attached to the Link (or URL) that you
generate but to the element on the page that generates the event,  
such

as the anchor tag ( ... ) or form. Take a look at the linkZone
function in tapestry.js and beginRender in  
AbstractComponentEventLink.


Josh

On Wed, May 26, 2010 at 5:27 AM, blueboy6 blueb...@gmail.com wrote:


Hello ppl,

Long time since I needed to post a question here, but this is really
making
me crazy...

I have event links generated with component resources, lots of  
them...

200-300 of them. and I have zone that all of them should update...

problem, event links that are generated with
componentResources.createEventLink(eventName, context); dont  
have zone
parameter set... and I'm getting absoluteURI from them and using  
them in

my
page...

And all of the links are generated in setupRender faze and I can't  
access

them in after render...

Any ideas?

Thanks
Bojan Cincur
--
View this message in context:
http://old.nabble.com/-T5.1-generated-Event-Links-and-zone-tp28680025p28680025.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






--
--
http://www.bodylabgym.com - a private, by appointment only, one-on- 
one

health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
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





--
View this message in context: 
http://old.nabble.com/-T5.1-generated-Event-Links-and-zone-tp28680025p28692638.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



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



Re: T5: ProgressiveDisplay - Possibly not reloading properly on Safari when user uses browser 'Back' Button

2010-05-27 Thread Chris Darlaston

Thanks Josh, that worked a treat and solved the issue.


Josh Canfield wrote:
 
 Try adding autocomplete=off on your radio button element. I haven't
 tried it, but it works for input fields.
 
 On Wed, May 26, 2010 at 9:09 AM, Chris Darlaston ch...@2infinity.net
 wrote:

 Using cmd-R, I get the right page shown again. If this is a browser
 related
 problem does anyone have any ideas how to get Safari to reload the page
 or
 not to cache the radio button information?

   thanks

         Chris


 Howard Lewis Ship wrote:

 It can be hard to say; too often, the browser is doing something
 clever for you (the way it often fills in user name and password
 fields for you). Doing a hard refresh (cmd-R) usually clarifies
 whether the problem is the browser or Tapestry.

 On Tue, May 25, 2010 at 6:55 AM, Chris Darlaston ch...@2infinity.net
 wrote:

 Hi,

  I have a t:radiogroup set of buttons in a t:progressivedisplay. On
 selection of the radio button, another zone is updated (which contains
 a
 drop down list) is done via a t:mixins.  In Firefox 3, IE 8, it works
 perfectly and on using 'Back' from the browser, the
 t:progressivedisplay
 component upon loading appears to reset the page and the default radio
 button is loaded and the default drop down list in the corresponding
 zone
 is
 loaded.

  When I use Safari on either Windows or MacOS, and I go through the
 same
 motions, the t:progressivedisplay element still appears to reset (you
 get
 the Loading animation);  the state of the radio group is in the state
 it
 was
 in when you left the page and the drop down list is in the default
 state
 ...

  Is there an issue with t:progressivedisplay not fully reloading and
 updating all the elements inside it?

 Example nesting:

   t:progressivedisplay t:id=mainCategory t:update=show

     t:radiogroup t:id=mainCategoryGroup
             t:radio id=radio_${radioIndex}
 value=mainCategoryIterator
                t:mixins=zoneUpdater zone=primarySelectZone
 event=changeMainCategory
                clientEvent=click context=mainCategoryIterator.id/
           ..
     /t:radiogroup

    t:zone t:id=primarySelectZone id=primarySelectZone
 t:update=show
        select t:id=primarySelect t:blankLabel=-- Select a Product
 --
                t:mixins=zoneUpdater zone=secondarySelectZone
 event=changePrimarySelect
                clientEvent=change
 context=mainCategory?.id/select
    /t:zone
  /t:progressivedisplay


 --
 View this message in context:
 http://old.nabble.com/T5%3A-ProgressiveDisplay---Possibly-not-reloading-properly-on-Safari-when-user-uses-browser-%27Back%27-Button-tp28668681p28668681.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





 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!

 (971) 678-5210
 http://howardlewisship.com

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




 --
 View this message in context:
 http://old.nabble.com/T5%3A-ProgressiveDisplay---Possibly-not-reloading-properly-on-Safari-when-user-uses-browser-%27Back%27-Button-tp28668681p28682858.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


 
 
 
 -- 
 --
 http://www.bodylabgym.com - a private, by appointment only, one-on-one
 health and fitness facility.
 --
 http://www.ectransition.com - Quality Electronic Cigarettes at a
 reasonable price!
 --
 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
 
 
 

-- 
View this message in context: 
http://old.nabble.com/T5%3A-ProgressiveDisplay---Possibly-not-reloading-properly-on-Safari-when-user-uses-browser-%27Back%27-Button-tp28668681p28693893.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 manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Genís Pujol

Hello,

Does anybody have documentation regarding how to deploy a Tapestry5 
project into Tomcat? The official docs just say it's the same as jetty...


Does one have to use Maven? can I just drop the folders into webapps (if 
so, how)?


Thanks,


Genis

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



Rendering Chart and ImageMap on the page

2010-05-27 Thread paha

Hi, i have a question:
what is the best approach to extend 
http://wiki.apache.org/tapestry/Tapestry5HowToCreateGenericGraphComponent
GenericGraphComponent  to output an image map along with the chart itself.
for now i have only one idea. 
1) create and process chart in beginRender to obtain CharRenderingInfo
(needed to produce image map)
2) generate and output image map in beginRender
3) create and process chart again in onChart event to return the
StreamResponce

the obvious issue is the need to generate the chart twice or export it to
image twice. i don't think persisting the chart/input stream is the best
idea, unless there are no other approaches. 
-- 
View this message in context: 
http://old.nabble.com/Rendering-Chart-and-ImageMap-on-the-page-tp28693905p28693905.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



Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Todd Orr
I am trying to integrate spring security into my Tapestry application and am
unable to get the TSS module to work correctly. I've created a login page
and am attempting to perform the authentication manually so that I can use
tap for the fields etc. I have a login page with the j_username, etc. also.
It doesn't work either. The code for my login page is:


private final static Logger LOG = LoggerFactory.getLogger(LoginPage.class);

@Inject
 private RequestGlobals requestGlobals;

@Inject
private AuthenticationManager authenticationManager;

private Class? defaultTargetUrl = Index.class;

@SuppressWarnings(unused)
 @Inject
private Request request;

@SuppressWarnings(unused)
 @Inject
private Response response;

@Persist
 @Property
private String username;

@Persist(PersistenceConstants.FLASH)
 @Property
private String password;

@Property
 @Component(id = loginForm)
private Form loginForm;

 private Authentication authResult;

@Component(id = password)
 private PasswordField passwordField;

@SuppressWarnings(unused)
 @Component(id = username)
private TextField usernameField;

 public void onValidateFormFromLoginForm() {
// clean up the properties
 username = username == null ? null : username.trim();
password = password == null ? null : password.trim();

UsernamePasswordAuthenticationToken authRequest = new
UsernamePasswordAuthenticationToken(username, password);
try {
 authResult = authenticationManager.authenticate(authRequest);

} catch (BadCredentialsException e) {
 LOG.warn(Authentication failed: {}, e.getAuthentication());
loginForm.recordError(passwordField, Invalid username or password);

} catch (AuthenticationException e) {
LOG.warn(Authentication failed: {}, e.getAuthentication());
 loginForm.recordError(passwordField, Invalid username or password);
}

}

public Object onSuccessFromLoginForm() {

 SavedRequest savedRequest = (SavedRequest)
requestGlobals.getHTTPServletRequest().getSession().getAttribute(
AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY);

SecurityContextHolder.getContext().setAuthentication(authResult);

if (savedRequest != null) {

URL url = null;
try {
url = new URL(savedRequest.getRequestURL());

} catch (MalformedURLException e) {
LOG.error(malformed url: + savedRequest.getRequestURI());
 return defaultTargetUrl;
}

return url;

}

return defaultTargetUrl;

 }

And the stdout shows the following when attempting to login:

10:49:01,733 DEBUG [UserDetailsServiceImpl] Attempting to locate user with
username my_username
10:49:01,782 INFO  [sqlonly] select this_.user_id as user1_0_1_,
this_.user_passwd as user2_0_1_, this_.user_username as
user3_0_1_, roles2_.u_to_p_frn_user_id as u2_3_,
roles2_.u_to_p_frn_permission_id as u1_3_,
roles2_.u_to_p_frn_permission_id as u1_1_0_, roles2_.u_to_p_frn_user_id as
u2_1_0_ from users
this_ left outer join user_to_permissions roles2_ on
this_.user_id=roles2_.u_to_p_frn_user_id
where this_.user_username='my_username'
10:49:02,063 DEBUG [UserDetailsServiceImpl] Located user:
User[username=my_username,roles=[ROLE_TEMP,
ROLE_ADMIN],authorities=[ROLE_TEMP, ROLE_ADMIN]]
10:49:02,446 WARN  [LoginPage] Authentication failed:
org.springframework.security.providers.usernamepasswordauthenticationto...@1f:
Principal: my_username; Password: [PROTECTED]; Authenticated: false;
Details: null; Not granted any authorities

I am sure that a valid user with valid authorities is being returned from my
UserDetailsService. I am sure it's password matches the password I am
providing. But no matter what, it always - ALWAYS - throws the
BadCredentialsException.

I've been beating my head against this wall since Tuesday - literally.
Please advise.

Thanks,
T


Re: Rendering Chart and ImageMap on the page

2010-05-27 Thread Thiago H. de Paula Figueiredo

Option 2.

On Thu, 27 May 2010 11:32:26 -0300, paha ch_pa...@yahoo.com wrote:



Hi, i have a question:
what is the best approach to extend
http://wiki.apache.org/tapestry/Tapestry5HowToCreateGenericGraphComponent
GenericGraphComponent  to output an image map along with the chart  
itself.

for now i have only one idea.
1) create and process chart in beginRender to obtain CharRenderingInfo
(needed to produce image map)
2) generate and output image map in beginRender
3) create and process chart again in onChart event to return the
StreamResponce

the obvious issue is the need to generate the chart twice or export it to
image twice. i don't think persisting the chart/input stream is the best
idea, unless there are no other approaches.



--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

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: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Josh Canfield
Tapestry is built using maven but your project doesn't need to care  
about that. You can download all the dependencies yourself and deploy  
your app as a WAR or an exploded webapp folder. In the end to the  
container Tapestry is just a Servlet filter.


-- Josh

On May 27, 2010, at 7:11 AM, Genís Pujol gpu...@ngeografics.com  
wrote:



Hello,

Does anybody have documentation regarding how to deploy a Tapestry5  
project into Tomcat? The official docs just say it's the same as  
jetty...


Does one have to use Maven? can I just drop the folders into webapps  
(if so, how)?


Thanks,


Genis

-
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



Re: Rendering Chart and ImageMap on the page

2010-05-27 Thread Josh Canfield
You've outlined the two approaches. Either you generate the chart  
twice or store the image for later retrieval. You have to decide which  
concerns you more, CPU to generate the chart or memory to store it.


I don't know how what backs the chart's image stream, but I'd probably  
generate the image and store that for later... If your really worried  
about performance then you can stick ehcache in there to hold the map  
and image so that page refreshes just grab the already generated  
content from memory or disk.


-- Josh

On May 27, 2010, at 7:32 AM, paha ch_pa...@yahoo.com wrote:



Hi, i have a question:
what is the best approach to extend
http://wiki.apache.org/tapestry/Tapestry5HowToCreateGenericGraphComponent
GenericGraphComponent  to output an image map along with the chart  
itself.

for now i have only one idea.
1) create and process chart in beginRender to obtain CharRenderingInfo
(needed to produce image map)
2) generate and output image map in beginRender
3) create and process chart again in onChart event to return the
StreamResponce

the obvious issue is the need to generate the chart twice or export  
it to
image twice. i don't think persisting the chart/input stream is the  
best

idea, unless there are no other approaches.
--
View this message in context: 
http://old.nabble.com/Rendering-Chart-and-ImageMap-on-the-page-tp28693905p28693905.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



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



Re: Saving state when changing grid pages

2010-05-27 Thread des999

Thank you so much Josh, your solution works great!  It's also easy to
understand.

Thanks again,
Paul



Josh Canfield wrote:
 
 I whipped something up that will allow you to only submit the form
 when the link is clicked.
 
 Add this to your form containing the grid to keep track of the page
 t:hidden t:id=page/
 
 Add this to your page:
 
 @Property
 private int _page;
 
 @Component
 private Grid _grid;
 
 void onSuccess() {
 _grid.setCurrentPage(_page);
 }
 
 Add this javascript to the page after the grid.
 
 script type=text/javascript
 $$('.t-data-grid-pager a').each(function(a) {
 a.observe(click, function(e) {
 e.stop();
 // parse out the page number.
 var page = a.href.replace(/^.*pager\/(\d+)$/, $1);
 var form = $('personForm');
 // Hidden doesn't include the id so find by name
 var pageField = form.select([name='page'])[0];
 pageField.value = page;
 
 form.submit();
 });
 });
 /script
 
 Good Luck,
 Josh
 
 

-- 
View this message in context: 
http://old.nabble.com/Saving-state-when-changing-grid-pages-tp28682342p28694125.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



Re: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Genís Pujol

Al 27/05/2010 17:03, En/na Josh Canfield ha escrit:
Tapestry is built using maven but your project doesn't need to care 
about that. You can download all the dependencies yourself and deploy 
your app as a WAR or an exploded webapp folder. In the end to the 
container Tapestry is just a Servlet filter.


-- Josh

On May 27, 2010, at 7:11 AM, Genís Pujol gpu...@ngeografics.com wrote:


Hello,

Does anybody have documentation regarding how to deploy a Tapestry5 
project into Tomcat? The official docs just say it's the same as 
jetty...


Does one have to use Maven? can I just drop the folders into webapps 
(if so, how)?


Thanks,


Genis

-
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


OK Thank you Josh :)

I've deployed it as an exploded webapp folder, but Tomcat doesn't find 
the resource, I guess I need to configure something in Tomcat?


Genís

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



Re: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Genís Pujol

Al 27/05/2010 17:03, En/na Josh Canfield ha escrit:
Tapestry is built using maven but your project doesn't need to care 
about that. You can download all the dependencies yourself and deploy 
your app as a WAR or an exploded webapp folder. In the end to the 
container Tapestry is just a Servlet filter.


-- Josh

On May 27, 2010, at 7:11 AM, Genís Pujol gpu...@ngeografics.com wrote:


Hello,

Does anybody have documentation regarding how to deploy a Tapestry5 
project into Tomcat? The official docs just say it's the same as 
jetty...


Does one have to use Maven? can I just drop the folders into webapps 
(if so, how)?


Thanks,


Genis

-
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

I meant that Tomcat does find the Index.tml but it doesn't pass control 
to Tapestry so it renders the template as plain text...


any clues?

G.

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



RE: ClassTransformation API change for 5.2.0

2010-05-27 Thread Jim O'Callaghan
Pierce, Howard,

Thanks for the responses.  I back up and running (on this part!) - code is
more concise if a little less intuitive initially.  Thanks.

Regards,
Jim.

-Original Message-
From: Pierce Wetter [mailto:pie...@paceap.com] 
Sent: 27 May 2010 01:28
To: Tapestry users
Subject: Re: ClassTransformation API change for 5.2.0


On May 26, 2010, at 10:13 AM, Howard Lewis Ship wrote:

 You now getOrCreateMethod()  to create an empty placeholder (that
 calls the super implementation, if there is one). You then use the
 TransformMethod to addAdvice() to get it to do what you want.  It
 seems more complicated, but it has the advantage of being in purely
 Java code ... no Javassist psuedo-code is involved at all, and you can
 also add multiple bits of advice.  It's really about weaving a
 Tapestry of method invocations together :-)

  I had a hard time with this too, so I'll expand:

The old way was to have hard coded strings of java that then javaassist
would compile. You often had to fuss about and add new instance variables,
then set the instance variable values, etc. You could have strings to run
before the method, after the method, and instead of the method. 

The new way is to make an advice object, which you can do inline as an
inner class. That object only has one method, which is called to invoke the
method. So you generally don't need to add any instance variables or any of
the other mucking about, and the java compiler compiles plain old java code.
so no run-time syntax errors! 

To run stuff before, the method in your advice object does:

   {

  stuff before

  invoke();
   }

   To run stuff after, the method does:

  {
  invoke();
  
  stuff after
  }

  To run stuff instead:

  {

 stuff
 //   invoke();  
   }

   To run stuff before and after:
   {

   stuff before

   invoke();

   stuff after
   }


  So the new approach becomes:

  TransformMethod method = getOrCreateMethod()

  advice = new MyAdviseObject();

  method.addAdvice(advice);

 Pierce




-
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



How often snapshot jar refreshed?

2010-05-27 Thread Jim O'Callaghan
I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
been fixed in the trunk at ASF by
https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
5.2.0-SNAPSHOT jar I pulled in from
http://tapestry.formos.com/maven-snapshot-repository.  Can someone involved
in the build process tell me what kind of interval the snapshot jar is
refreshed at / if I should be using a different maven repo, or if there is a
link somewhere on the Tapestry site I could get the details from?  Thanks.

 

Regards,

Jim.



Re: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Josh Canfield
I meant that Tomcat does find the Index.tml but it doesn't pass  
control to Tapestry so it renders the template as plain text...


What is the path to your .tml files located in your exploded folder?

-- Josh

On May 27, 2010, at 8:24 AM, Genís Pujol gpu...@ngeografics.com  
wrote:



Al 27/05/2010 17:03, En/na Josh Canfield ha escrit:
Tapestry is built using maven but your project doesn't need to care  
about that. You can download all the dependencies yourself and  
deploy your app as a WAR or an exploded webapp folder. In the end  
to the container Tapestry is just a Servlet filter.


-- Josh

On May 27, 2010, at 7:11 AM, Genís Pujol gpu...@ngeografics.com  
wrote:



Hello,

Does anybody have documentation regarding how to deploy a  
Tapestry5 project into Tomcat? The official docs just say it's  
the same as jetty...


Does one have to use Maven? can I just drop the folders into  
webapps (if so, how)?


Thanks,


Genis

--- 
--

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

I meant that Tomcat does find the Index.tml but it doesn't pass  
control to Tapestry so it renders the template as plain text...


any clues?

G.

-
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



Re: How often snapshot jar refreshed?

2010-05-27 Thread Robin Komiwes
Hi!

Just at the end of this page:
http://tapestry.apache.org/tapestry5.1/

On Thu, May 27, 2010 at 5:29 PM, Jim O'Callaghan
j...@peritussolutions.comwrote:

 I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
 been fixed in the trunk at ASF by
 https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
 5.2.0-SNAPSHOT jar I pulled in from
 http://tapestry.formos.com/maven-snapshot-repository.  Can someone
 involved
 in the build process tell me what kind of interval the snapshot jar is
 refreshed at / if I should be using a different maven repo, or if there is
 a
 link somewhere on the Tapestry site I could get the details from?  Thanks.



 Regards,

 Jim.




RE: How often snapshot jar refreshed?

2010-05-27 Thread Jim O'Callaghan
Thanks Robin.

If say the BeanEditForm was last modified at ASF Mon May 3 23:05:07 2010
UTC, and the snapshot at
http://tapestry.formos.com/maven-snapshot-repository/org/apache/tapestry/tap
estry-core/5.2.0-SNAPSHOT/was last modified 20-Mar-2010 02:23 - what
triggers the ASF version being pushed to the snapshot at formos?  Does the
commit have to voted on or something?

Regards,
Jim.

-Original Message-
From: odiss...@gmail.com [mailto:odiss...@gmail.com] On Behalf Of Robin
Komiwes
Sent: 27 May 2010 16:34
To: Tapestry users
Subject: Re: How often snapshot jar refreshed?

Hi!

Just at the end of this page:
http://tapestry.apache.org/tapestry5.1/

On Thu, May 27, 2010 at 5:29 PM, Jim O'Callaghan
j...@peritussolutions.comwrote:

 I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
 been fixed in the trunk at ASF by
 https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
 5.2.0-SNAPSHOT jar I pulled in from
 http://tapestry.formos.com/maven-snapshot-repository.  Can someone
 involved
 in the build process tell me what kind of interval the snapshot jar is
 refreshed at / if I should be using a different maven repo, or if there is
 a
 link somewhere on the Tapestry site I could get the details from?  Thanks.



 Regards,

 Jim.




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



Re: Rendering Chart and ImageMap on the page

2010-05-27 Thread paha

thanks, i just wanted to know if there is any better approach. 
for now i render the chart in beginRender and store image as Byte[] in field
with FLASH Strategy. seems to work :)

-- 
View this message in context: 
http://old.nabble.com/Rendering-Chart-and-ImageMap-on-the-page-tp28693905p28696838.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



Re: How often snapshot jar refreshed?

2010-05-27 Thread Andreas Andreou
https://repository.apache.org/snapshots

it's updated almost daily

On Thu, May 27, 2010 at 18:29, Jim O'Callaghan j...@peritussolutions.com 
wrote:
 I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
 been fixed in the trunk at ASF by
 https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
 5.2.0-SNAPSHOT jar I pulled in from
 http://tapestry.formos.com/maven-snapshot-repository.  Can someone involved
 in the build process tell me what kind of interval the snapshot jar is
 refreshed at / if I should be using a different maven repo, or if there is a
 link somewhere on the Tapestry site I could get the details from?  Thanks.



 Regards,

 Jim.





-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
Why do you try to do the work of Spring Security? Please follow the 
sample in [1]. There's no need to check the credentials on your own. You 
just need to provide your implementation of UserDetails.


[1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample/

Am 27/05/2010 16:53, schrieb Todd Orr:

I am trying to integrate spring security into my Tapestry application and am
unable to get the TSS module to work correctly. I've created a login page
and am attempting to perform the authentication manually so that I can use
tap for the fields etc. I have a login page with the j_username, etc. also.
It doesn't work either. The code for my login page is:


private final static Logger LOG = LoggerFactory.getLogger(LoginPage.class);

@Inject
  private RequestGlobals requestGlobals;

@Inject
private AuthenticationManager authenticationManager;

private Class?  defaultTargetUrl = Index.class;

@SuppressWarnings(unused)
  @Inject
private Request request;

@SuppressWarnings(unused)
  @Inject
private Response response;

@Persist
  @Property
private String username;

@Persist(PersistenceConstants.FLASH)
  @Property
private String password;

@Property
  @Component(id = loginForm)
private Form loginForm;

  private Authentication authResult;

@Component(id = password)
  private PasswordField passwordField;

@SuppressWarnings(unused)
  @Component(id = username)
private TextField usernameField;

  public void onValidateFormFromLoginForm() {
// clean up the properties
  username = username == null ? null : username.trim();
password = password == null ? null : password.trim();

UsernamePasswordAuthenticationToken authRequest = new
UsernamePasswordAuthenticationToken(username, password);
try {
  authResult = authenticationManager.authenticate(authRequest);

} catch (BadCredentialsException e) {
  LOG.warn(Authentication failed: {}, e.getAuthentication());
loginForm.recordError(passwordField, Invalid username or password);

} catch (AuthenticationException e) {
LOG.warn(Authentication failed: {}, e.getAuthentication());
  loginForm.recordError(passwordField, Invalid username or password);
}

}

public Object onSuccessFromLoginForm() {

  SavedRequest savedRequest = (SavedRequest)
requestGlobals.getHTTPServletRequest().getSession().getAttribute(
AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY);

SecurityContextHolder.getContext().setAuthentication(authResult);

if (savedRequest != null) {

URL url = null;
try {
url = new URL(savedRequest.getRequestURL());

} catch (MalformedURLException e) {
LOG.error(malformed url: + savedRequest.getRequestURI());
  return defaultTargetUrl;
}

return url;

}

return defaultTargetUrl;

  }

And the stdout shows the following when attempting to login:

10:49:01,733 DEBUG [UserDetailsServiceImpl] Attempting to locate user with
username my_username
10:49:01,782 INFO  [sqlonly] select this_.user_id as user1_0_1_,
this_.user_passwd as user2_0_1_, this_.user_username as
user3_0_1_, roles2_.u_to_p_frn_user_id as u2_3_,
roles2_.u_to_p_frn_permission_id as u1_3_,
roles2_.u_to_p_frn_permission_id as u1_1_0_, roles2_.u_to_p_frn_user_id as
u2_1_0_ from users
this_ left outer join user_to_permissions roles2_ on
this_.user_id=roles2_.u_to_p_frn_user_id
where this_.user_username='my_username'
10:49:02,063 DEBUG [UserDetailsServiceImpl] Located user:
User[username=my_username,roles=[ROLE_TEMP,
ROLE_ADMIN],authorities=[ROLE_TEMP, ROLE_ADMIN]]
10:49:02,446 WARN  [LoginPage] Authentication failed:
org.springframework.security.providers.usernamepasswordauthenticationto...@1f:
Principal: my_username; Password: [PROTECTED]; Authenticated: false;
Details: null; Not granted any authorities

I am sure that a valid user with valid authorities is being returned from my
UserDetailsService. I am sure it's password matches the password I am
providing. But no matter what, it always - ALWAYS - throws the
BadCredentialsException.

I've been beating my head against this wall since Tuesday - literally.
Please advise.

Thanks,
T

   



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



Re: How often snapshot jar refreshed?

2010-05-27 Thread Ulrich Stärk
The snapshot gets refreshed with every build, i.e. once hudson has completed a build it gets pushed 
to the nexus repository at http://repository.apache.org/snapshots/


I guess you are trying to get snapshots from formos? Just switch to the apache repository and you 
should be good.


HTH,

Uli

On 27.05.2010 17:29, Jim O'Callaghan wrote:

I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
been fixed in the trunk at ASF by
https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
5.2.0-SNAPSHOT jar I pulled in from
http://tapestry.formos.com/maven-snapshot-repository.  Can someone involved
in the build process tell me what kind of interval the snapshot jar is
refreshed at / if I should be using a different maven repo, or if there is a
link somewhere on the Tapestry site I could get the details from?  Thanks.



Regards,

Jim.




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



T5: Using Event.observer with a form within a t:block

2010-05-27 Thread immutability

A little background: I need to wire-up some custom JavaScript to be launched
when the Submit button of my form is clicked. I now believe that the best
way to do this with Tapestry5 is to use the Event.observer for this purpose.
Unfortunately my knowledge of client-side javascript, scriptaculous, etc, is
limited, and I can't make this work. The issue seems to be that my form is
within a t:block that gets injected into a t:zone dynamically.

So, even if I do this in my JS file:

Event.observe(window, 'load', function() 
{
Event.observe('formTranslator', 'submit', function() 
{
// some onsubmit actions
});
});

this will fail, because apparently, the my form named formTranslator doesn't
exist at the point the document is loaded (the form gets reinjected into the
t:zone whenever a new object to translate is selected by the user). The
JavaScript error that I see in my JS console is this:

element is null - scriptaculous/prototype.js Line:3936

I guess I somehow need to have the Event.observer called everytime the form
is reinjected into the t:zone, but how? Are my assumptions correct at all?

Thanks for any ideas in advance!

Rado
-- 
View this message in context: 
http://old.nabble.com/T5%3A-Using-Event.observer-with-a-form-within-a-t%3Ablock-tp28697334p28697334.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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Todd Orr
I've tried that way as well. It doesn't work either and I assume it's for
the same reason, though I cannot tell in that case because the exception
doesn't bubble out of Tapestry Spring Security.

Login code:

private final static Logger LOG = LoggerFactory.getLogger(Login.class);

@Inject
 @Value(${spring-security.check.url})
private String checkUrl;

@Inject
private Request request;

private boolean failed = false;

public boolean isFailed() {
return failed;
}

public String getLoginCheckUrl() {
String loginCheckUrl = request.getContextPath() + checkUrl;
 LOG.debug(Returning login check url: {}, loginCheckUrl);
return loginCheckUrl;
 }

void onActivate(String extra) {
if (extra.equals(failed)) {
 failed = true;
}
}

TML:

html t:type=layout
title=message:page-title
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
 xmlns:p=tapestry:parameter

div id=login-help
 t:outputraw value=${message:login-help} /
/div
 div
form action=${loginCheckUrl} method=post
 t:if test=failed
pUsername and/or password was wrong!/p
 /t:if
div id=login-username-row
label for=j_usernameUsername:/label
 input id=j_username name=j_username type=text /
/div
 div id=login-password-row
label for=j_passwordPassword/label
 input id=j_password name=j_password type=password /
/div
 div id=login-submit-row
input type=submit value=Login /
 /div
/form
/div

/html

Module:

private final static Logger LOG =
LoggerFactory.getLogger(SecurityModule.class);
 public static void
contributeProviderManager(OrderedConfigurationAuthenticationProvider
configuration,
 @InjectService(DaoAuthenticationProvider) AuthenticationProvider
daoAuthenticationProvider) {
LOG.debug(Received AuthenticationProvider: {}, daoAuthenticationProvider);
 configuration.add(daoAuthenticationProvider, daoAuthenticationProvider);
}

public static void
contributeAlias(ConfigurationAliasContributionPasswordEncoder
configuration) {
configuration.add(AliasContribution.create(PasswordEncoder.class, new
PlaintextPasswordEncoder()));
 }

public static void contributeApplicationDefaults(MappedConfigurationString,
String configuration) {
 configuration.add(spring-security.failure.url, /login/failed);
configuration.add(spring-security.accessDenied.url, /accessdenied);
 configuration.add(spring-security.check.url, /j_spring_security_check);
configuration.add(spring-security.target.url, /intranet);
 configuration.add(spring-security.afterlogout.url, /);
configuration.add(spring-security.rememberme.key, REMEMBERMEKEY);
 configuration.add(spring-security.loginform.url, /login);
configuration.add(spring-security.force.ssl.login, false);
 configuration.add(spring-security.anonymous.key, acegi_anonymous);
configuration.add(spring-security.anonymous.attribute,
anonymous,ROLE_ANONYMOUS);
 configuration.add(spring-security.password.salt, DEADBEEF);
}

public static void
contributeFilterSecurityInterceptor(ConfigurationRequestInvocationDefinition
configuration) {
configuration.add(new RequestInvocationDefinition(/intranet*/**,
ROLE_ADMIN));
 }


No redirect to the target URL occurs. It just says that Username and/or
password was wrong!.


On Thu, May 27, 2010 at 12:54 PM, Michael Gerzabek michael.gerza...@gmx.net
 wrote:

 Why do you try to do the work of Spring Security? Please follow the sample
 in [1]. There's no need to check the credentials on your own. You just need
 to provide your implementation of UserDetails.

 [1] http://www.localhost.nu/svn/public/tapestry-spring-security-sample/

 Am 27/05/2010 16:53, schrieb Todd Orr:

  I am trying to integrate spring security into my Tapestry application and
 am
 unable to get the TSS module to work correctly. I've created a login page
 and am attempting to perform the authentication manually so that I can use
 tap for the fields etc. I have a login page with the j_username, etc.
 also.
 It doesn't work either. The code for my login page is:


 private final static Logger LOG =
 LoggerFactory.getLogger(LoginPage.class);

 @Inject
  private RequestGlobals requestGlobals;

 @Inject
 private AuthenticationManager authenticationManager;

 private Class?  defaultTargetUrl = Index.class;

 @SuppressWarnings(unused)
  @Inject
 private Request request;

 @SuppressWarnings(unused)
  @Inject
 private Response response;

 @Persist
  @Property
 private String username;

 @Persist(PersistenceConstants.FLASH)
  @Property
 private String password;

 @Property
  @Component(id = loginForm)
 private Form loginForm;

  private Authentication authResult;

 @Component(id = password)
  private PasswordField passwordField;

 @SuppressWarnings(unused)
  @Component(id = username)
 private TextField usernameField;

  public void onValidateFormFromLoginForm() {
 // clean up the properties
  username = username == null ? null : username.trim();
 password = password == null ? null : password.trim();

 UsernamePasswordAuthenticationToken authRequest = new
 UsernamePasswordAuthenticationToken(username, password);
 try {
  authResult = 

Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
What about the salt. Did you change it? You have to 'save' password with 
your PasswordEncoder prior to using it.


Which Am 27/05/2010 19:20, schrieb Todd Orr:

I've tried that way as well. It doesn't work either and I assume it's for
the same reason, though I cannot tell in that case because the exception
doesn't bubble out of Tapestry Spring Security.

Login code:

private final static Logger LOG = LoggerFactory.getLogger(Login.class);

@Inject
  @Value(${spring-security.check.url})
private String checkUrl;

@Inject
private Request request;

private boolean failed = false;

public boolean isFailed() {
return failed;
}

public String getLoginCheckUrl() {
String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug(Returning login check url: {}, loginCheckUrl);
return loginCheckUrl;
  }

void onActivate(String extra) {
if (extra.equals(failed)) {
  failed = true;
}
}

TML:

html t:type=layout
title=message:page-title
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

div id=login-help
  t:outputraw value=${message:login-help} /
/div
  div
form action=${loginCheckUrl} method=post
  t:if test=failed
pUsername and/or password was wrong!/p
  /t:if
div id=login-username-row
label for=j_usernameUsername:/label
  input id=j_username name=j_username type=text /
/div
  div id=login-password-row
label for=j_passwordPassword/label
  input id=j_password name=j_password type=password /
/div
  div id=login-submit-row
input type=submit value=Login /
  /div
/form
/div

/html

Module:

private final static Logger LOG =
LoggerFactory.getLogger(SecurityModule.class);
  public static void
contributeProviderManager(OrderedConfigurationAuthenticationProvider
configuration,
  @InjectService(DaoAuthenticationProvider) AuthenticationProvider
daoAuthenticationProvider) {
LOG.debug(Received AuthenticationProvider: {}, daoAuthenticationProvider);
  configuration.add(daoAuthenticationProvider, daoAuthenticationProvider);
}

public static void
contributeAlias(ConfigurationAliasContributionPasswordEncoder
configuration) {
configuration.add(AliasContribution.create(PasswordEncoder.class, new
PlaintextPasswordEncoder()));
  }

public static void contributeApplicationDefaults(MappedConfigurationString,
String  configuration) {
  configuration.add(spring-security.failure.url, /login/failed);
configuration.add(spring-security.accessDenied.url, /accessdenied);
  configuration.add(spring-security.check.url, /j_spring_security_check);
configuration.add(spring-security.target.url, /intranet);
  configuration.add(spring-security.afterlogout.url, /);
configuration.add(spring-security.rememberme.key, REMEMBERMEKEY);
  configuration.add(spring-security.loginform.url, /login);
configuration.add(spring-security.force.ssl.login, false);
  configuration.add(spring-security.anonymous.key, acegi_anonymous);
configuration.add(spring-security.anonymous.attribute,
anonymous,ROLE_ANONYMOUS);
  configuration.add(spring-security.password.salt, DEADBEEF);
}

public static void
contributeFilterSecurityInterceptor(ConfigurationRequestInvocationDefinition
configuration) {
configuration.add(new RequestInvocationDefinition(/intranet*/**,
ROLE_ADMIN));
  }


No redirect to the target URL occurs. It just says that Username and/or
password was wrong!.
   



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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Todd Orr
My UserDetailsService is managed by Spring and as such I can't inject the
same exact instances that tapestry is using, but I do use the same types,
PlaintextPasswordEncoder and SaltSourceImpl.

UserDetailsService:


private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

@Autowired
 private SessionFactory sessionManager;

private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder();

private SaltSource saltSource = new SaltSourceImpl();

/**
 * Default constructor.
 */
public UserDetailsServiceImpl() {
 // default
}

/**
 * Try to find the given user in the local database.
 */
@Transactional(propagation = Propagation.REQUIRED, isolation =
Isolation.READ_COMMITTED, readOnly = true)
 public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException, DataAccessException {
LOG.debug(Attempting to locate user with username \{}\, username);

Session session = sessionManager.getCurrentSession();

User user = (User)
session.createCriteria(User.class).add(Restrictions.eq(username,
username)).uniqueResult();

if (user != null) {
// encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
 }

LOG.debug(Located user: {}, user);

 return new User(user);
}

On Thu, May 27, 2010 at 1:29 PM, Michael Gerzabek
michael.gerza...@gmx.netwrote:

 What about the salt. Did you change it? You have to 'save' password with
 your PasswordEncoder prior to using it.

 Which Am 27/05/2010 19:20, schrieb Todd Orr:

  I've tried that way as well. It doesn't work either and I assume it's for
 the same reason, though I cannot tell in that case because the exception
 doesn't bubble out of Tapestry Spring Security.

 Login code:

 private final static Logger LOG = LoggerFactory.getLogger(Login.class);

 @Inject
  @Value(${spring-security.check.url})
 private String checkUrl;

 @Inject
 private Request request;

 private boolean failed = false;

 public boolean isFailed() {
 return failed;
 }

 public String getLoginCheckUrl() {
 String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug(Returning login check url: {}, loginCheckUrl);
 return loginCheckUrl;
  }

 void onActivate(String extra) {
 if (extra.equals(failed)) {
  failed = true;
 }
 }

 TML:

 html t:type=layout
 title=message:page-title
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

 div id=login-help
  t:outputraw value=${message:login-help} /
 /div
  div
 form action=${loginCheckUrl} method=post
  t:if test=failed
 pUsername and/or password was wrong!/p
  /t:if
 div id=login-username-row
 label for=j_usernameUsername:/label
  input id=j_username name=j_username type=text /
 /div
  div id=login-password-row
 label for=j_passwordPassword/label
  input id=j_password name=j_password type=password /
 /div
  div id=login-submit-row
 input type=submit value=Login /
  /div
 /form
 /div

 /html

 Module:

 private final static Logger LOG =
 LoggerFactory.getLogger(SecurityModule.class);
  public static void
 contributeProviderManager(OrderedConfigurationAuthenticationProvider
 configuration,
  @InjectService(DaoAuthenticationProvider) AuthenticationProvider
 daoAuthenticationProvider) {
 LOG.debug(Received AuthenticationProvider: {},
 daoAuthenticationProvider);
  configuration.add(daoAuthenticationProvider,
 daoAuthenticationProvider);
 }

 public static void
 contributeAlias(ConfigurationAliasContributionPasswordEncoder
 configuration) {
 configuration.add(AliasContribution.create(PasswordEncoder.class, new
 PlaintextPasswordEncoder()));
  }

 public static void
 contributeApplicationDefaults(MappedConfigurationString,
 String  configuration) {
  configuration.add(spring-security.failure.url, /login/failed);
 configuration.add(spring-security.accessDenied.url, /accessdenied);
  configuration.add(spring-security.check.url,
 /j_spring_security_check);
 configuration.add(spring-security.target.url, /intranet);
  configuration.add(spring-security.afterlogout.url, /);
 configuration.add(spring-security.rememberme.key, REMEMBERMEKEY);
  configuration.add(spring-security.loginform.url, /login);
 configuration.add(spring-security.force.ssl.login, false);
  configuration.add(spring-security.anonymous.key, acegi_anonymous);
 configuration.add(spring-security.anonymous.attribute,
 anonymous,ROLE_ANONYMOUS);
  configuration.add(spring-security.password.salt, DEADBEEF);
 }

 public static void

 contributeFilterSecurityInterceptor(ConfigurationRequestInvocationDefinition
 configuration) {
 configuration.add(new RequestInvocationDefinition(/intranet*/**,
 ROLE_ADMIN));
  }


 No redirect to the target URL occurs. It just says that Username and/or
 password was wrong!.




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




Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek
Did you debug down to the point where the compare of the credential to 
the stored pwd happens? Are they really the same?


Am 27/05/2010 19:37, schrieb Todd Orr:

My UserDetailsService is managed by Spring and as such I can't inject the
same exact instances that tapestry is using, but I do use the same types,
PlaintextPasswordEncoder and SaltSourceImpl.

UserDetailsService:


private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

@Autowired
  private SessionFactory sessionManager;

private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder();

private SaltSource saltSource = new SaltSourceImpl();

/**
  * Default constructor.
  */
public UserDetailsServiceImpl() {
  // default
}

/**
  * Try to find the given user in the local database.
  */
@Transactional(propagation = Propagation.REQUIRED, isolation =
Isolation.READ_COMMITTED, readOnly = true)
  public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException, DataAccessException {
LOG.debug(Attempting to locate user with username \{}\, username);

Session session = sessionManager.getCurrentSession();

User user = (User)
session.createCriteria(User.class).add(Restrictions.eq(username,
username)).uniqueResult();

if (user != null) {
// encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
  }

LOG.debug(Located user: {}, user);

  return new User(user);
}

On Thu, May 27, 2010 at 1:29 PM, Michael Gerzabek
michael.gerza...@gmx.netwrote:

   

What about the salt. Did you change it? You have to 'save' password with
your PasswordEncoder prior to using it.

Which Am 27/05/2010 19:20, schrieb Todd Orr:

  I've tried that way as well. It doesn't work either and I assume it's for
 

the same reason, though I cannot tell in that case because the exception
doesn't bubble out of Tapestry Spring Security.

Login code:

private final static Logger LOG = LoggerFactory.getLogger(Login.class);

@Inject
  @Value(${spring-security.check.url})
private String checkUrl;

@Inject
private Request request;

private boolean failed = false;

public boolean isFailed() {
return failed;
}

public String getLoginCheckUrl() {
String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug(Returning login check url: {}, loginCheckUrl);
return loginCheckUrl;
  }

void onActivate(String extra) {
if (extra.equals(failed)) {
  failed = true;
}
}

TML:

html t:type=layout
title=message:page-title
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

div id=login-help
  t:outputraw value=${message:login-help} /
/div
  div
form action=${loginCheckUrl} method=post
  t:if test=failed
pUsername and/or password was wrong!/p
  /t:if
div id=login-username-row
label for=j_usernameUsername:/label
  input id=j_username name=j_username type=text /
/div
  div id=login-password-row
label for=j_passwordPassword/label
  input id=j_password name=j_password type=password /
/div
  div id=login-submit-row
input type=submit value=Login /
  /div
/form
/div

/html

Module:

private final static Logger LOG =
LoggerFactory.getLogger(SecurityModule.class);
  public static void
contributeProviderManager(OrderedConfigurationAuthenticationProvider
configuration,
  @InjectService(DaoAuthenticationProvider) AuthenticationProvider
daoAuthenticationProvider) {
LOG.debug(Received AuthenticationProvider: {},
daoAuthenticationProvider);
  configuration.add(daoAuthenticationProvider,
daoAuthenticationProvider);
}

public static void
contributeAlias(ConfigurationAliasContributionPasswordEncoder
configuration) {
configuration.add(AliasContribution.create(PasswordEncoder.class, new
PlaintextPasswordEncoder()));
  }

public static void
contributeApplicationDefaults(MappedConfigurationString,
String   configuration) {
  configuration.add(spring-security.failure.url, /login/failed);
configuration.add(spring-security.accessDenied.url, /accessdenied);
  configuration.add(spring-security.check.url,
/j_spring_security_check);
configuration.add(spring-security.target.url, /intranet);
  configuration.add(spring-security.afterlogout.url, /);
configuration.add(spring-security.rememberme.key, REMEMBERMEKEY);
  configuration.add(spring-security.loginform.url, /login);
configuration.add(spring-security.force.ssl.login, false);
  configuration.add(spring-security.anonymous.key, acegi_anonymous);
configuration.add(spring-security.anonymous.attribute,
anonymous,ROLE_ANONYMOUS);
  configuration.add(spring-security.password.salt, DEADBEEF);
}

public static void

contributeFilterSecurityInterceptor(ConfigurationRequestInvocationDefinition
configuration) {
configuration.add(new RequestInvocationDefinition(/intranet*/**,
ROLE_ADMIN));
  }


No redirect to the target URL occurs. It just says that Username and/or
password was wrong!.


   


-
To unsubscribe, e-mail: 

Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Todd Orr
I changed the code so that these are injected and now it works. I cannot
describe how angry this makes me. Days wasted.

Thanks for you help though!!!

On Thu, May 27, 2010 at 1:37 PM, Todd Orr torr0...@gmail.com wrote:

 My UserDetailsService is managed by Spring and as such I can't inject the
 same exact instances that tapestry is using, but I do use the same types,
 PlaintextPasswordEncoder and SaltSourceImpl.

 UserDetailsService:


 private final static Logger LOG =
 LoggerFactory.getLogger(UserDetailsServiceImpl.class);

 @Autowired
  private SessionFactory sessionManager;

 private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder();

 private SaltSource saltSource = new SaltSourceImpl();

 /**
  * Default constructor.
  */
 public UserDetailsServiceImpl() {
  // default
 }

 /**
  * Try to find the given user in the local database.
  */
 @Transactional(propagation = Propagation.REQUIRED, isolation =
 Isolation.READ_COMMITTED, readOnly = true)
  public UserDetails loadUserByUsername(String username) throws
 UsernameNotFoundException, DataAccessException {
 LOG.debug(Attempting to locate user with username \{}\, username);

 Session session = sessionManager.getCurrentSession();

 User user = (User)
 session.createCriteria(User.class).add(Restrictions.eq(username,
 username)).uniqueResult();

 if (user != null) {
 // encode the password
 user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
 saltSource.getSalt(user)));
  }

 LOG.debug(Located user: {}, user);

  return new User(user);
 }

 On Thu, May 27, 2010 at 1:29 PM, Michael Gerzabek 
 michael.gerza...@gmx.net wrote:

 What about the salt. Did you change it? You have to 'save' password with
 your PasswordEncoder prior to using it.

 Which Am 27/05/2010 19:20, schrieb Todd Orr:

  I've tried that way as well. It doesn't work either and I assume it's for
 the same reason, though I cannot tell in that case because the exception
 doesn't bubble out of Tapestry Spring Security.

 Login code:

 private final static Logger LOG = LoggerFactory.getLogger(Login.class);

 @Inject
  @Value(${spring-security.check.url})
 private String checkUrl;

 @Inject
 private Request request;

 private boolean failed = false;

 public boolean isFailed() {
 return failed;
 }

 public String getLoginCheckUrl() {
 String loginCheckUrl = request.getContextPath() + checkUrl;
  LOG.debug(Returning login check url: {}, loginCheckUrl);
 return loginCheckUrl;
  }

 void onActivate(String extra) {
 if (extra.equals(failed)) {
  failed = true;
 }
 }

 TML:

 html t:type=layout
 title=message:page-title
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

 div id=login-help
  t:outputraw value=${message:login-help} /
 /div
  div
 form action=${loginCheckUrl} method=post
  t:if test=failed
 pUsername and/or password was wrong!/p
  /t:if
 div id=login-username-row
 label for=j_usernameUsername:/label
  input id=j_username name=j_username type=text /
 /div
  div id=login-password-row
 label for=j_passwordPassword/label
  input id=j_password name=j_password type=password /
 /div
  div id=login-submit-row
 input type=submit value=Login /
  /div
 /form
 /div

 /html

 Module:

 private final static Logger LOG =
 LoggerFactory.getLogger(SecurityModule.class);
  public static void
 contributeProviderManager(OrderedConfigurationAuthenticationProvider
 configuration,
  @InjectService(DaoAuthenticationProvider) AuthenticationProvider
 daoAuthenticationProvider) {
 LOG.debug(Received AuthenticationProvider: {},
 daoAuthenticationProvider);
  configuration.add(daoAuthenticationProvider,
 daoAuthenticationProvider);
 }

 public static void
 contributeAlias(ConfigurationAliasContributionPasswordEncoder
 configuration) {
 configuration.add(AliasContribution.create(PasswordEncoder.class, new
 PlaintextPasswordEncoder()));
  }

 public static void
 contributeApplicationDefaults(MappedConfigurationString,
 String  configuration) {
  configuration.add(spring-security.failure.url, /login/failed);
 configuration.add(spring-security.accessDenied.url, /accessdenied);
  configuration.add(spring-security.check.url,
 /j_spring_security_check);
 configuration.add(spring-security.target.url, /intranet);
  configuration.add(spring-security.afterlogout.url, /);
 configuration.add(spring-security.rememberme.key, REMEMBERMEKEY);
  configuration.add(spring-security.loginform.url, /login);
 configuration.add(spring-security.force.ssl.login, false);
  configuration.add(spring-security.anonymous.key, acegi_anonymous);
 configuration.add(spring-security.anonymous.attribute,
 anonymous,ROLE_ANONYMOUS);
  configuration.add(spring-security.password.salt, DEADBEEF);
 }

 public static void

 contributeFilterSecurityInterceptor(ConfigurationRequestInvocationDefinition
 configuration) {
 configuration.add(new RequestInvocationDefinition(/intranet*/**,
 ROLE_ADMIN));
  }


 No redirect to the target URL occurs. It just says that Username and/or
 password was 

Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek

Just for the records. What did you change now?

Am 27/05/2010 19:48, schrieb Todd Orr:

I changed the code so that these are injected and now it works. I cannot
describe how angry this makes me. Days wasted.

Thanks for you help though!!!

   



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



RE: How often snapshot jar refreshed?

2010-05-27 Thread Jim O'Callaghan
Ulrich, Andreas, thanks I'm good now.

-Original Message-
From: Ulrich Stärk [mailto:u...@spielviel.de] 
Sent: 27 May 2010 18:17
To: Tapestry users
Subject: Re: How often snapshot jar refreshed?

The snapshot gets refreshed with every build, i.e. once hudson has completed
a build it gets pushed 
to the nexus repository at http://repository.apache.org/snapshots/

I guess you are trying to get snapshots from formos? Just switch to the
apache repository and you 
should be good.

HTH,

Uli

On 27.05.2010 17:29, Jim O'Callaghan wrote:
 I just noticed an issue post upgrading to 5.2.0-SNAPSHOT that I know has
 been fixed in the trunk at ASF by
 https://issues.apache.org/jira/browse/TAP5-1088 but is not yet in the
 5.2.0-SNAPSHOT jar I pulled in from
 http://tapestry.formos.com/maven-snapshot-repository.  Can someone
involved
 in the build process tell me what kind of interval the snapshot jar is
 refreshed at / if I should be using a different maven repo, or if there is
a
 link somewhere on the Tapestry site I could get the details from?  Thanks.



 Regards,

 Jim.



-
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



Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Todd Orr
I exported all the data access code into an independent DAO that is still
managed by Spring. Then I added a constructor to my UserDetailsService that
took the dao plus the salt and encoder:


 private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

private final Dao dao;

private final PasswordEncoder passwordEncoder;

private final SaltSource saltSource;

/**
 * Default constructor.
 */
 public UserDetailsServiceImpl(Dao dao, PasswordEncoder encoder, SaltSource
salt) {
dao = dao;
 passwordEncoder = encoder;
saltSource = salt;
}

/**
 * Try to find the given user in the local database.
 */
 public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException {
LOG.debug(Attempting to locate user with username \{}\, username);

User user = dao.findUserByUsername(username);

if (user != null) {
 // encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
 }

LOG.debug(Located user: {}, user);

 return new User(user);
}

Then updated my module to provide the dependencies:

public static UserDetailsService buildUserDetailsService(Dao dao, @Inject
PasswordEncoder encoder,
@Inject SaltSource salt) {
 return new UserDetailsServiceImpl(dao, encoder, salt);
}



On Thu, May 27, 2010 at 1:53 PM, Michael Gerzabek
michael.gerza...@gmx.netwrote:

 Just for the records. What did you change now?

 Am 27/05/2010 19:48, schrieb Todd Orr:

  I changed the code so that these are injected and now it works. I cannot
 describe how angry this makes me. Days wasted.

 Thanks for you help though!!!





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




Re: Tapestry Spring Security - BadCredentialsException

2010-05-27 Thread Michael Gerzabek

Thank you.
/M

Am 27/05/2010 20:28, schrieb Todd Orr:

I exported all the data access code into an independent DAO that is still
managed by Spring. Then I added a constructor to my UserDetailsService that
took the dao plus the salt and encoder:


  private final static Logger LOG =
LoggerFactory.getLogger(UserDetailsServiceImpl.class);

private final Dao dao;

private final PasswordEncoder passwordEncoder;

private final SaltSource saltSource;

/**
  * Default constructor.
  */
  public UserDetailsServiceImpl(Dao dao, PasswordEncoder encoder, SaltSource
salt) {
dao = dao;
  passwordEncoder = encoder;
saltSource = salt;
}

/**
  * Try to find the given user in the local database.
  */
  public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException {
LOG.debug(Attempting to locate user with username \{}\, username);

User user = dao.findUserByUsername(username);

if (user != null) {
  // encode the password
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),
saltSource.getSalt(user)));
  }

LOG.debug(Located user: {}, user);

  return new User(user);
}

Then updated my module to provide the dependencies:

public static UserDetailsService buildUserDetailsService(Dao dao, @Inject
PasswordEncoder encoder,
@Inject SaltSource salt) {
  return new UserDetailsServiceImpl(dao, encoder, salt);
}



On Thu, May 27, 2010 at 1:53 PM, Michael Gerzabek
michael.gerza...@gmx.netwrote:

   

Just for the records. What did you change now?

Am 27/05/2010 19:48, schrieb Todd Orr:

  I changed the code so that these are injected and now it works. I cannot
 

describe how angry this makes me. Days wasted.

Thanks for you help though!!!



   


-
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



Re: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread françois facon
Hi Genis

wtp plug-in can help you to setup your environnement.
have a look at
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/
it's in french but with lots of screenshot.

hope this will help you

françois


Re: how to manually deploy a tapestry5 project into Tomcat

2010-05-27 Thread Geoff Callender
If you're happy to use Ant then the process here might help you:


http://jumpstart.doublenegative.com.au/jumpstart4.9/tips.html#OTHER_SERVERS

Cheers,

Geoff

On 28/05/2010, at 12:11 AM, Genís Pujol wrote:

 Hello,
 
 Does anybody have documentation regarding how to deploy a Tapestry5 project 
 into Tomcat? The official docs just say it's the same as jetty...
 
 Does one have to use Maven? can I just drop the folders into webapps (if so, 
 how)?
 
 Thanks,
 
 
 Genis
 
 -
 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



@Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton

Hi all,

I'm making a few different types of ajax requests on my page, and a 
couple of fields on components and pages are annotated with 
@Persist(session).


Some of the ajax requests are made via t:actionlink components, others 
are via Ajax.Requests I've constructed myself (via 
resources.createEventLink().toAbsoluteURI().


I've noticed that the value for the apparently persistent field is reset 
to null when the second type of ajax requests are made ... this may be 
because the actions point to different components as listeners.


I thought that marking @Persist(session) would mean their values were 
stored in the HttpSession until session death or I specifically set the 
value to null, regardless of which component/class is handling the 
request ??


How do I achieve this if not by @Persist(session) ?

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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Thiago H. de Paula Figueiredo
On Thu, 27 May 2010 23:08:37 -0300, Paul Stanton p...@mapshed.com.au  
wrote:



Hi all,


Hi!

I've noticed that the value for the apparently persistent field is reset  
to null when the second type of ajax requests are made ... this may be  
because the actions point to different components as listeners.


How you noticed that? If it was through a debugger, you are looking at a  
field which access was replaced by method invocations, so its value may  
not be what you expect.


I thought that marking @Persist(session) would mean their values were  
stored in the HttpSession until session death or I specifically set the  
value to null,


That's exactly what happens. I guess you're misunderstanding something in  
your application.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton

I've also tried with @SessionState with no luck.

I'm imagining it's because one request goes to componentA (where the 
persistent field is) the other goes to componentB. The subsequent 
request to componentA reveals that the persistent field is reset. ie:


1. Ajax.Request to componentA via actionlink
 componentA.persistentField does not exist, initialised

2. Ajax.Request to componentA via actionlink
 componentA.persistentField exists

3. Ajax.Request to componentB via manually constructed
 must be what resets the state

4. Ajax.Request to componentA via actionlink
 componentA.persistentField does NOT exist (problem)

What is responsible for evicting my session variable?

Do I need to revert to HttpSession handling myself?

Paul Stanton wrote:

Hi all,

I'm making a few different types of ajax requests on my page, and a 
couple of fields on components and pages are annotated with 
@Persist(session).


Some of the ajax requests are made via t:actionlink components, others 
are via Ajax.Requests I've constructed myself (via 
resources.createEventLink().toAbsoluteURI().


I've noticed that the value for the apparently persistent field is 
reset to null when the second type of ajax requests are made ... this 
may be because the actions point to different components as listeners.


I thought that marking @Persist(session) would mean their values 
were stored in the HttpSession until session death or I specifically 
set the value to null, regardless of which component/class is handling 
the request ??


How do I achieve this if not by @Persist(session) ?

-
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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton

Hi Thiago,

please bare with me... I'm not imagining it. I'm guessing it's something 
to do with my manually created ajax request...


I'm not inspecting via debugger, I'm testing the value of the field in 
code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);

and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);

please see other email for more info

thanks.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:08:37 -0300, Paul Stanton p...@mapshed.com.au 
wrote:



Hi all,


Hi!

I've noticed that the value for the apparently persistent field is 
reset to null when the second type of ajax requests are made ... this 
may be because the actions point to different components as listeners.


How you noticed that? If it was through a debugger, you are looking at 
a field which access was replaced by method invocations, so its value 
may not be what you expect.


I thought that marking @Persist(session) would mean their values 
were stored in the HttpSession until session death or I specifically 
set the value to null,


That's exactly what happens. I guess you're misunderstanding something 
in your application.




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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Thiago H. de Paula Figueiredo
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton p...@mapshed.com.au  
wrote:



Hi Thiago,


Hi!

please bare with me... I'm not imagining it. I'm guessing it's something  
to do with my manually created ajax request...


Tapestry's session handling works the same regardless how the request was  
made.


I'm not inspecting via debugger, I'm testing the value of the field in  
code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);


I don't know if that's the case, but a persistent field from a given page  
is only accessible in the same page, even when some other page has a  
similar field.



and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);


Use @SessionState(create = false) instead and test for null.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Thiago H. de Paula Figueiredo
On Thu, 27 May 2010 23:26:13 -0300, Paul Stanton p...@mapshed.com.au  
wrote:



I've also tried with @SessionState with no luck.


Please post your code. Without it, it will be very hard to understand  
what's happening.


I'm imagining it's because one request goes to componentA (where the  
persistent field is) the other goes to componentB. The subsequent  
request to componentA reveals that the persistent field is reset. ie:


1. Ajax.Request to componentA via actionlink
  componentA.persistentField does not exist, initialised

2. Ajax.Request to componentA via actionlink
  componentA.persistentField exists

3. Ajax.Request to componentB via manually constructed
  must be what resets the state


If componentB state is completely independent of componentA state when  
using @Persist. In addition, if you have a component instance in one page  
and another in another page, their state is independent, because,  
ultimately, all @Persist handling is done per page. On the other hand, a  
@SessionState private Class1 class1; is one for the whole session.



4. Ajax.Request to componentA via actionlink
  componentA.persistentField does NOT exist (problem)

What is responsible for evicting my session variable?


Again, please post your code.


Do I need to revert to HttpSession handling myself?


Only if you need to interact with some non-Tapestry code that uses the  
session.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Josh Canfield
I'm with Thiago, what you are describing doesn't make sense. It  
doesn't matter how you make the request the session stored attributes  
should still be there. Since it doesn't make sense I'll ask all the  
dumb question:


Are you setting the value somewhere? If you have a setter for it try  
setting a breakpoint or add logging...


-- Josh

On May 27, 2010, at 7:32 PM, Paul Stanton p...@mapshed.com.au wrote:


Hi Thiago,

please bare with me... I'm not imagining it. I'm guessing it's  
something to do with my manually created ajax request...


I'm not inspecting via debugger, I'm testing the value of the field  
in code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);

and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);

please see other email for more info

thanks.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:08:37 -0300, Paul Stanton  
p...@mapshed.com.au wrote:



Hi all,


Hi!

I've noticed that the value for the apparently persistent field is  
reset to null when the second type of ajax requests are made ...  
this may be because the actions point to different components as  
listeners.


How you noticed that? If it was through a debugger, you are looking  
at a field which access was replaced by method invocations, so its  
value may not be what you expect.


I thought that marking @Persist(session) would mean their values  
were stored in the HttpSession until session death or I  
specifically set the value to null,


That's exactly what happens. I guess you're misunderstanding  
something in your application.




-
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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton

Thiago,

I tried with @SessionState(create=false) and the same occurs (testing 
the field for null).


I also tried (as a sanity check) to inject HttpRequest and manage the 
session attribute manually. Interestingly, the session Id is changing!


This must be the cause - somehow my manual Ajax.Request to a url derived 
from resources.createEventLink().toAbsoluteURI() is creating a new 
session


p.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton p...@mapshed.com.au 
wrote:



Hi Thiago,


Hi!

please bare with me... I'm not imagining it. I'm guessing it's 
something to do with my manually created ajax request...


Tapestry's session handling works the same regardless how the request 
was made.


I'm not inspecting via debugger, I'm testing the value of the field 
in code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);


I don't know if that's the case, but a persistent field from a given 
page is only accessible in the same page, even when some other page 
has a similar field.



and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);


Use @SessionState(create = false) instead and test for null.



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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton
Actually, the 2nd request (which clears the session) is not a manually 
created Ajax.Request. Sorry for the confusion.


It's actually a async form submit, and to simplify the issue somewhat 
every submit of this form prints a different sessionId:


   t:form t:id=someForm t:zone=someZone
   input t:type=TextField t:id=someInput /
   input type=submit value=search /
   /t:form

   @Inject
   private HttpServletRequest request;

   Object onSuccessFromSomeForm()
   {
   LOG.debug(onSuccessFromSomeForm  + 
httpRequest.getSession().getId());

   return null;
   }

Surely that can't be correct?

p.

Paul Stanton wrote:

Thiago,

I tried with @SessionState(create=false) and the same occurs (testing 
the field for null).


I also tried (as a sanity check) to inject HttpRequest and manage the 
session attribute manually. Interestingly, the session Id is changing!


This must be the cause - somehow my manual Ajax.Request to a url 
derived from resources.createEventLink().toAbsoluteURI() is creating a 
new session


p.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton 
p...@mapshed.com.au wrote:



Hi Thiago,


Hi!

please bare with me... I'm not imagining it. I'm guessing it's 
something to do with my manually created ajax request...


Tapestry's session handling works the same regardless how the request 
was made.


I'm not inspecting via debugger, I'm testing the value of the field 
in code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);


I don't know if that's the case, but a persistent field from a given 
page is only accessible in the same page, even when some other page 
has a similar field.



and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);


Use @SessionState(create = false) instead and test for null.



-
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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton
Here is a concrete example which I've constructed separate to the rest 
of my app to exclude any quirks intruduced by it's complexity:


public class Start
{
   private final static Logger LOG = Logger.getLogger(Start.class);
   @Inject
   private ComponentResources resources;
   @Inject
   @Property
   private HttpServletRequest httpRequest;

   Object onSuccessFromMyForm()
   {
   LOG.debug(httpRequest.getSession().getId());
   return new MultiZoneUpdate(myZone, 
resources.getEmbeddedComponent(myZone));

   }
}
---
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; 
xmlns:p=tapestry:parameter

   head
   /head
   body
   t:form t:id=myForm t:zone=myZone
   input type=submit /
   /t:form
   t:zone t:id=myZone
   ${httpRequest.session.id}
   /t:zone
   /body
/html
--

Paul Stanton wrote:
Actually, the 2nd request (which clears the session) is not a manually 
created Ajax.Request. Sorry for the confusion.


It's actually a async form submit, and to simplify the issue somewhat 
every submit of this form prints a different sessionId:


   t:form t:id=someForm t:zone=someZone
   input t:type=TextField t:id=someInput /
   input type=submit value=search /
   /t:form

   @Inject
   private HttpServletRequest request;

   Object onSuccessFromSomeForm()
   {
   LOG.debug(onSuccessFromSomeForm  + 
httpRequest.getSession().getId());

   return null;
   }

Surely that can't be correct?

p.

Paul Stanton wrote:

Thiago,

I tried with @SessionState(create=false) and the same occurs (testing 
the field for null).


I also tried (as a sanity check) to inject HttpRequest and manage the 
session attribute manually. Interestingly, the session Id is changing!


This must be the cause - somehow my manual Ajax.Request to a url 
derived from resources.createEventLink().toAbsoluteURI() is creating 
a new session


p.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton 
p...@mapshed.com.au wrote:



Hi Thiago,


Hi!

please bare with me... I'm not imagining it. I'm guessing it's 
something to do with my manually created ajax request...


Tapestry's session handling works the same regardless how the 
request was made.


I'm not inspecting via debugger, I'm testing the value of the field 
in code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);


I don't know if that's the case, but a persistent field from a given 
page is only accessible in the same page, even when some other page 
has a similar field.



and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);


Use @SessionState(create = false) instead and test for null.



-
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




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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Paul Stanton

Sorry guys, I found the problem.

I had disabled cookies on the webapp.

Surely this is a bug in t5 ...
in that with cookies disabled, an ajax form submit acquires a new 
session every time?


Regards, p.

Paul Stanton wrote:
Here is a concrete example which I've constructed separate to the rest 
of my app to exclude any quirks intruduced by it's complexity:


public class Start
{
   private final static Logger LOG = Logger.getLogger(Start.class);
   @Inject
   private ComponentResources resources;
   @Inject
   @Property
   private HttpServletRequest httpRequest;

   Object onSuccessFromMyForm()
   {
   LOG.debug(httpRequest.getSession().getId());
   return new MultiZoneUpdate(myZone, 
resources.getEmbeddedComponent(myZone));

   }
}
---
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; 
xmlns:p=tapestry:parameter

   head
   /head
   body
   t:form t:id=myForm t:zone=myZone
   input type=submit /
   /t:form
   t:zone t:id=myZone
   ${httpRequest.session.id}
   /t:zone
   /body
/html
--

Paul Stanton wrote:
Actually, the 2nd request (which clears the session) is not a 
manually created Ajax.Request. Sorry for the confusion.


It's actually a async form submit, and to simplify the issue somewhat 
every submit of this form prints a different sessionId:


   t:form t:id=someForm t:zone=someZone
   input t:type=TextField t:id=someInput /
   input type=submit value=search /
   /t:form

   @Inject
   private HttpServletRequest request;

   Object onSuccessFromSomeForm()
   {
   LOG.debug(onSuccessFromSomeForm  + 
httpRequest.getSession().getId());

   return null;
   }

Surely that can't be correct?

p.

Paul Stanton wrote:

Thiago,

I tried with @SessionState(create=false) and the same occurs 
(testing the field for null).


I also tried (as a sanity check) to inject HttpRequest and manage 
the session attribute manually. Interestingly, the session Id is 
changing!


This must be the cause - somehow my manual Ajax.Request to a url 
derived from resources.createEventLink().toAbsoluteURI() is creating 
a new session


p.

Thiago H. de Paula Figueiredo wrote:
On Thu, 27 May 2010 23:32:38 -0300, Paul Stanton 
p...@mapshed.com.au wrote:



Hi Thiago,


Hi!

please bare with me... I'm not imagining it. I'm guessing it's 
something to do with my manually created ajax request...


Tapestry's session handling works the same regardless how the 
request was made.


I'm not inspecting via debugger, I'm testing the value of the 
field in code, ie:


via @Persist(session)
if (persistentField == null) LOG.debug(state reset);


I don't know if that's the case, but a persistent field from a 
given page is only accessible in the same page, even when some 
other page has a similar field.



and via the @SessionState
if (!persistentFieldExists) LOG.debug(state reset);


Use @SessionState(create = false) instead and test for null.



-
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




-
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



Re: @Persist(session) field is null after AjaxRequest

2010-05-27 Thread Thiago H. de Paula Figueiredo
On Fri, 28 May 2010 00:31:18 -0300, Paul Stanton p...@mapshed.com.au  
wrote:



Surely this is a bug in t5 ...


I disagree. HTTP is purely stateless. Session keeping is the container's  
(server) responsibility, not Tapestry's. With cookies disabled, the only  
way to find out what is the session is appending the ;jsessionid=xxx  
string to the URLs. This is done by HttpServletResponde.encodeURL(String  
url), which is indirectly invoked for every single link generated by  
Tapestry.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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