You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by klopfdreh <gi...@git.apache.org> on 2017/07/31 15:40:23 UTC
[GitHub] wicket pull request #225: Some regarding CssHeaderItem / push integration
GitHub user klopfdreh opened a pull request:
https://github.com/apache/wicket/pull/225
Some regarding CssHeaderItem / push integration
* there are some methods to apply the rel attribute to css header items
* fixed a bug that the resources were not pushed correctly to the client
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/klopfdreh/wicket css_improvements_and_push_integration_fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/225.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #225
----
commit 1eb3b63b4235c38f0d23a502c9ebf730ee117c3c
Author: Tobias Soloschenko <ts...@apache.org>
Date: 2017-07-31T15:34:25Z
Some regarding CssHeaderItem / push integration
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request #225: Some changes regarding CssHeaderItem / push integr...
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh closed the pull request at:
https://github.com/apache/wicket/pull/225
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket issue #225: Some changes regarding CssHeaderItem / push integration
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/225
All in all there are currently some errors regarding the caching of the resources which are pushed. It currently behaves like this:
Resource pushed (no status code) > 200 OK (served via link tag) > 304 NOT MODIFIED (received from cache)
It should be:
Resource pushed (no status code) > 304 NOT MODIFIED (received from cache)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request #225: Some changes regarding CssHeaderItem / push integr...
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/225#discussion_r130392658
--- Diff: wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java ---
@@ -361,7 +366,32 @@ else if (url.toString().startsWith("."))
url = url.toString().substring(1);
}
- urls.add(url.toString());
+ // The context path and the filter have to be applied to the URL, because otherwise
+ // the resource is not pushed correctly
+ StringBuffer partialUrl = new StringBuffer();
+ String contextPath = WebApplication.get().getServletContext().getContextPath();
+ partialUrl.append(contextPath);
+ if (!contextPath.equals("/"))
+ {
+ partialUrl.append("/");
+ }
+ String filterPath = WebApplication.get().getWicketFilter().getFilterPath();
+ if (filterPath.equals("/"))
+ {
+ filterPath = "";
+ }
+ else if (filterPath.endsWith("/"))
+ {
+ filterPath = filterPath.replaceAll(".$", "");
+ }
+ partialUrl.append(filterPath);
--- End diff --
I miss you too! ;-)
`org.apache.wicket.protocol.http.servlet.ServletWebRequest` has methods for both.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request #225: Some regarding CssHeaderItem / push integration
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on a diff in the pull request:
https://github.com/apache/wicket/pull/225#discussion_r130389962
--- Diff: wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java ---
@@ -361,7 +366,32 @@ else if (url.toString().startsWith("."))
url = url.toString().substring(1);
}
- urls.add(url.toString());
+ // The context path and the filter have to be applied to the URL, because otherwise
+ // the resource is not pushed correctly
+ StringBuffer partialUrl = new StringBuffer();
+ String contextPath = WebApplication.get().getServletContext().getContextPath();
+ partialUrl.append(contextPath);
+ if (!contextPath.equals("/"))
+ {
+ partialUrl.append("/");
+ }
+ String filterPath = WebApplication.get().getWicketFilter().getFilterPath();
+ if (filterPath.equals("/"))
+ {
+ filterPath = "";
+ }
+ else if (filterPath.endsWith("/"))
+ {
+ filterPath = filterPath.replaceAll(".$", "");
+ }
+ partialUrl.append(filterPath);
--- End diff --
@martin-g - long time ago we wrote to each other 😄 - I have a question regarding receiving the context path / filter path - is there a method to do so?
Example:
https://127.0.0.1:8443/mywebappcontext/myfilter/wicket/....
I need a better way to get this part:
/mywebappcontext/myfilter/
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket issue #225: Some changes regarding CssHeaderItem / push integration
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on the issue:
https://github.com/apache/wicket/pull/225
Closing this PR and replace it with two separated PRs:
https://github.com/apache/wicket/pull/227
https://github.com/apache/wicket/pull/226
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket issue #225: Some changes regarding CssHeaderItem / push integration
Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the issue:
https://github.com/apache/wicket/pull/225
This PR should be split into two parts:
- one for the `rel` attribute
- another for the Push related change
Please remove the re-formatting of the code.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] wicket pull request #225: Some changes regarding CssHeaderItem / push integr...
Posted by klopfdreh <gi...@git.apache.org>.
Github user klopfdreh commented on a diff in the pull request:
https://github.com/apache/wicket/pull/225#discussion_r130393784
--- Diff: wicket-experimental/wicket-http2/wicket-http2-core/src/main/java/org/apache/wicket/http2/markup/head/PushHeaderItem.java ---
@@ -361,7 +366,32 @@ else if (url.toString().startsWith("."))
url = url.toString().substring(1);
}
- urls.add(url.toString());
+ // The context path and the filter have to be applied to the URL, because otherwise
+ // the resource is not pushed correctly
+ StringBuffer partialUrl = new StringBuffer();
+ String contextPath = WebApplication.get().getServletContext().getContextPath();
+ partialUrl.append(contextPath);
+ if (!contextPath.equals("/"))
+ {
+ partialUrl.append("/");
+ }
+ String filterPath = WebApplication.get().getWicketFilter().getFilterPath();
+ if (filterPath.equals("/"))
+ {
+ filterPath = "";
+ }
+ else if (filterPath.endsWith("/"))
+ {
+ filterPath = filterPath.replaceAll(".$", "");
+ }
+ partialUrl.append(filterPath);
--- End diff --
I used those:
```java
WebApplication.get().getServletContext().getContextPath();
WebApplication.get().getWicketFilter().getFilterPath();
```
and build the path by my self.
Can you have a look at the implementation if this is ok?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---