I have a follow up question, a harder one. I want to send the mail from a Spring Bean using the Spring Framework.
The Spring Beans mark my transaction boundary. When I call a method in a Spring bean a transaction is started, and when the method returns the transaction is commited. Inside my Wicket component code there never is any transaction. It would be best if I could create the URL inside the Spring Bean as I would like to do it inside the transaction. I guess I could do it using a callback from the Spring Bean to the Wicket component. But if I'm able to do it without any callback I think that would be a better solution. Is it possible? Best regards, Kent On Wed, May 20, 2009 at 6:33 PM, Kent Larsson <[email protected]> wrote: > Thank you, it worked! > > PageParameters pars = new PageParameters(); > pars.add("confirmationCode", "some conf?code&string"); > System.out.println("URL: " + urlFor(ForgotPasswordRequest.class, pars)); > > Best regards, Kent > > > On Wed, May 20, 2009 at 6:01 PM, Clint Popetz <[email protected]> wrote: >> Component.urlFor(ForgotPasswordRequest.class,pars); >> >> (not a static...call it as "urlFor(...)" from your page or component) >> >> -Clint >> >> On Wed, May 20, 2009 at 10:54 AM, Kent Larsson <[email protected]> >> wrote: >>> Hi, >>> >>> I have created a BookmarkablePageLink and I would like to grab a >>> properly escaped URL-string which I can then send through e-mail. >>> >>> For my first try noHtmlSensitiveChars & fullyEscaped contained the >>> empty ("") string: >>> >>> PageParameters pars = new PageParameters(); >>> pars.add("confirmationCode", "someconfcodestring"); >>> BookmarkablePageLink bookmarkablePageLink = new >>> BookmarkablePageLink("link", ForgotPasswordRequest.class, pars); >>> String noHtmlSensitiveChars = bookmarkablePageLink.getModelObjectAsString(); >>> String fullyEscaped = Strings.escapeMarkup(noHtmlSensitiveChars, true, >>> true).toString(); >>> System.out.println("No sensitive chars:" + noHtmlSensitiveChars); >>> System.out.println("Fully escaped:" + fullyEscaped); >>> >>> Any ideas on how I could solve this? >>> >>> Best regards, Kent >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >> >> >> -- >> Clint Popetz >> http://42lines.net >> Scalable Web Application Development >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
