I am creating a project in vaadin which runs on Tomcat, but the question concerns generally a java web-application. The application consists of a number of modules, which all together comprise the application. I want to adjust it, so as the way the application runs to be determined by the url. Therefore I attach a parameter to the url, the url seems namely as:
http:myproject/anything/foo?mode=sth.
I extract the parameter in the method onRequestStart():
String param = request.getParameter("mode");
I build the application according to the parameter. I.e. parameter a1 shows only module a1, parameter a2 only module a2,... and parameter normal the whole application. However I have a problem with the browser cache especially on parameter "normal". After running first time with this parameter, all the next times the browser does not "realize" a new request and shows the application from the cache, meaning the last module showed. Strangely on the other parameters I have not yet noticed this problem. Nevertheless, it is still not reliable and in order to make it certainly reliable I have to avoid browser cache. What could be a solution? I have found that one solution is to add a timestamp on the url, which must each time change so that it reads always a new url and makes a new request. How could I attach it though in a java application?