Results 1 to 3 of 3

Thread: Redirect expose jsp path?

  1. #1

    Default Redirect expose jsp path?

    I have put all of my JSP inside WEB-INF directory, so that no one can access the jsp directly. Normally, all of the view should be called by controller.

    Say, I have mapped a request /home.html to HomeController and then it would dispatch to the view name home which is located at /WEB-INF/jsp/home.jsp (by using prefix-suffix mapping as viewResolver)

    The problem is that I want to redirect the request by sending redirect to browser, so I use
    Code:
    return new ModelAndView(new RedirectView("/home.html"))
    But in the browser's address bar, I see something like:
    Code:
    http://serverName/appName/WEB-INF/jsp/home.jsp
    And actually I want it to redirect to http://serverName/appName/home.html

    How can I do that?

  2. #2

    Default

    Originally I use websphere that will have such exposing JSP path problem. I found that if I use Tomcat, the redirect is normal.

  3. #3

    Default

    It turns out that I'm tracing wrong. So it is not related the to RedirectView object problem.

    The source of the problem is: in WebSphere, if I use request.getRequestURL(), it would not return what the browser has initially request, but the real jsp location.

    So does that mean I have to construct the path from other parameter instead?

Similar Threads

  1. Replies: 4
    Last Post: May 2nd, 2007, 08:55 PM
  2. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  3. Replies: 2
    Last Post: Jul 21st, 2005, 04:07 AM
  4. Resource: Add valid path not found
    By moacsjr in forum Data
    Replies: 3
    Last Post: May 24th, 2005, 05:53 PM
  5. redirect: prefix and view resolver
    By sjivan in forum Web
    Replies: 2
    Last Post: Dec 20th, 2004, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •