You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by RogerV <ro...@googlemail.com> on 2009/10/08 11:46:05 UTC

Struts 2 tag

Could someone correct my syntax please - I can't get this to work at all.

<s:if test="<s:property value="value[#parameter.index].type"/>=='ENUM'">
....
</s:if>

I keep getting a JasperException; equal symbol expected

Regards
-- 
View this message in context: http://www.nabble.com/Struts-2-%3Cs%3Aif%3E-tag-tp25801138p25801138.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: Struts 2 tag

Posted by Gregor Marinšek <gm...@tis.si>.
Yes. Typo .....

Thank you.

Gregor

Dale Newfield wrote:
> Gregor Marinšek wrote:
> > <s:if test="%{parameter.index.type}=='ENUM'">
>
> I assume you meant: "%{parameter.index.type=='ENUM'}"
>
> -Dale
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


-- 
Gregor Marinšek


TIS d.o.o.
Ljubljanska 9, Maribor
e-mail: gmarinsek@tis.si
http://www.tis.si

GSM: (+386) 040 730 015

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


RE: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Posted by James Cook <Ja...@wecomm.com>.
Excellent.

Thank you musachy and thanks Brian.
:)

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: 08 October 2009 19:44
To: Struts Users Mailing List
Subject: Re: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

different applications have different classpaths, so they are
isolated, unless you put the classes in a shared dir, like tomcat
shared lib dir, in that case there would be some mixing, unless you
create package locators for them. Btw i just merged a patch into trunk
that should take care of those exceptions:

https://issues.apache.org/struts/browse/WW-3234

Thanks to Brian Ferris for it.

musachy

On Thu, Oct 8, 2009 at 11:10 AM, James Cook <Ja...@wecomm.com> wrote:
> Hi, thank you very much for your response...
>
> The exceptions don't really bother me, it is just we deployed an app onto a domain with 5 other apps and it just trawled through all their packages.
>
> This does however beg the question. What would have happened if I had another S2 app on the domain and that scanning actually picked up valid actions? Would my app actually be able to see them e.g. from the config-browser and would this affect the operation?
>
> Thanks again
>
> James
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@gmail.com]
> Sent: 08 October 2009 18:59
> To: Struts Users Mailing List
> Subject: Re: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2
>
> Those exceptions are annoying, but they can be ignored. There are
> multiple settings for scanning, like not scanning jars, which you can
> play with.
>
> musachy
>
> On Thu, Oct 8, 2009 at 10:19 AM, James Cook <Ja...@wecomm.com> wrote:
>> Hi All,
>>
>> I did ask this question before but never received an answer, I do
>> understand that this is quite complex problem. However I thought I would
>> ask again in case anyone else has come across this...
>>
>> When I use the Convention plugin with Spring and Glassfish, upon deploy
>> of the resulting WAR the Convention plugin scans all the packages that
>> are in the /applications/j2ee-modules of the given domain.
>>
>> This is seen in the server log of the Glassfish e.g.
>>
>> [#|2009-10-08T14:24:09.106+0100|WARNING|sun-appserver9.1|javax.enterpris
>> e.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=00746e6a-87
>> 1e-4a90-b155-92d8b81b942b;|
>> java.lang.Exception: Could not load
>> domains/domain3/applications/j2ee-modules/OtherApp/WEB-INF/classes/com/o
>> ther/package/SubmissionThread.class
>>        at
>> com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder
>> .java:745)
>>        at
>> com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
>> 148)
>>        at
>> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findAction
>> s(PackageBasedActionConfigBuilder.java:295)
>>        at
>> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio
>> nConfigs(PackageBasedActionConfigBuilder.java:277)
>>
>> OtherApp is another application I have installed on the same domain.
>>
>> Is this a bug with convention? I am using default settings and when I
>> get the chance I plan on adding
>>
>> struts.convention.package.locators.basePackage to be my com.myApp.stuff
>> to see if this restricts this...
>>
>> Any help would be very much appreciated.
>>
>> James
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
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: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Posted by Musachy Barroso <mu...@gmail.com>.
different applications have different classpaths, so they are
isolated, unless you put the classes in a shared dir, like tomcat
shared lib dir, in that case there would be some mixing, unless you
create package locators for them. Btw i just merged a patch into trunk
that should take care of those exceptions:

https://issues.apache.org/struts/browse/WW-3234

Thanks to Brian Ferris for it.

musachy

On Thu, Oct 8, 2009 at 11:10 AM, James Cook <Ja...@wecomm.com> wrote:
> Hi, thank you very much for your response...
>
> The exceptions don't really bother me, it is just we deployed an app onto a domain with 5 other apps and it just trawled through all their packages.
>
> This does however beg the question. What would have happened if I had another S2 app on the domain and that scanning actually picked up valid actions? Would my app actually be able to see them e.g. from the config-browser and would this affect the operation?
>
> Thanks again
>
> James
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@gmail.com]
> Sent: 08 October 2009 18:59
> To: Struts Users Mailing List
> Subject: Re: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2
>
> Those exceptions are annoying, but they can be ignored. There are
> multiple settings for scanning, like not scanning jars, which you can
> play with.
>
> musachy
>
> On Thu, Oct 8, 2009 at 10:19 AM, James Cook <Ja...@wecomm.com> wrote:
>> Hi All,
>>
>> I did ask this question before but never received an answer, I do
>> understand that this is quite complex problem. However I thought I would
>> ask again in case anyone else has come across this...
>>
>> When I use the Convention plugin with Spring and Glassfish, upon deploy
>> of the resulting WAR the Convention plugin scans all the packages that
>> are in the /applications/j2ee-modules of the given domain.
>>
>> This is seen in the server log of the Glassfish e.g.
>>
>> [#|2009-10-08T14:24:09.106+0100|WARNING|sun-appserver9.1|javax.enterpris
>> e.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=00746e6a-87
>> 1e-4a90-b155-92d8b81b942b;|
>> java.lang.Exception: Could not load
>> domains/domain3/applications/j2ee-modules/OtherApp/WEB-INF/classes/com/o
>> ther/package/SubmissionThread.class
>>        at
>> com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder
>> .java:745)
>>        at
>> com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
>> 148)
>>        at
>> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findAction
>> s(PackageBasedActionConfigBuilder.java:295)
>>        at
>> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio
>> nConfigs(PackageBasedActionConfigBuilder.java:277)
>>
>> OtherApp is another application I have installed on the same domain.
>>
>> Is this a bug with convention? I am using default settings and when I
>> get the chance I plan on adding
>>
>> struts.convention.package.locators.basePackage to be my com.myApp.stuff
>> to see if this restricts this...
>>
>> Any help would be very much appreciated.
>>
>> James
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> 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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Posted by James Cook <Ja...@wecomm.com>.
Hi, thank you very much for your response...

The exceptions don't really bother me, it is just we deployed an app onto a domain with 5 other apps and it just trawled through all their packages. 

This does however beg the question. What would have happened if I had another S2 app on the domain and that scanning actually picked up valid actions? Would my app actually be able to see them e.g. from the config-browser and would this affect the operation?

Thanks again

James

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: 08 October 2009 18:59
To: Struts Users Mailing List
Subject: Re: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Those exceptions are annoying, but they can be ignored. There are
multiple settings for scanning, like not scanning jars, which you can
play with.

musachy

On Thu, Oct 8, 2009 at 10:19 AM, James Cook <Ja...@wecomm.com> wrote:
> Hi All,
>
> I did ask this question before but never received an answer, I do
> understand that this is quite complex problem. However I thought I would
> ask again in case anyone else has come across this...
>
> When I use the Convention plugin with Spring and Glassfish, upon deploy
> of the resulting WAR the Convention plugin scans all the packages that
> are in the /applications/j2ee-modules of the given domain.
>
> This is seen in the server log of the Glassfish e.g.
>
> [#|2009-10-08T14:24:09.106+0100|WARNING|sun-appserver9.1|javax.enterpris
> e.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=00746e6a-87
> 1e-4a90-b155-92d8b81b942b;|
> java.lang.Exception: Could not load
> domains/domain3/applications/j2ee-modules/OtherApp/WEB-INF/classes/com/o
> ther/package/SubmissionThread.class
>        at
> com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder
> .java:745)
>        at
> com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
> 148)
>        at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findAction
> s(PackageBasedActionConfigBuilder.java:295)
>        at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio
> nConfigs(PackageBasedActionConfigBuilder.java:277)
>
> OtherApp is another application I have installed on the same domain.
>
> Is this a bug with convention? I am using default settings and when I
> get the chance I plan on adding
>
> struts.convention.package.locators.basePackage to be my com.myApp.stuff
> to see if this restricts this...
>
> Any help would be very much appreciated.
>
> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
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: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Posted by Musachy Barroso <mu...@gmail.com>.
Those exceptions are annoying, but they can be ignored. There are
multiple settings for scanning, like not scanning jars, which you can
play with.

musachy

On Thu, Oct 8, 2009 at 10:19 AM, James Cook <Ja...@wecomm.com> wrote:
> Hi All,
>
> I did ask this question before but never received an answer, I do
> understand that this is quite complex problem. However I thought I would
> ask again in case anyone else has come across this...
>
> When I use the Convention plugin with Spring and Glassfish, upon deploy
> of the resulting WAR the Convention plugin scans all the packages that
> are in the /applications/j2ee-modules of the given domain.
>
> This is seen in the server log of the Glassfish e.g.
>
> [#|2009-10-08T14:24:09.106+0100|WARNING|sun-appserver9.1|javax.enterpris
> e.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=00746e6a-87
> 1e-4a90-b155-92d8b81b942b;|
> java.lang.Exception: Could not load
> domains/domain3/applications/j2ee-modules/OtherApp/WEB-INF/classes/com/o
> ther/package/SubmissionThread.class
>        at
> com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder
> .java:745)
>        at
> com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
> 148)
>        at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.findAction
> s(PackageBasedActionConfigBuilder.java:295)
>        at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio
> nConfigs(PackageBasedActionConfigBuilder.java:277)
>
> OtherApp is another application I have installed on the same domain.
>
> Is this a bug with convention? I am using default settings and when I
> get the chance I plan on adding
>
> struts.convention.package.locators.basePackage to be my com.myApp.stuff
> to see if this restricts this...
>
> Any help would be very much appreciated.
>
> James
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

Posted by James Cook <Ja...@wecomm.com>.
Hi All,

I did ask this question before but never received an answer, I do
understand that this is quite complex problem. However I thought I would
ask again in case anyone else has come across this...

When I use the Convention plugin with Spring and Glassfish, upon deploy
of the resulting WAR the Convention plugin scans all the packages that
are in the /applications/j2ee-modules of the given domain. 

This is seen in the server log of the Glassfish e.g.

[#|2009-10-08T14:24:09.106+0100|WARNING|sun-appserver9.1|javax.enterpris
e.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=00746e6a-87
1e-4a90-b155-92d8b81b942b;|
java.lang.Exception: Could not load
domains/domain3/applications/j2ee-modules/OtherApp/WEB-INF/classes/com/o
ther/package/SubmissionThread.class
	at
com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder
.java:745)
	at
com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:
148)
	at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.findAction
s(PackageBasedActionConfigBuilder.java:295)
	at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio
nConfigs(PackageBasedActionConfigBuilder.java:277)

OtherApp is another application I have installed on the same domain. 

Is this a bug with convention? I am using default settings and when I
get the chance I plan on adding 

struts.convention.package.locators.basePackage to be my com.myApp.stuff
to see if this restricts this...

Any help would be very much appreciated.

James

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


Re: Struts 2 tag

Posted by Dale Newfield <da...@newfield.org>.
Gregor Marinšek wrote:
 > <s:if test="%{parameter.index.type}=='ENUM'">

I assume you meant: "%{parameter.index.type=='ENUM'}"

-Dale


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


Re: Struts 2 tag

Posted by dcabasson <de...@gmail.com>.
Hi Roger,

I usually use

<s:if test="%{type==@com.myPackage@MY_ENUM_VALUE}">
Denis. 

RogerV wrote:
> 
> 
> 
> Gregor Marinšek wrote:
>> 
>> You don't have to use "value", because s:iterator puts the value on the 
>> top of ValueStack. What about:
>> 
>> <s:if test="%{type=='ENUM'}"> 
>> I assume you are iterating over objects, with defined get/setType
>> Gregor
>> 
> 
> Thanks Gregor, that works - in conjunction with another older nabble post
> which discusses whether the "object" returned implemented the equals
> method. In fact "type" is an Enum - so I provided a method on my Action to
> return the value as a String and called that instead, so now I've got
> <s:if test="%{typeAsString=='ENUM'}"> which works whereas <s:if
> test="%{type=='ENUM'}"> doesn't.
> 
> For future reference, how would I handle an Enum in <s:if> (I'm not
> confusing things, the
> value ENUM is one of the values of the Enum type in this instance)
> 
> Regards
> 

-- 
View this message in context: http://www.nabble.com/Struts-2-%3Cs%3Aif%3E-tag-tp25801138p25815556.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: Struts 2 tag

Posted by RogerV <ro...@googlemail.com>.


Gregor Marinšek wrote:
> 
> You don't have to use "value", because s:iterator puts the value on the 
> top of ValueStack. What about:
> 
> <s:if test="%{type=='ENUM'}"> 
> I assume you are iterating over objects, with defined get/setType
> Gregor
> 

Thanks Gregor, that works - in conjunction with another older nabble post
which discusses whether the "object" returned implemented the equals method.
In fact "type" is an Enum - so I provided a method on my Action to return
the value as a String and called that instead, so now I've got <s:if
test="%{typeAsString=='ENUM'}"> which works whereas <s:if
test="%{type=='ENUM'}"> doesn't.

For future reference, how would I handle an Enum in <s:if> (I'm not
confusing things, the
value ENUM is one of the values of the Enum type in this instance)

Regards
-- 
View this message in context: http://www.nabble.com/Struts-2-%3Cs%3Aif%3E-tag-tp25801138p25801877.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: Struts 2 tag

Posted by Gregor Marinšek <gm...@tis.si>.
You don't have to use "value", because s:iterator puts the value on the 
top of ValueStack. What about:

<s:if test="%{type=='ENUM'}"> 

I assume you are iterating over objects, with defined get/setType

Gregor



RogerV wrote:
>
> Try something like this.
>
> <s:if test="%{parameter.index.type}=='ENUM'">
>
> Gregor
>
> That stops the exception but it's not evaluating correctly. If I add
> <s:property value="value[#parameter.index].type"/> to my jsp immediately
> prior to the <s:if>
> tag then when it is ENUM, it prints ENUM and then fails to do anything with
> the content of the <s:if> tag.
>
> I should have mentioned that the reason I'm using value[#parameter.index] is
> that my test is sitting
> inside an iterator loop.
>
> <s:iterator value="value" status="parameter">
> <s:property value="value[#parameter.index].type"/>
> <s:if test="<s:property value='value[#parameter.index].type'/>=='ENUM' ">
>
> using single quotes around the value attribute stops the error message as
> well but it's still ignoring
> the contents of the <s:if>. Interstingly enough, it does exactly the same
> thing if I change the test
> to <s:if test="<s:property value='value[#parameter.index].type'/>!='ENUM' ">
>
> Regards
>
>
>
>
>   


-- 
Gregor Marinšek


TIS d.o.o.
Ljubljanska 9, Maribor
e-mail: gmarinsek@tis.si
http://www.tis.si

GSM: (+386) 040 730 015

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


Re: Struts 2 tag

Posted by RogerV <ro...@googlemail.com>.


Try something like this.

<s:if test="%{parameter.index.type}=='ENUM'">

Gregor

That stops the exception but it's not evaluating correctly. If I add
<s:property value="value[#parameter.index].type"/> to my jsp immediately
prior to the <s:if>
tag then when it is ENUM, it prints ENUM and then fails to do anything with
the content of the <s:if> tag.

I should have mentioned that the reason I'm using value[#parameter.index] is
that my test is sitting
inside an iterator loop.

<s:iterator value="value" status="parameter">
<s:property value="value[#parameter.index].type"/>
<s:if test="<s:property value='value[#parameter.index].type'/>=='ENUM' ">

using single quotes around the value attribute stops the error message as
well but it's still ignoring
the contents of the <s:if>. Interstingly enough, it does exactly the same
thing if I change the test
to <s:if test="<s:property value='value[#parameter.index].type'/>!='ENUM' ">

Regards




-- 
View this message in context: http://www.nabble.com/Struts-2-%3Cs%3Aif%3E-tag-tp25801138p25801415.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: Struts 2 tag

Posted by Gregor Marinšek <gm...@tis.si>.
Try something like this.

<s:if test="%{parameter.index.type}=='ENUM'">

Gregor

RogerV wrote:
> Could someone correct my syntax please - I can't get this to work at all.
>
> <s:if test="<s:property value="value[#parameter.index].type"/>=='ENUM'">
> ....
> </s:if>
>
> I keep getting a JasperException; equal symbol expected
>
> Regards
>   


-- 
Gregor Marinšek


TIS d.o.o.
Ljubljanska 9, Maribor
e-mail: gmarinsek@tis.si
http://www.tis.si

GSM: (+386) 040 730 015

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