I'm wondering if anyone else has seen this problem and if it's a known bug
or if I'm doing something wrong.

I'm using 1.3.0-SNAPSHOT on Weblogic 8.1. When I have Wicket set up in
web.xml as a servlet, any request to /myApp/myJS.js (or
/myApp/resources/myJS.js or /myApp/com/.../myJS.js) gets stripped and the
page is redirected to the home page.

When I say stripped, I'm referring to this code:
    public String getRelativePath(HttpServletRequest request)
    {
        String path = Strings.stripJSessionId(request.getRequestURI());
        String contextPath = request.getContextPath();
        path = path.substring(contextPath.length());
        if (servletMode)
        {
            String servletPath = request.getServletPath();
            path = path.substring(servletPath.length()); // <--- javascript
is stripped out of the path. Weblogic 8.1 problem?
        }
...

Once I changed the web.xml to use a filter instead, it worked.

In fact, I couldn't get the JS/CSS in any way when using the servlet. I
tried putting the JS in my app.war in these directories:
/ (root)
/classes/com/.../someJS.js
/WEB-INF/classes/com/.../someJS.js (same directory as Class and html)

I tried :
response.renderJavascriptReference("common.js");
add(HeaderContributor.forJavaScript( MYPAGE_JS ));
add(new JavaScriptReference("commonjs", getClass(), "common.js"));

and none worked with the Wicket in servletMode. (All sent me to home page.)

I haven't tried these ways to insert the JS in filter mode. I've just used:
<script language="JavaScript" type="text/javascript" src="common.js
"></script>
I'm going back and seeing if any/all of those work now that I've switched to
a filter.

Thanks for reading!

Adam

Reply via email to