You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by et...@apache.org on 2008/01/20 13:54:06 UTC
svn commit: r613547 - in /incubator/shindig/trunk: features/core/feature.xml
java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java
Author: etnu
Date: Sun Jan 20 04:54:02 2008
New Revision: 613547
URL: http://svn.apache.org/viewvc?rev=613547&view=rev
Log:
Fixed a pathing issue with JsServlet when using wild cards for servlet config.
Modified gadgets.io to use a relative path. This makes it so that you don't have to configure as much if you're running your server on a different path.
Modified:
incubator/shindig/trunk/features/core/feature.xml
incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java
Modified: incubator/shindig/trunk/features/core/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core/feature.xml?rev=613547&r1=613546&r2=613547&view=diff
==============================================================================
--- incubator/shindig/trunk/features/core/feature.xml (original)
+++ incubator/shindig/trunk/features/core/feature.xml Sun Jan 20 04:54:02 2008
@@ -22,12 +22,12 @@
<script src="core.js"/>
<script src="util.js"/>
<script src="prefs.js"/>
- <script src="json.js"/>
+ <script src="json.js"/>
<script src="io.js"/>
<script><![CDATA[
gadgets.io.init({
proxyUrl: "http://www.gmodules.com/ig/proxy?url=%url%",
- jsonProxyUrl: "/gadgets/proxy?url=%url%&output=js"
+ jsonProxyUrl: "proxy?url=%url%&output=js"
});
]]></script>
<script src="legacy.js"/>
Modified: incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java?rev=613547&r1=613546&r2=613547&view=diff
==============================================================================
--- incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java (original)
+++ incubator/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/http/JsServlet.java Sun Jan 20 04:54:02 2008
@@ -73,9 +73,10 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
// Use the last component as filename; prefix is ignored
- String path = req.getPathTranslated();
- String[] pathComponents = path.split("/");
- String resourceName = pathComponents[pathComponents.length-1];
+ String uri = req.getRequestURI();
+ // We only want the file name part. There will always be at least 1 slash
+ // (the server root), so this is always safe.
+ String resourceName = uri.substring(uri.lastIndexOf("/") + 1);
if (resourceName.endsWith(".js")) {
// Lop off the suffix for lookup purposes
resourceName = resourceName.substring(