-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gwt-dev-help documentation #386
Open
vegegoku
wants to merge
1
commit into
gwtproject:main
Choose a base branch
from
vegegoku:gwt-dev-help-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/markdown/doc/latest/gwt-dev-help/WebAppClassPath.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Web App Classpath Problem | ||
|
||
You were directed to this help topic because your server code needed a class or resource that was not found on the *web app classpath*, but **was** found on the *system classpath*. The *system classpath* is the classpath you specify when launching the Java VM to run hosted mode. The *web app classpath* is different — it consists of classes that live in your web application's *war directory*. All server classes and dependencies should be placed in your war directory: libraries (jars) should be placed in `war/WEB-INF/lib/` and classes that don't live in jars should be placed in `war/WEB-INF/classes/`. | ||
|
||
GWT hosted mode helpfully works around this problem by mapping these outside resources into your web app classpath. This warning reminds you that failing to address the issue can lead to problems when you actually deploy your web app to a real server. | ||
|
||
## Tips | ||
|
||
- The most common reason to encounter this problem with a new project is using RPC, which tries to load `com.google.gwt.user.client.rpc.RemoteService`. The solution is to copy `gwt-servlet.jar` from the GWT install directory into your web app's `war/WEB-INF/lib/` directory. | ||
|
||
- If you have a good reason for not following the recommended configuration, you can suppress the warning by setting the Java system property `gwt.nowarn.webapp.classpath`. Specify `-Dgwt.nowarn.webapp.classpath` as a JVM argument when launching hosted mode. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we say: 'If you have good reasons for ...'? |
11 changes: 11 additions & 0 deletions
11
src/main/markdown/doc/latest/gwt-dev-help/longJsniRestriction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Restrictions on Long Values with JSNI | ||
|
||
The Java `long` type cannot be represented in JavaScript as a numeric type, so GWT emulates it using an opaque data structure. This means that JSNI methods cannot process a `long` as a numeric type. The compiler, therefore, disallows, by default, directly accessing a `long` from JSNI: JSNI methods cannot have `long` as a parameter type or a return type, and they cannot access a `long` using a JSNI reference. If you find yourself wanting to pass a `long` into or out of a JSNI method, here are some options: | ||
|
||
1. **For numbers that fit into type `double`**, use type `double` instead of type `long`. | ||
|
||
2. **For computations that require the full `long` semantics**, rearrange the code so that the computations happen in Java instead of in JavaScript. That way, they will use the `long` emulation. | ||
|
||
3. **For values meant to be passed through unchanged to Java code**, wrap the value in a `Long`. There are no restrictions on type `Long` with JSNI methods. | ||
|
||
4. **If you are sure you know what you are doing**, you can add the annotation `com.google.gwt.core.client.UnsafeNativeLong` to the method. The compiler will then allow you to pass a `long` into and out of JavaScript. It will still be an opaque data type, however, so the only thing you will be able to do with it will be to pass it back to Java. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Servlet Mappings, GWT Modules, and web.xml | ||
|
||
GWT modules may declare one or more `<servlet>` tags. These define Java Servlets that implement the server-side component of a GWT-enabled web application. | ||
|
||
In modern GWT applications, these are only used for testing, and it is discouraged to use them in application code. | ||
|
||
During hosted mode startup, the set of *expected* servlets (from GWT module `<servlet>` tags) is validated against the set of actual servlets (from the `WEB-INF/web.xml`) and a warning is issued for each *expected* servlet which does not match an actual servlet. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove 'with a new project'? So, we would not limit it to new projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, these definitely need to be updated - this is just the first step at migrating them out of gwtproject/gwt itself, we'll want to refine them and possibly add more (jsinterop errors and warnings could use some help sections, or anchors on existing pages)