You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sloan Seaman <sl...@sgi.net> on 2003/03/02 19:39:29 UTC

c:out

I have a variable in the session named:
com.symbol.mobilecommerce.analysis.SESSION_USER

I want to get the object via c:out and use it in a JSP page.
When I have the variable just named SESSION_USER it works fine.
Example (note core:out = c:out)
Greetings
<core:out value="${sessionScope.SESSION_USER.firstName}"/>
<core:out value="${sessionScope.SESSION_USER.lastName}"/>.

But if I try:
Greetings
<core:out
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
ame}"/>
<core:out
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
me}"/>.

It doesn't work.

I know this is because c:out is trying to call the object com and then the
getter symbol and so on.

How do I get around this so that it works?

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: c:out

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Sloan" == Sloan Seaman <sl...@sgi.net> writes:

    Sloan> I have a variable in the session named:
    Sloan> com.symbol.mobilecommerce.analysis.SESSION_USER

    Sloan> I want to get the object via c:out and use it in a JSP page.
    Sloan> When I have the variable just named SESSION_USER it works fine.
    Sloan> Example (note core:out = c:out)
    Sloan> Greetings
    Sloan> <core:out value="${sessionScope.SESSION_USER.firstName}"/>
    Sloan> <core:out value="${sessionScope.SESSION_USER.lastName}"/>.

    Sloan> But if I try:
    Sloan> Greetings
    Sloan> <core:out
    Sloan> value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
    Sloan> ame}"/>
    Sloan> <core:out
    Sloan> value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
    Sloan> me}"/>.

    Sloan> It doesn't work.

    Sloan> I know this is because c:out is trying to call the object com and then the
    Sloan> getter symbol and so on.

    Sloan> How do I get around this so that it works?

Try:

value='${sessionScope["com.symbol.mobilecommerce.analysis.SESSION_USER"].firstName}'


-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:out

Posted by Sloan Seaman <sl...@sgi.net>.
Good guess... it worked ;)

Thanks!

--
Sloan

----- Original Message -----
From: "Joseph Fifield" <jf...@programmerplanet.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, March 02, 2003 1:52 PM
Subject: Re: c:out


> This is just a guess...did you try:
>
> sessionScope['com.symbol.mobilecommerce.analysis.SESSION_USER'].lastName
>
> Joe
>
> ----- Original Message -----
> From: "Sloan Seaman" <sl...@sgi.net>
> To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> Cc: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Sunday, March 02, 2003 1:39 PM
> Subject: c:out
>
>
> > I have a variable in the session named:
> > com.symbol.mobilecommerce.analysis.SESSION_USER
> >
> > I want to get the object via c:out and use it in a JSP page.
> > When I have the variable just named SESSION_USER it works fine.
> > Example (note core:out = c:out)
> > Greetings
> > <core:out value="${sessionScope.SESSION_USER.firstName}"/>
> > <core:out value="${sessionScope.SESSION_USER.lastName}"/>.
> >
> > But if I try:
> > Greetings
> > <core:out
> >
>
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
> > ame}"/>
> > <core:out
> >
>
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
> > me}"/>.
> >
> > It doesn't work.
> >
> > I know this is because c:out is trying to call the object com and then
the
> > getter symbol and so on.
> >
> > How do I get around this so that it works?
> >
> > Thanks!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: c:out

Posted by Joseph Fifield <jf...@programmerplanet.org>.
This is just a guess...did you try:

sessionScope['com.symbol.mobilecommerce.analysis.SESSION_USER'].lastName

Joe

----- Original Message -----
From: "Sloan Seaman" <sl...@sgi.net>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Cc: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, March 02, 2003 1:39 PM
Subject: c:out


> I have a variable in the session named:
> com.symbol.mobilecommerce.analysis.SESSION_USER
>
> I want to get the object via c:out and use it in a JSP page.
> When I have the variable just named SESSION_USER it works fine.
> Example (note core:out = c:out)
> Greetings
> <core:out value="${sessionScope.SESSION_USER.firstName}"/>
> <core:out value="${sessionScope.SESSION_USER.lastName}"/>.
>
> But if I try:
> Greetings
> <core:out
>
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
> ame}"/>
> <core:out
>
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
> me}"/>.
>
> It doesn't work.
>
> I know this is because c:out is trying to call the object com and then the
> getter symbol and so on.
>
> How do I get around this so that it works?
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: jstl & dataSource

Posted by Ivonne Barrantes <ib...@ods.co.cr>.
I've had that same problem a few days ago.

Besides the code you already typed (which seems to be ok) you will need to 
have:

1)  The library (.jar) under your JSP container's specific sub directory
         (e.g.  d:\tomcat\common\lib).  Not on your application (so it 
works from any other application you want to create on the future)

2) A .xml file (named exactly the same as your context with the 
specification of your connection.

<Resource name="jdbc/DailyUsers" auth="Container" 
type="javax.sql.DataSource" />
<ResourceParams name="jdbc/DailyUsers">
         <parameter>
                 <name>factory</name>
                 <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
         <parameter>
                 <name>driverClassName</name>
                 <value>org.postgresql.Driver</value>
         </parameter>
         <parameter>
                 <name>url</name>
                 <value>jdbc:postgresql://localhost:5432/users</value>
         </parameter>
         <parameter>
                 <name>username</name>
                 <value>abcdef</value>
         </parameter>
         <parameter>
                 <name>password</name>
                 <value>123456789</value>
         </parameter>
         <parameter>
                 <name>maxActive</name>
                 <value>20</value>
         </parameter>
         <parameter>
                 <name>maxIdle</name>
                 <value>10</value>
         </parameter>
         <parameter>
                 <name>maxWait</name>
                 <value>-1</value>
         </parameter>
</ResourceParams>


This examples uses a postgres jdbc,  you might change drivers & stuff for 
your own jdbc.

Good look!!!

jstl & dataSource

Posted by Lorenzo Sicilia <ar...@kemen.it>.
hi,

I had try to use dataSource in sql TAG but...

"Unable to get COnnection, Datasource ivalid:'no suitable driver' "

It is strage because in another application (Flash Remoting) I use the 
same driver perfectly.

I work with
JRUN4 and Apache 2.44 on windowsXP (staging) jvm 1.4.1
JRUN4 ang Apache 2.40 LInux (production) jvm 1.4.1


my script:

1)
<sql:setDataSource
dataSource="aosta" scope="request" />

<sql:query var="test" dataSource="aosta" >
SELECT *
FROM users
</sql:query>

<c:forEach items="${test.rows}" var="row">
<c:out value="${row.username}"/>
</c:forEach>

2)
<sql:query var="test" dataSource="aosta" >
SELECT *
FROM users
</sql:query>

<c:forEach items="${test.rows}" var="row">
<c:out value="${row.username}"/>
</c:forEach>


Both don't work :o(

Some one can help me?

thanks in advance

Lorenzo Sicilia


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:out

Posted by Sloan Seaman <sl...@sgi.net>.
That works... thanks!

----- Original Message -----
From: "Henri Yandell" <ba...@generationjava.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Cc: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, March 02, 2003 3:09 PM
Subject: Re: c:out


>
> I'm just guessing, based on frequent other answers to the list, but have
> you tried:
>
>
${sessionScope['com.symbol.mobilecommerce.analysis.SESSION_USER'].firstName}
>
>
> Hen
>
> On Sun, 2 Mar 2003, Sloan Seaman wrote:
>
> > I have a variable in the session named:
> > com.symbol.mobilecommerce.analysis.SESSION_USER
> >
> > I want to get the object via c:out and use it in a JSP page.
> > When I have the variable just named SESSION_USER it works fine.
> > Example (note core:out = c:out)
> > Greetings
> > <core:out value="${sessionScope.SESSION_USER.firstName}"/>
> > <core:out value="${sessionScope.SESSION_USER.lastName}"/>.
> >
> > But if I try:
> > Greetings
> > <core:out
> >
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
> > ame}"/>
> > <core:out
> >
value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
> > me}"/>.
> >
> > It doesn't work.
> >
> > I know this is because c:out is trying to call the object com and then
the
> > getter symbol and so on.
> >
> > How do I get around this so that it works?
> >
> > Thanks!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: c:out

Posted by Henri Yandell <ba...@generationjava.com>.
I'm just guessing, based on frequent other answers to the list, but have
you tried:

${sessionScope['com.symbol.mobilecommerce.analysis.SESSION_USER'].firstName}


Hen

On Sun, 2 Mar 2003, Sloan Seaman wrote:

> I have a variable in the session named:
> com.symbol.mobilecommerce.analysis.SESSION_USER
>
> I want to get the object via c:out and use it in a JSP page.
> When I have the variable just named SESSION_USER it works fine.
> Example (note core:out = c:out)
> Greetings
> <core:out value="${sessionScope.SESSION_USER.firstName}"/>
> <core:out value="${sessionScope.SESSION_USER.lastName}"/>.
>
> But if I try:
> Greetings
> <core:out
> value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN
> ame}"/>
> <core:out
> value="${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa
> me}"/>.
>
> It doesn't work.
>
> I know this is because c:out is trying to call the object com and then the
> getter symbol and so on.
>
> How do I get around this so that it works?
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org