Author Login
Post Reply
user Digest 8 Apr 2008 16:16:05 -0000 Issue 7969
Topics (messages 185146 through 185168):
Re: Url-Parameters only set once
185146 by: Eric Nelson
185157 by: me
185164 by: Dave Newton
Re: Multiple Result in one Page
185147 by: Jeromy Evans
185149 by: Frans Thamura
185150 by: Jeromy Evans
185154 by: Frans Thamura
Noob question(s). Interceptor breaking forms, and Connection handling?
185148 by: Dave Belfer-Shevett
185151 by: Dave Newton
Re: interesting proxy + action chain issue
185152 by: Jeromy Evans
185153 by: Jeromy Evans
185166 by: Brad A Cupit
sitemesh + views configuration
185155 by: me
185159 by: Jeromy Evans
Downloading file rendered in JSP
185156 by: David Loup
185160 by: Brad A Cupit
185167 by: David Loup
185168 by: Brad A Cupit
another noob..
185158 by: Berger, Michael
185161 by: Antonio Petrelli
Commons Validator Issue with Collections
185162 by: Ghaznavi, Syed
Problem with struts in JSP
185163 by: De Landa Gil Agustin
Preparable Question
185165 by: manishbel
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_185146.ezm (zipped)Ah, you're right. Thanks for the correction.
--Eric
-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Monday, April 07, 2008 9:29 AM
To: Struts Users Mailing List
Subject: RE: Url-Parameters only set once
--- Eric Nelson <eric.nelson@(protected):
> You CAN set the property to a different value every time. Most of my
> action beans implement this behavior just fine. Did you make sure
your
> action bean implements the ParameterAware interface? This binds your
> action bean properties to the current values in the request scope.
Just for completeness, ParameterAware is for getting the map of
parameters,
not for binding those parameters to action properties.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185157.ezm (zipped)Yes of course that's what I thougt. But when I change the scope of the
spring bean to default
I could provide the id using a get request but nothing happens.
Now I keep it on prototype which is okay for this page.
Marc
Eric Nelson schrieb:
> You CAN set the property to a different value every time. Most of my
> action beans implement this behavior just fine. Did you make sure your
> action bean implements the ParameterAware interface? This binds your
> action bean properties to the current values in the request scope.
>
> --Eric
>
> -----Original Message-----
> From: Marc Ende [mailto:mlists@(protected)]
> Sent: Sunday, April 06, 2008 1:19 PM
> To: Struts Users Mailing List
> Subject: Re: Url-Parameters only set once
>
> Hello Dave,
>
> I've found a solution for that. The spring-action was standard-scoped
> and in cause of that it didn't accept the
> id parameter a second time.
>
> I think it's a little bit strange that it's impossible to set an
> property again when it's done before.
>
> Marc
>
>
>
>
> Dave Newton schrieb:
>
>> --- Marc Ende <mlists@(protected):
>>
>>
>>> I've got a list with several items which are linked to a
>>>
> details-action.
>
>>> If I klick on an item after the restart of the webapp a link like
>>> http://.../details.action?id=123
>>> is called. Everything is fine. I can see the correct details site.
>>> When I go back and klick on another item (with another id)
>>> the old id is called from the database and shown.
>>>
>>>
>> Without any further info it's hard to say what the problem might be.
>>
>> Actions are instantiated per-request, unless you've mis-configured a
>> Spring-defined action.
>>
>> Depending on how you're creating the links (and how your application
>>
> is laid
>
>> out) you may be getting URL parameters you're not expecting in your
>>
> link;
>
>> <s:url...> has an "includeParams" attribute you might want to look at.
>>
>> I'm sure there are more possibilities, but we might need more info in
>>
> order
>
>> to help.
>>
>> Dave
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_185164.ezm (zipped)--- me <mlists@(protected):
> Yes of course that's what I thougt. But when I change the scope of the
> spring bean to default I could provide the id using a get request but
> nothing happens.
>
> Now I keep it on prototype which is okay for this page.
S2 assumes a new action will be created for every request... Not doing so is
almost certainly a Bad Idea.
I'm sure it's possible, but it runs contrary to everything the framework
assumes about application structure.
Dave

Attachment:
user_185147.ezm (zipped)Does that mean ExtFS can build a form from a json (or xml)
specification? I've needed that myself.
I don't see anything wrong with your approach. In fact I like it. The
view (form) is nice separated from the model (data).
Frans Thamura wrote:
> take a look of this
>
> http://farm3.static.flickr.com/2018/2394469980_a9984272d8.jpg?v=0
>
> this is our current approach, a s2 action for form, and another action for
> value
>
> i use the ExtJS, and run well here :)
>
> thx to the ExtJs GUI Designer team
>
> but i am seeking another cool stuff that beter.
>
>
> Frans
>
> On Mon, Apr 7, 2008 at 10:08 AM, Jeromy Evans <
> jeromy.evans@(protected):
>
>
>> I'm not completely sure what you mean but two things come to mind:
>> - the s:action tag is useful for pages that need to be assembled using the
>> results from multiple actions. If each each outputs a component of the
>> view, you can uses Tiles or Sitemesh to assemble a page on the server-side
>> that invokes numerous actions. You can then reuse the components and design
>> actions around each data model instead of each page.
>> - as you're using ExtJS, you can use the same pattern as described above,
>> but invoke each action XHR. The page can be assembled via ExtJS on the
>> client-side with your actions returning data or html fragments as
>> appropriate.
>>
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.8/1362 - Release Date: 6/04/2008 11:12 AM
>

Attachment:
user_185149.ezm (zipped)On Tue, Apr 8, 2008 at 6:07 AM, Jeromy Evans <
jeromy.evans@(protected):
> Does that mean ExtFS can build a form from a json (or xml) specification?
> I've needed that myself.
>
> I don't see anything wrong with your approach. In fact I like it. The
> view (form) is nice separated from the model (data).
>
>
right,
i think that it is nice they separated view meta to create the form, and
model meta to fill the value in the input form inside form
but.. if we move all of our project, the json plugins is not stable version,
will this make the code of mine become unstable
that will be nice if there is REST with json output...
F

Attachment:
user_185150.ezm (zipped)Frans Thamura wrote:
>
> right,
>
> i think that it is nice they separated view meta to create the form, and
> model meta to fill the value in the input form inside form
>
> but.. if we move all of our project, the json plugins is not stable version,
>
> will this make the code of mine become unstable
>
>
> that will be nice if there is REST with json output...
>
> F
>
>
The JSON plugin is stable in all respects except that it hasn't been
released as a 1.x. I use it a lot and haven't encountered any problems
since adding enum support.
However the REST Plugin itself actually uses json-lib:
http://json-lib.sourceforge.net/. I haven't had a change to compare it
yet, but if it is truly based on Douglas Crockford's work then I'll
propose changing the JSON plugin to use json-lib to generate the JSON
(or at least allow it to be plugged in as an alternative serializer).

Attachment:
user_185154.ezm (zipped)> The JSON plugin is stable in all respects except that it hasn't been
> released as a 1.x. I use it a lot and haven't encountered any problems
> since adding enum support.
>
we are finding this issue also.
>
> However the REST Plugin itself actually uses json-lib:
> http://json-lib.sourceforge.net/. I haven't had a change to compare it
> yet, but if it is truly based on Douglas Crockford's work then I'll propose
> changing the JSON plugin to use json-lib to generate the JSON (or at least
> allow it to be plugged in as an alternative serializer)
that will be cool, but i dont know, how to write a plugins using this api
i am very close with the creator of json-lib, andre almiray (CMIIW)
> .
>

Attachment:
user_185148.ezm (zipped)Hi folks, I have two questions, and I apologize for the n00b approach.
I'm just teaching myself struts2, coming from a PHP background (but I've
done plenty of JEE and Java Swing programming, so the language isn't
completely alien :)
Question 1...
I have a Logon form that works fine without an interceptor, but as soon
as I add one, my getUsername() and other methods fail (the username is
null).
Struts.xml:
http://pastebin.stonekeep.com/1893
DBInterceptor:
http://pastebin.stonekeep.com/1894
Logon.java:
http://pastebin.stonekeep.com/1895
If I uncomment the interceptor line in my struts.xml file, the Logon
form validator fails. Line 29 shows 'null' in Logon.java. If i leave
it commented out, it works fine.
Question 2...
In Logon.java, I'm using the execute() method to set up my JDBC
connection (as pulled from my JBoss container datasource), setting up
the Connection, and making the call. Wouldn't it make more sense to do
that in an interceptor around every class, and do something like
ic = new InitialContext();
dataSource = (DataSource)ic.lookup("java:JQuoDEV");
c = dataSource.getConnection();
Logon action = (Logon)invocation.getAction();
action.connection = c;
return invocation.invoke() ;
I tried doing this, and saw the connection start up, but the Action
class kept having the connection as 'null'. I think I'm either
misunderstanding how the interceptor / action sequence works, or doing
something blatantly stupid.
Help?
-dbs
--
Dave Belfer-Shevet
Stonekeep Consulting, Inc
http://www.stonekeep.com/

Attachment:
user_185151.ezm (zipped)--- Dave Belfer-Shevett <dbs@(protected):
> I have a Logon form that works fine without an interceptor, but as soon
> as I add one, my getUsername() and other methods fail (the username is
> null).
When you declare interceptor-refs for an action you are declaring *all* the
interceptors for that action. You either need to create a *complete* stack
with your interceptor included or specify *all* the interceptors your action
requires.
> Question 2...
> I tried doing this, and saw the connection start up, but the Action
> class kept having the connection as 'null'. I think I'm either
> misunderstanding how the interceptor / action sequence works, or doing
> something blatantly stupid.
Without the actual implementation it will be difficult to help.
What you probably meant in the code above was that you'd check for an
interface that informs the interceptor that the action accepts a connection
property. If the action being invoked implements the interface, get the
connection and set it on the action. If you look at many of the S2/XWork
interceptor source you'll see this technique used all over the place.
That's certainly one way to handle connections.
Dave

Attachment:
user_185152.ezm (zipped)Brad A Cupit wrote:
> ServletActionRedirectResult worked when I used it instead of the
> ActionChainResult. This performs an extra round trip back to the
> browser, which isn't terrible unless I want to pass data from one Action
> to another, and herein lies some concern.
> ...
>
> POSTS should each have their own Action (which may write the data to the
> DB). This Action should only process the POST. Afterwards, it forwards
> (chains) to another Action, which sits in front of the view. If the view
> needs data from the DB, it goes in the Action for that view (not the
> POST-handling Action). If the view doesn't need data, then the Action is
> dumb and just forwards to the view.
>
>
The reason the post-redirect-get pattern is typically preferred over
your approach is for handling of the browser's back button.
By returning a redirect the browser is prevented from reposting
data/showing a warning if the user presses back.
Your approach is clearly more efficient as it removes a request-response
cycle, but unfortunately the repost issue usually supersedes that.
>
> Seems like a nice design, but Action chaining isn't recommended, and
> isn't working with CGLIB proxies :-(
>
>
The main argument for discouraging action chaining is simply to reduce
coupling between actions. I didn't realise Ognl was performing a copy.
I thought the next action was
simply pushed onto the stack above the previous action allowing you to
access the properties of the previous action. I guess I'm wrong.
You may have stumbled upon another reason to discourage use of chaining.

Attachment:
user_185153.ezm (zipped)Jeromy Evans wrote:
> Brad A Cupit wrote:
>> ...
>>
>> POSTS should each have their own Action (which may write the data to the
>> DB). This Action should only process the POST. Afterwards, it forwards
>> (chains) to another Action, which sits in front of the view. If the view
>> needs data from the DB, it goes in the Action for that view (not the
>> POST-handling Action). If the view doesn't need data, then the Action is
>> dumb and just forwards to the view.
>>
>>
>
> The reason the post-redirect-get pattern is typically preferred over
> your approach is for handling of the browser's back button.
> By returning a redirect the browser is prevented from reposting
> data/showing a warning if the user presses back.
> Your approach is clearly more efficient as it removes a
> request-response cycle, but unfortunately the repost issue usually
> supersedes that.
>
>
>
I thought I'd add that a way to overcome this in modern browsers is to
perform all posts via an asynchronous request. The POST returns a
pass/fail response and the client then determines which action to take
(eg. update the DOM, render the post response, perform a GET) etc.
Prasad, Taneja & Todankar's paper "Life Above the Service Tier" [1]
contains a good description of the problem.
[1] http://wisdomofganesh.blogspot.com/2007/10/life-above-service-tier.html

Attachment:
user_185166.ezm (zipped)Oh thank you so much for the response. I've been reading about the
POST-redirect-GET pattern and I'm starting to see the light. I found the
original article here, in case anyone else is interested:
http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@(protected)]
Sent: Monday, April 07, 2008 8:20 PM
To: Struts Users Mailing List
Subject: Re: interesting proxy + action chain issue
Brad A Cupit wrote:
> ServletActionRedirectResult worked when I used it instead of the
> ActionChainResult. This performs an extra round trip back to the
> browser, which isn't terrible unless I want to pass data from one
Action
> to another, and herein lies some concern.
> ...
>
> POSTS should each have their own Action (which may write the data to
the
> DB). This Action should only process the POST. Afterwards, it forwards
> (chains) to another Action, which sits in front of the view. If the
view
> needs data from the DB, it goes in the Action for that view (not the
> POST-handling Action). If the view doesn't need data, then the Action
is
> dumb and just forwards to the view.
>
>
The reason the post-redirect-get pattern is typically preferred over
your approach is for handling of the browser's back button.
By returning a redirect the browser is prevented from reposting
data/showing a warning if the user presses back.
Your approach is clearly more efficient as it removes a request-response
cycle, but unfortunately the repost issue usually supersedes that.
>
> Seems like a nice design, but Action chaining isn't recommended, and
> isn't working with CGLIB proxies :-(
>
>
The main argument for discouraging action chaining is simply to reduce
coupling between actions. I didn't realise Ognl was performing a copy.
I thought the next action was
simply pushed onto the stack above the previous action allowing you to
access the properties of the previous action. I guess I'm wrong.
You may have stumbled upon another reason to discourage use of chaining.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185155.ezm (zipped)Hi,
I'm working on configuration issues and I'm searching for the best way to
have a consitent configuration over the whole webapp (or more webapps).
The webapp has got a sitemesh-freemarker-template and the views are done
with jsps.
What I wanted to do is to have configuratio values (such as hostnames of
other servers)
on a single point (for example in a database). So I can access them also
from the other servers
and have a confiuration repository which i can change on a development
environment to use it on a productional site.
Does anybody have a "great/best way" idea?
Marc

Attachment:
user_185159.ezm (zipped)me wrote:
> Hi,
>
> I'm working on configuration issues and I'm searching for the best way to
> have a consitent configuration over the whole webapp (or more webapps).
>
> The webapp has got a sitemesh-freemarker-template and the views are
> done with jsps.
> What I wanted to do is to have configuratio values (such as hostnames
> of other servers)
> on a single point (for example in a database). So I can access them
> also from the other servers
> and have a confiuration repository which i can change on a development
> environment to use it on a productional site.
>
> Does anybody have a "great/best way" idea?
One approach is to place those resources in a directory accessed via
JNDI. That will allow you to share resources between your apps and
containers.
There is overhead associated with JNDI lookups but it's supported by
every J2EE container. It may be over-the-top for what you want.
http://java.sun.com/products/jndi/tutorial/
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

Attachment:
user_185156.ezm (zipped)Hi,
I'm trying to make one of my pages downloadable as a CSV file.
Currently my XML is configured like this:
<action name="downloadCSV" class="test.struts.ListItems" method="downloadCSV">
<interceptor-ref name="standardStack"/>
<result name="success">/pages/download.jsp</result>
</action>
And /pages/download.jsp renders the list as a CSV.
I have changed the content type in the CSV:
<%@(protected)" %>
But I'd like to force the contentDisposition so that I can control the filename.
I know it's easy to do that using StreamResult, but that doesn't look like the right solution for me, since I don't want to access a file on the file system and return it, but rather offer a page rendered by that JSP as downloadable.
Is there any way to do this, or a way to use StreamResult and configure it so that it can work with a page rendered by a JSP?
Thanks
D.
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If this has come to you in error, you must not copy, distribute, disclose or use any of the information it contains. Please notify the sender immediately and delete them from your system.
SECURITY - Please be aware that communication by email, by its very nature, is not 100% secure and by communicating with Perform Group by email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence of computer viruses, the sender accepts no liability for any damage sustained as a result of a computer virus and it is the recipients responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely those of the sender and do not necessarily represent those of Perform Group.
COPYRIGHT - Copyright of this email and any attachments belongs to Perform Group, Companies House Registration number 6324278.

Attachment:
user_185160.ezm (zipped)To set the download file name, in addition to the "text/csv" mime type
(which you already have set), write the following java code in your
Action or (if necessary) as Java in your JSP:
response.setHeader("Content-disposition", "attachment; filename=" +
CSV_FILE_NAME);
where CSV_FILE_NAME is the name you want the user to see for the csv
file.
Since this is a dynamically generated file, if you're using https and
need to work in IE you may also want to set the following:
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Pragma", "public");
see the following two links for more details:
http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with
-internet-explorer/
http://forum.java.sun.com/thread.jspa?threadID=233446&forumID=45
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: David Loup [mailto:David.Loup@(protected)]
Sent: Tuesday, April 08, 2008 7:42 AM
To: user@(protected)
Subject: Downloading file rendered in JSP
Hi,
I'm trying to make one of my pages downloadable as a CSV file.
Currently my XML is configured like this:
<action name="downloadCSV" class="test.struts.ListItems"
method="downloadCSV">
<interceptor-ref name="standardStack"/>
<result name="success">/pages/download.jsp</result>
</action>
And /pages/download.jsp renders the list as a CSV.
I have changed the content type in the CSV:
<%@(protected)" %>
But I'd like to force the contentDisposition so that I can control the
filename.
I know it's easy to do that using StreamResult, but that doesn't look
like the right solution for me, since I don't want to access a file on
the file system and return it, but rather offer a page rendered by that
JSP as downloadable.
Is there any way to do this, or a way to use StreamResult and configure
it so that it can work with a page rendered by a JSP?
Thanks
D.
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are
confidential, may be legally privileged and are intended solely for the
use of the individual or entity to whom they are addressed. If this has
come to you in error, you must not copy, distribute, disclose or use any
of the information it contains. Please notify the sender immediately and
delete them from your system.
SECURITY - Please be aware that communication by email, by its very
nature, is not 100% secure and by communicating with Perform Group by
email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence
of computer viruses, the sender accepts no liability for any damage
sustained as a result of a computer virus and it is the recipient's
responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely
those of the sender and do not necessarily represent those of Perform
Group.
COPYRIGHT - Copyright of this email and any attachments belongs to
Perform Group, Companies House Registration number 6324278.

Attachment:
user_185167.ezm (zipped)Thanks for that.
I actually just needed to implement the ServletResponseAware interface to access the servlet response properly.
Trying to set those in the JSP (through a scriplet) didn't work, but indeed doing it in the action is fine.
-----Original Message-----
From: Brad A Cupit [mailto:brad@(protected)]
Sent: 08 April 2008 14:25
To: Struts Users Mailing List
Subject: RE: Downloading file rendered in JSP
To set the download file name, in addition to the "text/csv" mime type
(which you already have set), write the following java code in your
Action or (if necessary) as Java in your JSP:
response.setHeader("Content-disposition", "attachment; filename=" +
CSV_FILE_NAME);
where CSV_FILE_NAME is the name you want the user to see for the csv
file.
Since this is a dynamically generated file, if you're using https and
need to work in IE you may also want to set the following:
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Pragma", "public");
see the following two links for more details:
http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with
-internet-explorer/
http://forum.java.sun.com/thread.jspa?threadID=233446&forumID=45
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: David Loup [mailto:David.Loup@(protected)]
Sent: Tuesday, April 08, 2008 7:42 AM
To: user@(protected)
Subject: Downloading file rendered in JSP
Hi,
I'm trying to make one of my pages downloadable as a CSV file.
Currently my XML is configured like this:
<action name="downloadCSV" class="test.struts.ListItems"
method="downloadCSV">
<interceptor-ref name="standardStack"/>
<result name="success">/pages/download.jsp</result>
</action>
And /pages/download.jsp renders the list as a CSV.
I have changed the content type in the CSV:
<%@(protected)" %>
But I'd like to force the contentDisposition so that I can control the
filename.
I know it's easy to do that using StreamResult, but that doesn't look
like the right solution for me, since I don't want to access a file on
the file system and return it, but rather offer a page rendered by that
JSP as downloadable.
Is there any way to do this, or a way to use StreamResult and configure
it so that it can work with a page rendered by a JSP?
Thanks
D.
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are
confidential, may be legally privileged and are intended solely for the
use of the individual or entity to whom they are addressed. If this has
come to you in error, you must not copy, distribute, disclose or use any
of the information it contains. Please notify the sender immediately and
delete them from your system.
SECURITY - Please be aware that communication by email, by its very
nature, is not 100% secure and by communicating with Perform Group by
email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence
of computer viruses, the sender accepts no liability for any damage
sustained as a result of a computer virus and it is the recipient's
responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely
those of the sender and do not necessarily represent those of Perform
Group.
COPYRIGHT - Copyright of this email and any attachments belongs to
Perform Group, Companies House Registration number 6324278.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If this has come to you in error, you must not copy, distribute, disclose or use any of the information it contains. Please notify the sender immediately and delete them from your system.
SECURITY - Please be aware that communication by email, by its very nature, is not 100% secure and by communicating with Perform Group by email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence of computer viruses, the sender accepts no liability for any damage sustained as a result of a computer virus and it is the recipients responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely those of the sender and do not necessarily represent those of Perform Group.
COPYRIGHT - Copyright of this email and any attachments belongs to Perform Group, Companies House Registration number 6324278.

Attachment:
user_185168.ezm (zipped)whoops! I should have been more clear about it using the
HttpServletResponse
Brad Cupit
Louisiana State University - UIS
e-mail: brad@(protected)
office: 225.578.4774
-----Original Message-----
From: David Loup [mailto:David.Loup@(protected)]
Sent: Tuesday, April 08, 2008 10:57 AM
To: Struts Users Mailing List
Subject: RE: Downloading file rendered in JSP
Thanks for that.
I actually just needed to implement the ServletResponseAware interface
to access the servlet response properly.
Trying to set those in the JSP (through a scriplet) didn't work, but
indeed doing it in the action is fine.
-----Original Message-----
From: Brad A Cupit [mailto:brad@(protected)]
Sent: 08 April 2008 14:25
To: Struts Users Mailing List
Subject: RE: Downloading file rendered in JSP
To set the download file name, in addition to the "text/csv" mime type
(which you already have set), write the following java code in your
Action or (if necessary) as Java in your JSP:
response.setHeader("Content-disposition", "attachment; filename=" +
CSV_FILE_NAME);
where CSV_FILE_NAME is the name you want the user to see for the csv
file.
Since this is a dynamically generated file, if you're using https and
need to work in IE you may also want to set the following:
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Pragma", "public");
see the following two links for more details:
http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with
-internet-explorer/
http://forum.java.sun.com/thread.jspa?threadID=233446&forumID=45
Brad Cupit
Louisiana State University - UIS
-----Original Message-----
From: David Loup [mailto:David.Loup@(protected)]
Sent: Tuesday, April 08, 2008 7:42 AM
To: user@(protected)
Subject: Downloading file rendered in JSP
Hi,
I'm trying to make one of my pages downloadable as a CSV file.
Currently my XML is configured like this:
<action name="downloadCSV" class="test.struts.ListItems"
method="downloadCSV">
<interceptor-ref name="standardStack"/>
<result name="success">/pages/download.jsp</result>
</action>
And /pages/download.jsp renders the list as a CSV.
I have changed the content type in the CSV:
<%@(protected)" %>
But I'd like to force the contentDisposition so that I can control the
filename.
I know it's easy to do that using StreamResult, but that doesn't look
like the right solution for me, since I don't want to access a file on
the file system and return it, but rather offer a page rendered by that
JSP as downloadable.
Is there any way to do this, or a way to use StreamResult and configure
it so that it can work with a page rendered by a JSP?
Thanks
D.
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are
confidential, may be legally privileged and are intended solely for the
use of the individual or entity to whom they are addressed. If this has
come to you in error, you must not copy, distribute, disclose or use any
of the information it contains. Please notify the sender immediately and
delete them from your system.
SECURITY - Please be aware that communication by email, by its very
nature, is not 100% secure and by communicating with Perform Group by
email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence
of computer viruses, the sender accepts no liability for any damage
sustained as a result of a computer virus and it is the recipient's
responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely
those of the sender and do not necessarily represent those of Perform
Group.
COPYRIGHT - Copyright of this email and any attachments belongs to
Perform Group, Companies House Registration number 6324278.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
________________________________________________________________________
CONFIDENTIALITY - This email and any files transmitted with it, are
confidential, may be legally privileged and are intended solely for the
use of the individual or entity to whom they are addressed. If this has
come to you in error, you must not copy, distribute, disclose or use any
of the information it contains. Please notify the sender immediately and
delete them from your system.
SECURITY - Please be aware that communication by email, by its very
nature, is not 100% secure and by communicating with Perform Group by
email you consent to us monitoring and reading any such correspondence.
VIRUSES - Although this email message has been scanned for the presence
of computer viruses, the sender accepts no liability for any damage
sustained as a result of a computer virus and it is the recipient's
responsibility to ensure that email is virus free.
AUTHORITY - Any views or opinions expressed in this email are solely
those of the sender and do not necessarily represent those of Perform
Group.
COPYRIGHT - Copyright of this email and any attachments belongs to
Perform Group, Companies House Registration number 6324278.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_185158.ezm (zipped)I've been studying struts and trying to get up to speed on it. My
question is downloading the struts package itself.
I downloaded both the struts-1.3.8-all.zip and the
struts-2.0.11.1-all.zip from the struts.apache.org website.
When I extract these .zip files, I expected to see the relevant .tld
files in the lib sub-directory. All the .jar files I expected are there,
but I can't find any of the .tld files.
What am I mis-understanding / doing wrong ?
Thanks,
Mike

Attachment:
user_185161.ezm (zipped)2008/4/8, Berger, Michael <mberger3@(protected)>:
>
> All the .jar files I expected are there,
> but I can't find any of the .tld files.
> What am I mis-understanding / doing wrong ?
The TLD files are under:
META-INF/tld
directory of struts2-core.jar
Antonio

Attachment:
user_185162.ezm (zipped)It's a question regarding commons validator api, wherein i am trying to
validate an input request form (xml-request) which contains a collection
of
items...like
<OrdersInputRequest>
<Order>
<OrderId>222</OderId>
<OrderDate>04/04/2004</OrderDate>
</Order>
<Order>
<OrderId>223</OderId>
<OrderDate>04/04/2004</OrderDate>
</Order>
</OrderInputRequest>
What would be the valid format for the commons-validator form to
validate
this input request? Since there can be any number of Orders
(
java.util.ArrayList) in the request and all the items have the same
validation.
I looked at the examples on the project but couldn't find any
solution...
* <formset>
<form name="OrdersRequestValidationForm">
<field property="OrderId" type="Integer" depends="required">
</field>
<field property="OrderDate" type="String" depends="required">
</field>
</form>
</formset> *
Any assistance on this is appreciated..
Thanks!
--Syed Ghaznavi

Attachment:
user_185163.ezm (zipped)Hello I have a very strange problem.
I have an application that we developed in JAVA and the application works ok in Windows.
We recentl deployed the same application in Linux REDHAT and the application seemed to worked fine, until the user reported to us a problem.
After doing research it happens that in Linux RedHat instructions like this:
<s:if test="${marca.claseDeMarca != null}">
All of our jsp pages do not work at all, while in Windows they work ok. Looks like a Struts problem to us.
This makes the appplication in linux to work incorrectly as the test always evaluates to FALSE and in windows the test evaluates to TRUE.
We use Oracle Database and the tomcat version we have is JAKARTA-TOMCAT-5.0.28
Any help will be appreciated.
Agustin.
Agustín de Landa Gil
Grupo Industrial Saltillo
Tel: (844) 411-7114 Ext. 7114
Fax: (844) 411 7105
agustin.delanda@gis.com.mx<mailto:agustin.delanda@(protected)>
==================================================
NOTICE: This e-mail transmission, and any other documents, like files or previous-mail messages attached to it, may contain confidential or privileged information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify the sender, permanently delete it and destroy any copies of it that were printed out. Grupo Industrial Saltillo is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Thank you.
Visit us at www.gis.com.mx<file:///C:\Documents%20and%20Settings\agustin.delanda\Datos%20de%20programa\Microsoft\Signatures\www.gis.com.mx> <http://www.gis.com.mx/>
AVISO: Este correo electrónico, y cualquier otro documento, como archivos o mensajes previos adjuntos, pueden contener información de tipo privilegiada y/o confidencial. Si usted no es el destinatario, o la persona responsable para entregarlo al destinatario, se le notifica que cualquier revelación, copiado, distribución o uso de cualquier información contenida o adjunta a este mensaje esta ESTRICTAMENTE PROHIBIDA. Si usted recibió este correo electrónico por error, por favor, notifique inmediatamente al remitente, elimínelo permanentemente y destruya cualquier copia que haya sido impresa. Grupo Industrial Saltillo no es responsable por la correcta transmision de la informacion contenida en este medio, o de cualquier retraso del mismo con respecto a la entrega al destinatario. Gracias.
Visite nuestra página en www.gis.com.mx<file:///C:\Documents%20and%20Settings\agustin.delanda\Datos%20de%20programa\Microsoft\Signatures\www.gis.com.mx> <http://www.gis.com.mx/> ==================================================

Attachment:
user_185165.ezm (zipped)
Hello,
I am trying to use the Preparable but having some problems while the page is
being rendered. I will try my best to explain the problem, please ask if you
need more information as i might not be able to accurately explain the
problem as i am pretty new to struts2.
Scenario:
User should be able to create the EmailDistributionList and create email
Addresses under it.
My first attempt is to be able to create the Group Itself . So i introduced
an action which implements Preparable interface.
The Action provides
1.) List of currently avaialable groups- displayed as dropdown on the
screen.
2.) has a group id based on which it tries to decide whether to load data
from the databse or not. e.g. if the user
lands for the first time on the page there would be no id in the rquest
hence the id would not have any data in
it. it is similar to the CRUD example on struts website.
Creation and saving of the group went ok, the problem occured when i load
the data from the databse and try to display it on the screen.
i have defined just one action in struts.xml to accomplish this. when the
user arrives for the first time through the menu item which is of course a
get request , the user is provided with list of available groups and a blank
description field (since it does not have any id in the request).
When the user changes selection in the drop down i do a post to the same
action which binds the id to group id field in the action. It works ok as
far as it has the id in the request and loads the data from the databse and
stuff. but as soon as it reaches the screen and when it tries to extract
data out of the domain it wipes out the fields from the group domain, e.g.
If the Group had id name and description, and i try to display the
description on the page like <s:textarea name="group.description"/> the page
shows nothing in it even though the id was passed to the action and logger
statements show that the group has the description on the server side.
I used <s:debug/> tag to see more information but even in that information
it shows that the description is blank. I am trying to solve this problem
for a long time but have been unsuccessful in resolving it, your help would
be greatly appreciated.
Thanks
Manish.
--
Sent from the Struts - User mailing list archive at Nabble.com.