Re: foreach Problem - Not iterating like expected...

2003-02-10 Thread Hunter Hillegas
Yeah, I figured it out. Thanks a lot for the response.

Hunter

> From: Martin Cooper <[EMAIL PROTECTED]>
> Reply-To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
> Date: Mon, 10 Feb 2003 23:00:19 -0800 (PST)
> To: Tag Libraries Users List <[EMAIL PROTECTED]>
> Subject: Re: foreach Problem - Not iterating like expected...
> 
> 
> 
> On Mon, 10 Feb 2003, Hunter Hillegas wrote:
> 
>> I have the following code:
>> 
>> <%
>> System.out.println("Start Page: " + startPage); //DEBUG
>> System.out.println("End Page: " + endPage); //DEBUG
>> %>
>> 
>> 
>> <%
>> System.out.println("Looping..."); //DEBUG
>> %>
>> 
>> 
>> When I run this code, I get the following values printed out for start and
>> end:
>> 
>> Start Page: 0
>> End Page: 42
>> 
>> But, the code only loops through one time, instead of looping all the times
>> I would expect... Shouldn't it be counting up through all iterations between
>> 0 and 42?
> 
> Nope. You are making a common mistake - assuming that scripting variables
> and scoped attributes are the same thing.
> 
> The 'startPage' and 'endPage' variables that you are displaying using
> System.out.println() are scripting variables. Scripting variables are not
> visible to the regular JSTL tags - those tags obtain their attribute
> values from scoped attributes (e.g. request or session attributes)
> instead.
> 
> To have your loop behave correctly, you'll need to set startPage and
> endPage as scoped attributes instead of scripting variables.
> 
> --
> Martin Cooper
> 
> 
>> 
>> If I replace the begin and end with 0 and 42 like this:
>> 
>> 
>> <%
>> System.out.println("Looping..."); //DEBUG
>> %>
>> 
>> 
>> Then it loops as I would expect.
>> 
>> What am I doing wrong?
>> 
>> Thanks,
>> Hunter
>> 
>> 
>> -
>> 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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: foreach Problem - Not iterating like expected...

2003-02-10 Thread Martin Cooper


On Mon, 10 Feb 2003, Hunter Hillegas wrote:

> I have the following code:
>
> <%
> System.out.println("Start Page: " + startPage); //DEBUG
> System.out.println("End Page: " + endPage); //DEBUG
> %>
>
> 
> <%
> System.out.println("Looping..."); //DEBUG
> %>
> 
>
> When I run this code, I get the following values printed out for start and
> end:
>
> Start Page: 0
> End Page: 42
>
> But, the code only loops through one time, instead of looping all the times
> I would expect... Shouldn't it be counting up through all iterations between
> 0 and 42?

Nope. You are making a common mistake - assuming that scripting variables
and scoped attributes are the same thing.

The 'startPage' and 'endPage' variables that you are displaying using
System.out.println() are scripting variables. Scripting variables are not
visible to the regular JSTL tags - those tags obtain their attribute
values from scoped attributes (e.g. request or session attributes)
instead.

To have your loop behave correctly, you'll need to set startPage and
endPage as scoped attributes instead of scripting variables.

--
Martin Cooper


>
> If I replace the begin and end with 0 and 42 like this:
>
> 
> <%
> System.out.println("Looping..."); //DEBUG
> %>
> 
>
> Then it loops as I would expect.
>
> What am I doing wrong?
>
> Thanks,
> Hunter
>
>
> -
> 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]




Xtag taglib and iso-8859-1 *** HELP ***

2003-02-10 Thread Dariush Behboudi
Hi everyone,
I've a problem applying xsl files to iso-8859-1 encoded xml files.
I'm using the xpath taglib.
Here my very simple jsp code:










And here my xsl file:


http://www.w3.org/1999/XSL/Transform";>


   



My CDATA results corrupted after parsing.
PLEASE HELP, Any suggestion is great.

Regards, Dariush.






Dariush Behboudi Resp.Software Engineering
Phone: +39 02 45441.238Mobile Phone: 335 1207222Fax: +39 02
[EMAIL PROTECTED] Interactive Spa
  GRUPPO DATASERVICE
  Via Negroli, 35
  20133 Milano (Italy)








Re: more forEach woes

2003-02-10 Thread Hans Bergsten
Felipe Schnack wrote:

  It was that!
  what is this runtime taglib??


The RT libraries support Java expressions instead of EL expressions,
e.g. '<= request.getParameter("foo") %> instead of "${param.foo}".
But seriously, you can avoid a lot of problems by reading a bit
about JSTL before you use it. Sun's JSTL pages has lots of resources:

  

Hans


On Mon, 2003-02-10 at 18:55, Hans Bergsten wrote:


Felipe Schnack wrote:


 I must have a serious problem here... I can't make this work:


 



 It simply prints "{$i}" 20 times


It looks like you're using the RT library, not the EL library.
Check your taglib directive. You should use the uri
"http://java.sun.com/jstl/core"; for the EL library.

Hans
--
Hans Bergsten<[EMAIL PROTECTED]>
Gefion Software   
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--
Hans Bergsten<[EMAIL PROTECTED]>
Gefion Software   
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: more forEach woes

2003-02-10 Thread Felipe Schnack
  It was that!
  what is this runtime taglib??

On Mon, 2003-02-10 at 18:55, Hans Bergsten wrote:
> Felipe Schnack wrote:
> >   I must have a serious problem here... I can't make this work:
> > 
> > 
> >   
> > 
> > 
> > 
> >   It simply prints "{$i}" 20 times
> 
> It looks like you're using the RT library, not the EL library.
> Check your taglib directive. You should use the uri
> "http://java.sun.com/jstl/core"; for the EL library.
> 
> Hans
> -- 
> Hans Bergsten<[EMAIL PROTECTED]>
> Gefion Software   
> Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
> Details at
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: more forEach woes

2003-02-10 Thread Hans Bergsten
Felipe Schnack wrote:

  I must have a serious problem here... I can't make this work:


  



  It simply prints "{$i}" 20 times


It looks like you're using the RT library, not the EL library.
Check your taglib directive. You should use the uri
"http://java.sun.com/jstl/core"; for the EL library.

Hans
--
Hans Bergsten<[EMAIL PROTECTED]>
Gefion Software   
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: more forEach woes

2003-02-10 Thread Larry Zappeterrini
Are you using the runtime version of the common taglib? That is what this
problem sounds like...

-Original Message-
From: Felipe Schnack [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 3:43 PM
To: [EMAIL PROTECTED]
Subject: more forEach woes


  I must have a serious problem here... I can't make this work:


  



  It simply prints "{$i}" 20 times

-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


*** 
This electronic mail transmission contains confidential and/or privileged 
information intended only for the person(s) named.  Any use, distribution, 
copying or disclosure by another person is strictly prohibited. 
*** 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




more forEach woes

2003-02-10 Thread Felipe Schnack
  I must have a serious problem here... I can't make this work:


  



  It simply prints "{$i}" 20 times

-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: oh, my

2003-02-10 Thread Felipe Schnack
  don't work...
  and this is strange... now I took off this line from my jsp and added
this one:
  
  What I get printed is "${param.txtQuestoes}"

On Mon, 2003-02-10 at 18:16, Jerome Jacobsen wrote:
> The 'begin' attribute expects an expression.
> I think this should work.
> 
> 
> 
> 
> > -Original Message-
> > From: Felipe Schnack [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 10, 2003 3:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: oh, my
> >
> >
> >   I guess I need an "extremely dummy user guide to JSTL". I'm making a
> > request to a JSP much like
> >   http://localhost:8080/test.jsp?number=5
> >   So, why this doesn't work:
> >   
> >   
> > --
> >
> > Felipe Schnack
> > Analista de Sistemas
> > [EMAIL PROTECTED]
> > Cel.: (51)91287530
> > Linux Counter #281893
> >
> > Centro Universitário Ritter dos Reis
> > http://www.ritterdosreis.br
> > [EMAIL PROTECTED]
> > Fone/Fax.: (51)32303341
> >
> >
> > -
> > 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]
> 
-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: oh, my

2003-02-10 Thread Jerome Jacobsen
The 'begin' attribute expects an expression.
I think this should work.




> -Original Message-
> From: Felipe Schnack [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 10, 2003 3:04 PM
> To: [EMAIL PROTECTED]
> Subject: oh, my
>
>
>   I guess I need an "extremely dummy user guide to JSTL". I'm making a
> request to a JSP much like
>   http://localhost:8080/test.jsp?number=5
>   So, why this doesn't work:
>   
>   
> --
>
> Felipe Schnack
> Analista de Sistemas
> [EMAIL PROTECTED]
> Cel.: (51)91287530
> Linux Counter #281893
>
> Centro Universitário Ritter dos Reis
> http://www.ritterdosreis.br
> [EMAIL PROTECTED]
> Fone/Fax.: (51)32303341
>
>
> -
> 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: oh, my

2003-02-10 Thread Felipe Schnack
  oh, sorry... it's a compilation error

java.lang.NumberFormatException: For input string: "${1}"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Integer.valueOf(Integer.java:532)
at
org.apache.jasper.compiler.Generator$GenerateVisitor.convertString(Generator.java:1777)
at
org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:1715)
at
org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:1337)
at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1173)


On Mon, 2003-02-10 at 18:11, Shawn Bayern wrote:
> On 10 Feb 2003, Felipe Schnack wrote:
> 
> >   I guess I need an "extremely dummy user guide to JSTL". I'm making a
> > request to a JSP much like 
> >   http://localhost:8080/test.jsp?number=5
> >   So, why this doesn't work:
> >   
> >   
> 
> What have you put inside the loop, and how is it failing?
> 
> -- 
> Shawn Bayern
> "JSTL in Action"   http://www.manning.com/bayern
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: oh, my

2003-02-10 Thread Shawn Bayern
On 10 Feb 2003, Felipe Schnack wrote:

>   I guess I need an "extremely dummy user guide to JSTL". I'm making a
> request to a JSP much like 
>   http://localhost:8080/test.jsp?number=5
>   So, why this doesn't work:
>   
>   

What have you put inside the loop, and how is it failing?

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




oh, my

2003-02-10 Thread Felipe Schnack
  I guess I need an "extremely dummy user guide to JSTL". I'm making a
request to a JSP much like 
  http://localhost:8080/test.jsp?number=5
  So, why this doesn't work:
  
  
-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303341


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




foreach Problem - Not iterating like expected...

2003-02-10 Thread Hunter Hillegas
I have the following code:

<%
System.out.println("Start Page: " + startPage); //DEBUG
System.out.println("End Page: " + endPage); //DEBUG
%>


<%
System.out.println("Looping..."); //DEBUG
%>


When I run this code, I get the following values printed out for start and
end:

Start Page: 0
End Page: 42

But, the code only loops through one time, instead of looping all the times
I would expect... Shouldn't it be counting up through all iterations between
0 and 42?

If I replace the begin and end with 0 and 42 like this:


<%
System.out.println("Looping..."); //DEBUG
%>


Then it loops as I would expect.

What am I doing wrong?

Thanks,
Hunter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




access to nested objects

2003-02-10 Thread John C Cartwright
Hello All,

can someone clarify for me how to use an expression to get to a nested 
field in a bean.  For example, I have a bean "mapserviceDetailForm" with 
a method that returns another bean "service", and I want to reference 
the "name" field within the "service" bean.

I was trying variations on:


value="${mapserviceDetailForm.service.name}"/>

Can someone clarify for me?

Thanks!

-- john



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: pushBody() and popBody() problems in BodyTag

2003-02-10 Thread Kishi Mikio
From: Kishi Mikio <[EMAIL PROTECTED]>
Subject: pushBody() and popBody() problems in BodyTag
Date: Thu, 06 Feb 2003 21:21:31 +0900 (JST)

> 
>   
>   <% if (true) return; %>
> 
> 
> In above case, I want to print out "test1", but not print out
> Is it possible to print out string
> between  and "return" ?

In order to solve this problem, I implemented  tag.
The following code is doEndTag() in the .

public int doEndTag()
throws JspException {
try {
BodyContent body = (BodyContent) pageContext.getOut();
try {
while (true) {
JspWriter writer = pageContext.popBody();
body.writeOut(writer);
body = (BodyContent) writer;
}
} catch (EmptyStackException e) {
// nothing to do
}
} catch (Exception e) {
e.printStackTrace();
throw new JspException(e.toString());
}
return SKIP_PAGE;
}

By using this tag, it became possible to display "test1" string.
But is this the best method ? Is this popBody() usage wrong ?
Is there any other better method ?

Thanks in advance
Mikio Kishi


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Typecasting the variable inside a c:foreach-loop

2003-02-10 Thread Shawn Bayern
On Mon, 10 Feb 2003, Sakke Wiik wrote:

> I have a loop where I need to cast the looped objects if
> they are of a certain type.
> Can someone explain me if it's possible with any standard tags,
> or how I could get hold of the storageObject object through some
> java-code?
> 
> Here's the loop:
> 
> 
>   
> Need to cast here <% TypeB typeB = anObject.typeB %>
>   
> 

Java code can refer to the scoped attribute as

 pageContext.findAttribute("anObject");

To get "typeB," you'd need to cast anObject to the appropriate type and
then call getTypeB().

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Broken resource bundle selection algorithm in JSTL and I18N?

2003-02-10 Thread Johann Uhrmann
Hi,

there seems to be a bug in the resource bundle selection algorithm of
JSTL 1.0.2 and I18N (nightly build from Feb 7 2003) (do they have the 
same code base?).

The libraries read the requested language from the first request they 
get. After that first request, the browser locale seems to be discarded
and all replies are generated with the locale from the first request.
The locale seems to be in application scope instead of request or page
scope.

Can anyone confirm that behaviour?

More information can be found at
http://issues.apache.org/bugzilla/show_bug.cgi?id=16849

By the way, Struts does not show that behaviour. It always replies with
the locale provided by the browser.

Kind regards,

Hans


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Typecasting the variable inside a c:foreach-loop

2003-02-10 Thread Sakke Wiik
I have a loop where I need to cast the looped objects if
they are of a certain type.
Can someone explain me if it's possible with any standard tags,
or how I could get hold of the storageObject object through some
java-code?

Here's the loop:


  
Need to cast here <% TypeB typeB = anObject.typeB %>
  





cheers,
Sakke Wiik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]