Question

I have developed a web application using sprint portlets JSR 286 which displays data in the table format in web browser.

Below given is the code used to call the controller from JSP file.

`

function openPortletReport(displayName,reportName,linkNum){
  document.eployerSearchLightFrm.action='<%=formAction%>';
  document.getElementById("reportName").value=reportName;
  document.getElementById("parentLinkName").value=linkNum;
  document.getElementById("eployerSearchLightFrm").submit();
}

` Here the form action type is POST and reportName, parentLinkName are parameters.

On submitting this form, handlerRenderRequest method of Controller is called. After getting the data from database we pass name of the view in ModelAndView object as follows:-

`modelAndView = new ModelAndView("searchlight/genderProfile");
 return modelAndView;`

This view name is mapped with the relevant JSP file using ViewResolver in application context xml file as given below:-

`

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>        
        <property name="prefix" value="/WEB-INF/jsp/"></property>        
        <property name="suffix" value=".jsp"></property>    
    </bean>

`

After displaying this JSP file, there can be another link in that JSP file which will go to some new JSP file following the same above process.

Now after JSP file gets loaded in browser using above process, if I click on browser back button, it does not resend the portlet request it gives me Webpage has expired error in browser. This is happening in all the browsers including IE 8, Mozilla Firefox 19 and Chrome 24.

Please help me in solving this problem, as I have searched through almost all the content in google to find the solution but no luck!!

Thank you.

Was it helpful?

Solution

That is expected behaviour for a form POST. If it's essential that the back button works, then use GET as the form method instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top