JSP1.2 (XML) probleme with syntaxe
I tryied to find answers form forum and within the archive but I never had answer so here is my probleme : I am trying to do a developpement in JSP1.2 (XML) instead of JSP1.1 using tag %=% and %% instead of %=..% et %..% I would like to change the style of div with an iteration: Mycode is the following jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 xmlns:tiles=/WEB-INF/struts-tiles.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:html=/WEB-INF/struts-html.tld xmlns:logic=/WEB-INF/struts-logic.tld jsp:scriptlet java.util.List l = com.imko.schemnet.anomalie.db.AnomaliePeer.doSelectAllOrdered(); //java.util.List l = new java.util.Vector(); pageContext.setAttribute(lstAnomalie,l); boolean grey = true; String classUsed=anomalieGrey; /jsp:scriptlet div class=anomalieGen jsp:expression classUsed /jsp:expression logic:iterate id=ano name=lstAnomalie div class=%=classUsed%!-- the probleme lay here -- bean:define id=cat name=ano property=idCategorie/ jsp:scriptlet if(grey){ classUsed=\anomalieGrey\; grey = false; }else{ grey = true; classUsed=\anomalieWhite\; } /jsp:scriptlet ... /div /logic:iterate /div /jsp:root Reference (http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html) says to remplace %=% par %=% . but it only work with taglig html:img class=%=classUsed% works but div class=%=classUsed%-- does not. Those are my tries : div class=%=classUsed%-- The value of attribute class must not contain the '' character.' div class=%=classUsed% -- Open quote is expected for attribute class|.' -- here might be a solution My only solution so far woulf be to create my own taglib. But it don't seams right. -- Charles-Alexandre SABOURDIN - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP1.2 (XML) probleme with syntaxe
Quoting Charles-Alexandre Sabourdin [EMAIL PROTECTED]: I have gone quickly through it :( and I am not confortable with the new notation you mention but I hope their might be a simpler solution then building a tag library ;) I tryied to find answers form forum and within the archive but I never had answer so here is my probleme : I am trying to do a developpement in JSP1.2 (XML) instead of JSP1.1 using tag %=% and %% instead of %=..% et %..% I would like to change the style of div with an iteration: Mycode is the following jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 xmlns:tiles=/WEB-INF/struts-tiles.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:html=/WEB-INF/struts-html.tld xmlns:logic=/WEB-INF/struts-logic.tld jsp:scriptlet java.util.List l = com.imko.schemnet.anomalie.db.AnomaliePeer.doSelectAllOrdered(); //java.util.List l = new java.util.Vector(); pageContext.setAttribute(lstAnomalie,l); boolean grey = true; String classUsed=anomalieGrey; /jsp:scriptlet div class=anomalieGen jsp:expression classUsed /jsp:expression logic:iterate id=ano name=lstAnomalie div class=%=classUsed%!-- the probleme lay here -- bean:define id=cat name=ano property=idCategorie/ jsp:scriptlet if(grey){ classUsed=\anomalieGrey\; grey = false; }else{ grey = true; classUsed=\anomalieWhite\; } /jsp:scriptlet ... /div /logic:iterate /div /jsp:root Reference (http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html) says to remplace %=% par %=% . but it only work with taglig html:img class=%=classUsed% works but Hereabove you are in a taglib attribute while hereafter you deal with plain text html markup. div class=%=classUsed%-- does not. So you might simply do something like div class='bean:write name=%=classUsed% /' By the way I guess by class attribute in html:img tag you meant styleClass ? My two cents, Patrick Those are my tries : div class=%=classUsed%-- The value of attribute class must not contain the '' character.' div class=%=classUsed% -- Open quote is expected for attribute class|.' -- here might be a solution My only solution so far woulf be to create my own taglib. But it don't seams right. -- Charles-Alexandre SABOURDIN - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP1.2 (XML) probleme with syntaxe
Charles-Alexandre Sabourdin wrote: I tryied to find answers form forum and within the archive but I never had answer so here is my probleme : I am trying to do a developpement in JSP1.2 (XML) instead of JSP1.1 using tag %=% and %% instead of %=..% et %..% I would like to change the style of div with an iteration: Mycode is the following jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 xmlns:tiles=/WEB-INF/struts-tiles.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:html=/WEB-INF/struts-html.tld xmlns:logic=/WEB-INF/struts-logic.tld jsp:scriptlet java.util.List l = com.imko.schemnet.anomalie.db.AnomaliePeer.doSelectAllOrdered(); //java.util.List l = new java.util.Vector(); pageContext.setAttribute(lstAnomalie,l); boolean grey = true; String classUsed=anomalieGrey; /jsp:scriptlet div class=anomalieGen jsp:expression classUsed /jsp:expression logic:iterate id=ano name=lstAnomalie div class=%=classUsed%!-- the probleme lay here -- bean:define id=cat name=ano property=idCategorie/ jsp:scriptlet if(grey){ classUsed=\anomalieGrey\; grey = false; }else{ grey = true; classUsed=\anomalieWhite\; } /jsp:scriptlet ... /div /logic:iterate /div /jsp:root Reference (http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html) says to remplace %=% par %=% . but it only work with taglig html:img class=%=classUsed% works but div class=%=classUsed%-- does not. Yes. This is right. %=% expressions can be used only in attributes in custom tags, not html tags. I solve the same problem with following (may be little ugly) expression: ![CDATA[div class=]]jsp:expressionclassUsed/jsp:expression![CDATA[]] div tag body ![CDATA[/div]] Or create yor own taglib :) best regards, Konstantin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP1.2 (XML) probleme with syntaxe
Le Jeudi 6 Novembre 2003 12:56, [EMAIL PROTECTED] a écrit : Quoting Charles-Alexandre Sabourdin [EMAIL PROTECTED]: I have gone quickly through it :( and I am not confortable with the new notation you mention but I hope their might be a simpler solution then building a tag library ;) I tryied to find answers form forum and within the archive but I never had answer so here is my probleme : I am trying to do a developpement in JSP1.2 (XML) instead of JSP1.1 using tag %=% and %% instead of %=..% et %..% I would like to change the style of div with an iteration: Mycode is the following jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 xmlns:tiles=/WEB-INF/struts-tiles.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:html=/WEB-INF/struts-html.tld xmlns:logic=/WEB-INF/struts-logic.tld jsp:scriptlet java.util.List l = com.imko.schemnet.anomalie.db.AnomaliePeer.doSelectAllOrdered(); //java.util.List l = new java.util.Vector(); pageContext.setAttribute(lstAnomalie,l); boolean grey = true; String classUsed=anomalieGrey; /jsp:scriptlet div class=anomalieGen jsp:expression classUsed /jsp:expression logic:iterate id=ano name=lstAnomalie div class=%=classUsed%!-- the probleme lay here -- bean:define id=cat name=ano property=idCategorie/ jsp:scriptlet if(grey){ classUsed=\anomalieGrey\; grey = false; }else{ grey = true; classUsed=\anomalieWhite\; } /jsp:scriptlet ... /div /logic:iterate /div /jsp:root Reference (http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html) says to remplace %=% par %=% . but it only work with taglig html:img class=%=classUsed% works but Hereabove you are in a taglib attribute while hereafter you deal with plain text html markup. div class=%=classUsed%-- does not. So you might simply do something like div class='bean:write name=%=classUsed% /' This does not works because The value of attribute class must not contain the '' character.' By the way I guess by class attribute in html:img tag you meant styleClass ? yes, that was only a test base on setting a variable attribut from a bean) My two cents, Patrick this Works but this is cheessy ![CDATA[div class=]]jsp:expressionclassUsed/jsp:expression![CDATA[]] div tag body ![CDATA[/div]] -- Charles-Alexandre SABOURDIN - 01.46.90.64.90 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]