Author Login
Post Reply
user Digest 21 Jul 2009 14:22:15 -0000 Issue 8763
Topics (messages 200934 through 200953):
Re: Tags as template parameters?
200934 by: Kawczynski, David
Re: unit testing Struts2 application (with Spring and Hibernate)
200935 by: Dimitrios Christodoulakis
200936 by: Haroon Rafique
200939 by: Dimitrios Christodoulakis
200940 by: Martin Gainty
200941 by: Dimitrios Christodoulakis
Struts2 framework question.
200937 by: sharath karnati
Re: Problem with s:text expansion...
200938 by: Martin Gainty
Re: Prevent persisting data when validation fails
200942 by: Burton Rhodes
Re: Pb displaying image
200943 by: tutu
200944 by: Pawe³ Wielgus
200946 by: tutu
200947 by: Nils-Helge Garli Hegvik
200948 by: tutu
Fileupload
200945 by: taltun
Re: action-method-validation
200949 by: mailtolouis2020-struts.yahoo.com
source code for examples
200950 by: Sam Wun
200951 by: Dave Newton
how to clear the "html:file " element value?
200952 by: abhishek reddy
Re: Design Practice question. Should I use same Action class for different functions?
200953 by: tsongwei
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_200934.ezm (zipped)Sitemesh doesn't build the entire page... it is a Filter that grabs the
response text (immediately before the servlet container sends it to the
client) and adds to it. Decorators contain what is added to the
response. I've found that if your decorators require a lot of run-time
logic then yes, it will take more time then if it were never modified.
(Exactly how much time depends on the decorator's logic.) Otherwise,
the time to decorate a page is negligible. Be smart when writing your
decorators... for instance, mapping different decorators to the
diverging URI patterns is an easy way to avoid the time penalty
associated with logic in decorators.
HTH,
-dave
> -----Original Message-----
> From: Pascal [mailto:pascal@(protected)]
> Sent: Sunday, July 19, 2009 8:13 AM
> To: Struts Users Mailing List
> Subject: Re: Tags as template parameters?
>
> I just had a look at Sitemesh and it looks like what I want.
> There is one
> thing that disturbs me, though, it looks as if sitemesh will
> build the page
> every request, which causes quite some overhead, or am I
> mistaken there?
>
> Pascal
>
> On Fri, 17 Jul 2009 20:44:59 -0400, Wes Wannemacher <wesw@(protected)>
> wrote:
> > I'm on my phone so I only skimmed your message. If I read correctly,
> > you should take a look at sitemesh.
> >
> > -W
> >
> > On 7/17/09, Pascal <pascal@(protected):
> >> Hello list,
> >>
> >> in Struts2 it is possible to do something like
> >>
> >> <html>
> >> <body>
> >> <s:myMainNavigationMenu />
> >>
> >> <h1>A page</h1>
> >> <p>Some content</p>
> >> </body>
> >> </html>
> >>
> >> This works ok, but my problem is that I have to change every single
> >> page, if i would like to have a custom footer for every page, for
> >> example.
> >>
> >> Now my question is: Is it possible to do something like this?
> >>
> >> <s:useTemplate name="myCommonTemplate">
> >> <s:setTemplateTag name="body">
> >> <h1>A page</h1>
> >> <p>Some content</p>
> >> </s:setTemplateTag>
> >> </s:useTemplate>
> >>
> >> And as template definition say
> >>
> >> <!-- Main menu -->
> >> <table>...</table>
> >>
> >> <s:insertTemplateTag name="body" />
> >>
> >> <!-- Footer -->
> >> <p>This is the footer</p>
> >>
> >> I know it is possible to use parameters for templates, but they
> >> obviously have huge limitations as I can't just put the
> tags there as I
> >> did in my example.
> >>
> >> Also, I could do something like
> >>
> >> <s:myMainTemplate>
> >> <s:param name="bodyPage" value="page1.jsp" />
> >> </s:myMainTemplate>
> >>
> >> which I also don't want because I would have an extra (unnecessary)
> page.
> >>
> >> So, is it possible to pass whole XML-Structures to
> templates? Maybe you
> >> have some reasons why I shouldn't want what I'm suggesting
> here, I would
> >> be eager to hear them! :-)
> >>
> >> Pascal
> >>
>
>
> ---------------------------------------------------------------------
> 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_200935.ezm (zipped)Thanks Haroon for the handy advice. That seems to do the trick as far
as the session object is concerned. The test passes now. Would it be
easy for someone to extend your code to include actions that implement
the -aware interfaces? If I wanted to take a shot at that, is there a
particular point you would suggest I start with?
Also, many thanks to Wes, for pointing out a good starting point for
understanding Struts2 at a deeper level by examining the code!
Regards to all.
On Mon, Jul 20, 2009 at 9:26 AM, Haroon
Rafique<haroon.rafique@(protected):
> On Yesterday at 9:16pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected)>...:
>
> DC> [..snip..]
> DC>
> DC> When testing (junit 4) an action implementing the Sessionaware
> DC> interface (my login and register classes) I noticed that the session
> DC> object is set to null by BaseStrutsTestCase. This was mentioned before
> DC> in the author's blog, but not sure if ever addressed. I added a new
> DC> comment over there but the discussion could be inactive.
> DC>
>
> Hi Dimitrios,
>
> Don't think arsenalist is watching that blog dilligently any more.
>
> DC>
> DC> I was wondering if anyone who is using the BaseStrutsTestCase, or used
> DC> it in the past, came across this issue and if by any chance managed to
> DC> resolve it. Perhaps Haroon might have a comment on this?
> DC>
>
> Not a whole lot at the moment as none of our Action classes implement
> those interfaces. How about something like:
>
> protected static HashMap sessionMap = new HashMap();
>
> //.... and further on later in the code
>
> proxy.getInvocation().getInvocationContext().setSession(sessionMap);
>
>
> DC>
> DC> Also, a couple of more general questions:
> DC>
> DC> 1) Is there a recommended way to check during testing which
> DC> interceptors are firing and when?
> DC>
>
> Careful there. Haven't you now delved into the territory of testing the
> framework itself (rather than your own code)? IMHO, I would assume that
> it's the framework's responsibility to make sure that when a certain set
> of interceptors is configured, they better fire properly.
>
> DC>
> DC> [..snip..]
> DC>
> DC> Kind regards and I appreciate all the input.
> DC>
>
> Cheers,
> --
> Haroon Rafique
> <haroon.rafique@(protected)>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200936.ezm (zipped)On Today at 4:32pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected):
DC> Thanks Haroon for the handy advice. That seems to do the trick as far
DC> as the session object is concerned. The test passes now.
DC>
Glad it worked out.
DC>
DC> Would it be easy for someone to extend your code to include actions
DC> that implement the -aware interfaces? If I wanted to take a shot at
DC> that, is there a particular point you would suggest I start with?
DC>
Did you add that code in your Test class? I was actually suggesting that
you modify the code inside BaseStrutsTestCase. So, I would recommend
adding a private static HashMap variable called sessionMap in
BaseStrutsTestCase. And then in the createAction method, issue the
statement:
proxy.getInvocation().getInvocationContext().setSession(sessionMap);
Hope that helps.
The only other fringe case that I have dealth with in our code, is when we
have actions that implement Preparable and are used with a
ParamsPrepareParams interceptor. I created a method to allow action
parameters to be set.
/**
* Sets the action parameters
* @param parameters Parameters to set
*/
protected void setActionParameters(Map<String, String>
parameters) {
proxy.getInvocation().getInvocationContext().
setParameters(parameters);
}
Then inside my Action Test class, I can issue:
proxy.setActionParameters(...);
before:
proxy.execute();
Cheers,
--
Haroon Rafique
<haroon.rafique@(protected)>

Attachment:
user_200939.ezm (zipped)Thanks for clarifying Haroon,
Actually the additions you are mentioning sum up the original testing
code pretty well. Like I said, from an educational point of view, I
think one can learn a lot about the framework itself by studying that
article and the comments. Thanks for the "preparable" bit too.
As other folks here mentioned, it depends on the testing requirements
of the project when it comes which test strategy to take, or which
tool to use. As a learner, I found it very useful to experiment with
that code.
I haven't tried Selenium yet, but I would be interested to see how it
catches the same errors in the same test cases.
On Mon, Jul 20, 2009 at 5:02 PM, Haroon
Rafique<haroon.rafique@(protected):
> On Today at 4:32pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected):
>
> DC> Thanks Haroon for the handy advice. That seems to do the trick as far
> DC> as the session object is concerned. The test passes now.
> DC>
>
> Glad it worked out.
>
> DC>
> DC> Would it be easy for someone to extend your code to include actions
> DC> that implement the -aware interfaces? If I wanted to take a shot at
> DC> that, is there a particular point you would suggest I start with?
> DC>
>
> Did you add that code in your Test class? I was actually suggesting that
> you modify the code inside BaseStrutsTestCase. So, I would recommend
> adding a private static HashMap variable called sessionMap in
> BaseStrutsTestCase. And then in the createAction method, issue the
> statement:
> proxy.getInvocation().getInvocationContext().setSession(sessionMap);
>
> Hope that helps.
>
> The only other fringe case that I have dealth with in our code, is when we
> have actions that implement Preparable and are used with a
> ParamsPrepareParams interceptor. I created a method to allow action
> parameters to be set.
>
> /**
> * Sets the action parameters
> * @param parameters Parameters to set
> */
> protected void setActionParameters(Map<String, String>
> parameters) {
> proxy.getInvocation().getInvocationContext().
> setParameters(parameters);
> }
>
> Then inside my Action Test class, I can issue:
> proxy.setActionParameters(...);
> before:
> proxy.execute();
>
> Cheers,
> --
> Haroon Rafique
> <haroon.rafique@(protected)>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_200940.ezm (zipped)
can you show the code to obtain proxy?
could you post the URL for article?
Merci
Martin Gainty
______________________________________________
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Mon, 20 Jul 2009 19:07:09 -0500
> Subject: Re: unit testing Struts2 application (with Spring and Hibernate)
> From: dimi.chr@(protected)
> To: user@(protected)
>
> Thanks for clarifying Haroon,
>
> Actually the additions you are mentioning sum up the original testing
> code pretty well. Like I said, from an educational point of view, I
> think one can learn a lot about the framework itself by studying that
> article and the comments. Thanks for the "preparable" bit too.
>
> As other folks here mentioned, it depends on the testing requirements
> of the project when it comes which test strategy to take, or which
> tool to use. As a learner, I found it very useful to experiment with
> that code.
>
> I haven't tried Selenium yet, but I would be interested to see how it
> catches the same errors in the same test cases.
>
> On Mon, Jul 20, 2009 at 5:02 PM, Haroon
> Rafique<haroon.rafique@(protected):
> > On Today at 4:32pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected):
> >
> > DC> Thanks Haroon for the handy advice. That seems to do the trick as far
> > DC> as the session object is concerned. The test passes now.
> > DC>
> >
> > Glad it worked out.
> >
> > DC>
> > DC> Would it be easy for someone to extend your code to include actions
> > DC> that implement the -aware interfaces? If I wanted to take a shot at
> > DC> that, is there a particular point you would suggest I start with?
> > DC>
> >
> > Did you add that code in your Test class? I was actually suggesting that
> > you modify the code inside BaseStrutsTestCase. So, I would recommend
> > adding a private static HashMap variable called sessionMap in
> > BaseStrutsTestCase. And then in the createAction method, issue the
> > statement:
> > proxy.getInvocation().getInvocationContext().setSession(sessionMap);
> >
> > Hope that helps.
> >
> > The only other fringe case that I have dealth with in our code, is when we
> > have actions that implement Preparable and are used with a
> > ParamsPrepareParams interceptor. I created a method to allow action
> > parameters to be set.
> >
> > /**
> > * Sets the action parameters
> > * @param parameters Parameters to set
> > */
> > protected void setActionParameters(Map<String, String>
> > parameters) {
> > proxy.getInvocation().getInvocationContext().
> > setParameters(parameters);
> > }
> >
> > Then inside my Action Test class, I can issue:
> > proxy.setActionParameters(...);
> > before:
> > proxy.execute();
> >
> > Cheers,
> > --
> > Haroon Rafique
> > <haroon.rafique@(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)
>
_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Attachment:
user_200941.ezm (zipped)The full article is here:
http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
I think the author's explanations cover a lot. The comments and the
subsequent conversations are of value too.
On Mon, Jul 20, 2009 at 7:33 PM, Martin Gainty<mgainty@(protected):
>
> can you show the code to obtain proxy?
> could you post the URL for article?
>
>
>
> Merci
> Martin Gainty
> ______________________________________________
> Note de déni et de confidentialité
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>> Date: Mon, 20 Jul 2009 19:07:09 -0500
>> Subject: Re: unit testing Struts2 application (with Spring and Hibernate)
>> From: dimi.chr@(protected)
>> To: user@(protected)
>>
>> Thanks for clarifying Haroon,
>>
>> Actually the additions you are mentioning sum up the original testing
>> code pretty well. Like I said, from an educational point of view, I
>> think one can learn a lot about the framework itself by studying that
>> article and the comments. Thanks for the "preparable" bit too.
>>
>> As other folks here mentioned, it depends on the testing requirements
>> of the project when it comes which test strategy to take, or which
>> tool to use. As a learner, I found it very useful to experiment with
>> that code.
>>
>> I haven't tried Selenium yet, but I would be interested to see how it
>> catches the same errors in the same test cases.
>>
>> On Mon, Jul 20, 2009 at 5:02 PM, Haroon
>> Rafique<haroon.rafique@(protected):
>> > On Today at 4:32pm, DC=>Dimitrios Christodoulakis <dimi.chr@(protected):
>> >
>> > DC> Thanks Haroon for the handy advice. That seems to do the trick as far
>> > DC> as the session object is concerned. The test passes now.
>> > DC>
>> >
>> > Glad it worked out.
>> >
>> > DC>
>> > DC> Would it be easy for someone to extend your code to include actions
>> > DC> that implement the -aware interfaces? If I wanted to take a shot at
>> > DC> that, is there a particular point you would suggest I start with?
>> > DC>
>> >
>> > Did you add that code in your Test class? I was actually suggesting that
>> > you modify the code inside BaseStrutsTestCase. So, I would recommend
>> > adding a private static HashMap variable called sessionMap in
>> > BaseStrutsTestCase. And then in the createAction method, issue the
>> > statement:
>> > proxy.getInvocation().getInvocationContext().setSession(sessionMap);
>> >
>> > Hope that helps.
>> >
>> > The only other fringe case that I have dealth with in our code, is when we
>> > have actions that implement Preparable and are used with a
>> > ParamsPrepareParams interceptor. I created a method to allow action
>> > parameters to be set.
>> >
>> > /**
>> > * Sets the action parameters
>> > * @param parameters Parameters to set
>> > */
>> > protected void setActionParameters(Map<String, String>
>> > parameters) {
>> > proxy.getInvocation().getInvocationContext().
>> > setParameters(parameters);
>> > }
>> >
>> > Then inside my Action Test class, I can issue:
>> > proxy.setActionParameters(...);
>> > before:
>> > proxy.execute();
>> >
>> > Cheers,
>> > --
>> > Haroon Rafique
>> > <haroon.rafique@(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)
>>
>
> _________________________________________________________________
> Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out.
> http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports

Attachment:
user_200937.ezm (zipped)Dear All,
In strust2, we'll use struts.xml file for configuration.
As per my knowledge, when server is started it will load struts.xml file into memory and it will parse this .xml file. Depending upon URL it will navigates to required class and .jsp file accordingly.
I have similar requirement where I need to load one .xml file into memory and depending upon URL I need to read column values
<List>
<Page URL="/employeeList.jsp" actionClass="com.EmployeeAction">
<Column name="empNo" type="long"/>
<Column name="empName” type=”String”/>
<Column name="empDOJ” type=”Date” />
<Column name="empDept” type=”String” />
</Page>
<Page URL="/orderList.jsp" actionClass="com.OrderAction">
<Column name="orderNo" type="long"/>
<Column name="orderName” type=”String”/>
<Column name="orderDate” type=”Date” />
<Column name="orderAddress” type=”String” />
</Page>
</List>
Can anyone please let me know how to do this??
Thanks in advance.
Regards,
Sharath.

Attachment:
user_200938.ezm (zipped)
Good Evening
assume you are loading the properties file as
Properties properties = new Properties();
String string;
try {
properties.load(new FileInputStream("filename.properties"));
string = properties.getProperty("user.description");
} catch (IOException e) {
}
if you place your variable into session with something like
ActionContext.getContext().getSession().put("user.description", string);
then you can access with
<s:property value="#session.user.description"/>
http://struts.apache.org/2.0.14/docs/ognl.html
does this help?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> From: peter@(protected)
> To: user@(protected)
> Date: Mon, 20 Jul 2009 16:21:18 +0200
> Subject: Problem with s:text expansion...
>
>
> Hi! I have an annoying problem with s:text expanding my named resources from
> the stack. Example:
>
> <s:text name="user.description" />: <s:property value="user.description" />
>
> The desired behavior is that s:text should print the localized text with the
> key "user.description" and s:property should print the value of
> user.getDescription() found on the stack. But s:text makes the same
> expansion - is it possible to prevent this?
>
> It's of course easy to rename the text key, but since we are many working in
> this project, adding things to actions/property files can cause unexpected
> behavior.
>
> Thanks in advance.
>
> Regards
> Peter Björkman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
_________________________________________________________________
Windows Live™ SkyDrive™: Store, access, and share your photos. See how.
http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009

Attachment:
user_200942.ezm (zipped)I had the same problem while using the opensessioninview pattern.
Since this pattern in struts uses an interceptor, in the OSiV
interceptor I checked to see if validation had failed in an Action.
If so, I "rolled back" the transaction to make sure it didn't persist
the data. I eventually removed this "roll back" logic because I
thought it was more of a hack than a solution. I also ran into some
issues with the evict() method so didn't go that route. Eventually I
moved to manual commit using JPA with Hibernate and managed the
process myself. Hibernate's default setting is auto commit = true. I
think you'll find controlling the process yourself is not that
difficult and makes for cleaner code.
On Mon, Jul 20, 2009 at 2:07 PM, Greg Lindholm<greg.lindholm@(protected):
>> Thank you very much!!
>>
>> During my research, I remember some one solved the issue by creating an
>> Struts 2 intercepter. He placed the intercepter right after the
>> validationIntercepter. The job of the intercepter was to check if
>> getActionErrors or getFieldErrors collections was not empty than it closed
>> and flushed the entityManager. But he didn't specified what intercepter
>> method (before, inside or after the action was invoked) he implemented.
>>
>> Do you think this is a solution ?
>> Any disadvangages ?
>> What intercepter method do you think will be the correct one to implement?
>>
>>
>>
> You could probably make this work. You can take a look at the Workflow
> Interceptor as an example of how to tell if there are errors.
>
> You would have to do your stuff before calling invocation.invoke(); cause
> after is too late, the result will have already been rendered.
>
> Disadvantages are hard to determine, depends a lot on how you are managing
> your Hibernate sessions. If you clear() /close()/rollback you are throwing
> away all changes in the Hibernate session not just the one object you that
> failed validation. To avoid these issues that is why I always work with a
> copy of the db object.
>

Attachment:
user_200943.ezm (zipped)
Thanks for response.
Just one question, how do you make the image visible on the webserver
without putting it in the web application?
Jim Kiley wrote:
>
> Make sure the image is visible to your webserver, and then use an
> http://url to access it, rather than a file:// url.
> jk
>
> On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected):
>
>>
>> Hi,
>>
>> I have a pb while trying to display an image that is not in my
>> application
>> but on the file system!!
>>
>> I've tried to put this in my jsp:
>>
>> file:///<%=request.getAttribute( /1.png"></img>
>>
>> and that too:
>> <html:image
>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>> <html:img
>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>
>> (imageLocation reference D:/images)
>>
>> but nothing is displayed. Does anybody knows how to display an image that
>> is
>> not in the web application?
>>
>> thanks,
>>
>> tugdual
>> --
>> View this message in context:
>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200944.ezm (zipped)Hi tutu,
You can't.
Best greetings,
Paweł Wielgus.
2009/7/21 tutu <tugdual.huertas@(protected)>:
>
> Thanks for response.
> Just one question, how do you make the image visible on the webserver
> without putting it in the web application?
>
>
> Jim Kiley wrote:
>>
>> Make sure the image is visible to your webserver, and then use an
>> http://url to access it, rather than a file:// url.
>> jk
>>
>> On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected):
>>
>>>
>>> Hi,
>>>
>>> I have a pb while trying to display an image that is not in my
>>> application
>>> but on the file system!!
>>>
>>> I've tried to put this in my jsp:
>>>
>>> file:///<%=request.getAttribute( /1.png"></img>
>>>
>>> and that too:
>>> <html:image
>>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>> <html:img
>>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>>
>>> (imageLocation reference D:/images)
>>>
>>> but nothing is displayed. Does anybody knows how to display an image that
>>> is
>>> not in the web application?
>>>
>>> thanks,
>>>
>>> tugdual
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> --
>> Jim Kiley
>> Senior Technical Consultant | Summa
>> [p] 412.258.3346
>> http://www.summa-tech.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Pb-displaying-image-tp24571593p24582908.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_200946.ezm (zipped)Yes, that's what i thought.
Is there a way to display images that are on the file system but not in the
web application? If not, how can you configure an external folder for images
if you can't see them in a web application?
2009/7/21 Paweł Wielgus <poulwiel@(protected)>
> Hi tutu,
> You can't.
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2009/7/21 tutu <tugdual.huertas@(protected)>:
> >
> > Thanks for response.
> > Just one question, how do you make the image visible on the webserver
> > without putting it in the web application?
> >
> >
> > Jim Kiley wrote:
> >>
> >> Make sure the image is visible to your webserver, and then use an
> >> http://url to access it, rather than a file:// url.
> >> jk
> >>
> >> On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected)>
> wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> I have a pb while trying to display an image that is not in my
> >>> application
> >>> but on the file system!!
> >>>
> >>> I've tried to put this in my jsp:
> >>>
> >>> file:///<%=request.getAttribute( /1.png"></img>
> >>>
> >>> and that too:
> >>> <html:image
> >>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> >>> <html:img
> >>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> >>>
> >>> (imageLocation reference D:/images)
> >>>
> >>> but nothing is displayed. Does anybody knows how to display an image
> that
> >>> is
> >>> not in the web application?
> >>>
> >>> thanks,
> >>>
> >>> tugdual
> >>> --
> >>> View this message in context:
> >>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
> >>> Sent from the Struts - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >>> For additional commands, e-mail: user-help@(protected)
> >>>
> >>>
> >>
> >>
> >> --
> >> Jim Kiley
> >> Senior Technical Consultant | Summa
> >> [p] 412.258.3346
> >> http://www.summa-tech.com
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Pb-displaying-image-tp24571593p24582908.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)
>
>

Attachment:
user_200947.ezm (zipped)1. You put it in a directory that your webserver serve...
or
2. Create a servlet that reads the data from the filesystem and sends
back the data in the response.
I'd certainly prefer option 1 if possible.
Nils-H
On Tue, Jul 21, 2009 at 9:31 AM, tutu<tugdual.huertas@(protected):
>
> Thanks for response.
> Just one question, how do you make the image visible on the webserver
> without putting it in the web application?
>
>
> Jim Kiley wrote:
>>
>> Make sure the image is visible to your webserver, and then use an
>> http://url to access it, rather than a file:// url.
>> jk
>>
>> On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected):
>>
>>>
>>> Hi,
>>>
>>> I have a pb while trying to display an image that is not in my
>>> application
>>> but on the file system!!
>>>
>>> I've tried to put this in my jsp:
>>>
>>> file:///<%=request.getAttribute( /1.png"></img>
>>>
>>> and that too:
>>> <html:image
>>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>> <html:img
>>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
>>>
>>> (imageLocation reference D:/images)
>>>
>>> but nothing is displayed. Does anybody knows how to display an image that
>>> is
>>> not in the web application?
>>>
>>> thanks,
>>>
>>> tugdual
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> --
>> Jim Kiley
>> Senior Technical Consultant | Summa
>> [p] 412.258.3346
>> http://www.summa-tech.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Pb-displaying-image-tp24571593p24582908.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_200948.ezm (zipped)Ok, thanks Nils,
i'll try first solution.
On Tue, Jul 21, 2009 at 9:53 AM, Nils-Helge Garli Hegvik
<nilsga@(protected):
> 1. You put it in a directory that your webserver serve...
> or
> 2. Create a servlet that reads the data from the filesystem and sends
> back the data in the response.
>
> I'd certainly prefer option 1 if possible.
>
> Nils-H
>
> On Tue, Jul 21, 2009 at 9:31 AM, tutu<tugdual.huertas@(protected):
> >
> > Thanks for response.
> > Just one question, how do you make the image visible on the webserver
> > without putting it in the web application?
> >
> >
> > Jim Kiley wrote:
> >>
> >> Make sure the image is visible to your webserver, and then use an
> >> http://url to access it, rather than a file:// url.
> >> jk
> >>
> >> On Mon, Jul 20, 2009 at 11:08 AM, tutu <tugdual.huertas@(protected)>
> wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> I have a pb while trying to display an image that is not in my
> >>> application
> >>> but on the file system!!
> >>>
> >>> I've tried to put this in my jsp:
> >>>
> >>> file:///<%=request.getAttribute( /1.png"></img>
> >>>
> >>> and that too:
> >>> <html:image
> >>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> >>> <html:img
> >>> src="file:///<%=request.getAttribute("imageLocation")%>/1.png"/>
> >>>
> >>> (imageLocation reference D:/images)
> >>>
> >>> but nothing is displayed. Does anybody knows how to display an image
> that
> >>> is
> >>> not in the web application?
> >>>
> >>> thanks,
> >>>
> >>> tugdual
> >>> --
> >>> View this message in context:
> >>> http://www.nabble.com/Pb-displaying-image-tp24571593p24571593.html
> >>> Sent from the Struts - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >>> For additional commands, e-mail: user-help@(protected)
> >>>
> >>>
> >>
> >>
> >> --
> >> Jim Kiley
> >> Senior Technical Consultant | Summa
> >> [p] 412.258.3346
> >> http://www.summa-tech.com
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Pb-displaying-image-tp24571593p24582908.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)
>
>

Attachment:
user_200945.ezm (zipped)
Hi,
When uploading an image using file upload calling this code:
InputStream stream = new BufferedInputStream(new FileInputStream(file));
It seems like the webapplication try to access the filesystem temporary to
create the file using FileInputStream.
On Windows it works, but it seems like on Unix server it does not have
permission to access the filesystem using FileInputStream, , am I right ?
- What should I do ?
- Is there other way to convert a file to inputStream without accessing the
filesystem ?
-taltun
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_200949.ezm (zipped)Hi,
I mean in xml validation, the document I read is
Action-validation.xml
Action-<alias>-validation.xml
What I wonder is S2 support Action-<action_method>-validation.xml?
For e.g I've input1() and input2() method in my action, when I call input1() I like to have something Action-input1-validation.xml to be use and input2() will use Action-input2-validation.xml. I did tried it, but it not work for me.
I know I can define alias to a action method, then I can use Action-<alias>-validation.xml, but this is not my first choice, unless there is no other way.
Regards
Louis
________________________________
From: Jim Kiley <jhkiley@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Monday, July 20, 2009 7:36:45 PM
Subject: Re: action-method-validation
Do you mean, can I write a validateFoo() method for my foo() action method
and be sure validateFoo() will run before foo() does? Yes.
jk
On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo <jlvoo@(protected):
> Hi,
>
> Does struts2 support action-method-validation ?
>
>
> Regards
> Louis
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com

Attachment:
user_200950.ezm (zipped)Hi,
Can anyone show me a link where I can download the example source
codes from the following link:
http://struts.improve-technologies.com/faqs/lists.html
Very appreciate for any answers.
Thanks
Sam

Attachment:
user_200951.ezm (zipped)Sam Wun wrote:
> Can anyone show me a link where I can download the example source
> codes from the following link:
>
> http://struts.improve-technologies.com/faqs/lists.html
http://struts.improve-technologies.com/download.html?

Attachment:
user_200952.ezm (zipped)hi every one,
how to clear the "html:file " element value?
form is not submitting, until the "html:file" tag has a valid
value..........
Iam doing serverside validations, and "html:file" is the last element in the
form.....
how to tackle this problem?
Is there any way i can create the html:file element, dynamically using
javascript
--
Abhishek

Attachment:
user_200953.ezm (zipped)
Hi Dave,
Thanks for your reply. It makes perfect sense.
I should revisit my action classes and do some refactoring....
Thanks,
ST
newton.dave wrote:
>
>
> Personally I tend to use multiple actions, mostly to avoid having
> unnecessary action properties. For me it's easier to deal with many
> tightly-focused classes (as opposed to a small number of classes with
> multiple responsibilities).
>
> I don't think there's a right or wrong way, really--I just happen to
> prefer keeping classes as light and lean as possible; they're easier for
> me to read and understand that way. The negative is that I end up with a
> lot of classes--but I'm okay with that.
>
> Common functionality often gets broken out into super-classes. For
> example a recent project now has a user admin action base class with a
> bunch of services used across all user admin functionality, with a
> number of sub-classes that handle specific tasks.
>
> Bigger codespace, more lines of code. Lower cognitive overhead for each
> class (although it's not always immediately obvious where shared
> functionality is handled), more granularity making things easier to mock
> and/or stub.
>
> Ah, I miss Smalltalk.
>
> Dave
>
> ---------------------------------------------------------------------
> 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.