Scott Sauyet wrote:
Jeremy Levy wrote:
It sounds like this:

https://issues.apache.org/jira/browse/WICKET-1205

That was exactly it.  Thank you.

Unfortunately, this issue has not been resolved as of Wicket 1.3.3. There was a bizarre note at the end of that issue from Al Maw that it had something to do with having an "index.jsp" page in the application. Sure enough, when I removed that page, it seems to work fine.

The client wanted that "index.jsp" for consistency with the application that I'm replacing.

I found a relatively simple solution for my case, which may help others. I really do want the *URL*

    http://host:port/context/index.jsp

to work and map to my home page, but I don't need the *file*

    index.jsp

So I just added a servlet filter to do the mapping for me. And this also gave me a way to map other older URLs that might be bookmarked. An abbreviated version of that filter is below, specific to my own application but clear enough I think in intent.

I hope it helps others in the same boat.

  -- Scott

============================== code below ==============================

package com.example;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class OldUrlFilter implements Filter {

    public void destroy() {}
    public void init(FilterConfig config) {}
    public void doFilter(ServletRequest request,
            ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        if (request instanceof HttpServletRequest &&
            response instanceof HttpServletResponse) {
            if (process((HttpServletRequest) request,
                        (HttpServletResponse) response)) {
                chain.doFilter(request, response);
            }
        }
    }

    public boolean process(HttpServletRequest request,
            HttpServletResponse response) throws IOException {
        if (request.getRequestURI().endsWith("DisplayDoctext.jsp")) {
            int id = Integer.valueOf(request.getParameter("doctextid"));
            response.sendRedirect(request.getContextPath() +
                    "/DisplayDocText/id/" + id + "/");
            return false;
        } else if (request.getRequestURI().endsWith(
                "ResponseCodeList.jsp")) {
            response.sendRedirect(request.getContextPath() +
                    "/ListResponseCodes/");
            return false;
        } else if (request.getRequestURI().endsWith("index.jsp")) {
            response.sendRedirect(request.getContextPath() + "/Home/");
            return false;
        }
        return true;
    }
}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to