Changeset 7217
- Timestamp:
- Oct 31, 2016, 1:34:10 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Head.java
r7197 r7217 239 239 private void appendScripts(StringBuilder sb, JspContext jspContext) 240 240 { 241 SessionControl sc = page.getSessionControl();242 241 LinkedHashSet<String> allScripts = new LinkedHashSet<String>(); 243 242 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Icon.java
r6881 r7217 165 165 private boolean enabled = true; 166 166 167 private boolean setEnabledIsCalled = false;168 169 167 private int tabIndex; 170 168 … … 198 196 { 199 197 this.enabled = enabled; 200 this.setEnabledIsCalled = true;201 198 } 202 199 public boolean isEnabled() -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Page.java
r7108 r7217 218 218 */ 219 219 private transient SessionControl sc; 220 // TRUE if 'sc' has been set (including to null) in this page request 221 private transient boolean scHasBeenSet; 220 222 221 223 private transient JspContext skinContext; … … 284 286 } 285 287 288 /** 289 Set the session control to use in this request. 290 @since 3.10 291 */ 292 public void setSc(SessionControl sc) 293 { 294 this.scHasBeenSet = true; 295 this.sc = sc; 296 } 297 298 public SessionControl getSessionControl() 299 { 300 if (!scHasBeenSet && sc == null) 301 { 302 // Try to autoamtically get a session control 303 try 304 { 305 scHasBeenSet = true; 306 sc = Application.isRunning() ? Base.getSessionControl(pageContext.getRequest(), null, false) : null; 307 } 308 catch (RuntimeException ex) 309 {} 310 } 311 return sc; 312 } 313 286 314 public void setType(String type) 287 315 { … … 352 380 { 353 381 return BASE_VERSION; 354 }355 public SessionControl getSessionControl()356 {357 return sc;358 382 } 359 383 … … 382 406 { 383 407 super.setPageContext(pageContext); 408 // Reset variables that may exists since previous requests 384 409 favicon = null; 410 sc = null; 411 skinActions = null; 412 skinContext = null; 413 scHasBeenSet = false; 385 414 if (!initialized) initStaticFields(pageContext); 386 try387 {388 sc = Application.isRunning() ? Base.getSessionControl(pageContext, false) : null;389 }390 catch (RuntimeException ex)391 {}392 415 } 393 416 -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/Tab.java
r6881 r7217 29 29 import javax.servlet.jsp.JspException; 30 30 import javax.servlet.jsp.JspTagException; 31 import javax.servlet.jsp.PageContext; 31 32 import javax.servlet.jsp.tagext.BodyTagSupport; 32 33 import javax.servlet.jsp.tagext.DynamicAttributes; … … 288 289 return dynamicAttributes == null ? null : dynamicAttributes.values().iterator(); 289 290 } 291 292 /** 293 Reset the dynamic attributes to make sure old ones are not 294 included in case the tag object is reused. 295 @since 3.10 296 */ 297 @Override 298 public void setPageContext(PageContext pageContext) 299 { 300 dynamicAttributes = null; 301 super.setPageContext(pageContext); 302 } 290 303 291 304 @Override -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/TabControl.java
r6881 r7217 329 329 content = new StringBuilder(); 330 330 initialTab = null; 331 numTabs = 0; 331 332 332 333 if (!noTabs) -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Table.java
r7083 r7217 385 385 } 386 386 } 387 else 388 { 389 sortColumns = null; 390 } 387 391 } 388 392 public String getSortby() … … 657 661 } 658 662 definedColumns = new HashSet<String>(); 663 extensionColumns = null; 659 664 660 665 hiddenForm = new StringBuilder(); -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Toolbar.java
r6881 r7217 26 26 import javax.servlet.jsp.JspTagException; 27 27 28 import net.sf.basedb.clients.web. Base;28 import net.sf.basedb.clients.web.taglib.Page; 29 29 import net.sf.basedb.clients.web.taglib.StylableTag; 30 30 import net.sf.basedb.util.Values; … … 172 172 { 173 173 if (!isVisible()) return SKIP_BODY; 174 175 SessionControl sc = null; 174 Page page = (Page)findAncestorWithClass(this, Page.class); 175 176 SessionControl sc = page != null ? page.getSessionControl() : null; 176 177 StringBuilder sb = new StringBuilder(); 177 178 178 sc = Base.getSessionControl(pageContext, false);179 179 sb.append("<div"); 180 180 addIdAndStyles(sb); -
trunk/src/core/net/sf/basedb/core/Application.java
r7166 r7217 1032 1032 throw new PermissionDeniedException("Invalid remoteId ("+remoteId+"; expected: "+sc.getRemoteId()+")"); 1033 1033 } 1034 if ( !sc.isAllowedToUseClient(externalClientId))1034 if (externalClientId != null && !sc.isAllowedToUseClient(externalClientId)) 1035 1035 { 1036 1036 log.warn("getSessionControl: Invalid externalClientId: "+externalClientId+"; expected: "+sc.getExternalClientId()); -
trunk/www/WEB-INF/base.tld
r6684 r7217 66 66 <rtexprvalue>true</rtexprvalue> 67 67 </attribute> 68 <attribute> 69 <name>sc</name> 70 <rtexprvalue>true</rtexprvalue> 71 </attribute> 68 72 </tag> 69 73
Note: See TracChangeset
for help on using the changeset viewer.