Author Login
Post Reply
user Digest 15 Jul 2009 06:16:48 -0000 Issue 8751
Topics (messages 200705 through 200725):
struts2 doubleselect tag doesn't support multiselect?
200705 by: FreshAir
Re: MethodFilterInterceptor <package>
200706 by: stanlick.gmail.com
200724 by: cilquirm
Change style by javascript after loading
200707 by: Felipe Fraga
Re: Uploading large files
200708 by: Wes Wannemacher
200710 by: Dale Newfield
Re: Help with JSP and javascript
200709 by: Security Management
200713 by: Martin Gainty
Re: Migration from Struts1 to Struts2
200711 by: Dale Newfield
Re: Stream Result and Japanese data getting corrupted
200712 by: David Canos
how to configure struts2 for /*.action?
200714 by: ravi_eze
200716 by: Kawczynski, David
200718 by: è°¢å¬é¸£
200719 by: Wes Wannemacher
200720 by: Dale Newfield
200723 by: ravi_eze
Re: JSON Plugin and S:Action
200715 by: Musachy Barroso
200717 by: Chris Pratt
200725 by: Chris Pratt
Re: For s:textfield tag how to get value for title attribute from resource bundle.
200721 by: wkbutler
Struts1.3.10 and command chains
200722 by: Struts Two
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_200705.ezm (zipped)
Hi,
I am currently using struts2.1.6 tag on my web pages. Yet when it comes to
<s:doubleselect/> tag, I find it seemingly impossible to make its double
list multiple-selected. The following is my tag on the form page:
<s:doubleselect labelposition="left" labelSeparator=":"
requiredposition="right" doubleMultiple="true"
list="codeCategoryMap.keySet()" listKey="codeNumber"
listValue="codeMean" name="userProduct.proType" label="product type"
doubleName="userProduct.proGenre" doubleList="codeCategoryMap[top]"
doubleListKey="itemNumber" doubleListValue="cateName"
doubleValue="selectedProGenres">
</s:doubleselect>
The attribute "doubleMultiple" is set to be true so that when I choose a
type from its select list, I can multi-select corresponding items belonging
to the type in double list. My problem is that when I want to edit this VO,
I can't make the double list automatically multi-selected by loading it from
DB. I even transfer "userProduct.proGenre" from a string(like: "001, 005,
003") to a List<String>, as you can see in "doubleValue="selectedProGenres""
in which "selectedProGenres" is that List<String>.However all these efforts
appear failed. Is there any way that this doubleselect can automatically get
multi-selected?
Any suggestion would be highly appreciated. Thank you in advance!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200706.ezm (zipped)The logic considers the action name without regard to the package the action
is contained within.
On Mon, Jul 13, 2009 at 5:53 PM, Musachy Barroso <musachy@(protected):
> > independent of the methods' package name
>
> I am not sure what you mean by this. example?
>
> musachy
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200724.ezm (zipped)
stanlick wrote:
>
> The logic considers the action name without regard to the package the
> action
> is contained within.
>
I'm confused by this also. I thought an example implied either a real-world
or contrived scenario where the problem in question manifests itself.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200707.ezm (zipped)Hello all,
I would like to change struts templates, so I can add some Javascript
after an action is loaded and result put in some div.
Problem is that I can't seem to find the template or javascript file for that.
I am aware of the afterLoading attribute, but since it is deprecated I
don't want to use it.
Thanks in advance,
Felipe

Attachment:
user_200708.ezm (zipped)There is a pretty good information here -
http://struts.apache.org/2.x/docs/file-upload.html
The internal details are relatively non-complex. The dispatcher hands
file uploads off to this class -
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java?annotate=781501
If you're familiar with commons-fileupload, it's pretty straightforward.
As far as using the new plugin, it's in the sandbox right now, but
it's not much different than the original implementation, I just
changed some things up so that other implementations can be plugged in
(rather than taking the default FileItemFactory, etc.). Let me know
how it works for you.
-Wes
On Tue, Jul 14, 2009 at 6:39 AM, Daniele
Development-ML<daniele.dml@(protected):
> Hello,
> my process in getting to this was 1. looking for some API to stream
> upload/download data directly into the HD, 2. found the Common File Upload
> API, 3. Went to the FAQ section to see how I could integrate in my Struts
> application ( http://commons.apache.org/fileupload/faq.html ), and read the
> last point - from which I assumed Struts doesn't use this modality.
>
> In addition, I didn't find any entry attached to Struts on the Web about
> this, and also I couldn't find any entry about configuration options on the
> upload/download modalities.
>
> Now, I'm a bit confused from your last message, Wes, is Dale right about
> multipart requests streamed into the HD directly?
>
> I'll use your plugin, and I'll report my experience once done.
>
> Thanks,
>
> Daniele
>
> On Mon, Jul 13, 2009 at 9:43 PM, Wes Wannemacher <wesw@(protected):
>
>> On Mon, Jul 13, 2009 at 4:34 PM, Dale Newfield<dale@(protected):
>> >
>> >> I remember once I came across another possible solution, which allows
>> the
>> >> serialization of the file data as it is received from the server.
>> >
>> > I assume that the multipart request processor streams the content into a
>> > file without first loading the entire thing into memory...if you know
>> that
>> > this is not the case, please point out the offending portion of code...
>> >
>> > -Dale
>> >
>>
>> I am pretty sure you are right Dale, there was a JIRA that the choice
>> was unavailable. The GAE doesn't allow you to write files anywhere on
>> the filesystem, and there was no option to configure this behavior.
>> That's one of the reasons I started a plugin. The choices are
>> available in commons-fileupload, but we just weren't exposing them.
>> I'm guessing the files are getting serialized (I think the threshold
>> is way less than what he is talking about), he just didn't see them
>> anywhere.
>>
>> -Wes
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
--
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_200710.ezm (zipped)Daniele Development-ML wrote:
> 3. Went to the FAQ section to see how I could integrate in my Struts
> application ( http://commons.apache.org/fileupload/faq.html ), and read the
> last point - from which I assumed Struts doesn't use this modality.
Those two FAQs are related to Struts1, not Struts2. In Struts2 the
standard way to do this is to use the fileUpload interceptor, and then
the action need not be special, just have a few relevant setters.
> download
For this you'll want to look into the "stream" result type.
-Dale

Attachment:
user_200709.ezm (zipped)For the record, here's what works.
<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(\\'' + #form_name + '\\').request(); setTimeout(new
Ajax.Updater(\\'' + #door_url + '\\', \\'' + #foo +'\\', {evalScripts:
true}), 1000000); return false;'}"/>
Thanks for the help.
Mike.
-----Original Message-----
From: Wes Wannemacher [mailto:wesw@(protected)]
Sent: Friday, July 10, 2009 3:03 PM
To: Struts Users Mailing List
Subject: Re: Help with JSP and javascript
There is a way to escape quotes in OGNL... I thought I had a sample sitting
around somewhere but I am not finding it. Check google. I would guess that
you
could just escape the single quotes you need and the rest will fall into
place.
-Wes
On Friday 10 July 2009 14:54:30 Security Management wrote:
> OK, thanks Wes, I'm making progress:
>
> This:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;'}"/>
>
>
> Generates:
>
> <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> /images/unlocked.png" id="door3_0" value="Submit"
> onclick="$(door3).request(); return false
> ;" alt="Unlocked"/>
>
> If I use single-quotes inside, I get errors. Double quotes as well.
> Escaped double quotes give me ", but what I really need is:
>
> onclick="$('door3').request(); return false;"
>
> Note the single quotes around 'door3', which is what #foo is.
>
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@(protected)]
> Sent: Friday, July 10, 2009 12:09 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
>
> On Friday 10 July 2009 11:49:04 Security Management wrote:
> > Can someone suggest a way to do this:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> >
> > I have tried a bunch of ways, but always wind up with the
> > <s:property... in the resulting HTML, rather than
'$("form1").submit()'
> > like I need.
> >
> > Thanks
>
> Try this -
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;}'}"/>
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_200713.ezm (zipped)
Good Morning Mike
http://www.prototypejs.org/api/ajax/updater
could you illustrate how the prototype JS function works in struts?
are you using a <struts>plugin?
how would struts identify and create the 'items' container for 1st parameter
illustrated here:
new Ajax.Updater('items', '/items', {
parameters: { text: $F('text') }
});
when script elements are in response and evalScripts=true
evalScripts
false
This determines whether <script> elements in the response text are evaluated or not.where are the script functions located that would be eval'ed
can prototype return json formatted response?
apologies for long-winded response,
Martin
______________________________________________
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.
> From: list-subscriptions@(protected)
> To: user@(protected)
> Subject: RE: Help with JSP and javascript
> Date: Tue, 14 Jul 2009 09:33:23 -0400
>
> For the record, here's what works.
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(\\'' + #form_name + '\\').request(); setTimeout(new
> Ajax.Updater(\\'' + #door_url + '\\', \\'' + #foo +'\\', {evalScripts:
> true}), 1000000); return false;'}"/>
>
> Thanks for the help.
>
> Mike.
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@(protected)]
> Sent: Friday, July 10, 2009 3:03 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
>
> There is a way to escape quotes in OGNL... I thought I had a sample sitting
> around somewhere but I am not finding it. Check google. I would guess that
> you
> could just escape the single quotes you need and the rest will fall into
> place.
>
> -Wes
>
> On Friday 10 July 2009 14:54:30 Security Management wrote:
> > OK, thanks Wes, I'm making progress:
> >
> > This:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;'}"/>
> >
> >
> > Generates:
> >
> > <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> > /images/unlocked.png" id="door3_0" value="Submit"
> > onclick="$(door3).request(); return false
> > ;" alt="Unlocked"/>
> >
> > If I use single-quotes inside, I get errors. Double quotes as well.
> > Escaped double quotes give me ", but what I really need is:
> >
> > onclick="$('door3').request(); return false;"
> >
> > Note the single quotes around 'door3', which is what #foo is.
> >
> >
> > -----Original Message-----
> > From: Wes Wannemacher [mailto:wesw@(protected)]
> > Sent: Friday, July 10, 2009 12:09 PM
> > To: Struts Users Mailing List
> > Subject: Re: Help with JSP and javascript
> >
> > On Friday 10 July 2009 11:49:04 Security Management wrote:
> > > Can someone suggest a way to do this:
> > >
> > > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> > >
> > > I have tried a bunch of ways, but always wind up with the
> > > <s:property... in the resulting HTML, rather than
> '$("form1").submit()'
> > > like I need.
> > >
> > > Thanks
> >
> > Try this -
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;}'}"/>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> 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)
>
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Attachment:
user_200711.ezm (zipped)Lasantha Pambagoda wrote:
> We have been monitoring both memory and CPU usage, Interesting thing
> is memory is normal and only CPU is coursing the problem after
> migration.
So have you run this in a profiler to see where it's spending all its time?
-Dale

Attachment:
user_200712.ezm (zipped)Hi folks i'm facing the same problem.
if a setup *struts.locale=en_GB* in struts.properties I get
ISO-8859-1 instead of UTF-8 in some result-type text/plain received.
before set up this locale property it worked fine... and all other GETs and
POSTs queries are working as expected in UTF-8...
Is there a way to set the charset in a result stream-type?
the answer is yes in a little dirty way....
<result type="stream" name="success">
<param name="contentType">text/plain*;charset=UTF-8*</param>
<param name="inputName">inputStream</param>
</result>
can anyone change add this to the wiki?
2009/3/10 shyamb <shyam.bhaskaran@(protected)>
>
> Hi,
>
> I am using Struts2 Stream Result for Downloading To Excel, by constructing
> the inputStream as required for Stream Result as :
>
> inputStream = new
> ByteArrayInputStream(getSomeStringData().getBytes("UTF-8"));
>
> My action is configured in struts.xml as follows
> <result name="sendFile" type="stream">
> application/csv
> UTF-8
> inputStream
> attachment:filename="CasesDetails.csv"
>
> 1024
> </result>
>
> In my jsp page there is a button on click of which I am calling the Action
> and I also put in this page the following:
>
> <%@(protected)"%>
> <%@(protected)"%>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
>
> The problem which I am facing is when the method getSomeStringData() is
> returning Japanese or Chinese characters. In such scenarios the excel file
> data is containing junk characters (?????) etc.
>
> Has anyone faced a similar problem or anyone has any solutions for fixing
> this issue
> --
> View this message in context:
> http://www.nabble.com/Stream-Result-and-Japanese-data-getting-corrupted-tp22432726p22432726.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_200714.ezm (zipped)
hi,
We have an application in jsps. Now we added new functionality using Struts
2.
The jsps (not struts2 jsps) have a file upload utility ( where the multi
part form posts request to /upload.jsp). Now, this upload doesnt work if we
have the struts2 filter mapping in web.xml. If we remove teh mapping then
the upload works but not the struts2 application.
The filter dispatcher documentation tells not to try other than /* i.e.. i
cant wrtie /*.do or /*.action here. Why so? any reason? or in other words if
i want to get this then how do i proceed?
The filter is mapped to the end of the chain as said in the documentation.
The cleanup Action context filter is placed before its execution.
Any clues/ ideas? Please help.
regards,
ravi
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200716.ezm (zipped)I was in the same boat...
One of my clients use apache httpd for all static content
and tomcat for all dynamic content... there are several
Struts2 jars that house css and js files. If you don't
map everything to the Struts2 filter your Struts2 app
won't be as full-featured as it could be. (Javascript
validation won't work, any themed presentation will appear
quite plain, etc...)
If you really want to use a non-default filter mapping
pattern, this can be worked around... You just have to
determine the files are returning 404 status codes to the
browser (use firebug or yslow). Find those files in the
struts jars, and extract them (preserving path info) to
the web server.
> -----Original Message-----
> From: ravi_eze [mailto:ravichandrac@(protected)]
> Sent: Tuesday, July 14, 2009 10:42 AM
> To: user@(protected)
> Subject: how to configure struts2 for /*.action?
>
>
> hi,
>
> We have an application in jsps. Now we added new
> functionality using Struts
> 2.
>
> The jsps (not struts2 jsps) have a file upload utility (
> where the multi
> part form posts request to /upload.jsp). Now, this upload
> doesnt work if we
> have the struts2 filter mapping in web.xml. If we remove teh
> mapping then
> the upload works but not the struts2 application.
>
> The filter dispatcher documentation tells not to try other
> than /* i.e.. i
> cant wrtie /*.do or /*.action here. Why so? any reason? or in
> other words if
> i want to get this then how do i proceed?
>
> The filter is mapped to the end of the chain as said in the
> documentation.
> The cleanup Action context filter is placed before its execution.
>
> Any clues/ ideas? Please help.
>
> regards,
> ravi
> --
> View this message in context:
> http://www.nabble.com/how-to-configure-struts2-for--*.action--
> tp24481000p24481000.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)
>
>
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.

Attachment:
user_200718.ezm (zipped)Hi david,
I have another question, I want to forward my Struts2 result to one jsp page
which included in one jar file, how can I locate the jsp file? You said
"...there are several Struts2 jars that house css and js files...", do you
have any idea how to get these files?
Thanks
On Tue, Jul 14, 2009 at 23:29, Kawczynski, David <david_kawczynski@(protected)
> wrote:
> I was in the same boat...
> One of my clients use apache httpd for all static content
> and tomcat for all dynamic content... there are several
> Struts2 jars that house css and js files. If you don't
> map everything to the Struts2 filter your Struts2 app
> won't be as full-featured as it could be. (Javascript
> validation won't work, any themed presentation will appear
> quite plain, etc...)
>
> If you really want to use a non-default filter mapping
> pattern, this can be worked around... You just have to
> determine the files are returning 404 status codes to the
> browser (use firebug or yslow). Find those files in the
> struts jars, and extract them (preserving path info) to
> the web server.
>
>
> > -----Original Message-----
> > From: ravi_eze [mailto:ravichandrac@(protected)]
> > Sent: Tuesday, July 14, 2009 10:42 AM
> > To: user@(protected)
> > Subject: how to configure struts2 for /*.action?
> >
> >
> > hi,
> >
> > We have an application in jsps. Now we added new
> > functionality using Struts
> > 2.
> >
> > The jsps (not struts2 jsps) have a file upload utility (
> > where the multi
> > part form posts request to /upload.jsp). Now, this upload
> > doesnt work if we
> > have the struts2 filter mapping in web.xml. If we remove teh
> > mapping then
> > the upload works but not the struts2 application.
> >
> > The filter dispatcher documentation tells not to try other
> > than /* i.e.. i
> > cant wrtie /*.do or /*.action here. Why so? any reason? or in
> > other words if
> > i want to get this then how do i proceed?
> >
> > The filter is mapped to the end of the chain as said in the
> > documentation.
> > The cleanup Action context filter is placed before its execution.
> >
> > Any clues/ ideas? Please help.
> >
> > regards,
> > ravi
> > --
> > View this message in context:
> > http://www.nabble.com/how-to-configure-struts2-for--*.action--
> > tp24481000p24481000.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)
> >
> >
> Notice: This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or
> MSD and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and
> then delete it from your system.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
*********************************************
Xie Dongming
MAIL(Gtalk):msys.xdm@(protected)
Mobie:+86-15071342225
*********************************************
---------------------------------------------------------------------
俺终身奋斗的最低革命纲领:农妇--山泉--有点儿田

Attachment:
user_200719.ezm (zipped)2009/7/14 谢冬鸣 <msys.xdm@(protected)>:
> Hi david,
> I have another question, I want to forward my Struts2 result to one jsp page
> which included in one jar file, how can I locate the jsp file? You said
> "...there are several Struts2 jars that house css and js files...", do you
> have any idea how to get these files?
>
> Thanks
>
> On Tue, Jul 14, 2009 at 23:29, Kawczynski, David <david_kawczynski@(protected)
>> wrote:
>
>> I was in the same boat...
>> One of my clients use apache httpd for all static content
>> and tomcat for all dynamic content... there are several
>> Struts2 jars that house css and js files. If you don't
>> map everything to the Struts2 filter your Struts2 app
>> won't be as full-featured as it could be. (Javascript
>> validation won't work, any themed presentation will appear
>> quite plain, etc...)
>>
As far as I know, the content that is served by struts directly (css,
js and image files) are always mapped to URLs that start with /struts.
It might be possible to create two mappings, one to /struts/* and
another to *.action. As for the question above, I don't think there is
any good way to serve a JSP out of a jar file. Rather than packaging
your JSPs into your jar, can you configure your build to copy the JSP
somewhere into your app so that it can be served traditionally? If you
have to put the content into a jar, maybe try looking at freemarker.
We use freemarker internally for generating tag output because we can
package it in the jar files and it is more general-purpose than JSP.
-Wes
--
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_200720.ezm (zipped)谢冬鸣 wrote:
> I have another question,
So please start a new thread. Hijacking another is impolite.
That said, this recent thread answers your question: It can't be done.
http://www.nabble.com/Struts-2-Plug-in-and-JSP-404-td24415564.html#a24416948
-Dale

Attachment:
user_200723.ezm (zipped)
i didnt get u,
did u mean that we cant map only *.action to struts filter? Or u were
telling of some workaround? Why does struts put this restriction that all
urls should pass through him? And Why does he put restrictions at container
level.
see web.xml is the container level and i have my own applications/ filters
in it. I should be given the choice to decide what urls should go to what
and what not! Now why does struts come at this level at all??; Now that it
comes what is the work around? The Filter dispatcher documentations says not
to use other than '/*' for url pattern. He doesnt say what i need to do if
at all i cant put /* there?
Please help, this is unexpected behavior of our application. We were
thinking all are fine, but suddenly this file upload didnt work (of prev jsp
application).
any help/ ponters are of great help.
regards,
ravi
Wes Wannemacher wrote:
>
> 2009/7/14 谢冬鸣 <msys.xdm@(protected)>:
>> Hi david,
>> I have another question, I want to forward my Struts2 result to one jsp
>> page
>> which included in one jar file, how can I locate the jsp file? You said
>> "...there are several Struts2 jars that house css and js files...", do
>> you
>> have any idea how to get these files?
>>
>> Thanks
>>
>> On Tue, Jul 14, 2009 at 23:29, Kawczynski, David
>> <david_kawczynski@(protected)
>>> wrote:
>>
>>> I was in the same boat...
>>> One of my clients use apache httpd for all static content
>>> and tomcat for all dynamic content... there are several
>>> Struts2 jars that house css and js files. If you don't
>>> map everything to the Struts2 filter your Struts2 app
>>> won't be as full-featured as it could be. (Javascript
>>> validation won't work, any themed presentation will appear
>>> quite plain, etc...)
>>>
>
> As far as I know, the content that is served by struts directly (css,
> js and image files) are always mapped to URLs that start with /struts.
> It might be possible to create two mappings, one to /struts/* and
> another to *.action. As for the question above, I don't think there is
> any good way to serve a JSP out of a jar file. Rather than packaging
> your JSPs into your jar, can you configure your build to copy the JSP
> somewhere into your app so that it can be served traditionally? If you
> have to put the content into a jar, maybe try looking at freemarker.
> We use freemarker internally for generating tag output because we can
> package it in the jar files and it is more general-purpose than JSP.
>
> -Wes
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> 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_200715.ezm (zipped)Never thought of this use case before. Does it work if you use the
action directly, instead of calling from a jsp?
musachy
On Mon, Jul 13, 2009 at 11:17 PM, Chris Pratt<thechrispratt@(protected):
> I'm having a problem using <s:action executeResult="true"> with an action
> whose result type is json. It doesn't insert the results. My Action is
> something like:
>
> public class InitCalendarAction {
> private List<List<String>> json;
>
> /**
> * Get the JSON Object to be Serialized
> *
> * @return JSON Object
> */
> public Object getJson () {
> return json;
> } //getJson
>
> /**
> * Prepare the Object to be Serialized using JSON
> *
> * @return "success";
> */
> public String execute () {
> Category cat;
> Category[] daily = user.getPlan().getDailyCategories();
> Calendar cal = Calendar.getInstance();
> cal.set(Calendar.DATE,1);
> int first = cal.get(Calendar.DAY_OF_WEEK) - 1;
> List<String> row;
> json = new ArrayList<List<String>>();
> for(int day = 1;day <= cal.getMaximum(Calendar.DATE);day++) {
> row = new ArrayList<String>();
> row.add("true");
> cat = daily[(day + first) % 7];
> row.add(cat.name().toLowerCase());
> row.add(cat.name());
> json.add(row);
> }
> return "success";
> } //execute
>
> } //*InitCalendarAction
>
> I have the action defined as:
>
> <action name="init-calendar" class="initCalendarAction">
> <result type="json">
> <param name="root">json</param>
> </result>
> </action>
>
> In my JSP, I have:
>
> var hilights = "<s:action name='init-calendar' namespace='/'
> executeResult='/'/>";
>
> But instead of the expected:
>
> var hilights = "[ [ "true", "cardio", "Cardio"], [ "true", "upperbody",
> "Upper Body"] ... ]";
>
> I get:
> var hilights = "";
>
> There are no errors in the logs and when I write out each row in the array,
> everything is there as expected, but there's just no output. Any idea's
> why?
> (*Chris*)
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_200717.ezm (zipped)Don't know, I was trying to initialize the variable using the same action
that would be used to update it. And, because of this problem, I haven't
been able to initialize it. Maybe I'll give it a try later.
(*Chris*)
On Tue, Jul 14, 2009 at 7:49 AM, Musachy Barroso <musachy@(protected):
> Never thought of this use case before. Does it work if you use the
> action directly, instead of calling from a jsp?
>
> musachy
>
> On Mon, Jul 13, 2009 at 11:17 PM, Chris Pratt<thechrispratt@(protected)>
> wrote:
> > I'm having a problem using <s:action executeResult="true"> with an action
> > whose result type is json. It doesn't insert the results. My Action is
> > something like:
> >
> > public class InitCalendarAction {
> > private List<List<String>> json;
> >
> > /**
> > * Get the JSON Object to be Serialized
> > *
> > * @return JSON Object
> > */
> > public Object getJson () {
> > return json;
> > } //getJson
> >
> > /**
> > * Prepare the Object to be Serialized using JSON
> > *
> > * @return "success";
> > */
> > public String execute () {
> > Category cat;
> > Category[] daily = user.getPlan().getDailyCategories();
> > Calendar cal = Calendar.getInstance();
> > cal.set(Calendar.DATE,1);
> > int first = cal.get(Calendar.DAY_OF_WEEK) - 1;
> > List<String> row;
> > json = new ArrayList<List<String>>();
> > for(int day = 1;day <= cal.getMaximum(Calendar.DATE);day++) {
> > row = new ArrayList<String>();
> > row.add("true");
> > cat = daily[(day + first) % 7];
> > row.add(cat.name().toLowerCase());
> > row.add(cat.name());
> > json.add(row);
> > }
> > return "success";
> > } //execute
> >
> > } //*InitCalendarAction
> >
> > I have the action defined as:
> >
> > <action name="init-calendar" class="initCalendarAction">
> > <result type="json">
> > <param name="root">json</param>
> > </result>
> > </action>
> >
> > In my JSP, I have:
> >
> > var hilights = "<s:action name='init-calendar' namespace='/'
> > executeResult='/'/>";
> >
> > But instead of the expected:
> >
> > var hilights = "[ [ "true", "cardio", "Cardio"], [ "true",
> "upperbody",
> > "Upper Body"] ... ]";
> >
> > I get:
> > var hilights = "";
> >
> > There are no errors in the logs and when I write out each row in the
> array,
> > everything is there as expected, but there's just no output. Any idea's
> > why?
> > (*Chris*)
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200725.ezm (zipped)Ok, calling it from AJAX, instead of <s:action>, seems to work, but
unfortunately it appears the JSON Plugin isn't compatible with Struts 2.1.
I'm currently using 2.1.2, but the documentation says that it works with
2.0.6. Is there any plan to update it to work with 2.1? What I'm seeing
is:
java.lang.NoSuchMethodError:
com.opensymphony.xwork2.ActionContext.get(Ljava/lang/String;)Ljava/lang/Object;
at com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:157)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult (
DefaultActionInvocation.java:355)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (
DefaultActionInvocation.java:259)
...
Thanks.
(*Chris*)
On Tue, Jul 14, 2009 at 8:33 AM, Chris Pratt <thechrispratt@(protected):
> Don't know, I was trying to initialize the variable using the same action
> that would be used to update it. And, because of this problem, I haven't
> been able to initialize it. Maybe I'll give it a try later.
> (*Chris*)
>
>
> On Tue, Jul 14, 2009 at 7:49 AM, Musachy Barroso <musachy@(protected):
>
>> Never thought of this use case before. Does it work if you use the
>> action directly, instead of calling from a jsp?
>>
>> musachy
>>
>> On Mon, Jul 13, 2009 at 11:17 PM, Chris Pratt<thechrispratt@(protected)>
>> wrote:
>> > I'm having a problem using <s:action executeResult="true"> with an
>> action
>> > whose result type is json. It doesn't insert the results. My Action is
>> > something like:
>> >
>> > public class InitCalendarAction {
>> > private List<List<String>> json;
>> >
>> > /**
>> > * Get the JSON Object to be Serialized
>> > *
>> > * @return JSON Object
>> > */
>> > public Object getJson () {
>> > return json;
>> > } //getJson
>> >
>> > /**
>> > * Prepare the Object to be Serialized using JSON
>> > *
>> > * @return "success";
>> > */
>> > public String execute () {
>> > Category cat;
>> > Category[] daily = user.getPlan().getDailyCategories();
>> > Calendar cal = Calendar.getInstance();
>> > cal.set(Calendar.DATE,1);
>> > int first = cal.get(Calendar.DAY_OF_WEEK) - 1;
>> > List<String> row;
>> > json = new ArrayList<List<String>>();
>> > for(int day = 1;day <= cal.getMaximum(Calendar.DATE);day++) {
>> > row = new ArrayList<String>();
>> > row.add("true");
>> > cat = daily[(day + first) % 7];
>> > row.add(cat.name().toLowerCase());
>> > row.add(cat.name());
>> > json.add(row);
>> > }
>> > return "success";
>> > } //execute
>> >
>> > } //*InitCalendarAction
>> >
>> > I have the action defined as:
>> >
>> > <action name="init-calendar" class="initCalendarAction">
>> > <result type="json">
>> > <param name="root">json</param>
>> > </result>
>> > </action>
>> >
>> > In my JSP, I have:
>> >
>> > var hilights = "<s:action name='init-calendar' namespace='/'
>> > executeResult='/'/>";
>> >
>> > But instead of the expected:
>> >
>> > var hilights = "[ [ "true", "cardio", "Cardio"], [ "true",
>> "upperbody",
>> > "Upper Body"] ... ]";
>> >
>> > I get:
>> > var hilights = "";
>> >
>> > There are no errors in the logs and when I write out each row in the
>> array,
>> > everything is there as expected, but there's just no output. Any idea's
>> > why?
>> > (*Chris*)
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_200721.ezm (zipped)
Well I took Dave's advice from another thread
(http://www.nabble.com/-S2--Dynamic-Text-Tag-Attributes-td19436146.html#a19436146)
and just implemented this in my action. Oh well. Thanks guys -
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200722.ezm (zipped)Prior to struts 1.3, If I wanted to load my catalog (say catalog.xml) file (which had all the business logic in chains for my app), I had to add the followings to my web.xml:
<context-param>
<description></description>
<param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
<param-value>resources/catalog.xml</param-value>
</context-param>
<listener>
<description>Chain Listener</description>
<display-name>Chain Listener</display-name>
<listener-class>
org.apache.commons.chain.web.ChainListener</listener-class>
</listener>
In struts 1.3.10 request processing cycle is rewritten using command chains and the jar file is part of struts apps. I was wondering if I want to load my own catalog [in which I have the list of all chains that runs my business logic], do I have to add ChainListener and CONFIG_CLASS_RESOURCE context parameter to my web.xml to be able to load my chain or command as follows:
Catalog catalog = CatalogFactory.getInstance().getCatalog();
Command command = catalog.getCommand("runTivoliCPUAVG");
__________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.