Gate catalog structure

I am trying to figure out the directory structure of the gate. I do not understand this! Say I want to upload an image with images /logo.gif or something like that. Where do I need to place the image folder? Please help me with this !;)

+3
source share
3 answers

Wicket facilitates the analysis of entire web pages through OOP paradigms and includes resource processing.

So, if your SomePage extends WebPageis in the package myprogram.view.pages, you will most likely add images, etc. into myprogram.view.pages.assets(or another similarly named, logical package), and then add the image to the SomePage source by calling

add(new Image("id", new ResourceReference(this.getClass(), "assets/logo.gif")));

, , , , ( , , CSS ?), .

: , , , , , , - , .

<wicket:link>
    <img src="images/logo.gif" />
</wicket:link>

. wicket: link , ( SomePage.class!) .

+7

. .. META-INF, WEB-INF, . - . html,

<img src="images/pic1.jpg"/>

java-, .

class MyPage extends WebPage {
  public MyPage() { 
     final ServletContext ctx = ((WebApplication) getApplication()).getServletContext();
     File imgFile = new File(ctx.getRealPath("/images/pic1.jpg"));
   }
}
+4

NetBeans Source packages tld.domain.project ,

-2

Source: https://habr.com/ru/post/1717436/


All Articles