Results 1 to 5 of 5

Thread: Controller URLs visible in Browser address bar?

  1. #1

    Default Controller URLs visible in Browser address bar?

    Hi,

    I am facing a problem regarding automatic storage of controller URLs in the browser history. I login to the application using http://localhost:8080/myapp/login.view and then access different pages. In all the JSPs I have used POST as the method for form submission. The problem is if I start typing the application url in the browser address bar, it shows me various controller URLs there like -

    http://localhost:8080/myapp/error.view
    http://localhost:8080/myapp/batch.view
    http://localhost:8080/myapp/changePassword.view
    http://localhost:8080/myapp/editBatch.view

    I have no idea why all these are getting stored in the browser history. Is there anything which I am missing while submitting the form?

    I thought that this was happening due to the usage of RedirectView, since I need to pass control to another controller from one controller, so I was using new ModelAndView(new RedirectView(controllerName)) as the return value in onSubmit method. Since redirect caused a new request to be issued from the browser so I thought this might have been a problem, so I changed the onSubmit return value to new ModelAndView("forward:"+controllerName). But this still does not solve the problem and I still get the various controller calls in the browser address bar.

    Can someone please help in this to sort it out.

    Thanks in advance!

    Regards,
    Anshumn

  2. #2
    Join Date
    Mar 2006
    Location
    Bangalore, India
    Posts
    242

    Default

    Hi ,

    the browser is storing the URL's since they are all Http GET,
    This is the default behaviour, you can clearing the history and again reopen the browser, it wouldnot remember the urls.
    Sami

  3. #3

    Default

    Hi,

    But I am not making any GET request. In all my forms I have specified the method as POST. I thought sending a Redirect could have been a problem since it would pass a get request, but even changing it to forward does not solve the problem.

    Clearing the browser history does it, I dont want the users to see the various controller calls when they type the application URL, so that is the reason I want to avoid it.

    Thanks & Regards,
    Anshumn

  4. #4
    Join Date
    Mar 2006
    Location
    Bangalore, India
    Posts
    242

    Default

    Hi,

    try using the cache control directives,

    you can add cacheSeconds property set it to "0" in the controllers,

    you can also try using the <meta http-equiv="Cache-Control" content="NO-CACHE"/> in the head section of the html.
    Sami

  5. #5

    Default

    Hi,

    I tried both the options, but still it continues to work in the same way. My BaseController extends SimpleFormController and in the constructor of my controller, I call super() , since the AbstractFormController makes a call to setCacheSeconds(0); in its constructor.

    Regards,
    Anshumn

Posting Permissions

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