Servlet mappings in DWR 3rc1
Hi All,
We've been using DWR 2.0.5 with the following Spring based configuration:
web.xml: servlet definition
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>allowScriptTagRemoting</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
web.xml: servlet mapping for multiple servlets - we need this as different servlets require different authentication privileges. We use specific filters on each servlet to authenticate the user to make sure they have access; thus the DWR must be relative to these servlets so the filter is invoked.
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/serlvet1/dwr/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serlvet1</servlet-name>
<url-pattern>/serlvet1/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/serlvet2/dwr/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>serlvet2</servlet-name>
<url-pattern>/serlvet2/*</url-pattern>
</servlet-mapping>
jsp template: we add the DWR-generated client javascript with a relative path (no root '/').
<script src="<c:url value="/scripts/dwr/engine.js"/>" type="text/javascript"></script>
<script src="<c:url value="dwr/util.js"/>" type="text/javascript"></script>
<script src="<c:url value="dwr/interface/MyClass1.js"/>" type="text/javascript" charset="utf-8"></script>
<script src="<c:url value="dwr/interface/MyCLass2.js"/>" type="text/javascript" charset="utf-8"></script>
Since upgrading to 3rc1 we have encountered a problem we have now is that the DWR-generated client javascript _path is always '/servlet1/' where in 2.0.5 it was the servlet path of the current context.
So, some questions:
- Is this a bug?
- How can we get the behaviour back to that of 2.0.5?
- How is engine.js generated - there is also a hard coded path to '/servlet1/' in the variable "_pathToDwrServlet" - is this adjustable in the config XML?
- Is there a better configuration for the scenario that we require?
Cheers,
Paul

RSS Feed