Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 5 Aug 2008 19:22:37 -0000 Issue 8180

user-digest-help

2008-08-05


Author LoginPost Reply

user Digest 5 Aug 2008 19:22:37 -0000 Issue 8180

Topics (messages 189717 through 189739):

Re: [S2] Validating Forms with Wildcard Mapping
 189717 by: Markus Stauffer

Re: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found
 189718 by: Brad A Cupit
 189719 by: doahh
 189721 by: doahh
 189730 by: Brad A Cupit

struts-portlet-sample-2.0.11.2 - validation not working
 189720 by: Torsten Krah
 189733 by: Torsten Krah

Re: [S2] what tag to use to get object's field?
 189722 by: xianwinwin

Re: HowTo: transfer parameter between actions?
 189723 by: Greg Lindholm

2 Validation Questions
 189724 by: Gundersen, Richard
 189728 by: Gabriel Belingueres
 189731 by: Gundersen, Richard

Re: Check if object in list (s:iterator additional constraint)
 189725 by: netslow
 189726 by: Gabriel Belingueres

Treenode, expanded onload
 189727 by: Jack Stuard

Re: [S2] Refactoring Action classes
 189729 by: Milan Milanovic
 189736 by: Al Sutton
 189738 by: Milan Milanovic
 189739 by: Al Sutton

execAndWait delay issue
 189732 by: daveck

struts-portlet-sample - UploadFileAction, caption parameter not set, ParametersInterceptor does not set property found by MultiPartRequest
 189734 by: Torsten Krah
 189735 by: Torsten Krah

Re: Struts 2 And JFreeChart
 189737 by: Leena Borle

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_189717.ezm (zipped)
thanks, i will give it a try...

On 8/5/08, Jim Kiley <jhkiley@(protected):
> I can't see any reference anywhere that suggests that putting a wildcard in
> the form's action attribute will work. Even if it does work with client
> side validation turned off, I get the impression -- and I could be wrong --
> that you've stumbled into a weird corner case that just happens to work. If
> you would like to have more consistency in your application's behavior, I
> think that Gabriel's advice is the way to go. Have each submit send
> "Subscription_execute" or "Subscription_cancel", and rely on the wildcarding
> in struts.xml to route the request appropriately.
>
> jk
>
> On Tue, Aug 5, 2008 at 7:00 AM, Markus Stauffer
> <markus.stauffer@(protected):
>
>> I have this in my form:
>>
>> <s:form action="Subscription_*">
>> <s:textfield key="something"/>
>>
>> <s:submit value="%{'Submit'}" method="execute"/>
>> <s:submit value="%{'Cancel'}" method="cancel"/>
>> </s:form>
>>
>> It works like a charm. But if i turn on client side validation there
>> are warnings/errors.
>>
>>
>>
>>
>>
>> On 8/5/08, Gabriel Belingueres <belingueres@(protected):
>> > AFAIK, wildcard mapping has sense only inside struts.xml.
>> > In your form, you must specify exactly which action will be called,
>> > like "Subscribe_dosomething"
>> >
>> > 2008/8/5 Markus Stauffer <markus.stauffer@(protected)>:
>> >> Hello all
>> >>
>> >> Say I have a struts2 form:
>> >>
>> >> <s:form action="Subscribe_*" validate="true">
>> >> <s:textfield key="something"/>
>> >> </s:form>
>> >>
>> >>
>> >> The javascript validation generated for this form is unfortunately
>> >> invalid. Firefox complains about the "*" character.
>> >>
>> >> Is there any way to get around this without turning to server side
>> >> validation?
>> >>
>> >> kind regards
>> >> --
>> >> Markus Stauffer
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> > For additional commands, e-mail: user-help@(protected)
>> >
>> >
>>
>>
>> --
>> Markus Stauffer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>


--
Markus Stauffer

Attachment: user_189718.ezm (zipped)
I noticed that you have this:

> <context-param>
>   <param-name>contextConfigLocation</param-name>
>   <param-value>/WEB-INF/applicationContext-security.xml</param-value>
> </context-param>

but the prosoc-spring-beans.xml is not listed, so Spring won't know to
pick it up. I did see that prosoc-spring-beans.xml was listed as an
init-param to the uk.co.prodia.prosoc.Config servlet. I'm not sure what
that is doing though.

Try changing the contextConfigLocation param value from this:
<param-value>/WEB-INF/applicationContext-security.xml</param-value>
to this:
<param-value>/WEB-INF/applicationContext-security.xml
classpath:prosoc-spring-beans.xml</param-value>

If the the uk.co.prodia.prosoc.Config servlet is manually loading
Spring, instead you could have it use Spring's
WebApplicationContextUtils (which is what StrutsSpringObjectFactory uses
to lookup beans), rather than manually configuring it. Then you'll have
one instance of Spring to manage all the beans, and the Struts 2
integration should work fine.

Hopefully you can edit the code in uk.co.prodia.prosoc.Config servlet!

Brad Cupit
Louisiana State University - UIS


Attachment: user_189719.ezm (zipped)

It looks like I can use:

WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean("myBean");

in order to get already deployed beans. That clear up the error I was
getting when I started this thread. I am getting another error but I will
spend some time on it first before seeking help.

Thanks for your time.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189721.ezm (zipped)

I didn't see your reply before I sent my last post.

You were absolutely correct and I must say that, looking through that mass
of config, well spotted.

Thanks for your help Bard.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189730.ezm (zipped)
on August 05, 2008 8:14 AM, doahh <gavin@(protected):
> I didn't see your reply before I sent my last post.
>
> You were absolutely correct and I must say that, looking
> through that mass of config, well spotted.
>
> Thanks for your help Bard.

Terrific!!!

Brad Cupit
Louisiana State University - UIS

Attachment: user_189720.ezm (zipped)
Hi,

i am working on portlets and wanted to get the struts sample mentioned
working.
It does work so far (changes to web.xml + dependencies) and it runs with pluto
1.1.5 (tomcat 6.0.16).
However, i can't get the validation example working - reading the docs it
should do - but it won't.
I am not using my own interceptor stack, i stay with the default portlet-stack
which does include the validation one.

Any hints about this? How can i debug this validation stuff?

thx for help


--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
 -- Linus Torvalds

Attachment: smime.p7s (zipped)
Attachment: user_189733.ezm (zipped)
nvm - works now, was a packaging issue, the xml file was not in the proper
location.


--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
 -- Linus Torvalds

Attachment: smime.p7s (zipped)
Attachment: user_189722.ezm (zipped)

thanks!!!

Gabriel Belingueres-2 wrote:
>
> <s:property>
>
> 2008/8/4 xianwinwin <xianwinwin@(protected)>:
>>
>> hi there,
>> say I have an object client and it has firstName and lastName. I wish to
>> write this on the jsp page:
>>
>> Dear Mr. XXXXXX welcome to....
>>
>>
>> the XXXXXX should be substitute with firstName and lastName.
>>
>> what tag should be used in order to achieve this?
>>
>> thank you!
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--what-tag-to-use-to-get-object%27s-field--tp18821594p18821594.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)
>>
>>
>
> ---------------------------------------------------------------------
> 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_189723.ezm (zipped)

You can pass parameters on a redirectAction, I do it all the time


<result type="redirectAction">
 PrepareDictionary
 /admin
 ${dictionaryId}
</result>



holod wrote:
>
> 1.I have action PrepareDictionaryAction
> it has field String dictionaryId and appropriate getter and setter.
> dictionaryid comes from previous jsp. (enter.jsp)
> action sends user to dictionary.jsp
>
> 2.dictionary jsp has hidden field <s:hidden name="dictionaryId"/>. So I
> will not be lost.
> 3.then through form submit user goes to WorkWithDictionaryAction.
> This action reads hidden field dictionaryId.
>
> I want on result="success" send user to PrepareDictionaryAction and I
> don't want to loose dictionaryId
>
> This is struts.xml for "WorkWithDictionary:
> <action name="WorkWithDictionary"
> class="ibs.parliament.action.admin.WorkWithDictionaryAction">
>        <result name="success" type="redirect-action">
>        PrepareDictionary
>        /admin
>      </result>
>      <result name="input">/admin/dictionary.jsp</result>
>    </action>
>
> As you can see on "success" user will go to PrepareDictionary. This
> action needs dictionaryId, but I is lost on WorkWithDictionary action,
> this parameter doesn't go forward.
>
> I would'nt like to use session, I would like to use something else. Does
> struts2 has special interceptor or result type for such tasks?
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189724.ezm (zipped)
Would really appreciate any help with the following (sent yesterday).
Just a pointer to some good docs would be great

-------------------------------------

Basic question sorry (looked all over but can't find the answer)

1) When validation fails for my 'username' textfield, the error message
is displayed ABOVE the text box.

Is it possible to have more fine-grained control over how to position
the error message. Ideally I would like it below (and in line with) the
text box.

2) If I enter an invalid value twice, the original message is still
there, so I have two 'username is invalid' messages on the screen now. I
know this is done by the javascript so I want to know the recommended
way of overriding this behaviour.

Thanks

-Richard

As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.

*** Disclaimer ***

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.


London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.

Subsidiary Companies:-

London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.

London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.

London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.

Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

Attachment: user_189728.ezm (zipped)
1) You can create a new theme and change the look and feel of the form
and of course where the field errors will be displayed. You can create
individual template Freemarker scripts for the textfield tag too.
2) IIRC, this javascript validation bug was resolved in the 2.1.x branch.

2008/8/5 Gundersen, Richard <Richard.Gundersen@(protected)>:
> Would really appreciate any help with the following (sent yesterday).
> Just a pointer to some good docs would be great
>
> -------------------------------------
>
> Basic question sorry (looked all over but can't find the answer)
>
> 1) When validation fails for my 'username' textfield, the error message
> is displayed ABOVE the text box.
>
> Is it possible to have more fine-grained control over how to position
> the error message. Ideally I would like it below (and in line with) the
> text box.
>
> 2) If I enter an invalid value twice, the original message is still
> there, so I have two 'username is invalid' messages on the screen now. I
> know this is done by the javascript so I want to know the recommended
> way of overriding this behaviour.
>
> Thanks
>
> -Richard
>
> As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.
>
> *** Disclaimer ***
>
> This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.
>
> If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).
>
> We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.
>
> Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.
>
>
> London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.
>
> Subsidiary Companies:-
>
> London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.
>
> London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.
>
> London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.
>
> Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189731.ezm (zipped)
Nice one - thanks for the tips Gabriel, much appreciated.

Richard Gundersen
Java Developer

Email: richard.gundersen@(protected)
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-----Original Message-----
From: Gabriel Belingueres [mailto:belingueres@(protected)]
Sent: Tuesday, August 05, 2008 3:12 PM
To: Struts Users Mailing List
Subject: Re: 2 Validation Questions

1) You can create a new theme and change the look and feel of the form
and of course where the field errors will be displayed. You can create
individual template Freemarker scripts for the textfield tag too.
2) IIRC, this javascript validation bug was resolved in the 2.1.x
branch.

2008/8/5 Gundersen, Richard <Richard.Gundersen@(protected)>:
> Would really appreciate any help with the following (sent yesterday).
> Just a pointer to some good docs would be great
>
> -------------------------------------
>
> Basic question sorry (looked all over but can't find the answer)
>
> 1) When validation fails for my 'username' textfield, the error
message
> is displayed ABOVE the text box.
>
> Is it possible to have more fine-grained control over how to position
> the error message. Ideally I would like it below (and in line with)
the
> text box.
>
> 2) If I enter an invalid value twice, the original message is still
> there, so I have two 'username is invalid' messages on the screen now.
I
> know this is done by the javascript so I want to know the recommended
> way of overriding this behaviour.
>
> Thanks
>
> -Richard
>
> As a responsible corporate citizen, London Scottish Bank plc asks you
to consider the environment before printing this email.
>
> *** Disclaimer ***
>
> This electronic communication is confidential and for the exclusive
use of the addressee. It may contain private and confidential
information. The information, attachments and opinions contained in this
E-mail are those of its author only and do not necessarily represent
those of London Scottish Bank PLC or any other members of the London
Scottish Group.
>
> If you are not the intended addressee, you are prohibited from any
disclosure, distribution or further copying or use of this communication
or the information in it or taking any action in reliance on it. If you
have received this communication in error please notify the Information
Security Manager at ISM@(protected)
delete the message from all places in your computer where it is stored.
>
> We utilise virus scanning software but we cannot guarantee the
security of electronic communications and you are advised to check any
attachments for viruses. We do not accept liability for any loss
resulting from any corruption or alteration of data or importation of
any virus as a result of receiving this electronic communication.
>
> Replies to this E-mail may be monitored for operational or business
reasons. London Scottish Bank PLC is regulated by the Financial Services
Authority.
>
>
> London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester
M3 3NW Registered Number 973008 England.
>
> Subsidiary Companies:-
>
> London Scottish Finance Limited, Registered Office: 201 Deansgate,
Manchester M3 3NW Registered Number 233259 England.
>
> London Scottish Broking Limited, Registered Office: 201 Deansgate,
Manchester M3 3NW Registered Number 230110 England.
>
> London Scottish Invoice Finance Limited, Registered Office: 201
Deansgate, Manchester M3 3NW Registered Number 2643766 England.
>
> Robinson Way & Company Limited, Registered Office: 201 Deansgate,
Manchester M3 3NW Registered Number 885896 England.
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.

*** Disclaimer ***

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.


London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.

Subsidiary Companies:-

London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.

London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.

London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.

Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

Attachment: user_189725.ezm (zipped)

People, I'm really confused. I'm still haven't found any solution.
Any ideas?


netslow wrote:
>
> I hello experts. I'm quite new in struts2, and I have a question.
> I have an action ShowReports which returns two lists of reports: reports
> and badReports.
> I would like to show these reports bud I need also check if current report
> belongs to badReports list, and if it does notify user about it. What is
> the best way to do that?
>
> I want something like that:
>
> <table>
> <tr><td>Name</td><td>Title</td></tr>
> <s:iterator value="reports">
> <s:if test="!(report in badReports)">
> <tr>
>  <td><s:property value="name"/></td>
>  <td><s:property value="title"/></td>
> </tr>
> </s:if>
> <s:else>
> <tr>
>  <td>bad report!</td>
>  <td>bad report!</td>
> </tr>
> </s:else>
> </s:iterator>
> </table>
>
> The question is how to check the condition?
> Thanks for any advice.
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189726.ezm (zipped)
Did you tested with 'not in' instead of '!'?

2008/8/5 netslow <netslow@(protected)>:
>
> People, I'm really confused. I'm still haven't found any solution.
> Any ideas?
>
>
> netslow wrote:
>>
>> I hello experts. I'm quite new in struts2, and I have a question.
>> I have an action ShowReports which returns two lists of reports: reports
>> and badReports.
>> I would like to show these reports bud I need also check if current report
>> belongs to badReports list, and if it does notify user about it. What is
>> the best way to do that?
>>
>> I want something like that:
>>
>> <table>
>> <tr><td>Name</td><td>Title</td></tr>
>> <s:iterator value="reports">
>> <s:if test="!(report in badReports)">
>> <tr>
>>     <td><s:property value="name"/></td>
>>     <td><s:property value="title"/></td>
>> </tr>
>> </s:if>
>> <s:else>
>> <tr>
>>     <td>bad report!</td>
>>     <td>bad report!</td>
>> </tr>
>> </s:else>
>> </s:iterator>
>> </table>
>>
>> The question is how to check the condition?
>> Thanks for any advice.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Check-if-object-in-list-%28s%3Aiterator-additional-constraint%29-tp18712148p18831733.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_189727.ezm (zipped)
Hi, I've searched but maybe I don't have used the right term to this, I'd to
know if is possible to show a Tree, with some specific treenodes already
opened (or expanded) onload of a page in Struts 2 (stable version).

Thanks in advance.
Jack Stuard

Attachment: user_189729.ezm (zipped)

Dear Al,

O.K. You suggest that I have multiple classes in one package/namespace, like
this:

<package name="somePackafe" namespace="/myNamespace"
extends="struts-default">

 <action name="load" method="execute" class="FirstActionClass">
           ...
        </action>

        ...

        <action name="save" method="execute" class="SecondActionClass">
           ...
        </action>
</package>

?

I understand what are you talking about, but my class is connected to little
bit complex jsp-s, where I have, reading/saving master object,
reading/saving its child objects, some links to other objects, and all of
that must be placed during user input, like wizard, so it's hard to separate
code in two classes, because I will have a lot of duplicate code
(attributes).

--
Regards, Milan


Al Sutton wrote:
>
> You don't need to have all your actions for a namespace in a single
> class, you can use multiple classes.
>
> I usually group methods acting on a common object into a single class
> which usually leaves me with the 5 public methods in a class which map
> to actions (typically CRUD plus a View method), and multiple classes for
> different object types.
>
> Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public
> action methods, the number of private methods you have will depend on
> your app).
>
> Al.
>
>
> Milan Milanovic wrote:
>> Dear Al and Dave,
>>
>> I tried to fix that error with session variable all weekend and I didn't
>> managed to fix it. When action is defined as redirect action to another
>> namespace, and when that action is called, another action called method
>> doesn't see my session variables. I just changed this redirect action to
>> that another namespace, as standard action (not redirect) and I now see
>> my
>> variables! I don't have any idea why it doesn't work with redirect
>> action,
>> but I'm SURE that there is some problem.
>>
>> I have one question regarding refactoring action classes, is it much to
>> have
>> 20 actions per one namespace/action class ?
>>
>> --
>> Regards, Milan
>>  
>
>
> --
> --
> Al Sutton
>
> W: www.alsutton.com
> T: twitter.com/alsutton
>
>
> ---------------------------------------------------------------------
> 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_189736.ezm (zipped)
More like;

<package name="somePackage" namespace="/myNamespace" extends="struts-default">
 <action name="load" method="load" class="FirstObjectManager">...</action>
 <action name="save" method="save" class="FirstObjectManager">...</action>
 <action name="load" method="load" class="SecondObjectManager">...</action>
 <action name="save" method="save" class="SecondObjectManager">...</action>
 ...
</package>

You can also use singletons, utility classes, and good old-fashioned
inheritance to reduce code duplication (remember, Actions don't have to
extend ActionSupport, ActionSupport is just a utility class).

Al.

Milan Milanovic wrote:
> Dear Al,
>
> O.K. You suggest that I have multiple classes in one package/namespace, like
> this:
>
> <package name="somePackafe" namespace="/myNamespace"
> extends="struts-default">
>
>  <action name="load" method="execute" class="FirstActionClass">
>             ...
>         </action>
>
>         ...
>
>         <action name="save" method="execute" class="SecondActionClass">
>             ...
>         </action>
> </package>
>
> ?
>
> I understand what are you talking about, but my class is connected to little
> bit complex jsp-s, where I have, reading/saving master object,
> reading/saving its child objects, some links to other objects, and all of
> that must be placed during user input, like wizard, so it's hard to separate
> code in two classes, because I will have a lot of duplicate code
> (attributes).
>
> --
> Regards, Milan
>
>
> Al Sutton wrote:
>  
>> You don't need to have all your actions for a namespace in a single
>> class, you can use multiple classes.
>>
>> I usually group methods acting on a common object into a single class
>> which usually leaves me with the 5 public methods in a class which map
>> to actions (typically CRUD plus a View method), and multiple classes for
>> different object types.
>>
>> Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public
>> action methods, the number of private methods you have will depend on
>> your app).
>>
>> Al.
>>
>>
>> Milan Milanovic wrote:
>>  
>>> Dear Al and Dave,
>>>
>>> I tried to fix that error with session variable all weekend and I didn't
>>> managed to fix it. When action is defined as redirect action to another
>>> namespace, and when that action is called, another action called method
>>> doesn't see my session variables. I just changed this redirect action to
>>> that another namespace, as standard action (not redirect) and I now see
>>> my
>>> variables! I don't have any idea why it doesn't work with redirect
>>> action,
>>> but I'm SURE that there is some problem.
>>>
>>> I have one question regarding refactoring action classes, is it much to
>>> have
>>> 20 actions per one namespace/action class ?
>>>
>>> --
>>> Regards, Milan
>>>  
>>>    
>> --
>> --
>> Al Sutton
>>
>> W: www.alsutton.com
>> T: twitter.com/alsutton
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>>  
>
>  


--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


Attachment: user_189738.ezm (zipped)

Thanks Al.

But in this way, how I'll now which load is for which class when defining a
link ?

--
Regards, Milan


Al Sutton wrote:
>
> More like;
>
> <package name="somePackage" namespace="/myNamespace"
> extends="struts-default">
>  <action name="load" method="load" class="FirstObjectManager">...</action>
>  <action name="save" method="save" class="FirstObjectManager">...</action>
>  <action name="load" method="load"
> class="SecondObjectManager">...</action>
>  <action name="save" method="save"
> class="SecondObjectManager">...</action>
>  ...
> </package>
>
> You can also use singletons, utility classes, and good old-fashioned
> inheritance to reduce code duplication (remember, Actions don't have to
> extend ActionSupport, ActionSupport is just a utility class).
>
> Al.
>
> Milan Milanovic wrote:
>> Dear Al,
>>
>> O.K. You suggest that I have multiple classes in one package/namespace,
>> like
>> this:
>>
>> <package name="somePackafe" namespace="/myNamespace"
>> extends="struts-default">
>>
>>  <action name="load" method="execute" class="FirstActionClass">
>>             ...
>>         </action>
>>
>>         ...
>>
>>         <action name="save" method="execute"
>> class="SecondActionClass">
>>             ...
>>         </action>
>> </package>
>>
>> ?
>>
>> I understand what are you talking about, but my class is connected to
>> little
>> bit complex jsp-s, where I have, reading/saving master object,
>> reading/saving its child objects, some links to other objects, and all of
>> that must be placed during user input, like wizard, so it's hard to
>> separate
>> code in two classes, because I will have a lot of duplicate code
>> (attributes).
>>
>> --
>> Regards, Milan
>>
>>
>> Al Sutton wrote:
>>  
>>> You don't need to have all your actions for a namespace in a single
>>> class, you can use multiple classes.
>>>
>>> I usually group methods acting on a common object into a single class
>>> which usually leaves me with the 5 public methods in a class which map
>>> to actions (typically CRUD plus a View method), and multiple classes for
>>> different object types.
>>>
>>> Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public
>>> action methods, the number of private methods you have will depend on
>>> your app).
>>>
>>> Al.
>>>
>>>
>>> Milan Milanovic wrote:
>>>  
>>>> Dear Al and Dave,
>>>>
>>>> I tried to fix that error with session variable all weekend and I
>>>> didn't
>>>> managed to fix it. When action is defined as redirect action to another
>>>> namespace, and when that action is called, another action called method
>>>> doesn't see my session variables. I just changed this redirect action
>>>> to
>>>> that another namespace, as standard action (not redirect) and I now see
>>>> my
>>>> variables! I don't have any idea why it doesn't work with redirect
>>>> action,
>>>> but I'm SURE that there is some problem.
>>>>
>>>> I have one question regarding refactoring action classes, is it much to
>>>> have
>>>> 20 actions per one namespace/action class ?
>>>>
>>>> --
>>>> Regards, Milan
>>>>  
>>>>    
>>> --
>>> --
>>> Al Sutton
>>>
>>> W: www.alsutton.com
>>> T: twitter.com/alsutton
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>>  
>>
>>  
>
>
> --
> --
> Al Sutton
>
> W: www.alsutton.com
> T: twitter.com/alsutton
>
>
> ---------------------------------------------------------------------
> 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_189739.ezm (zipped)
You can change the action name to something more explicit so instead of
just load, save, load, save, you could have firstObjectLoad,
firstObjectSave,....

You may want to look up RESTful URLs to get some inspiration.

Al.

Milan Milanovic wrote:
> Thanks Al.
>
> But in this way, how I'll now which load is for which class when defining a
> link ?
>
> --
> Regards, Milan
>
>
> Al Sutton wrote:
>  
>> More like;
>>
>> <package name="somePackage" namespace="/myNamespace"
>> extends="struts-default">
>>  <action name="load" method="load" class="FirstObjectManager">...</action>
>>  <action name="save" method="save" class="FirstObjectManager">...</action>
>>  <action name="load" method="load"
>> class="SecondObjectManager">...</action>
>>  <action name="save" method="save"
>> class="SecondObjectManager">...</action>
>>  ...
>> </package>
>>
>> You can also use singletons, utility classes, and good old-fashioned
>> inheritance to reduce code duplication (remember, Actions don't have to
>> extend ActionSupport, ActionSupport is just a utility class).
>>
>> Al.
>>
>> Milan Milanovic wrote:
>>  
>>> Dear Al,
>>>
>>> O.K. You suggest that I have multiple classes in one package/namespace,
>>> like
>>> this:
>>>
>>> <package name="somePackafe" namespace="/myNamespace"
>>> extends="struts-default">
>>>
>>>  <action name="load" method="execute" class="FirstActionClass">
>>>             ...
>>>         </action>
>>>
>>>         ...
>>>
>>>         <action name="save" method="execute"
>>> class="SecondActionClass">
>>>             ...
>>>         </action>
>>> </package>
>>>
>>> ?
>>>
>>> I understand what are you talking about, but my class is connected to
>>> little
>>> bit complex jsp-s, where I have, reading/saving master object,
>>> reading/saving its child objects, some links to other objects, and all of
>>> that must be placed during user input, like wizard, so it's hard to
>>> separate
>>> code in two classes, because I will have a lot of duplicate code
>>> (attributes).
>>>
>>> --
>>> Regards, Milan
>>>
>>>
>>> Al Sutton wrote:
>>>  
>>>    
>>>> You don't need to have all your actions for a namespace in a single
>>>> class, you can use multiple classes.
>>>>
>>>> I usually group methods acting on a common object into a single class
>>>> which usually leaves me with the 5 public methods in a class which map
>>>> to actions (typically CRUD plus a View method), and multiple classes for
>>>> different object types.
>>>>
>>>> Imho 20 is too many, 10 is a lot, 5 is OK (don't forget that's public
>>>> action methods, the number of private methods you have will depend on
>>>> your app).
>>>>
>>>> Al.
>>>>
>>>>
>>>> Milan Milanovic wrote:
>>>>  
>>>>      
>>>>> Dear Al and Dave,
>>>>>
>>>>> I tried to fix that error with session variable all weekend and I
>>>>> didn't
>>>>> managed to fix it. When action is defined as redirect action to another
>>>>> namespace, and when that action is called, another action called method
>>>>> doesn't see my session variables. I just changed this redirect action
>>>>> to
>>>>> that another namespace, as standard action (not redirect) and I now see
>>>>> my
>>>>> variables! I don't have any idea why it doesn't work with redirect
>>>>> action,
>>>>> but I'm SURE that there is some problem.
>>>>>
>>>>> I have one question regarding refactoring action classes, is it much to
>>>>> have
>>>>> 20 actions per one namespace/action class ?
>>>>>
>>>>> --
>>>>> Regards, Milan
>>>>>  
>>>>>    
>>>>>      
>>>> --
>>>> --
>>>> Al Sutton
>>>>
>>>> W: www.alsutton.com
>>>> T: twitter.com/alsutton
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>>>
>>>>  
>>>>      
>>>  
>>>    
>> --
>> --
>> Al Sutton
>>
>> W: www.alsutton.com
>> T: twitter.com/alsutton
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>>  
>
>  


--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


Attachment: user_189732.ezm (zipped)

If I don't use a delay the wait.jsp is displayed on my input and success
results.

Because I don't want to display the wait.jsp on my input result I'm using a
delay.

If I use a delay (any length of time) the wait.jsp never displays.

Any ideas would be appreciated! Thank you.


<action name="search" class="com.struts.SomeClass">
    <interceptor-ref name="execAndWait">
        500
     </interceptor-ref>
     <result name="wait">/actions/wait.jsp</result>
     <result name="input">/actions/SomeClass-input.jsp</result>
     <result name="success">/actions/SomeClass-success.jsp</result>    
</action>
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189734.ezm (zipped)
Hi get a problem with the caption parameter of this example, it is sent and
found by the MultiPartRequest Handler, but it is not set by the
ParametersInterceptor; look at the stacktrace:

18:11:49,119 DEBUG [org.apache.struts2.dispatcher.multipart.MultiPartRequest]
Found item upload
18:11:49,119 DEBUG [org.apache.struts2.dispatcher.multipart.MultiPartRequest]
Item is a file upload
18:11:49,119 DEBUG [org.apache.struts2.dispatcher.multipart.MultiPartRequest]
Found item caption
18:11:49,119 DEBUG [org.apache.struts2.dispatcher.multipart.MultiPartRequest]
Item is a normal form field
18:11:49,120 DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher]
Creating action proxy for name = fileUpload, namespace = /view
18:11:49,120 DEBUG [com.opensymphony.xwork2.DefaultActionProxy] Creating an
DefaultActionProxy for namespace /view and action name fileUpload
18:11:49,121 DEBUG [com.opensymphony.xwork2.interceptor.I18nInterceptor]
intercept '/view/fileUpload' {
18:11:49,121 DEBUG [com.opensymphony.xwork2.interceptor.I18nInterceptor]
requested_locale=null
18:11:49,121 DEBUG [com.opensymphony.xwork2.interceptor.I18nInterceptor]
before Locale=de_DE
18:11:49,122 DEBUG
[com.opensymphony.xwork2.interceptor.StaticParametersInterceptor] Setting
static parameters {}
18:11:49,122 DEBUG [com.opensymphony.xwork2.interceptor.ParametersInterceptor]
Setting params uploadFileName => [ a.txt ] uploadContentType => [
text/plain ] templateDir => [ template ] theme => [ xhtml ] up
load =>
[ /home/krah/Development/seu/pluto-1.1.5/work/Catalina/localhost/struts2-portlet-0.0.1-SNAPSHOT/upload__6f236e88_11b93a379fc__8000_00000000.tmp ]
struts.portlet.mode => [ view ] struts.portlet.action
=> [ /view/fileUpload ]

Does look like a bug, is it?
If it is one, is this one already known and solved or some workarounds
available?
Or did i miss something?

--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
 -- Linus Torvalds

Attachment: smime.p7s (zipped)
Attachment: user_189735.ezm (zipped)
Am Dienstag, 5. August 2008 18:18:51 schrieb Torsten Krah:
> Does look like a bug, is it?

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

May this be related to this bug?
Can anyone tell me what is/was the fix? Can i use the latestet GA release and
get this working (without patching)?

--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
 -- Linus Torvalds

Attachment: smime.p7s (zipped)
Attachment: user_189737.ezm (zipped)
Hello,
See if this helps you.
I have a form with remote DIV which displays chart after user clicks on
submit.
Trick here is to generate chart object, store it in session and display it
in separate JSP.  Remove the form part if you want to display just the
dynamic-DIV using Chart image.

Form.jsp [
    <s:form>
       <s:url id="display_chart" value="DrawChart_draw.action"
namespace="/user" />

       <s:submit value="Draw chart" href="%{display_chart}"
theme="ajax" targets="*chart_div*" />
       <br />
     </s:form>

  <h4>Your Running Chart</h4>
    <div id="*chart_div*">
    </div>   <!-- End display chart -->
  </div>

]


display_chart.jsp [
<body>

  <img src="/MyApp/user/DrawChart_display.action" alt="No Chart Image"
/>
</body>

]


struts.xml[
      <package name="user" extends
="struts-default,jfreechart-default">
       <!-- Separate method to draw and display due to Remote
DIV/Button tag contsraints.
        -->
       <action name="DrawChart_input" method="input"
class=".xxx.DrawChart">
            <result name="input">form.jsp </result>
       </action>

       <action name="DrawChart_draw" method="draw"
class="xxx..DrawChart">
            <result name="success">/jsp/display_chart.jsp </result>
       </action>
       <action name="DrawChart_display" method="display"
class="xxx.DrawChart">
            <result name="success" type="chart">
               <param name="width">400</param>
               <param name="height">300</param>
             </result>
       </action>

      </package>
]


DrawChart.java [
  JFreeChart chart;
  public String draw() throws Exception {
          //chart creation logic.
        //generate chart object
        chart = ....
        session = ....
        session.put("CHART", chart);
       return success;
  }

  /**
  * returns chart obejct from the session.
    This methos is used by display_chart.jsp
  */
  public String display() throws Exception {
    session = ...get session ...
    this.chart = (JFreeChart) session.get("CHART");
    if(chart == null) {
       addActionError(getText("error.nochart"));
       return ERROR;
    }
    return SUCCESS;
  }

  // this method will get called if we specify <param
name="value">chart</param>
  public JFreeChart getChart() {
       return chart;
  }

  /**
  * <p> input action
  */
  public String input() throws Exception {
    return INPUT;
  }

]



Leena
©2008 gg3721.com - Jax Systems, LLC, U.S.A.