[HepData-svn] r1442 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Feb 15 16:02:14 GMT 2011


Author: whalley
Date: Tue Feb 15 16:02:14 2011
New Revision: 1442

Log:
fix handling of + sign in queries

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java	Tue Feb 15 11:13:08 2011	(r1441)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java	Tue Feb 15 16:02:14 2011	(r1442)
@@ -72,15 +72,16 @@
         return getSearchString();
     }
     public void onActivate(String q) {
-        System.out.println("activating searchString");
+        if(q.contains("_")){
+           q=q.replace("+","@");
+        }
         try{
           q =  URLDecoder.decode(q,"UTF-8"); 
         } catch(Exception ex){}
+        q = q.replace("@","+");
         setSearchString(q.replace("_", " "));
-//        setSearchString(q);
     }
     public void onActivate(EventContext context) {
-//        System.out.println("activating context");
         parseContext(context);
 
     }
@@ -93,7 +94,6 @@
             query = URLEncoder.encode(query,"UTF-8");
         } catch(Exception ex){};
         _search.setSearchString(query.replace(" ", "_"));
-//        _search.setSearchString(query);
         return _search;
     }
 


More information about the HepData-svn mailing list