I have a redirect back to a list of search results in the header.jsp, inside that jsp there is a javascript function that gets called if we hit the “Return to Result List” link. It should redirect the user to their previous results page. The Redirect right now is resolving to a blank white page with no indicated errors. I can’t quite figure out why it’s not properly showing the jsp of the page we’re redirecting to.
searchResultHeading.jsp is the jsp that has the header inside of it that contains the link in question
<%if(ApplicationBean.getBizActivityAuthorizations().ResultBasicInfo() && !ApplicationBean.isInExternalAppContext()) { %>
| <a href="javaScript:returnToResultList();" class=sm>Return to Result list</a>
<% } %>
</td>
</tr>
Header.jsp is another jsp that contains a ton of common stuff as well as functions. The returnToResultList Function is inside there
function gotoSearchResults(searchForm)
{
searchForm.userAction.value = "<%=myLiterals.USER_ACTION_RETURN_TO_SEARCH_RESULTS_PAGE%>";
searchForm.action="/mySite/GlobalNavigationController";
searchForm.submit();
return true;
}
The GlobalNavigationController.java itself is below which is where we arrange the redirects to various sub-controllers who display their JSPs. Navigating to the Search and then performing it and getting the Results List works if searching but when trying to back-track from a result it fails.
@Controller
public class GlobalNavigationController {
@Autowired
private CustomerListController customerListController;
@RequestMapping(path="/GlobalNavigationController", method={RequestMethod.GET, RequestMethod.POST})
public ModelAndView doGet(HttpSession session, HttpServletRequest req, HttpServletResponse res) throws Exception
{
SiteBean myBean = new myBean();
try
{
RequestMapper.MapToBean(req,myBean);
if (myBean.getUserAction().equals(myLiterals.USER_ACTION_1))
{
return null;
}
else if(myBean.getUserAction().equals(myLiterals.USER_ACTION_2))
{
GlobalNavigationUCService.processSideNav();
GlobalNavigationUCService.resetDisPlayOrder();
return maintainController.doGet(session, req, res);
}
else if (myBean.getUserAction().equals(myLiterals.USER_ACTION_3))
{
GlobalNavigationUCService.processSideNavInitiateSearch();
GlobalNavigationUCService.resetDisPlayOrder();
return SearchController.doGet(session, req, res);
}
else if(myBean.getUserAction().equalsIgnoreCase(myLiteral.USER_ACTION_4))
{
GlobalNavigationUCService.processSideNavInitiateSearch();
GlobalNavigationUCService.processTabsGoToResults();
GlobalNavigationUCService.resetDisPlayOrder();
return ProfileController.doGet(session,req,res);
}
else if (myBean.getUserAction().equals(myLiterals.USER_ACTION_RETURN_TO_SEARCH_RESULTS_PAGE))
{
GlobalNavigationUCService.processTabsGoToResults();
return customerListController.doGet(session, req, res);
}
I’ve managed to so understand the standard navigation and get that working but I am not sure why the retun to results is not working from the javascript link in the JSP.