Update of /var/cvs/applications/taglib/META-INF/tags/mm/u
In directory james.mmbase.org:/tmp/cvs-serv14182

Modified Files:
        jdbc.tag option.tagx 
Added Files:
        tabs.tagx 
Log Message:
some small improvements


See also: http://cvs.mmbase.org/viewcvs/applications/taglib/META-INF/tags/mm/u


tabs.tagx is new



Index: jdbc.tag
===================================================================
RCS file: /var/cvs/applications/taglib/META-INF/tags/mm/u/jdbc.tag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- jdbc.tag    16 Jul 2007 11:39:09 -0000      1.2
+++ jdbc.tag    22 Jan 2008 11:09:29 -0000      1.3
@@ -4,6 +4,8 @@
 %>
 <jsp:directive.attribute name="query"   required="true" />
 <jsp:directive.attribute name="mode"   />
+<jsp:directive.attribute name="max" type="java.lang.Integer"  />
+<jsp:directive.attribute name="throwexception" type="java.lang.Boolean"  />
 <%
 Connection con = null;
 Statement stmt = null;
@@ -11,6 +13,7 @@
 DataSource dataSource = (DataSource) 
MMBase.getMMBase().getStorageManagerFactory().getAttribute(Attributes.DATA_SOURCE);
 con = dataSource.getConnection();
 stmt = con.createStatement();
+query = query.replace("$PREFIX", MMBase.getMMBase().getBaseName());
 ResultSet rs = 
stmt.executeQuery(org.mmbase.util.transformers.Xml.XMLUnescape(query));
 %>
 <c:if test="${empty mode or mode eq 'table'}">
@@ -26,8 +29,11 @@
   </tr>
   </c:if>
   <%
+  int seq = 0;
   while(true) {
    boolean valid = rs.next();
+   seq ++;
+   if (max != null && seq > max) break;
    if (! valid) break;
   %>
 <c:if test="${empty mode or mode eq 'table'}"> 
@@ -47,14 +53,15 @@
          for   (int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
           data.put(rs.getMetaData().getColumnName(i), rs.getString(i));
         }
-        request.setAttribute("_node", data);
+        jspContext.setAttribute("help_node", data);
     %>
-    <mm:node referid="_node">
+    <mm:node referid="help_node">
   <jsp:doBody />       
   </mm:node>
   </c:if>
   <%}
   } catch (Exception e) {
+     if (throwexception != null && throwexception) throw e;
     out.println("<tr><td colspan='100'>ERROR:" + e.getMessage() + 
"</td></tr>");
     out.println("<tr><td colspan='100'><pre>" + 
org.mmbase.util.logging.Logging.stackTrace(e) + "</pre></td></tr>");
   } finally {


Index: option.tagx
===================================================================
RCS file: /var/cvs/applications/taglib/META-INF/tags/mm/u/option.tagx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- option.tagx 15 Sep 2006 17:29:45 -0000      1.2
+++ option.tagx 22 Jan 2008 11:09:29 -0000      1.3
@@ -7,7 +7,7 @@
   <!--
       Like HTML option tag, but it is handyer to deal with the selected 
attribute.
       @author Michiel Meeuwissen
-      @since MMBase-1.9
+      @since MMBase-1.8.5
   -->
   <jsp:directive.tag
       display-name="HTML option tag"
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to