You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Patrick Hess <pa...@ish.de> on 2003/10/28 11:40:01 UTC
xsp:expr / compiler error: Missing semicolon
Can somebody tell what I'm doing wrong in this XSP (snippet):
XSP:
for (int i = 0; i < users.size(); i++) {
UserDataBean udb = (UserDataBean) users.get(i);
String userName = ((String) udb.getUserName());
<xsp:expr>userName</xsp:expr>
}
Without the last line/expression of the loop the page compiles fine and
does the job (it's calling an EJB to get list of users). With the line I
get the following:
org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
csr_result_xsp: ERROR 1
(org\apache\cocoon\www\xml\csr\csr_result_xsp.java): ... String userName
= ((String) udb.getUserName()); // start error (lines 309-309) "Missing
semicolon" (userName) // end error } } catch (Exception e) { ... Line
309, column 0: Missing semicolon
and generated java code looks like this:
JAVA:
for (int i = 0; i < users.size(); i++) {
UserDataBean udb = (UserDataBean) users.get(i);
String userName = ((String) udb.getUserName());
(userName)
}
Sure it does not compile - but why is it generated this way? I've been
using the same style of printing values in an other XSP which works fine...
Thanks for any help!
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / compiler error: Missing semicolon
Posted by "John L. Webber" <Jo...@jentro.com>.
What do you want to do with userName? If you just want to print the
value, something like System.out.println(<xsp:expr>userName</xsp:expr>);
will work.
Patrick Hess wrote:
>
> Can somebody tell what I'm doing wrong in this XSP (snippet):
>
> XSP:
>
> for (int i = 0; i < users.size(); i++) {
> UserDataBean udb = (UserDataBean) users.get(i);
> String userName = ((String) udb.getUserName());
> <xsp:expr>userName</xsp:expr>
> }
>
>
>
> Sure it does not compile - but why is it generated this way? I've been
> using the same style of printing values in an other XSP which works
> fine...
>
--
---------------------------------------------------------
Jentro Technologies GmbH
John L. Webber, Software Development
---------------------------------------------------------
Rosenheimer Str. 145e 81671 München
Tel. +49 700 881 199 88 mailto:John.Webber@jentro.com
Fax +49 700 881 199 88 http://www.jentro.com
---------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / compiler error: Missing semicolon
Posted by Ugo Cei <u....@cbim.it>.
Patrick Hess wrote:
> <a href="#"><xsp:expr>userName</xsp:expr></a>
>
> How to create a href including the "userName" variable
> like <a href="mypage?user=bob_foo">bob_foo</a>
<a><xsp:attribute
name="href">mypage?user=<xsp:expr>userName</xsp:expr>
</xsp:attribute><xsp:expr>userName</xsp:expr></a>
HTH
Ugo
--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / creating a link
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Patrick Hess dijo:
> Antonio Gallardo wrote:
>
>> <a>
>> <xsp:attribute
>> name="href">#?<xsp:expr>userName</xsp:expr></xsp:attribute>
>> <xsp:expr>userName</xsp:expr>
>> </a>
>
> Thanks again fr the answers! Would be nice to get such a quick and
> informative service from professional vendors like here on this list! :)
lol.
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / creating a link
Posted by Patrick Hess <po...@pbone.biz>.
Antonio Gallardo wrote:
> <a>
> <xsp:attribute name="href">#?<xsp:expr>userName</xsp:expr></xsp:attribute>
> <xsp:expr>userName</xsp:expr>
> </a>
Thanks again fr the answers! Would be nice to get such a quick and
informative service from professional vendors like here on this list! :)
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / creating a link
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Patrick Hess dijo:
> <a href="#"><xsp:expr>userName</xsp:expr></a>
> How to create a href including the "userName" variable
> like <a href="mypage?user=bob_foo">bob_foo</a>
<a>
<xsp:attribute name="href">#?<xsp:expr>userName</xsp:expr></xsp:attribute>
<xsp:expr>userName</xsp:expr>
</a>
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / compiler error: Missing semicolon
Posted by Patrick Hess <po...@pbone.biz>.
> Try this:
>
> for (int i = 0; i < users.size(); i++) {
> UserDataBean udb = (UserDataBean) users.get(i);
> String userName = ((String) udb.getUserName());
> </xsp:logic>
> <xsp:expr>userName</xsp:expr>
> <xsp:logic>
> }
> </xsp:logic>
Sorry, another stupid question:
<a href="#"><xsp:expr>userName</xsp:expr></a>
How to create a href including the "userName" variable
like <a href="mypage?user=bob_foo">bob_foo</a>
Thanks,
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / compiler error: Missing semicolon
Posted by Patrick Hess <po...@pbone.biz>.
Thanks Antonio, that works!
Pretty dump question... I see there is still a lot of work in learning
the basic... :-) But I love cocoon...
Patrick
Antonio Gallardo wrote:
> Try this:
>
> for (int i = 0; i < users.size(); i++) {
> UserDataBean udb = (UserDataBean) users.get(i);
> String userName = ((String) udb.getUserName());
> </xsp:logic>
> <xsp:expr>userName</xsp:expr>
> <xsp:logic>
> }
> </xsp:logic>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp:expr / compiler error: Missing semicolon
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Patrick Hess dijo:
>
> Can somebody tell what I'm doing wrong in this XSP (snippet):
>
> XSP:
>
> for (int i = 0; i < users.size(); i++) {
> UserDataBean udb = (UserDataBean) users.get(i);
> String userName = ((String) udb.getUserName());
> <xsp:expr>userName</xsp:expr>
> }
Try this:
for (int i = 0; i < users.size(); i++) {
UserDataBean udb = (UserDataBean) users.get(i);
String userName = ((String) udb.getUserName());
</xsp:logic>
<xsp:expr>userName</xsp:expr>
<xsp:logic>
}
</xsp:logic>
Best Regards,
Antonio Gallardo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org