Author Login
Post Reply
user Digest 20 Jul 2009 19:08:28 -0000 Issue 8762
Topics (messages 200913 through 200933):
Re: Problem with LoginInterceptor
200913 by: mathias-ewald
200927 by: mailtolouis2020-struts.yahoo.com
200928 by: Pawe³ Wielgus
Re: Struts w/Ajax with Struts again
200914 by: Martin Gainty
Problem with s:text expansion...
200915 by: Peter Björkman
Re: Problem with Global Exception Mapping
200916 by: surya.mulakala.wipro.com
Re: unit testing Struts2 application (with Spring and Hibernate)
200917 by: Haroon Rafique
Re: Global Exception Handling in struts2
200918 by: surya.mulakala.wipro.com
200922 by: Dave Newton
200923 by: surya.mulakala.wipro.com
Re: Prevent persisting data when validation fails
200919 by: taltun
200920 by: taltun
200925 by: Greg Lindholm
200929 by: taltun
200933 by: Greg Lindholm
Problem with IE6 after upgrading to 2.1
200921 by: Scott Nesbitt
Pb displaying image
200924 by: tutu
200930 by: Jim Kiley
action-method-validation
200926 by: Louis Voo
200931 by: Wes Wannemacher
200932 by: Jim Kiley
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_200913.ezm (zipped)
Hi,
so what do you suggest? Isn't there any way to do that?
cu
mathias
mailtolouis2020-struts wrote:
>
> I don't think it will preserve your parameter by default, I might be
> wrong, if it do, then that is another magic in S2 I didn't know that.
>
> For what I understand is there are 2 request from the user,
> 1) http://localhost:8080/projektseminar/rating/Rate?staffResourceId=1
> 2) login submit
>
> I don't think you store a staffResourceId as a hidden param in the login
> page, if its not there you won't expect to come into your url.
>
> Regards
> Louis
>
>
> ________________________________
> From: mathias-ewald <nitehoaxxer@(protected)>
> To: user@(protected)
> Sent: Monday, July 20, 2009 2:53:39 PM
> Subject: Re: Problem with LoginInterceptor
>
>
> Hi,
>
> yes I am using the latest version of struts2. Most likely the tutorials I
> used refer to other versions. I set the struts.xml as follows:
>
> ---------------------------------------------------
> <interceptors>
> <interceptor name="login"
> class="de.mathiasewald.projektseminar.interceptor.LoginInterceptor" />
>
> <interceptor-stack name="defaultLoginStack">
> <interceptor-ref name="servletConfig" />
> <interceptor-ref name="params" />
> <interceptor-ref name="login" />
> <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
> <interceptor-ref name="modelDriven" />
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="staticParams" />
> <interceptor-ref name="params" />
> <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation" />
> <interceptor-ref name="workflow" />
> </interceptor-stack>
>
> <interceptor-stack name="defaultInsecureStack">
> <interceptor-ref name="servletConfig" />
> <interceptor-ref name="params" />
> <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
> <interceptor-ref name="modelDriven" />
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="staticParams" />
> <interceptor-ref name="params" />
> <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation" />
> <interceptor-ref name="workflow" />
> </interceptor-stack>
> </interceptors>
> ---------------------------------------------------
>
> The errors about unfindable interceptors disappeard. But still, the
> parameter is not preserved.
>
> Any suggestions?
>
> cu
> mathias
> --
> View this message in context:
> http://www.nabble.com/Problem-with-LoginInterceptor-tp24565562p24570331.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)
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200927.ezm (zipped)I'm new in S2, so not much suggestion I can give u now.
May be your interceptor store the entire action in the session. Once login success, you get back the action and invoke it again.
May be someone can give more better suggestion?
Regards
Louis
________________________________
From: mathias-ewald <nitehoaxxer@(protected)>
To: user@(protected)
Sent: Monday, July 20, 2009 3:17:47 PM
Subject: Re: Problem with LoginInterceptor
Hi,
so what do you suggest? Isn't there any way to do that?
cu
mathias
mailtolouis2020-struts wrote:
>
> I don't think it will preserve your parameter by default, I might be
> wrong, if it do, then that is another magic in S2 I didn't know that.
>
> For what I understand is there are 2 request from the user,
> 1) http://localhost:8080/projektseminar/rating/Rate?staffResourceId=1
> 2) login submit
>
> I don't think you store a staffResourceId as a hidden param in the login
> page, if its not there you won't expect to come into your url.
>
> Regards
> Louis
>
>
> ________________________________
> From: mathias-ewald <nitehoaxxer@(protected)>
> To: user@(protected)
> Sent: Monday, July 20, 2009 2:53:39 PM
> Subject: Re: Problem with LoginInterceptor
>
>
> Hi,
>
> yes I am using the latest version of struts2. Most likely the tutorials I
> used refer to other versions. I set the struts.xml as follows:
>
> ---------------------------------------------------
> <interceptors>
> <interceptor name="login"
> class="de.mathiasewald.projektseminar.interceptor.LoginInterceptor" />
>
> <interceptor-stack name="defaultLoginStack">
> <interceptor-ref name="servletConfig" />
> <interceptor-ref name="params" />
> <interceptor-ref name="login" />
> <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
> <interceptor-ref name="modelDriven" />
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="staticParams" />
> <interceptor-ref name="params" />
> <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation" />
> <interceptor-ref name="workflow" />
> </interceptor-stack>
>
> <interceptor-stack name="defaultInsecureStack">
> <interceptor-ref name="servletConfig" />
> <interceptor-ref name="params" />
> <interceptor-ref name="prepare" />
> <interceptor-ref name="chain" />
> <interceptor-ref name="modelDriven" />
> <interceptor-ref name="fileUpload" />
> <interceptor-ref name="staticParams" />
> <interceptor-ref name="params" />
> <interceptor-ref name="conversionError" />
> <interceptor-ref name="validation" />
> <interceptor-ref name="workflow" />
> </interceptor-stack>
> </interceptors>
> ---------------------------------------------------
>
> The errors about unfindable interceptors disappeard. But still, the
> parameter is not preserved.
>
> Any suggestions?
>
> cu
> mathias
> --
> View this message in context:
> http://www.nabble.com/Problem-with-LoginInterceptor-tp24565562p24570331.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)
>
--
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_200928.ezm (zipped)Hi all,
You can prepare comeback link and put it to session or whereever You like:
Map<String, String[]> parameters =
ServletActionContext.getRequest().getParameterMap();
String redirectLink = namespace+"/"+actionMapping.getName();
if (parameters.size() > 0) {
redirectLink += "?";
for (Entry<String, String[]> entry : parameters.entrySet()) {
for (String value : entry.getValue()) {
redirectLink += entry.getKey()+"="+value+"&";
}
}
}
ServletActionContext.getRequest().getSession().setAttribute(REDIRECT_AFTER_LOGIN,
redirectLink);
That's quick and dirty solution and won't work for many parameters but
should get You started.
Best greetings,
Paweł Wielgus.
2009/7/20 <mailtolouis2020-struts@(protected)>:
> I'm new in S2, so not much suggestion I can give u now.
>
> May be your interceptor store the entire action in the session. Once login success, you get back the action and invoke it again.
>
> May be someone can give more better suggestion?
>
> Regards
> Louis
>
>
>
> ________________________________
> From: mathias-ewald <nitehoaxxer@(protected)>
> To: user@(protected)
> Sent: Monday, July 20, 2009 3:17:47 PM
> Subject: Re: Problem with LoginInterceptor
>
>
> Hi,
>
> so what do you suggest? Isn't there any way to do that?
>
> cu
> mathias
>
>
> mailtolouis2020-struts wrote:
>>
>> I don't think it will preserve your parameter by default, I might be
>> wrong, if it do, then that is another magic in S2 I didn't know that.
>>
>> For what I understand is there are 2 request from the user,
>> 1) http://localhost:8080/projektseminar/rating/Rate?staffResourceId=1
>> 2) login submit
>>
>> I don't think you store a staffResourceId as a hidden param in the login
>> page, if its not there you won't expect to come into your url.
>>
>> Regards
>> Louis
>>
>>
>> ________________________________
>> From: mathias-ewald <nitehoaxxer@(protected)>
>> To: user@(protected)
>> Sent: Monday, July 20, 2009 2:53:39 PM
>> Subject: Re: Problem with LoginInterceptor
>>
>>
>> Hi,
>>
>> yes I am using the latest version of struts2. Most likely the tutorials I
>> used refer to other versions. I set the struts.xml as follows:
>>
>> ---------------------------------------------------
>> <interceptors>
>> <interceptor name="login"
>> class="de.mathiasewald.projektseminar.interceptor.LoginInterceptor" />
>>
>> <interceptor-stack name="defaultLoginStack">
>> <interceptor-ref name="servletConfig" />
>> <interceptor-ref name="params" />
>> <interceptor-ref name="login" />
>> <interceptor-ref name="prepare" />
>> <interceptor-ref name="chain" />
>> <interceptor-ref name="modelDriven" />
>> <interceptor-ref name="fileUpload" />
>> <interceptor-ref name="staticParams" />
>> <interceptor-ref name="params" />
>> <interceptor-ref name="conversionError" />
>> <interceptor-ref name="validation" />
>> <interceptor-ref name="workflow" />
>> </interceptor-stack>
>>
>> <interceptor-stack name="defaultInsecureStack">
>> <interceptor-ref name="servletConfig" />
>> <interceptor-ref name="params" />
>> <interceptor-ref name="prepare" />
>> <interceptor-ref name="chain" />
>> <interceptor-ref name="modelDriven" />
>> <interceptor-ref name="fileUpload" />
>> <interceptor-ref name="staticParams" />
>> <interceptor-ref name="params" />
>> <interceptor-ref name="conversionError" />
>> <interceptor-ref name="validation" />
>> <interceptor-ref name="workflow" />
>> </interceptor-stack>
>> </interceptors>
>> ---------------------------------------------------
>>
>> The errors about unfindable interceptors disappeard. But still, the
>> parameter is not preserved.
>>
>> Any suggestions?
>>
>> cu
>> mathias
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-with-LoginInterceptor-tp24565562p24570331.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)
>>
>
> --
> View this message in context: http://www.nabble.com/Problem-with-LoginInterceptor-tp24565562p24570714.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_200914.ezm (zipped)
did you check scope="request" in struts-config.xml
as earlier suggested
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Mon, 20 Jul 2009 03:36:36 -0700
> From: cpanon@(protected)
> Subject: Re: Struts w/Ajax with Struts again
> To: user@(protected)
>
> Hi PW
> But I cant access the session objects with JS, nor can I iterate the collections I have in the session to display the updated values that were written in the Ajax processing action. Correct?
>
> --- On Mon, 7/20/09, Paweł Wielgus <poulwiel@(protected):
>
> From: Paweł Wielgus <poulwiel@(protected)>
> Subject: Re: Struts w/Ajax with Struts again
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Monday, July 20, 2009, 2:18 AM
>
> Hi cpanon,
>
> > I am looking for the simplest technique that would reprocess the session objects from the new values, regenerate the full jsp,
>
> then just refresh the whole page, by javascript after completion of ajax.
> Or do not use ajax at all, this will be most simple solution for You.
>
> Best greetings,
> Paweł Wielgus.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Attachment:
user_200915.ezm (zipped)
Hi! I have an annoying problem with s:text expanding my named resources from
the stack. Example:
<s:text name="user.description" />: <s:property value="user.description" />
The desired behavior is that s:text should print the localized text with the
key "user.description" and s:property should print the value of
user.getDescription() found on the stack. But s:text makes the same
expansion - is it possible to prevent this?
It's of course easy to rename the text key, but since we are many working in
this project, adding things to actions/property files can cause unexpected
behavior.
Thanks in advance.
Regards
Peter Björkman

Attachment:
user_200916.ezm (zipped)Hi,
We are using struts, Spring and Hibernate in our application. For
handling exceptions in application, we are using global exception
mappings in struts2. Whenever an exception is coming in the application
it is taking us to required action and the functionality is working .
But in weblogic server logs we are getting following error :
java.lang.IllegalStateException: Response already committed
at
weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletR
esponseImpl.java:1462)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseI
mpl.java:601)
at
org.apache.struts2.dispatcher.Dispatcher.sendError (
Dispatcher.java:725)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (
Dispatcher.java:4
85)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)
when we try to analyze the problem in debug mode of weblogic server, it
is coming from interceptor
WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl)
line: 2032 .
can anybody help me to remove this error from application?
below i' m providing the struts.xml configuration for global exception
handling
<global-results>
<result name="globalError" type="chain">
ExceptionHandle
</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="
java.lang.Exception" result="globalError"
/>
</global-exception-mappings>
<action name="ExceptionHandle" class="common.action.ExceptionHandler">
<interceptor-ref name="defaultStack" />
<result name="globalError" type="tiles">main.error</result>
</action>
Thanks
Surya
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com

Attachment:
user_200917.ezm (zipped)On Yesterday at 9:16pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected)>...:
DC> [..snip..]
DC>
DC> When testing (junit 4) an action implementing the Sessionaware
DC> interface (my login and register classes) I noticed that the session
DC> object is set to null by BaseStrutsTestCase. This was mentioned before
DC> in the author's blog, but not sure if ever addressed. I added a new
DC> comment over there but the discussion could be inactive.
DC>
Hi Dimitrios,
Don't think arsenalist is watching that blog dilligently any more.
DC>
DC> I was wondering if anyone who is using the BaseStrutsTestCase, or used
DC> it in the past, came across this issue and if by any chance managed to
DC> resolve it. Perhaps Haroon might have a comment on this?
DC>
Not a whole lot at the moment as none of our Action classes implement
those interfaces. How about something like:
protected static HashMap sessionMap = new HashMap();
//.... and further on later in the code
proxy.getInvocation().getInvocationContext().setSession(sessionMap);
DC>
DC> Also, a couple of more general questions:
DC>
DC> 1) Is there a recommended way to check during testing which
DC> interceptors are firing and when?
DC>
Careful there. Haven't you now delved into the territory of testing the
framework itself (rather than your own code)? IMHO, I would assume that
it's the framework's responsibility to make sure that when a certain set
of interceptors is configured, they better fire properly.
DC>
DC> [..snip..]
DC>
DC> Kind regards and I appreciate all the input.
DC>
Cheers,
--
Haroon Rafique
<haroon.rafique@(protected)>

Attachment:
user_200918.ezm (zipped)Hi,
We are using struts2.1.6, Spring and Hibernate in our application. For
handling exceptions in application, we are using global exception
mappings in struts2. Whenever an exception is coming in the application
it is taking us to required action and the functionality is working .
But in weblogic server logs we are getting following error :
java.lang.IllegalStateException: Response already committed
at
weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletR
esponseImpl.java:1462)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseI
mpl.java:601)
at
org.apache.struts2.dispatcher.Dispatcher.sendError (
Dispatcher.java:725)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (
Dispatcher.java:4
85)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
.java:395)
when we try to analyze the problem in debug mode of weblogic server, it
is coming from interceptor
WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl)
line: 2032 .
can anybody help me to remove this error from application?
below i' m providing the struts.xml configuration for global exception
handling
<global-results>
<result name="globalError" type="chain">
ExceptionHandle
</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="
java.lang.Exception" result="globalError"
/>
</global-exception-mappings>
<action name="ExceptionHandle" class="common.action.ExceptionHandler">
<interceptor-ref name="defaultStack" />
<result name="globalError" type="tiles">main.error</result>
</action>
Thanks and Regards,
Surya
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com

Attachment:
user_200922.ezm (zipped)Did you see the rest of the comment I put in JIRA?
Dave
surya.mulakala@(protected):
> Hi,
>
> We are using struts2.1.6, Spring and Hibernate in our application. For
> handling exceptions in application, we are using global exception
> mappings in struts2. Whenever an exception is coming in the application
> it is taking us to required action and the functionality is working .
> But in weblogic server logs we are getting following error :
>
java.lang.IllegalStateException: Response already committed
> at
>
weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletR
> esponseImpl.java:1462)
> at
>
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseI
> mpl.java:601)
> at
>
org.apache.struts2.dispatcher.Dispatcher.sendError (
Dispatcher.java:725)
> at
>
org.apache.struts2.dispatcher.Dispatcher.serviceAction (
Dispatcher.java:4
> 85)
> at
>
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher
> .java:395)
>
> when we try to analyze the problem in debug mode of weblogic server, it
> is coming from interceptor
> WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl)
> line: 2032 .
>
> can anybody help me to remove this error from application?
> below i' m providing the struts.xml configuration for global exception
> handling
>
>
>
> <global-results>
> <result name="globalError" type="chain">
> ExceptionHandle
> </result>
>
> </global-results>
>
> <global-exception-mappings>
> <exception-mapping exception="
java.lang.Exception" result="globalError"
> />
> </global-exception-mappings>
>
> <action name="ExceptionHandle" class="common.action.ExceptionHandler">
> <interceptor-ref name="defaultStack" />
> <result name="globalError" type="tiles">main.error</result>
> </action>
>
> Thanks and Regards,
> Surya
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com
>

Attachment:
user_200923.ezm (zipped)Yeah. I have seen it.
But I'm not able to understand what you are trying to say.
I'm new to struts2.
Thanks and Regards,
Surya
-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Monday, July 20, 2009 8:27 PM
To: Struts Users Mailing List
Subject: Re: Global Exception Handling in struts2
Did you see the rest of the comment I put in JIRA?
Dave
surya.mulakala@(protected):
> Hi,
>
> We are using struts2.1.6, Spring and Hibernate in our application. For
> handling exceptions in application, we are using global exception
> mappings in struts2. Whenever an exception is coming in the
> application it is taking us to required action and the functionality
is working .
> But in weblogic server logs we are getting following error :
>
java.lang.IllegalStateException: Response already committed
> at
>
weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(Servle
> tR
> esponseImpl.java:1462)
> at
>
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletRespons
> eI
> mpl.java:601)
> at
>
org.apache.struts2.dispatcher.Dispatcher.sendError (
Dispatcher.java:725)
> at
>
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
> :4
> 85)
> at
>
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatch
> er
> .java:395)
>
> when we try to analyze the problem in debug mode of weblogic server,
> it is coming from interceptor
> WebAppServletContext.execute(ServletRequestImpl, ServletResponseImpl)
> line: 2032 .
>
> can anybody help me to remove this error from application?
> below i' m providing the struts.xml configuration for global exception
> handling
>
>
>
> <global-results>
> <result name="globalError" type="chain"> ExceptionHandle </result>
>
> </global-results>
>
> <global-exception-mappings>
> <exception-mapping exception="
java.lang.Exception"
result="globalError"
> />
> </global-exception-mappings>
>
> <action name="ExceptionHandle" class="common.action.ExceptionHandler">
> <interceptor-ref name="defaultStack" /> <result name="globalError"
> type="tiles">main.error</result> </action>
>
> Thanks and Regards,
> Surya
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.
>
> www.wipro.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com

Attachment:
user_200919.ezm (zipped)
Ok.
- What is the best way to copy a persistent object ? Using BeanUtil.copy or
clone, etc?
Greg Lindholm-2 wrote:
>
>> I use JPA (hibernate) to persist.
>>
>>
>>
>> An example of action that use prepare to load a person object from
>> transactional manager. When the validate fails and it return back to the
>> input page the request ends and the transaction persists the dirty user
>> object to database. The dirty user object should not be persisted if the
>> validation fails.:
>>
>> public class PersonAction extends BaseAction implements Preparable {
>>
>> private PersonManager personManager;
>> private Person person;
>>
>> public void prepare() {
>> person = personManager.getPerson(id);
>> }
>>
>> public String savePerson() {
>> manager.savePerson(person);
>> return SUCCESS;
>> }
>>
>> public void validate() {
>> if (person.firstName.length < 5 and person.firstName > 10) {
>> addActionError("Firstname length should be between 5 and 10
>> characters.");
>> }
>> }
>>
>> }
>>
>>
> This isn't really a Struts problem, it just the way Hibernate works.
>
> If you make changes to a monitored object (Persistent state) from the
> database then Hibernate will detect this and save the changes to the
> database when you commit the transaction. There is actually no need to
> call
> "save" to update a db object it will happen automatically.
>
> To "fix" your problem you have a couple of choices:
>
> 1) Don't make changes to db objects unless you are sure you want them
> saved. This would mean changing your actions to work with copies of the
> objects or Detached objects instead of the actually db objects (this is
> what
> I do).
>
> 2) Don't commit the transaction if the validation fails. Do a rollback
> instead.
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200920.ezm (zipped)
By the way, how can I let JPA return a deatached object ?
I make use of GenericDaoJpa.java which is attached to this message.
http://www.nabble.com/file/p24571326/GenericDaoJpa.java GenericDaoJpa.java
Greg Lindholm-2 wrote:
>
>> I use JPA (hibernate) to persist.
>>
>>
>>
>> An example of action that use prepare to load a person object from
>> transactional manager. When the validate fails and it return back to the
>> input page the request ends and the transaction persists the dirty user
>> object to database. The dirty user object should not be persisted if the
>> validation fails.:
>>
>> public class PersonAction extends BaseAction implements Preparable {
>>
>> private PersonManager personManager;
>> private Person person;
>>
>> public void prepare() {
>> person = personManager.getPerson(id);
>> }
>>
>> public String savePerson() {
>> manager.savePerson(person);
>> return SUCCESS;
>> }
>>
>> public void validate() {
>> if (person.firstName.length < 5 and person.firstName > 10) {
>> addActionError("Firstname length should be between 5 and 10
>> characters.");
>> }
>> }
>>
>> }
>>
>>
> This isn't really a Struts problem, it just the way Hibernate works.
>
> If you make changes to a monitored object (Persistent state) from the
> database then Hibernate will detect this and save the changes to the
> database when you commit the transaction. There is actually no need to
> call
> "save" to update a db object it will happen automatically.
>
> To "fix" your problem you have a couple of choices:
>
> 1) Don't make changes to db objects unless you are sure you want them
> saved. This would mean changing your actions to work with copies of the
> objects or Detached objects instead of the actually db objects (this is
> what
> I do).
>
> 2) Don't commit the transaction if the validation fails. Do a rollback
> instead.
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200925.ezm (zipped)>
> By the way, how can I let JPA return a deatached object ?
>
> I make use of GenericDaoJpa.java which is attached to this message.
> http://www.nabble.com/file/p24571326/GenericDaoJpa.java GenericDaoJpa.java
>
>
>
See
http://stackoverflow.com/questions/31446/detach-an-entity-from-jpa-ejb3-persistence-contextfor
discussion but the answer seems to be use the Hibernate
session.evict(object) method.
It may be easier to do an EntityManager.clear() or close() when validation
fails. Of course this will only work if you only use manual validation with
the validate() method, if you use declarative validation then you never get
a chance to react when validation fails.
( @Struts Experts: Is there any way to call an action method
post-validation but before the result is taken so you can do some stuff when
validation fails? I know about PreResultListener but don't think it's what
I want.)
> What is the best way to copy a persistent object ? Using BeanUtil.copy or
clone, etc?
I guess you can use clone, but I always write a copy constructor for entity
classes so I have more control over handling of references to other
entities.

Attachment:
user_200929.ezm (zipped)
Thank you very much!!
During my research, I remember some one solved the issue by creating an
Struts 2 intercepter. He placed the intercepter right after the
validationIntercepter. The job of the intercepter was to check if
getActionErrors or getFieldErrors collections was not empty than it closed
and flushed the entityManager. But he didn't specified what intercepter
method (before, inside or after the action was invoked) he implemented.
Do you think this is a solution ?
Any disadvangages ?
What intercepter method do you think will be the correct one to implement?
Greg Lindholm-2 wrote:
>
>>
>> By the way, how can I let JPA return a deatached object ?
>>
>> I make use of GenericDaoJpa.java which is attached to this message.
>> http://www.nabble.com/file/p24571326/GenericDaoJpa.java
>> GenericDaoJpa.java
>>
>>
>>
> See
> http://stackoverflow.com/questions/31446/detach-an-entity-from-jpa-ejb3-persistence-contextfor
> discussion but the answer seems to be use the Hibernate
> session.evict(object) method.
>
> It may be easier to do an EntityManager.clear() or close() when validation
> fails. Of course this will only work if you only use manual validation
> with
> the validate() method, if you use declarative validation then you never
> get
> a chance to react when validation fails.
>
> ( @Struts Experts: Is there any way to call an action method
> post-validation but before the result is taken so you can do some stuff
> when
> validation fails? I know about PreResultListener but don't think it's
> what
> I want.)
>
>
>> What is the best way to copy a persistent object ? Using BeanUtil.copy or
> clone, etc?
>
> I guess you can use clone, but I always write a copy constructor for
> entity
> classes so I have more control over handling of references to other
> entities.
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200933.ezm (zipped)> Thank you very much!!
>
> During my research, I remember some one solved the issue by creating an
> Struts 2 intercepter. He placed the intercepter right after the
> validationIntercepter. The job of the intercepter was to check if
> getActionErrors or getFieldErrors collections was not empty than it closed
> and flushed the entityManager. But he didn't specified what intercepter
> method (before, inside or after the action was invoked) he implemented.
>
> Do you think this is a solution ?
> Any disadvangages ?
> What intercepter method do you think will be the correct one to implement?
>
>
>
You could probably make this work. You can take a look at the Workflow
Interceptor as an example of how to tell if there are errors.
You would have to do your stuff before calling invocation.invoke(); cause
after is too late, the result will have already been rendered.
Disadvantages are hard to determine, depends a lot on how you are managing
your Hibernate sessions. If you clear() /close()/rollback you are throwing
away all changes in the Hibernate session not just the one object you that
failed validation. To avoid these issues that is why I always work with a
copy of the db object.

Attachment:
user_200921.ezm (zipped)
I recently upgraded from Struts 2.0.12 to 2.1.6. Everything works fine
in IE8, but IE6 (sometimes) hangs before it finishes downloading
everything. One one machine it works with IE6, and on another it
hangs. Using Fiddler2 I see that IE6 is not requesting the very last
.GIF file on the page that IE8 is requesting.
Has anybody experienced this?
Thanks,
Scott

Attachment:
user_200924.ezm (zipped)
Hi,
I have a pb while trying to display an image that is not in my application
but on the file system!!
I've tried to put this in my jsp:
file:///<%=request.getAttribute( /1.png"></img>
and that too:
<html:image src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
<html:img src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
(imageLocation reference D:/images)
but nothing is displayed. Does anybody knows how to display an image that is
not in the web application?
thanks,
tugdual
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200930.ezm (zipped)Make sure the image is visible to your webserver, and then use an
http://url to access it, rather than a file:// url.
jk
On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected):
>
> Hi,
>
> I have a pb while trying to display an image that is not in my application
> but on the file system!!
>
> I've tried to put this in my jsp:
>
> file:///<%=request.getAttribute( /1.png"></img>
>
> and that too:
> <html:image
> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> <html:img src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>
> (imageLocation reference D:/images)
>
> but nothing is displayed. Does anybody knows how to display an image that
> is
> not in the web application?
>
> thanks,
>
> tugdual
> --
> View this message in context:
> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.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)
>
>
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com

Attachment:
user_200926.ezm (zipped)Hi,
Does struts2 support action-method-validation ?
Regards
Louis

Attachment:
user_200931.ezm (zipped)Yes
On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo<jlvoo@(protected):
> Hi,
>
> Does struts2 support action-method-validation ?
>
>
> Regards
> Louis
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

Attachment:
user_200932.ezm (zipped)Do you mean, can I write a validateFoo() method for my foo() action method
and be sure validateFoo() will run before foo() does? Yes.
jk
On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo <jlvoo@(protected):
> Hi,
>
> Does struts2 support action-method-validation ?
>
>
> Regards
> Louis
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com