Re: RequestCycle().urlFor not work

2009-09-12 Thread Dima Rzhevskiy
I use wicket 1.4.1, and I want send e-mail's notifications to users.

I create problem code as simple as possible: only with AjaxLink
Users of my site send internal messages. Messages will be composed in
ModalWindow. Inside AjaxButton.onSumbit method e-mail notification sent.
(Long way to carry absoluteUrl through container hierarchy).


--
Rzhevskiy Dmitry

2009/9/12 Johan Compagner jcompag...@gmail.com

 Which version of wicket do you use?

 Why do you need absoluut urls?

 On 11/09/2009, Dima Rzhevskiy d...@rzhevskiy.info wrote:
  Sorry, yes, urlFor return correct result.
  toAbsolutePath(final String relativePagePath) do not return result what I
  expected.
   javadoc copy/pasted from toAbsolutePath(final String requestPath, String
  relativePagePath)...
 
  I undestand that it is nessesary to use toAbsolutePath(final String
  requestPath, String relativePagePath) where requestPath nessesaty take in
  constructor:
 
  public class X1 extends WebPage {
 
  private static final Logger LOG = LoggerFactory.getLogger(X1.class);
 
  public X1(final PageParameters parameters) {
 
   CharSequence url = getRequestCycle().urlFor(getClass().class,
 new
  PageParameters());
   final String outerUrl2=
  RequestUtils.toAbsolutePath(url.toString());   //get
   add(new AjaxLink(message){
  @Override
  public void onClick(AjaxRequestTarget ajaxRequestTarget) {
  CharSequence url =
  getRequestCycle().urlFor(X1.class, new PageParameters());
  String url2=
  RequestUtils.toAbsolutePath(outerUrl2, url.toString());
  LOG.info(url=+url);
  LOG.info(url2=+url2);
  }
  });
 
  }
  }
 
 
  But this code look ugly..
  Is better way of obtaining absolute url exists ?
 
  --
  Rzhevskiy Dmitry
 
 
  2009/9/11 Jeremy Thomerson jer...@wickettraining.com
 
  what is incorrect about those URLs?  they are relative - relative to the
  path you are on.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Fri, Sep 11, 2009 at 10:14 AM, Dima Rzhevskiy d...@rzhevskiy.info
  wrote:
 
   Hi !
  
   I create simple page X1 with AjaxLink :
   ..
   new AjaxLink(message){
  @Override
  public void onClick(AjaxRequestTarget ajaxRequestTarget) {
  CharSequence url =
   getRequestCycle().urlFor(X1.class, new PageParameters());
  String url2=
   RequestUtils.toAbsolutePath(url.toString());
  LOG.info(url=+url);
  LOG.info(url2=+url2);
  }
  }
   ...
   if I mount page to first  level directory , for example /x1.html
   result is correct:
   url=x1.html
   url2=http://localhost:8080/ctx/x1.html
  
   if I mount page to second level directory /x1/x2.html result
 incorrect
url=../x1/x2.html
url2=http://localhost:8080/x1/x2.html
  
   if i mount ti third level directory /x1/x2/x3.html
url=../../x1/x2/x3.html
url2=http://x1/x2/x3.html
  
   Is this bug or I use API incorrectly ?
  
   --
  
   Rzhevskiy Dmitry
  
 
 

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



RequestCycle().urlFor not work

2009-09-11 Thread Dima Rzhevskiy
Hi !

I create simple page X1 with AjaxLink :
..
new AjaxLink(message){
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
CharSequence url =
getRequestCycle().urlFor(X1.class, new PageParameters());
String url2=
RequestUtils.toAbsolutePath(url.toString());
LOG.info(url=+url);
LOG.info(url2=+url2);
}
}
...
if I mount page to first  level directory , for example /x1.html
result is correct:
url=x1.html
url2=http://localhost:8080/ctx/x1.html

if I mount page to second level directory /x1/x2.html result incorrect
 url=../x1/x2.html
 url2=http://localhost:8080/x1/x2.html

if i mount ti third level directory /x1/x2/x3.html
 url=../../x1/x2/x3.html
 url2=http://x1/x2/x3.html

Is this bug or I use API incorrectly ?

-- 

Rzhevskiy Dmitry


Re: RequestCycle().urlFor not work

2009-09-11 Thread Dima Rzhevskiy
Sorry, yes, urlFor return correct result.
toAbsolutePath(final String relativePagePath) do not return result what I
expected.
 javadoc copy/pasted from toAbsolutePath(final String requestPath, String
relativePagePath)...

I undestand that it is nessesary to use toAbsolutePath(final String
requestPath, String relativePagePath) where requestPath nessesaty take in
constructor:

public class X1 extends WebPage {

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

public X1(final PageParameters parameters) {

 CharSequence url = getRequestCycle().urlFor(getClass().class, new
PageParameters());
 final String outerUrl2=
RequestUtils.toAbsolutePath(url.toString());   //get
 add(new AjaxLink(message){
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
CharSequence url =
getRequestCycle().urlFor(X1.class, new PageParameters());
String url2=
RequestUtils.toAbsolutePath(outerUrl2, url.toString());
LOG.info(url=+url);
LOG.info(url2=+url2);
}
});

}
}


But this code look ugly..
Is better way of obtaining absolute url exists ?

-- 
Rzhevskiy Dmitry


2009/9/11 Jeremy Thomerson jer...@wickettraining.com

 what is incorrect about those URLs?  they are relative - relative to the
 path you are on.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, Sep 11, 2009 at 10:14 AM, Dima Rzhevskiy d...@rzhevskiy.info
 wrote:

  Hi !
 
  I create simple page X1 with AjaxLink :
  ..
  new AjaxLink(message){
 @Override
 public void onClick(AjaxRequestTarget ajaxRequestTarget) {
 CharSequence url =
  getRequestCycle().urlFor(X1.class, new PageParameters());
 String url2=
  RequestUtils.toAbsolutePath(url.toString());
 LOG.info(url=+url);
 LOG.info(url2=+url2);
 }
 }
  ...
  if I mount page to first  level directory , for example /x1.html
  result is correct:
  url=x1.html
  url2=http://localhost:8080/ctx/x1.html
 
  if I mount page to second level directory /x1/x2.html result incorrect
   url=../x1/x2.html
   url2=http://localhost:8080/x1/x2.html
 
  if i mount ti third level directory /x1/x2/x3.html
   url=../../x1/x2/x3.html
   url2=http://x1/x2/x3.html
 
  Is this bug or I use API incorrectly ?
 
  --
 
  Rzhevskiy Dmitry
 



where I can find soures for wicketstuff-rome

2009-06-02 Thread Dima Rzhevskiy
Hi.
I have problems with wicketstuff-rome: wrong encoding of rss in production
server. encoding is correct on my ubuntu development computer..
I don't find source code (nor in maven repo nor in svn) or issue tracker
Where I can find soures for wicketstuff-rome ?
How to fix problem with encoding?
-- 
Rzhevskiy Dmitry


@SpringBean instead @Resource

2008-07-07 Thread Dima Rzhevskiy
Why wicket framework used it's own annotation @SpringBean instead standard
annotation @Resource?
(I want configure other web framework to use anotation for bean injecting)

Dmitry.


Re: @SpringBean instead @Resource

2008-07-07 Thread Dima Rzhevskiy
Thank you for answer.

2008/7/7, Igor Vaynberg [EMAIL PROTECTED]:

 because when we created @SpringBean there was no standard @Resource.
 also, afaik, @Resource is part of jdk6 while Wicket requires 1.4/5.

 perhaps when we require jdk6 we can use @Resource

 -igor


 On Mon, Jul 7, 2008 at 11:32 AM, Dima Rzhevskiy [EMAIL PROTECTED]
 wrote:
  Why wicket framework used it's own annotation @SpringBean instead
 standard
  annotation @Resource?
  (I want configure other web framework to use anotation for bean
 injecting)
 
  Dmitry.
 


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