gwtboot / gwt-boot-samples

GWT Boot: Samples to check all the Starters
Apache License 2.0
40 stars 23 forks source link

serve public assets issues #19

Closed oedemis closed 1 year ago

oedemis commented 3 years ago

With following setup with img folder in public folder src/main/java/public/img

when i want to serve the image with elemtal2 style widget rendering in frontend like component.attr("src", "/app/img/testimage/" it not renders the image why ? ist this a general issue with project structure ?

lofidewanto commented 3 years ago

Hmm I think you need to know the "end" structure of your JS. Remember at the end you have JS and not Java with its structure...

Check out my presentation: https://bit.ly/gwtintropresentation -- Page 29 where you can see the structure of the JS result. So I always look at the "target" result...

If you have a concrete example, I could take a look.

Hope this helps...

oedemis commented 3 years ago

@lofidewanto thanks another point is how we can change the url to / instead of renamed path in module.gwt.xml

lofidewanto commented 3 years ago

Did you try with "/" in the Maven plugin of GWT? Something like this?

      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <configuration>
           <moduleName>hello.YourModule</moduleName>
           <startupUrls>
              <url>/</url>
           </startupUrls>
        </configuration>
     </plugin>
lofidewanto commented 1 year ago

Closed.