1 package net.simya.ldap.taglib; 2 3 import javax.servlet.jsp.tagext.*; 4 import javax.servlet.jsp.*; 5 import javax.naming.NamingException ; 6 import net.simya.ldap.beans.*; 7 8 public class ModifyDn 9 extends TagSupport 10 { 11 private String olddn = null; 12 private String newdn = null; 13 14 public int doStartTag() 15 throws JspException 16 { 17 Connect connectTag = (Connect) getParent(); 18 if ( connectTag == null ) 19 throw new JspTagException( "<modifydn> tag should be child node of <connect> tag." ); 20 21 LdapModifyDnBean modifydnBean = new LdapModifyDnBean(); 22 modifydnBean.setOldDn( olddn ); 23 modifydnBean.setNewDn( newdn ); 24 modifydnBean.setContext( connectTag.getContext() ); 25 try 26 { 27 modifydnBean.modifyDN(); 28 29 } catch ( NamingException ex ) 30 { 31 throw new LdapTaglibException( ex ); 32 } 33 return EVAL_PAGE; 34 } 35 36 public void release() 37 { 38 olddn = null; 39 newdn = null; 40 } 41 42 public String getOlddn() { return this.olddn; } 43 public void setOlddn(String olddn) { this.olddn = olddn; } 44 45 public String getNewdn() { return this.newdn; } 46 public void setNewdn(String newdn) { this.newdn = newdn; } 47 } | Popular Tags |