lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Sanford (JIRA)" <>
Subject [jira] Created: (LUCENE-1065) Session Time Out For UNLOGGED IN USER During Search -pls help!
Date Sat, 24 Nov 2007 04:19:43 GMT
Session Time Out For UNLOGGED IN USER During Search -pls help!

                 Key: LUCENE-1065
             Project: Lucene - Java
          Issue Type: Bug
          Components: Analysis, Build, Javadocs, Query/Scoring, QueryParser, Search
    Affects Versions: 2.1
         Environment: JDK1.5,JBoss4.0,Spring, Eclipse,mysql 5.0.4, tortoise cvs, clamwin0.91.1,
apache-ant 1.7
            Reporter: Jeffrey Sanford
            Priority: Critical

The problem lies in file under search/web/handler
of an application that supports educational note sharing.
The problem is that - 
When I search with query strings in different fields(as you will find in the above mentioned
java files)..the keywords in resourcedto and get some files as search results.
Then I click on one of the file from within the search result and visit the file.
Here if I m logged in as an user, and the session time out is set to 1 minute in the web.xml
file of the web folder not the admin folder then when I hit the BACK TO SEARCH button it easily
goes back to the previous search result page along with the queries string that I had input
The problem is that when I m NOT LOGGED in as an user, and I've performed a search with queries
and other dropdowns in the search panel, I get the search result page, I visit the file by
clicking on one of them but when I hit the BACK TO SEARCH button I don't see the previous
search result page from where I had navigated to view the file.
Please suggest on what changes shall I make in the code so that even if I m not logged in
as an user, I get back to the search result page on hitting the BACK TO SEARCH button from
the file view page.
I m herein pasting the code of the file, but please feel free
to ask for anyother related file whose code you might want to see.
You're sure to find all the required files in the folder attached herein.Letme
know if you need anyother files to resolve this issue asap.
In order to download the entire web folder which has all the related files - pls download
it from this url -
import java.util.Map;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import com.mgh.sps.common.dto.ResourceDTO;
import com.mgh.sps.common.util.SessionAttributeKey;
import com.mgh.sps.common.util.SessionManager;
import com.mgh.sps.fileusage.web.constants.FileUsageWebConstants;
public class SearchResultsController extends SimpleFormController {
* SearchResults Controller 
* @author Muralikrishna.s
* @Codedondate DD-MM-YY=26-07-07
* @Usecase/s associated =UC504
private static final Logger logger = Logger
private final static String REG_EXP = "^[A-Za-z0-9]*$";
private final static Pattern EMAIL_PATTERN_REG = Pattern.compile(REG_EXP);
* Spring framework method used to hold reference data
* @param request
* HttpServletRequest
* @param command
* Object
* @param arg2
* Errors
* @return Map
* @throws Exception
protected Map referenceData(HttpServletRequest request, Object command,
Errors errors) throws Exception {
logger.debug("SearchResultsController.referenceData() method entered:"
+ request + "," + command + "," + errors);
FileUsageWebConstants.TAB_SEARCH, request);
Search search = (Search) super.getWebApplicationContext().getBean(
ResourceDTO resourceDto = (ResourceDTO) command;
String[] allValues = new String[7];
if (null != (String[]) SessionManager.getSessionAttribute(
SessionAttributeKey.allValues, request)) {
allValues = (String[]) SessionManager.getSessionAttribute(
SessionAttributeKey.allValues, request);
+ resourceDto.getQualification());
String flag = (String) request.getParameter("id");
logger.debug("SearchResultsController.referenceData() method exited:");
return search.retrieveReferenceData(resourceDto);
* Spring framework method used to hold OnSubmit
* @param request
* HttpServletRequest
* @param response
* HttpServletResponse
* @param command
* Object
* @param arg3
* BindException
* @return ModelAndView
* @throws Exception
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
logger.debug("SearchResultsController.onSubmit() method entered:"
+ request + "," + command + "," + response + "," + errors);
Search search = (Search) super.getWebApplicationContext().getBean(
Map dynamic = (Map) getServletContext().getAttribute("config");
ResourceDTO resourceDto = (ResourceDTO) command;
//changed by sreelatha on sep21
//String key = request.getParameter("keywords");
//logger.debug("&&&&&&&&&&&&& key &&&&&&&&&&&&"
+ key);
String keywords = (request.getParameter("keywords"));
if(null!=keywords) {
keywords = keywords.trim();
// changes end
String[] allValues = new String[7];
//changed by sreelatha on sep21
//allValues[0] = request.getParameter("keywords");
allValues[0] = resourceDto.getKeywords();
//changes end
allValues[1] = request.getParameter("country");
allValues[2] = request.getParameter("universityName");
allValues[3] = request.getParameter("subjectArea");
allValues[4] = request.getParameter("qualification");
allValues[5] = request.getParameter("yearLevel");
allValues[6] = request.getParameter("specificType");
allValues, request);
if(null!=keywords) {
keywords = keywords.trim();
String words="";
for(int i=0;i<keywords.length();i++) { 
String key=String.valueOf(keywords.charAt(i));
if(key.contains("*")) {
key = key.replace("*"," ");
} else if(key.contains("?")) {
key = key.replace("?"," ");
} else if(key.contains("[")) {
key = key.replace("["," ");
} else if(key.contains("{")) {
key = key.replace("{"," ");
} else if(key.contains("(")) {
key = key.replace("("," ");
} else if(key.contains(")")) {
key = key.replace(")"," ");
} else if(key.contains("+")) {
key = key.replace("+"," ");
} else if(key.contains("
")) {
key = key.replace("
"," ");
} else if(key.contains(" ")) {
key = key.replace(" "," ");
} else if(key.contains("_")) {
key = key.replace("","");
} else if(!EMAIL_PATTERN_REG.matcher(key).matches()) {
key = key.replaceAll(key," ");
words = words + key;
keywords = words;
SessionManager.setSessionAttribute(SessionAttributeKey.test, search.setInputValues(resourceDto,
dynamic), request);
String name = (String) SessionManager.getSessionAttribute(SessionAttributeKey.tempName, request);
String flag1 = request.getParameter("id");
String status="";
if (flag1 !=null && flag1.equals("loggedInUser"))
return new ModelAndView();
if (flag1 !=null && flag1.equals("loggedInUser")){
status = "redirect:SearchResults.htm?id=loggedInUser";
}else if(flag1 !=null && flag1.equals("nonLoggedInUser"))
status = "redirect:SearchResultsnlu.htm?id=nonLoggedInUser"; 
ModelAndView mav = new ModelAndView(super.getSuccessView());
logger.debug("SearchResultsController.onSubmit() method exited:");
return mav;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message