Changeset 6301
- Timestamp:
- 2003-12-18T09:27:11+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/LibraryServlet.java
r5400 r6301 42 42 //protected GSCGI cgi = null; 43 43 protected GSParams params = null; 44 45 /** user id - new one per session. This doesn't work if session state is saved between restarts - this requires this value to be saved too. */ 46 protected int next_user_id = 0; 47 48 44 49 /** initialise the servlet 45 50 */ … … 47 52 // always call super.init; 48 53 super.init(config); 49 50 54 // disable preferences - does this work anyway?? 51 55 //System.setProperty("java.util.prefs.PreferencesFactory", "org.greenstone.gsdl3.util.DisabledPreferencesFactory"); … … 139 143 140 144 HttpSession session = request.getSession(true); 141 145 String uid = (String)session.getAttribute(GSXML.USER_ID_ATT); 146 if (uid ==null) { 147 uid = ""+getNextUserId(); 148 session.setAttribute(GSXML.USER_ID_ATT, uid); 149 } 142 150 request.setCharacterEncoding("UTF-8"); 143 151 response.setContentType("text/html;charset=UTF-8"); … … 164 172 // the request to the receptionist 165 173 Element xml_message = this.doc.createElement(GSXML.MESSAGE_ELEM); 166 Element xml_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PAGE, "", lang );174 Element xml_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PAGE, "", lang, uid); 167 175 xml_request.setAttribute(GSXML.OUTPUT_ATT, output); 168 176 xml_message.appendChild(xml_request); … … 220 228 String name = (String)params.nextElement(); 221 229 222 if ( !name.equals(GSParams.LANGUAGE) ) { // lang isstored but we dont want it in the param list cos its already in the request230 if ( !name.equals(GSParams.LANGUAGE) && !name.equals(GSXML.USER_ID_ATT)) { // lang and uid are stored but we dont want it in the param list cos its already in the request 223 231 224 232 Element param = this.doc.createElement(GSXML.PARAM_ELEM); … … 266 274 267 275 } 276 277 synchronized protected int getNextUserId() { 278 next_user_id++; 279 return next_user_id; 280 } 281 268 282 }
Note:
See TracChangeset
for help on using the changeset viewer.