wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Wicket and Struts together have a problem when not adding mountpath to the Wicket-Page
Date Tue, 04 Dec 2012 09:41:14 GMT
On Tue, Dec 4, 2012 at 10:29 AM, cknafl <chr.knafl@gmail.com> wrote:

> I am currently overwriting getNamespace(). But that is really dirty. When I
> make this method to return "" everytime, then my css, js and so on cannot
> be
> found anymore, that I added with renderHead(..).
> So I implemented an if-else logic:
> if(path.contains("resource")
>    return "wicket";
> ...
>

Just return "mine" or anything that looks non-dirty to you.


>
> Can you tell me how you would use this
> UrlRenderer#renderContextRelativeUrl() instead of setting my own
> UrlRenderer
> please?
>

class StrutsModel extends AbstractReadOnlyModel<String> {
  private final String relativeUrl;

  public StrutsModel(String relUrl) {
     this.relativeUrl = relUrl;
  }
 @Override
  public String getObject() {
     return
RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("struts/" +
relativeUrl);
  }
}

class StrutsLink extends ExternalLink {

  public StrutsLink(String id, String strutsUrl) {
     super(id, new StrutsModel(strutsUrl))
  }
}

add(new StrutsLink("linkId", "struts.html");


>
> Regards
> Christoph
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654461.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message