You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Paul DuBois <pa...@snake.net> on 2002/05/20 22:51:27 UTC

[JSTL] Possible to use dot notation in lvalues?

I'm curious whether it's possible to use dotted names as lvalues in
JSTL tags.

For example, I can increment a session counter like this:

<c:set var="count" scope="session" value="${sessionScope.count + 1}" />

But this appears not to be equivalent:

<c:set var="sessionScope.count" value="${sessionScope.count + 1}" />

 From that, I infer that dot notation works only within ${...} ?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Debuging when using JSTL

Posted by Roman Kapshevich <ro...@ucapital.ru>.
Hello!

For example forEach tag output the following error:

javax.servlet.jsp.JspException: An error occurred while evaluating

custom action attribute "items" with value "${cat.topLevel.rows}":

An error occurred while getting property "topLevel" from an instance of
class e_ectaco.Catalogue



At this point I only know that error occupier in Catalogue.getTopLevel(),
but original

error msg and stack trace not available. I can't easy figure why error
occupier. What techniques

Can I use to debug code which use mix of JavaBeans and JSP with JSTL tags?



What you can recommend for form processing error handling? For example form
submitted and <jsp:setProperty name="order" property="*"/> called to process
form. How to return error back to JSP level (null fields, wrong values).
Throw the exception? Provide special method? Anything else?



Thank you in advance!


Best regards,
Roman Kapshevich
ICQ 2032093



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [JSTL] Possible to use dot notation in lvalues?

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 20 May 2002, Paul DuBois wrote:

> Thanks!
> 
> By "now lets you perform ..." do you mean in beta2, or in more recent
> nightly builds?  (I just tried it with beta2 and got an
> UnsupportedOperationException.)

I don't believe it was fully implemented in Beta2; try one of the recent
nightly builds.  However, I don't ever remember a situation that would
lead to an UnsupportedOperationException; if you continue to get it,
sending along a full page would be helpful.  Thanks!

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [JSTL] Possible to use dot notation in lvalues?

Posted by Paul DuBois <pa...@snake.net>.
>On Mon, 20 May 2002, Paul DuBois wrote:
>
>>  I'm curious whether it's possible to use dotted names as lvalues in
>>  JSTL tags.
>
>I assume you mean, "can you assign to them?"

Right, exactly.

>  Not as such.  But <c:set>
>now lets you perform the assignment you're looking for.  Instead of this:
>
>>  <c:set var="sessionScope.count" value="${sessionScope.count + 1}" />
>
>you would write this:
>
>   <c:set
>      target="${sessionScope}"
>      property="count"
>      value="${sessionScope.count + 1}">
>
>You're right that the 'dot notation' works only in ${...}.

Thanks!

By "now lets you perform ..." do you mean in beta2, or in more recent
nightly builds?  (I just tried it with beta2 and got an
UnsupportedOperationException.)

>
>--
>Shawn Bayern
>"JSP Standard Tag Library"   http://www.jstlbook.com
>(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [JSTL] Possible to use dot notation in lvalues?

Posted by Shawn Bayern <ba...@essentially.net>.
On Mon, 20 May 2002, Paul DuBois wrote:

> I'm curious whether it's possible to use dotted names as lvalues in
> JSTL tags.

I assume you mean, "can you assign to them?"  Not as such.  But <c:set>
now lets you perform the assignment you're looking for.  Instead of this:

> <c:set var="sessionScope.count" value="${sessionScope.count + 1}" />

you would write this:

  <c:set
     target="${sessionScope}"
     property="count"
     value="${sessionScope.count + 1}">

You're right that the 'dot notation' works only in ${...}.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>