1 13 package com.tonbeller.wcf.sqltable; 14 15 import java.io.IOException ; 16 17 import javax.servlet.jsp.JspException ; 18 19 import com.tonbeller.tbutils.res.Resources; 20 21 25 public class SqlTableOrderByTag extends SqlTableNestedTag { 26 public int doStartTag() throws JspException { 27 SqlTable table = getTable(); 28 String column = table.getOrderBy(); 29 String nested = table.getNestedOrderBy(); 30 Resources res = getResources(); 31 String sql; 32 if (table.isDescending()) 33 sql = res.getString("sqltable.orderby.desc", column); 34 else 35 sql = res.getString("sqltable.orderby.asc", column); 36 37 if (nested != null && !nested.startsWith(column)) 39 sql = sql + "," + nested; 40 41 try { 42 pageContext.getOut().print(sql); 43 } catch (IOException e) { 44 throw new JspException (e); 45 } 46 return super.doStartTag(); 47 } 48 49 } 50 | Popular Tags |