This could be possible using a session attribute. so that the first time the page is loaded, and the HTTP session that gets created would not contain any custom attributes your app would stuff on it. So you can look for / set a session attribute that can be used to render the output for the first page load, or different content there after
Note that by using a date as the object for the first visit within this session, it could be used by something else in your app, like to show different content as the user continues to reload the page over time , during the span of their session.
Error: Keyboard not attached. Press F1 to continue.
Hi, I have one more idea ! you can use Jsp init parameter in web.xml like
suppose there are five different images, and we can choose randomly 5 images on each request <!-- Init parameters for the JSP readInitParamJSP --> <servlet> <servlet-name>readInitParamJSP</servlet-name> <jsp-file>/web/readInitParamJSP.jsp</jsp-file> <init-param> <param-name>1</param-name> <param-value>path to image 1</param-value> </init-param> <init-param> <param-name>2</param-name> <param-value>path to image 2</param-value> </init-param> and other 3 init parameter for ohter 3 images </servlet> <servlet-mapping> <servlet-name>readInitParamJSP</servlet-name> <url-pattern>/web/readInitParamJSP.jsp</url-pattern> </servlet-mapping> </web-app>
in jsp you can use following code
<% int a = (int)(Math.random()*100)/20; Stirng str= Integer.toString(a); String parameter =config.getInitParameter(str);