You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukasz Lenart <lu...@googlemail.com> on 2009/05/07 17:57:12 UTC
Re: Please help! Struts 2/Eclipse - List Object is not displaying in
JSP
2009/5/7 SofIAm <so...@yahoo.com>:
> public String getAllEmployees() {
This method is never called, renamed it to execute() and should be ok
Regards
--
Lukasz
http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying
in JSP
Posted by Timothy Orme <to...@genome.med.harvard.edu>.
This is actually not correct, he defined the method as "getAllEmployees" in his struts.xml
That said, I'm not sure of the default behavior of the s:property tag. Have you tried something like s:property value="top"?
I'm not huge on the struts tag libs, but this would be the first place I'd look, at a quick glance your action setup looks fine.
Have you tried setting a breakpoint on the getter action to see that the list is actually populated?
-Tim
Lukasz Lenart wrote:
> 2009/5/7 SofIAm <so...@yahoo.com>:
>> public String getAllEmployees() {
>
> This method is never called, renamed it to execute() and should be ok
>
>
> Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying
in JSP
Posted by SofIAm <so...@yahoo.com>.
That's great! I'll look into that. Thanks again.
Jim Kiley wrote:
>
> The checkstyle, FindBugs, or PMD plugin does this for sure.
>
> On Thu, May 7, 2009 at 8:50 PM, Dave Newton <ne...@yahoo.com> wrote:
>
>> SofIAm wrote:
>>
>>> Thank YOU ALL! What a dumb JAVA 101 mistake! I was never populating the
>>> class
>>> member variable myList, but the local one in my method, unintentionally
>>> of
>>> course. DUH!!! It's working like a charm! Thanks again!!!!!
>>>
>>
>> There is a warning available in Eclipse to notify you when a local
>> variable
>> shadows a property. (I think.)
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>
>
--
View this message in context: http://www.nabble.com/Please-help%21-Struts-2-Eclipse---List-Object-is-not-displaying-in-JSP-tp23429087p23444897.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying in
JSP
Posted by Jim Kiley <jh...@summa-tech.com>.
The checkstyle, FindBugs, or PMD plugin does this for sure.
On Thu, May 7, 2009 at 8:50 PM, Dave Newton <ne...@yahoo.com> wrote:
> SofIAm wrote:
>
>> Thank YOU ALL! What a dumb JAVA 101 mistake! I was never populating the
>> class
>> member variable myList, but the local one in my method, unintentionally of
>> course. DUH!!! It's working like a charm! Thanks again!!!!!
>>
>
> There is a warning available in Eclipse to notify you when a local variable
> shadows a property. (I think.)
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com
Re: Please help! Struts 2/Eclipse - List Object is not displaying
in JSP
Posted by Dave Newton <ne...@yahoo.com>.
SofIAm wrote:
> Thank YOU ALL! What a dumb JAVA 101 mistake! I was never populating the class
> member variable myList, but the local one in my method, unintentionally of
> course. DUH!!! It's working like a charm! Thanks again!!!!!
There is a warning available in Eclipse to notify you when a local
variable shadows a property. (I think.)
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying
in JSP
Posted by SofIAm <so...@yahoo.com>.
Thank YOU ALL! What a dumb JAVA 101 mistake! I was never populating the class
member variable myList, but the local one in my method, unintentionally of
course. DUH!!! It's working like a charm! Thanks again!!!!!
Timothy Orme wrote:
>
> Ah good catch, this is whats causing it. Although as I said, you dont need
> to rename the method if you've setup your struts.xml as it is.
>
> Jim Kiley wrote:
>> Even then it won't be OK. The OP is declaring myList as a local variable
>> in
>> getAllEmployees(), so getMyList won't return it. Change the line
>> "List<String>
>> myList = new ArrayList<String>();" in getAllEmployees() to just be
>> "myList =
>> new ArrayList<String>();" and do as Lukasz suggests and you should be OK.
>> jk
>>
>> On Thu, May 7, 2009 at 11:57 AM, Lukasz Lenart
>> <lukasz.lenart@googlemail.com
>>> wrote:
>>
>>> 2009/5/7 SofIAm <so...@yahoo.com>:
>>>> public String getAllEmployees() {
>>> This method is never called, renamed it to execute() and should be ok
>>>
>>>
>>> Regards
>>> --
>>> Lukasz
>>> http://www.lenart.org.pl/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Please-help%21-Struts-2-Eclipse---List-Object-is-not-displaying-in-JSP-tp23429087p23430437.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying
in JSP
Posted by Timothy Orme <to...@genome.med.harvard.edu>.
Ah good catch, this is whats causing it. Although as I said, you dont need to rename the method if you've setup your struts.xml as it is.
Jim Kiley wrote:
> Even then it won't be OK. The OP is declaring myList as a local variable in
> getAllEmployees(), so getMyList won't return it. Change the line "List<String>
> myList = new ArrayList<String>();" in getAllEmployees() to just be "myList =
> new ArrayList<String>();" and do as Lukasz suggests and you should be OK.
> jk
>
> On Thu, May 7, 2009 at 11:57 AM, Lukasz Lenart <lukasz.lenart@googlemail.com
>> wrote:
>
>> 2009/5/7 SofIAm <so...@yahoo.com>:
>>> public String getAllEmployees() {
>> This method is never called, renamed it to execute() and should be ok
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Please help! Struts 2/Eclipse - List Object is not displaying in
JSP
Posted by Jim Kiley <jh...@summa-tech.com>.
Even then it won't be OK. The OP is declaring myList as a local variable in
getAllEmployees(), so getMyList won't return it. Change the line "List<String>
myList = new ArrayList<String>();" in getAllEmployees() to just be "myList =
new ArrayList<String>();" and do as Lukasz suggests and you should be OK.
jk
On Thu, May 7, 2009 at 11:57 AM, Lukasz Lenart <lukasz.lenart@googlemail.com
> wrote:
> 2009/5/7 SofIAm <so...@yahoo.com>:
> > public String getAllEmployees() {
>
> This method is never called, renamed it to execute() and should be ok
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com