Author Login
Post Reply
user Digest 22 Jul 2009 16:47:38 -0000 Issue 8765
Topics (messages 200976 through 200985):
Re: struts2 validators doesn't work in java 1.6
200976 by: gwen harold autencio
200982 by: Wes Wannemacher
Re: Struts2 portlet bug found
200977 by: Nils-Helge Garli Hegvik
200978 by: Nils-Helge Garli Hegvik
200984 by: Kofford, C Todd
Re: struts 2.1.5 type conversion error
200979 by: Lukasz Lenart
Re: Exception though the result looks as expected
200980 by: Lukasz Lenart
How to fix this error.
200981 by: Sam Wun
Re: Redirecting to servlet
200983 by: Wes Wannemacher
Upgrading xWork??
200985 by: Hoying, Ken
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_200976.ezm (zipped)
Attachment:
user_200982.ezm (zipped)
Attachment:
user_200977.ezm (zipped)Does it work if you access the session "raw" (get the session and do
session.getAttribute("studentId", PortletSession.APPLICATION_SCOPE)?
Have you tried deploying to a different portlet container such as
jboss portal or just plain pluto? I assume that the resources you're
sharing session between are in the same war file? Unless you're
calling "clear()" on the session map, Struts 2 doesn't do anything to
the session, so it should not just disappear like that. Considering
you're using the same Struts 2 version in both deployments, I'm not
sure what could be wrong...
Nils-H
On Wed, Jul 22, 2009 at 3:48 AM, Tracy12<j_lalith@(protected):
>
> Hi,
>
> We got a struts 2.0.6 portlet application with uPortal 2.5.3 ( inside
> Pluto 1.0.x) with no issues and running fine.
>
> Now we deployed the same struts 2.0.6 application in uPortal 3.1.1 (inside
> pluto 1.1.7) and found following issue.
>
> in our action classes we had the following, where session is of type
> PortletSession.
>
> session.setAttribute("studentId","1111111",PortletSession.APPLICATION_SCOPE)
>
> We trieved the above studentId in the jsp as follows.
> <s:property value="#session.studentId"/>
>
> The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1 this
> is not working,
> Then I tried the following
> <s:property value="#application.studentId"/> but didnt work,
>
>
> I interacted with the uPortal forum and this is what it
> tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td24581733.html
>
> I thought based on that <s:property value="#application.studentId"/> should
> work,
>
> What else could I try, This looks to me a bug. Can't understand why it is
> not in the value stack.
>
> If not pls let me know how to retrieve the above
> PortletSession.APPLICATION_SCOPE variable in the jsp.
>
> If this has been fixed let me know which struts 2 version is that.
>
>
> I did try the following also with no luck
>
> <s:property value="%{#application['studentId']}"/>
>
> waiting for a quick reply
>
>
> Thanks
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200978.ezm (zipped)Ah, sorry, I think I misunderstood....
As they say in the uPortal forum, this is probably due to the older
version of uPortal returning all session attributes regardless of
scope. When this was fixed, you need to specify the correct scope to
retrieve application scoped attributes, but they are still in the
session. The "application" object is for attributes in the
PortletContext (or ServletContext if it's a servlet). Since the
session is represented as a Map object in Struts 2, there is no
support for "scope" (just simple "get" and "put" operations). To
retrieve the application scoped session attribute, you need to do as I
suggested in the previous reply, get the raw session and access it
directly.
Nils-H
On Wed, Jul 22, 2009 at 8:50 AM, Nils-Helge Garli
Hegvik<nilsga@(protected):
> Does it work if you access the session "raw" (get the session and do
> session.getAttribute("studentId", PortletSession.APPLICATION_SCOPE)?
> Have you tried deploying to a different portlet container such as
> jboss portal or just plain pluto? I assume that the resources you're
> sharing session between are in the same war file? Unless you're
> calling "clear()" on the session map, Struts 2 doesn't do anything to
> the session, so it should not just disappear like that. Considering
> you're using the same Struts 2 version in both deployments, I'm not
> sure what could be wrong...
>
> Nils-H
>
> On Wed, Jul 22, 2009 at 3:48 AM, Tracy12<j_lalith@(protected):
>>
>> Hi,
>>
>> We got a struts 2.0.6 portlet application with uPortal 2.5.3 ( inside
>> Pluto 1.0.x) with no issues and running fine.
>>
>> Now we deployed the same struts 2.0.6 application in uPortal 3.1.1 (inside
>> pluto 1.1.7) and found following issue.
>>
>> in our action classes we had the following, where session is of type
>> PortletSession.
>>
>> session.setAttribute("studentId","1111111",PortletSession.APPLICATION_SCOPE)
>>
>> We trieved the above studentId in the jsp as follows.
>> <s:property value="#session.studentId"/>
>>
>> The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1 this
>> is not working,
>> Then I tried the following
>> <s:property value="#application.studentId"/> but didnt work,
>>
>>
>> I interacted with the uPortal forum and this is what it
>> tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td24581733.html
>>
>> I thought based on that <s:property value="#application.studentId"/> should
>> work,
>>
>> What else could I try, This looks to me a bug. Can't understand why it is
>> not in the value stack.
>>
>> If not pls let me know how to retrieve the above
>> PortletSession.APPLICATION_SCOPE variable in the jsp.
>>
>> If this has been fixed let me know which struts 2 version is that.
>>
>>
>> I did try the following also with no luck
>>
>> <s:property value="%{#application['studentId']}"/>
>>
>> waiting for a quick reply
>>
>>
>> Thanks
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_200984.ezm (zipped)Since this deals with struts and uportal I have copied the uportal user
group in this response too.
I had a similar problem. See email thread below:
http://www.mail-archive.com/user@(protected)
I was simply using the session (map) object from a SessionAware action
class and not explicitly using PortletSession. This is because we run
our struts 2 webapp both as a portlet and a standalone webapp, and
wanted to handle the session in a consistent way. I applied the uportal
fix (mentioned in the email thread) to my uportal 2.5.x installation and
MY problem was solved.
We are just now moving to uportal 3.1.1 and are still on struts 2.0.14
due to an issue running struts 2.1.6 webapps as standalone and portlet
simultaneously. But so far, I have not seen the problem you describe
when testing my struts 2 portlets in uportal 3.1.1.
Todd Kofford
tkofford@(protected)
University of Kansas - IT
-----Original Message-----
From: Tracy12 [mailto:j_lalith@(protected)]
Sent: Tuesday, July 21, 2009 8:49 PM
To: user@(protected)
Subject: Struts2 portlet bug found
Hi,
We got a struts 2.0.6 portlet application with uPortal 2.5.3 ( inside
Pluto 1.0.x) with no issues and running fine.
Now we deployed the same struts 2.0.6 application in uPortal 3.1.1
(inside
pluto 1.1.7) and found following issue.
in our action classes we had the following, where session is of type
PortletSession.
session.setAttribute("studentId","1111111",PortletSession.APPLICATION_SC
OPE)
We trieved the above studentId in the jsp as follows.
<s:property value="#session.studentId"/>
The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1
this
is not working,
Then I tried the following
<s:property value="#application.studentId"/> but didnt work,
I interacted with the uPortal forum and this is what it
tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td
24581733.html
I thought based on that <s:property value="#application.studentId"/>
should
work,
What else could I try, This looks to me a bug. Can't understand why it
is
not in the value stack.
If not pls let me know how to retrieve the above
PortletSession.APPLICATION_SCOPE variable in the jsp.
If this has been fixed let me know which struts 2 version is that.
I did try the following also with no luck
<s:property value="%{#application['studentId']}"/>
waiting for a quick reply
Thanks
--
http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_200979.ezm (zipped)2009/7/17 <Sandy.Verfaille@(protected)>:
> <s:form action="addProduct" method="post" validate="true" >
> Name nl<s:textfield name="nameNl" />
> price<s:textfield name="price" value=""/>
> </s:form>
What type has "price" in action class?
Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/
Charles de Gaulle - "The better I get to know men, the more I find
myself loving dogs." -
http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html

Attachment:
user_200980.ezm (zipped)2009/7/18 mathias-ewald <nitehoaxxer@(protected)>:
> float average =
> (Float)ActionContext.getContext().getValueStack().findValue("#average");
This can be an issue - autoboxing ;-)
Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/
Ted Turner - "Sports is like a war without the killing." -
http://www.brainyquote.com/quotes/authors/t/ted_turner.html

Attachment:
user_200981.ezm (zipped)Hi,
I got the followiong error when I tried to compile it with Ant:
# ant
Buildfile: build.xml
compile:
[javac] Compiling 2 source files to
/usr/liferay-portal-5.2.3/dev/portlets/sample-datagrid/docroot/WEB-INF/classes
[javac] /usr/liferay-portal-5.2.3/dev/portlets/sample-datagrid/docroot/WEB-INF/src/com/ip6networks/datagrid/portlet/DatagridAction.java:28:
package fr.improve.struts.taglib.layout.datagrid does not exist
[javac] import fr.improve.struts.taglib.layout.datagrid.Datagrid;
The Struts-Layout jar file is already put in place in the lib folder:
# pwd
/usr/liferay-portal-5.2.3/dev/portlets/sample-datagrid/docroot/WEB-INF/lib
lib # ls
./ ../ Struts-Layout-1.3.jar
Very appreciate for any suggestion.
Thanks
Sam

Attachment:
user_200983.ezm (zipped)I think you can set the constant - struts.action.excludePattern to a
pattern that will match your servlet, then the dispatcher filter in
use should ignore it. You can specify a comma-separated list of
patterns for the dispatcher to ignore.
-Wes
On Tue, Jul 21, 2009 at 11:53 PM, Kavita Mehta<Kavita.Mehta@(protected):
> Hi,
> I have an application in struts2.0 . I want a servlet in it to cater to a
> specific HTTP request. How can I make sure that the request to servlet
> does not go through struts.xml as it searches for the action class with
> the same name.
>
>
>
> thanks,
> Kavita
>
>
>
>
> *****************************************************DISCLAIMER*****************************************************
>
> This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
> ********************************************************************************************************************
>
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

Attachment:
user_200985.ezm (zipped)We are running with Struts 2.0.1.1 (which uses xWork 2.0.4) and are noticing that we are getting hung threads sometimes on a HashMap call from com.opensymphony.xwork2.util.LocalizedTextUtil.
It looks like the xWork code is question needs to be synchronized and is causing the threads to lock due to corruption in the HashMap. The problem code from xWork 2.0.4 is:
private static MessageFormat buildMessageFormat(String pattern, Locale locale) {
MessageFormatKey key = new MessageFormatKey(pattern, locale);
MessageFormat format = (MessageFormat) messageFormats.get(key);
if (format == null) {
format = new MessageFormat(pattern);
format.setLocale(locale);
format.applyPattern(pattern);
messageFormats.put(key, format);
}
return format;
}
I noticed that in later version of xWork this appears to have been fixed by the following change:
private static MessageFormat buildMessageFormat(String pattern, Locale locale) {
MessageFormatKey key = new MessageFormatKey(pattern, locale);
MessageFormat format = null;
synchronized(messageFormats) {
format = (MessageFormat) messageFormats.get(key);
if (format == null) {
format = new MessageFormat(pattern);
format.setLocale(locale);
format.applyPattern(pattern);
messageFormats.put(key, format);
}
}
return format;
}
So my question is, has anyone attempted to upgrade the xWork library to a later version in Struts 2.0.1.1? And if so, what version did you use and what was your experience?
Thank you in advance!
Ken
-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.