Re: Graphical Configuration Utility

2008-12-16 Thread ManiKanta G
well that is not the issue with the S2GUI jar... but with the Java itself...

When the jar file having dependencies is in folder names '!' (with out
quotes, only exclamatory sign) in windows, is is failing to open the main
class.

When I moved out the '!' folder, it is working fine. This is second time I
scratched my head with this bug.. Any way this time I filed a bug in Sun
site.. waiting for their reply.

Finally I was able to run ur jar..

I've created new one, by

File > New > on struts, Add Package > on New Package, New Action.

But then how do I type/map/configure actions there... I m clueless

ManiKanta


Fwd: Exception when using ServletActionRedirectResult with @Result

2008-12-16 Thread Amin Mohammed-Coleman



Sent from my iPhone

Begin forwarded message:


From: Amin Mohammed-Coleman 
Date: 28 November 2008 22:07:10 GMT
To: "Struts Users Mailing List" 
Subject: Re: Exception when using ServletActionRedirectResult with  
@Result





Hi

I do apologise, I didn't mean to send it three times.  My email  
program was doing some funny things and I thought that the email was  
not sent.


The exception is thrown and fails to work.


Sorry again!

On 28 Nov 2008, at 20:34, Dave Newton wrote:


Sorry to be sending this again but I was wondering if some
might be able to help. I added a param actionName but no luck.


Re-sending it may not be the best approach--three's a lot of times.

Is it actually not working, or is it just logging the exception?

Dave



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org





RE: Disabling i18n support on Struts1/Struts2

2008-12-16 Thread nodje

Hi, 

I'm sorry, I'm not sure I understand.
What exatly is  supposed to do?
Force Struts to look for all resources in a single resource-bundle instead
of looking for the localized one?

cheers


Seshagiri V wrote:
> 
> 
> Hi All,
> Please use following code in struts.xml file.
> 
>value="globalMessages" />
> 
> This is one of the solutions. Please try it.
> 
> Thank you,
> Seshagiri V
> seshagi...@kensium.com. 
>  
> US Main: 877 KENSIUM (536.7486)
> US Fax:   312.242.3029
>  
> Kensium
> 200 S Wacker Dr, Suite 3100
> Chicago, IL 60606
>  
> Confidentiality Note:
> -
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
>  
>  
> -Original Message-
> From: nodje [mailto:nodje...@gmail.com] 
> Sent: Tuesday, December 16, 2008 12:45 PM
> To: user@struts.apache.org
> Subject: Disabling i18n support on Struts1/Struts2
> 
> 
> Is there a way to disable i18n support on respectively Struts1 and
> Struts2?
> 
> cheers
> 
> -nodje
> -- 
> View this message in context:
> http://www.nabble.com/Disabling-i18n-support-on-Struts1-Struts2-tp21028365p2
> 1028365.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.176 / Virus Database: 270.9.18/1850 - Release Date:
> 12/15/2008
> 5:04 PM
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Disabling-i18n-support-on-Struts1-Struts2-tp21028365p21045866.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Simple Question?

2008-12-16 Thread Mark Rollins

Thanks Dave, that's sorted it.

I've worked with many technologies over many years, but the quirks of OGNL
with Struts2 seem to defy reason for me. Totally frustrating!

But thanks again for your help.


>The answer is that OGNL interprets a single character between single quotes
as a character, not a string, so the original comparison will not work.
Using double quotes will work, as will using a more meaningful
representation of the action (like "insert").

>This has been a FAQ entry for some time:

>http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html

>Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-- 
View this message in context: 
http://www.nabble.com/Simple-Question--tp21037097p21044006.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Invalid path was requested

2008-12-16 Thread laredotornado

Thanks for your example.  It helped me realize that when I edited my path so
that it was relative to the context path of my app, instead of cutting and
pasting everything after the domain, everything worked just fine.

 - Dave


Paweł Wielgus wrote:
> 
> Hi Dave,
> i have almost the same code and it works,
> 
> ActionForward forward = new
> ActionForward("/remoteAccess.do?server=irqpa&entry=potentialCost"
> + "&idExtraCostType=" + ExtraCostType.MEDICAL_TEST.getOrdinal());
> return forward;
> 
> But i also have such one:
> ActionForward forward = new ActionForward();
> 
> forward.setPath("/temp/representative/request/"+representativeForm.getActionTarget()+"/view.do");
> forward.setContextRelative(originalForward.getContextRelative());
> forward.setName(originalForward.getName());
> forward.setRedirect(originalForward.getRedirect());
> return forward;
> 
> But i use some ancient s1 version.
> 
> So firstly You can try without URLEncoder.encode(appName),
> then you can add printing constructed string and pasting it into browser,
> maybe some typo?
> 
> Best greetings,
> Paweł Wielgus.
> 
> 
> 2008/12/15 laredotornado :
>>
>> Hi,
>>
>> I'm using Struts 1 and trying to figure out the mysterious world of
>> forwarding.  I have
>>
>>String path = new
>> String("/npsim/appGroupsAdmin.do?addAppGroup=Add+New+Group&submitted=submit&task=add&appName="
>> + URLEncoder.encode(appName));
>>return new ActionForward(path);
>>
>> but when this code is invoked, I get the error "Invalid path was
>> requested".
>> I can cut and paste the above (substituting in the appropriate variable
>> for
>> "appName") and it will come up in my browser.  What am I doing wrong
>> here?
>>
>> Thanks, - Dave
>> --
>> View this message in context:
>> http://www.nabble.com/Invalid-path-was-requested-tp21020377p21020377.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Invalid-path-was-requested-tp21020377p21043835.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



A complete listing of velocity struts 2 tags?

2008-12-16 Thread James Carr
Is there a complete listing of the struts 2 tags in velocity?
Specifically, I want to use the #stext tag with parameters (for a
parameterized i18n property) but unfortunately cannot find any example
at all anywhere.

I tried this:

#stext("name=foo.bar.baz")
   #sparam(1123)
#end

but no luck. I am clueless on what to do next!

Thanks,
James

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



expression validator NPE

2008-12-16 Thread stanlick

I have encountered a validation that seems to disrupt the S2 request life
cycle.  If I have the following validation and foo is not found on the
stack, I do not get a result!




foo.startsWith(validPrefix)





OgnlRuntime is throwing a NPE and ValidationInterceptor is not catching it. 
If I change my validation to:

foo != null && foo.startsWith(validPrefix)

it works.

Scott
-- 
View this message in context: 
http://www.nabble.com/expression-validator-NPE-tp21039786p21039786.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: html:form windowstate

2008-12-16 Thread Nils-Helge Garli Hegvik
Are you using the struts 1 portlet bridge?
(http://portals.apache.org/bridges/multiproject/portals-bridges-struts)
Haven't used it myself, but I'd be surprised if the framework didn't
support creating portlet urls. I have only used a WebSphere
Portal-proprietary extension which (from what I remember) created
portlet urls automatically.

Nils-H


On Tue, Dec 16, 2008 at 5:27 PM, Evert Lammerts  wrote:
> Hi Nils,
>
> I've tried your suggestion but it doesn't seem to be possible. The action 
> attribute in html:form expects an Action URI, while actionURL creates an 
> absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing 
> something - I guess it IS possible to create a form tag that submits to a 
> WindowState.MAXIMIZED state.
>
> Thanks, Evert Lammerts
>
> -Original Message-
> From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com]
> Sent: dinsdag 16 december 2008 13:07
> To: Struts Users Mailing List
> Subject: Re: html:form windowstate
>
> You can probably use the 'var' attribute of the portlet:actionURL tag
> to store the url as a variable which you can reference by an
> expression in the html:form tag. Take a look at the tag reference for
> the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.
>
> Nils-H
>
> [1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html
>
> On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts  
> wrote:
>> Hi all,
>>
>> Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
>> attribute that submits the form to a maximized window state, like possible 
>> with the actionURL tag:
>>
>> > WindowState.MAXIMIZED.toString() %>">
>>
>>"
>>method="POST">
>>
>> Is there a way to do this? Maybe with a hidden form input?
>>
>> Thanks,
>> Evert Lammerts
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: .properties variable from action class

2008-12-16 Thread Oscar Alvarez
if you extend ActionSupport try getText("name.of.your.property")

2008/12/16 elyes sallem 

> Hello,
> i wanna know how get back a property variable defined in ".properties" file
> from an exceute method, in the action class
>
> Regards
> Elyes.
>


Re: Simple Question?

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, Oscar Alvarez wrote:
> try puting a comparator in your action like this
> 
> public Boolean isPipeEditAction(){
>return "|".equals(getEditAction());
> }
> 
> and then test it in your view

I think your font is fooling you--the original question was regarding a capital 
'i', 'I'.

The answer is that OGNL interprets a single character between single quotes as 
a character, not a string, so the original comparison will not work. Using 
double quotes will work, as will using a more meaningful representation of the 
action (like "insert").

This has been a FAQ entry for some time:

http://struts.apache.org/2.x/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Simple Question?

2008-12-16 Thread Oscar Alvarez
try puting a comparator in your action like this

public Boolean isPipeEditAction(){
   return "|".equals(getEditAction());
}

and then test it in your view

2008/12/16 Dave Newton 

> > Famoso Struts OGNL :-)!
>
> Or typical Java.
>
> OGNL one-ups Java, in fact, as OGNL will treat multiple characters within
> single-quotes as a string, but falls back to standard Java if it's a single
> character.
>
> Dave
>
> > Musachy Barroso wrote:
> > >
> > > I think OGNL will try 'I' as a character, so
> > they will never match,
> > > just a hunch :)
> > >
> > > musachy
> > >
> > > On Tue, Dec 16, 2008 at 11:58 AM, Mark Rollins
> > >  wrote:
> > >>
> > >> I know this should be obvious. Perhaps I'm
> > just too thick to use Struts2!
> > >>
> > >> I have an action class with a private String
> > editAction and corresponding
> > >> public getter/setter. I know the value for this
> > String is "I".
> > >>
> > >> In the view I need to test the value of this field
> > using  > >> test="...">,
> > >> to see if it is "I"
> > >>
> > >> I've tried just about everything I can for the
> > test expression, including
> > >> editAction=='I',
> > %{editAction=='I'}, #editAction=='I',
> > >> %{#editAction=='I'},
> > >> %{getEditAction()=='I'} but nothing works.
> > >>
> > >> I had thought that properties of an action class
> > were available on the
> > >> value
> > >> stack. Do I need to use a .Equals() method?
> > >>
> > >> Why, why why isn't this simple? Please put me
> > out of my misery!
> > >>
> > >> Many thanks
> > >>
> > >>
> > >> --
> > >> View this message in context:
> > >>
> > http://www.nabble.com/Simple-Question--tp21037097p21037097.html
> > >> Sent from the Struts - User mailing list archive
> > at Nabble.com.
> > >>
> > >>
> > >>
> > -
> > >> To unsubscribe, e-mail:
> > user-unsubscr...@struts.apache.org
> > >> For additional commands, e-mail:
> > user-h...@struts.apache.org
> > >>
> > >>
> > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the
> > stone?" Pink Floyd
> > >
> > >
> > -
> > > To unsubscribe, e-mail:
> > user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail:
> > user-h...@struts.apache.org
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Simple-Question--tp21037097p21037595.html
> > Sent from the Struts - User mailing list archive at
> > Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail:
> > user-h...@struts.apache.org
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Simple Question?

2008-12-16 Thread Dave Newton
> Famoso Struts OGNL :-)!

Or typical Java.

OGNL one-ups Java, in fact, as OGNL will treat multiple characters within 
single-quotes as a string, but falls back to standard Java if it's a single 
character.

Dave

> Musachy Barroso wrote:
> > 
> > I think OGNL will try 'I' as a character, so
> they will never match,
> > just a hunch :)
> > 
> > musachy
> > 
> > On Tue, Dec 16, 2008 at 11:58 AM, Mark Rollins
> >  wrote:
> >>
> >> I know this should be obvious. Perhaps I'm
> just too thick to use Struts2!
> >>
> >> I have an action class with a private String
> editAction and corresponding
> >> public getter/setter. I know the value for this
> String is "I".
> >>
> >> In the view I need to test the value of this field
> using  >> test="...">,
> >> to see if it is "I"
> >>
> >> I've tried just about everything I can for the
> test expression, including
> >> editAction=='I',
> %{editAction=='I'}, #editAction=='I',
> >> %{#editAction=='I'},
> >> %{getEditAction()=='I'} but nothing works.
> >>
> >> I had thought that properties of an action class
> were available on the
> >> value
> >> stack. Do I need to use a .Equals() method?
> >>
> >> Why, why why isn't this simple? Please put me
> out of my misery!
> >>
> >> Many thanks
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Simple-Question--tp21037097p21037097.html
> >> Sent from the Struts - User mailing list archive
> at Nabble.com.
> >>
> >>
> >>
> -
> >> To unsubscribe, e-mail:
> user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail:
> user-h...@struts.apache.org
> >>
> >>
> > 
> > 
> > 
> > -- 
> > "Hey you! Would you help me to carry the
> stone?" Pink Floyd
> > 
> >
> -
> > To unsubscribe, e-mail:
> user-unsubscr...@struts.apache.org
> > For additional commands, e-mail:
> user-h...@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Simple-Question--tp21037097p21037595.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail:
> user-h...@struts.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Simple Question?

2008-12-16 Thread Milan Milanovic

Famoso Struts OGNL :-)!


Musachy Barroso wrote:
> 
> I think OGNL will try 'I' as a character, so they will never match,
> just a hunch :)
> 
> musachy
> 
> On Tue, Dec 16, 2008 at 11:58 AM, Mark Rollins
>  wrote:
>>
>> I know this should be obvious. Perhaps I'm just too thick to use Struts2!
>>
>> I have an action class with a private String editAction and corresponding
>> public getter/setter. I know the value for this String is "I".
>>
>> In the view I need to test the value of this field using > test="...">,
>> to see if it is "I"
>>
>> I've tried just about everything I can for the test expression, including
>> editAction=='I', %{editAction=='I'}, #editAction=='I',
>> %{#editAction=='I'},
>> %{getEditAction()=='I'} but nothing works.
>>
>> I had thought that properties of an action class were available on the
>> value
>> stack. Do I need to use a .Equals() method?
>>
>> Why, why why isn't this simple? Please put me out of my misery!
>>
>> Many thanks
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Simple-Question--tp21037097p21037097.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Simple-Question--tp21037097p21037595.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



S2: using a button how can I get a value of a field in the interceptor?

2008-12-16 Thread xianwinwin

Hi all,

I have a button that once clicked an Interceptor does something. 
So...I have a form that requires the user to input an ID, how can I check,
in the interceptor, if this value is valid BEFORE it gets to the action
class.

in other words: say a field called resourceID (Long) and the user input any
number and clicks the button how can I get this number in the interceptor? 

(if it was a link, not a button, I could have done request.getParameter and
get the value)

Thanks for any pointers

-- 
View this message in context: 
http://www.nabble.com/S2%3A-using-a-button-how-can-I-get-a-value-of-a-field-in-the-interceptor--tp21037525p21037525.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



.properties variable from action class

2008-12-16 Thread elyes sallem
Hello,
i wanna know how get back a property variable defined in ".properties" file
from an exceute method, in the action class

Regards
Elyes.


[S2] Problem with testing S2 Action when JasperResult type is used

2008-12-16 Thread Milan Milanovic

Hi,

I have defined a following Struts 2 action which show one simple PDF report: 



/reports/MainReport.jasper
parameters
connection
PDF



And I'm trying to test with JUnit 4 this action by using BaseStrutsTestCase
class (
http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
). But I have a problem because JasperReportsResult is trying to find
location of my report by using finalLocation parameter of its doExecute(...)
method. The problem is that this file is not found during test, while, when
application is running on server IT IS found. So, how can I solve this
problem, i.e., how to pass correct location to doExecute method of
JasperReportsResult during Junit test, or maybe I can pass this somehow ?

--
Thx, M.
-- 
View this message in context: 
http://www.nabble.com/-S2--Problem-with-testing-S2-Action-when-JasperResult-type-is-used-tp21037498p21037498.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Simple Question?

2008-12-16 Thread Musachy Barroso
I think OGNL will try 'I' as a character, so they will never match,
just a hunch :)

musachy

On Tue, Dec 16, 2008 at 11:58 AM, Mark Rollins
 wrote:
>
> I know this should be obvious. Perhaps I'm just too thick to use Struts2!
>
> I have an action class with a private String editAction and corresponding
> public getter/setter. I know the value for this String is "I".
>
> In the view I need to test the value of this field using ,
> to see if it is "I"
>
> I've tried just about everything I can for the test expression, including
> editAction=='I', %{editAction=='I'}, #editAction=='I', %{#editAction=='I'},
> %{getEditAction()=='I'} but nothing works.
>
> I had thought that properties of an action class were available on the value
> stack. Do I need to use a .Equals() method?
>
> Why, why why isn't this simple? Please put me out of my misery!
>
> Many thanks
>
>
> --
> View this message in context: 
> http://www.nabble.com/Simple-Question--tp21037097p21037097.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Simple Question?

2008-12-16 Thread Mark Rollins

I know this should be obvious. Perhaps I'm just too thick to use Struts2!

I have an action class with a private String editAction and corresponding
public getter/setter. I know the value for this String is "I".

In the view I need to test the value of this field using ,
to see if it is "I"

I've tried just about everything I can for the test expression, including
editAction=='I', %{editAction=='I'}, #editAction=='I', %{#editAction=='I'},
%{getEditAction()=='I'} but nothing works. 

I had thought that properties of an action class were available on the value
stack. Do I need to use a .Equals() method?

Why, why why isn't this simple? Please put me out of my misery!

Many thanks


-- 
View this message in context: 
http://www.nabble.com/Simple-Question--tp21037097p21037097.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: html:form windowstate

2008-12-16 Thread Evert Lammerts
Hi Nils,

I've tried your suggestion but it doesn't seem to be possible. The action 
attribute in html:form expects an Action URI, while actionURL creates an 
absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing 
something - I guess it IS possible to create a form tag that submits to a 
WindowState.MAXIMIZED state.

Thanks, Evert Lammerts

-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: dinsdag 16 december 2008 13:07
To: Struts Users Mailing List
Subject: Re: html:form windowstate

You can probably use the 'var' attribute of the portlet:actionURL tag
to store the url as a variable which you can reference by an
expression in the html:form tag. Take a look at the tag reference for
the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.

Nils-H

[1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html

On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts  wrote:
> Hi all,
>
> Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
> attribute that submits the form to a maximized window state, like possible 
> with the actionURL tag:
>
>  WindowState.MAXIMIZED.toString() %>">
>
>"
>method="POST">
>
> Is there a way to do this? Maybe with a hidden form input?
>
> Thanks,
> Evert Lammerts
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Fwd: export file data using formFile

2008-12-16 Thread elyes sallem
it forwarded me to page with "unreadable data"
comapred to the first example, you omit the
resp.setHeader("Content-Disposition", ...
here is the code ,i have the export method in a dispatch action :

public ActionForward exportSelectedIntaff(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {

and i put this, after the creation of the excel file

try {
 OutputStream out = response.getOutputStream();
  FileInputStream fileStream = new
FileInputStream(filePath.replaceAll("/", "//"));
  int bufferLen = 1024 * 8;// 8 KB
  byte[] buffer = new byte[bufferLen];
  while (true) {
  int max = buffer.length;
  int len = fileStream.read(buffer, 0, max);
  if (len > 0)
  out.write(buffer, 0, len);
  else
  break;
  }

} catch (IOException e) {
// TODO: handle exception
}


Regards
Elyes




2008/12/16 Robert Graf-Waczenski 

> Hi Elyes,
>
> something like this here should work:
>
>   OutputStream out = resp.getOutputStream();
>   FileInputStream fileStream = new
> FileInputStream("path/to/your/excelFile.xls");
>   int bufferLen = 1024 * 8;// 8 KB
>   byte[] buffer = new byte[bufferLen];
>   while (true) {
>   int max = buffer.length;
>   int len = fileStream.read(buffer, 0, max);
>   if (len > 0)
>   out.write(buffer, 0, len);
>   else
>   break;
>   }
>
> Bye,
>
> Robert
>
>
>
> elyes sallem wrote:
>
>> Hello Robert ,
>> so assume that i have an excel file on the server
>> and i have a button to download it for the client (of course with a browse
>> dialog)
>> could you show me how develop it , in your example ,  you call
>> writePDFDataToOutputStream
>> and it is a pdf file which is not my case
>>
>> Thanks
>> Regards
>> Elyes
>>
>>
>>
>>
>>
>> 2008/12/15 Robert Graf-Waczenski 
>>
>>
>>
>>> Here's an example:
>>>
>>> public class Downloader extends HttpServlet
>>> {
>>> private void doGet(HttpServletRequest req, HttpServletResponse resp)
>>> throws
>>> IOException
>>> {
>>>  resp.setHeader("Pragma", "no-cache");
>>>  resp.setHeader("Cache-control", "no-cache");
>>>  resp.setIntHeader("Expires", -1);
>>>  MyData data = new MyData();
>>>  resp.setHeader("content-type", "application/pdf");
>>>  resp.setHeader("content-encoding", "binary");
>>>  resp.setHeader("Content-Disposition", "attachment;
>>> filename=myfile.pdf");
>>>  data.writePDFDataToOutputStream(resp.getOutputStream());
>>>
>>> }
>>> }
>>>
>>>
>>> elyes sallem wrote:
>>>
>>>
>>>
 ok, do you have an example?

 Thanks
 Regards
 Elyes


 2008/12/15 Dave Newton 





> --- On Mon, 12/15/08, elyes sallem wrote:
>
>
>
>
>> the problem is that with the html:file you must browse to an
>> existant file, but in my case, i wanna browse to a new file,
>> and then in the action i will make some treatment, generate
>> data and export them to this file
>>
>>
>>
>>
> That's not how you do that.
>
> You stream the response back and the user gets a save-file dialog.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
>
>
>




>>>
>>>
>>
>>
>>
>>
>
>


-- 
Elyes.


Re: Oops... ignore the stupid job posting I just allowed through.

2008-12-16 Thread Antonio
2008/12/16 Dave Newton :
> I hit the wrong button.

I hope it wasn't red and big

Antonio

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Oops... ignore the stupid job posting I just allowed through.

2008-12-16 Thread Dave Newton
I hit the wrong button.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Softwareart Requirement List - 12/16/2008

2008-12-16 Thread Vinit
Click here to Remove

(struts-u...@jakarta.apache.org) from our mailing list.

Dear Yahoo:     
 
 
These are the requirements currently open.
 
 
Req. ID: Req-0207 - System Analyst, Bancware RCAP Product (SunGard)

Primary Skills:  Bancware RCAP Product (SunGard), Oracle, UNIX   
Description: Technically we are looking for a System Analyst about 7
years experience.

Experience in Bancware RCAP Product (SunGard) who understands scripting.
White Light Analytics server is a must and has worked with Oracle and UNIX.

He/ She should be able to customize Bancware models as per Basel 2 final
rules - the key would be to know Basel 2 rules and understanding of
Bancware.

Currently we are having some resource requirements with SunGard Bancware
(Whitelight server) skills. 

 Rate: Open,   Job Type: Contract,   Total Exp: 7+,   Start Date:
ASAP,   Duration: 12 Months,   Number Of Openings: 1,   Location: Boston, MA

 Respond to this requirement.

 
 
Please respond with Resume, Rate and Phone numbers of the Consultant. Make
sure the Consultant's skills match the requirement.
 
I will contact you, if I need more information.
 

Regards,

 

Vinit 

 

SoftwareArt Corporation

2nd Floor

1155 Whitehorse-Mercerville Road
Hamilton, NJ 08619
H.Q.: 27 Water St. Wakefield, MA 01880

Phone: 609-585-7300 x 100

Fax: 609-585-7322

E-mail: vi...@softwareart.com

  www.softwareart.com

 

SoftwareArt is your best partner - let us show you the "Blueprint For
Success"

Please reply blank mail with REMOVE in the subject line of the original
message, if you do not wish to receive further e-mails from us.

Sorry for the inconvenience caused!

Note: Under Bill s.1618 Title III passed by the 105th U.S. Congress this
mail cannot be considered Spam as long as we include contact information and
remove link for removal from our mailing list. This message contains
confidential information and is intended only for the individual named. If
you are not the named addressee, you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail address.



 
eMailed To: struts-u...@jakarta.apache.org


Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, red phoenix wrote:
> How to look if I use the default stack? 
> 
>   
>   [...]

It's important to know how the framework you're using works (IMO).

You are extending the default package. You can see how the default package is 
configured by understanding what's in the default struts config file:

http://struts.apache.org/2.0.14/docs/struts-defaultxml.html

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: S2 V2.0.14: with HTML in property key value

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, Robert Graf-Waczenski wrote:
> I would like to avoid the HTML encoding, so that the button
> caption is instead "  OK  " (i.e. with spaces to
> the left and the right next to "OK").
> 
> Any ideas?

Personally I'd use CSS for this.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



S2 V2.0.14: with HTML in property key value

2008-12-16 Thread Robert Graf-Waczenski

Hello all,

I'm using  and my 
properties file looks like this:


myproperties.caption.buttoncaption=  OK  

This yields a button with the label "  OK  ", i.e. 
the button text has been HTML-encoded before it was sent to the browser.


I would like to avoid the HTML encoding, so that the button caption is 
instead "  OK  " (i.e. with spaces to the left and the right next to "OK").


FWIW, the submit tag above is nested in a  tab with the "simple" 
theme.


Any ideas?

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread red phoenix
>How to look if I use the default stack? My configure file is follows:

   
   
   /demo/upload.jsp
  
  


Is it  "fileUpload" interceptor?

phoenix

On Tue, Dec 16, 2008 at 11:55 PM, Dave Newton  wrote:

> --- On Tue, 12/16/08, red phoenix wrote:
> > It says: Ensure that {{fileUpload }} Interceptor is included in the
> > Action's stack. .*The default stack already includes {{fileUpload }}.*
> >
> > I don't know how to determine 'Ensure that {{fileUpload }} Interceptor
> > is included in the Action's stack",which file? Would you give me a
> > example?
>
> ...
>
> The default stack already includes the "fileUpload" interceptor.
>
> Are you using the default stack?
>
> If yes: it already includes the "fileUpload" interceptor.
> If no: does *your* stack include the "fileUpload" interceptor?
>  If yes: you're done.
>  If no: include it.
>
> > My question is how to get upload stream when submit  jsp to
> > action, client and server are not the same machine. How to do it?
>
> The file is an action property: you can do whatever you want with it.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, red phoenix wrote:
> It says: Ensure that {{fileUpload }} Interceptor is included in the
> Action's stack. .*The default stack already includes {{fileUpload }}.*
> 
> I don't know how to determine 'Ensure that {{fileUpload }} Interceptor 
> is included in the Action's stack",which file? Would you give me a 
> example?

...

The default stack already includes the "fileUpload" interceptor.

Are you using the default stack?

If yes: it already includes the "fileUpload" interceptor.
If no: does *your* stack include the "fileUpload" interceptor?
  If yes: you're done.
  If no: include it.

> My question is how to get upload stream when submit  jsp to
> action, client and server are not the same machine. How to do it? 

The file is an action property: you can do whatever you want with it.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread red phoenix
>Use the *preferred* method, the interceptor.
It says:
Ensure that {{fileUpload }} Interceptor is included in the Action's stack.
  .*The default stack already includes {{fileUpload }}.*

I don't know how to determine 'Ensure that {{fileUpload }} Interceptor is
included in the Action's stack",which file? Would you give me a example?

By the way, I want to get upload stream as follows:
FileInputStream fis = ...  //how to get FileInputStream?
uploadaction.setData(Hibernate.createBlob(fis));

My question is how to get upload stream when submit  jsp to action, client
and server are not the same machine. How to do it? An example is better.

phoenix

On Tue, Dec 16, 2008 at 11:32 PM, Dave Newton  wrote:

> Use the *preferred* method, the interceptor.
>
> I haven't looked in to what caused the breaking change.
>
> Dave
>
> --- On Tue, 12/16/08, red phoenix  wrote:
>
> > From: red phoenix 
> > Subject: Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be
> cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> > To: "Struts Users Mailing List" ,
> newton.d...@yahoo.com
> > Date: Tuesday, December 16, 2008, 10:26 AM
>  > In
> > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html
> > , it use
> > MultiPartRequestWrapper multipartRequest =
> > (MultiPartRequestWrapper)
> > ServletActionContext.getRequest();
> > It still raise java.lang.ClassCastException:
> > org.apache.struts2.dispatcher.StrutsRequestWrapper cannot
> > be cast to
> > org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.
> > My popuse is that when jsp sumbit to action,I can get
> > upload file name and
> > the stream of upload file,then I can write the stream of
> > upload file into
> > blob of oracle database.I don't know how to get the
> > stream of upload file!
> >  I still puzzled with why raise above error. I don't
> > find the different
> > between my code and
> > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html.
> >
> > Where wrong with my code?
> >
> >
> >
> >
> > On Tue, Dec 16, 2008 at 11:13 PM, Dave Newton
> >  wrote:
> >
> > > --- On Tue, 12/16/08, red phoenix wrote:
> > > > [...]
> > > > MultiPartRequestWrapper multipartRequest =
> > > > (MultiPartRequestWrapper)
> > ServletActionContext.getRequest();
> > > > [...]
> > > >
> > > >
> > org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be
> > cast to
> > > >
> > org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> > > >
> > > > Why raise above error?
> > >
> > > Because StrutsRequestWrappers can't be cast to
> > MultiPartRequestWrappers.
> > >
> > > > How to correct it?
> > >
> > > Use the built-in file upload capabilities of Struts 2;
> > there's no reason to
> > > access the request manually.
> > >
> > > Here's that link again:
> > >
> > >
> > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html
> > >
> > > Dave
> > >
> > >
> > >
> > -
> > > To unsubscribe, e-mail:
> > user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail:
> > user-h...@struts.apache.org
> > >
> > >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Fwd: export file data using formFile

2008-12-16 Thread Robert Graf-Waczenski

Hi Elyes,

something like this here should work:

   OutputStream out = resp.getOutputStream();
   FileInputStream fileStream = new 
FileInputStream("path/to/your/excelFile.xls");

   int bufferLen = 1024 * 8;// 8 KB
   byte[] buffer = new byte[bufferLen];
   while (true) {
   int max = buffer.length;
   int len = fileStream.read(buffer, 0, max);
   if (len > 0)
   out.write(buffer, 0, len);
   else
   break;
   }

Bye,

Robert


elyes sallem wrote:

Hello Robert ,
so assume that i have an excel file on the server
and i have a button to download it for the client (of course with a browse
dialog)
could you show me how develop it , in your example ,  you call
writePDFDataToOutputStream
and it is a pdf file which is not my case

Thanks
Regards
Elyes





2008/12/15 Robert Graf-Waczenski 

  

Here's an example:

public class Downloader extends HttpServlet
{
private void doGet(HttpServletRequest req, HttpServletResponse resp) throws
IOException
{
  resp.setHeader("Pragma", "no-cache");
  resp.setHeader("Cache-control", "no-cache");
  resp.setIntHeader("Expires", -1);
  MyData data = new MyData();
  resp.setHeader("content-type", "application/pdf");
  resp.setHeader("content-encoding", "binary");
  resp.setHeader("Content-Disposition", "attachment;
filename=myfile.pdf");
  data.writePDFDataToOutputStream(resp.getOutputStream());

}
}


elyes sallem wrote:



ok, do you have an example?

Thanks
Regards
Elyes


2008/12/15 Dave Newton 



  

--- On Mon, 12/15/08, elyes sallem wrote:




the problem is that with the html:file you must browse to an
existant file, but in my case, i wanna browse to a new file,
and then in the action i will make some treatment, generate
data and export them to this file


  

That's not how you do that.

You stream the response back and the user gets a save-file dialog.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org








  




  




Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread Dave Newton
Use the *preferred* method, the interceptor.

I haven't looked in to what caused the breaking change.

Dave

--- On Tue, 12/16/08, red phoenix  wrote:

> From: red phoenix 
> Subject: Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be 
> cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> To: "Struts Users Mailing List" , 
> newton.d...@yahoo.com
> Date: Tuesday, December 16, 2008, 10:26 AM
> In
> http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html
> , it use
> MultiPartRequestWrapper multipartRequest =
> (MultiPartRequestWrapper)
> ServletActionContext.getRequest();
> It still raise java.lang.ClassCastException:
> org.apache.struts2.dispatcher.StrutsRequestWrapper cannot
> be cast to
> org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.
> My popuse is that when jsp sumbit to action,I can get
> upload file name and
> the stream of upload file,then I can write the stream of
> upload file into
> blob of oracle database.I don't know how to get the
> stream of upload file!
>  I still puzzled with why raise above error. I don't
> find the different
> between my code and
> http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html.
> 
> Where wrong with my code?
> 
> 
> 
> 
> On Tue, Dec 16, 2008 at 11:13 PM, Dave Newton
>  wrote:
> 
> > --- On Tue, 12/16/08, red phoenix wrote:
> > > [...]
> > > MultiPartRequestWrapper multipartRequest =
> > > (MultiPartRequestWrapper)
> ServletActionContext.getRequest();
> > > [...]
> > >
> > >
> org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be
> cast to
> > >
> org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> > >
> > > Why raise above error?
> >
> > Because StrutsRequestWrappers can't be cast to
> MultiPartRequestWrappers.
> >
> > > How to correct it?
> >
> > Use the built-in file upload capabilities of Struts 2;
> there's no reason to
> > access the request manually.
> >
> > Here's that link again:
> >
> >
> http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html
> >
> > Dave
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> user-unsubscr...@struts.apache.org
> > For additional commands, e-mail:
> user-h...@struts.apache.org
> >
> >

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread elyes sallem
ok, for the upload, i saved the file on the server
so i create a tmp file in this directory
"servlet.getServletContext().getRealPath("/")"
is it ok for the place , or i must create temporary file in an other
location? if not OK, where do i have to create them?

Thanks
Regards
Elyes






2008/12/16 Nils-Helge Garli Hegvik 

> So... are you:
>
> 1) Trying to upload a file to the server?
> 2) Trying to send a file the browser?
> 3) Both?
>
> If 1) See if http://wiki.apache.org/struts/StrutsFileUpload can help.
> If your API only accepts a file path, save the file as a temp file
> locally on the server.
> If 2) The solution has been provided to you in your previous thread:
> Stream the file content to the browser.
> If 3) See 1) and 2)
>
> Nils-H
>
> On Tue, Dec 16, 2008 at 2:09 PM, elyes sallem 
> wrote:
> > to avoid any confusion,
> > all i want to do is that :
> > 1- i have data in a file, so through the formfile, i get the file path
> (now
> > i make the test locally, but after it will be deployed on a server) and i
> > load this data in a database, depending on the file's meta data, and its
> > content
> > 2- i allow the user to make some select , with some condition
> > after setting his condition, through the interface (in the final it is a
> > select with conditions ...)
> > i allow the user to exports this data in an excel file
> > that's all
> > the trt of parsing the file metadata, and content , is done
> > the trt of export data in an excel file based on a select is done
> > now i have to make some choices of loading the  file , and saving the
> excel
> > file
> > i wish that it was clear
> > furthermore,
> > yes Dave , this is my proposition
> > have you a better idea?
> > as for the proposition to use servlet link, it was not clear
> >
> > Regards
> > Elyes
> >
> >
> > 2008/12/16 Dave Newton 
> >
> >> --- On Tue, 12/16/08, elyes sallem wrote:
> >> > this library, take as input a file and depending on this
> >> > file's metadata generates tables in a database and make trt
> >> > after this (so as a constraint, i can't modify the class in
> >> > this jar)
> >>
> >> So... you're *uploading* a file to the server (from the user of the
> browser
> >> to the web application)??? Then you need to save the FormFile locally
> and
> >> use *that* path when you call your library methods.
> >>
> >> Dave
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> >
> > --
> > Elyes.
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Elyes.


Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread red phoenix
In http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html , it use
MultiPartRequestWrapper multipartRequest = (MultiPartRequestWrapper)
ServletActionContext.getRequest();
It still raise java.lang.ClassCastException:
org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to
org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.
My popuse is that when jsp sumbit to action,I can get upload file name and
the stream of upload file,then I can write the stream of upload file into
blob of oracle database.I don't know how to get the stream of upload file!
 I still puzzled with why raise above error. I don't find the different
between my code and
http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html.

Where wrong with my code?




On Tue, Dec 16, 2008 at 11:13 PM, Dave Newton  wrote:

> --- On Tue, 12/16/08, red phoenix wrote:
> > [...]
> > MultiPartRequestWrapper multipartRequest =
> > (MultiPartRequestWrapper) ServletActionContext.getRequest();
> > [...]
> >
> > org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to
> > org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> >
> > Why raise above error?
>
> Because StrutsRequestWrappers can't be cast to MultiPartRequestWrappers.
>
> > How to correct it?
>
> Use the built-in file upload capabilities of Struts 2; there's no reason to
> access the request manually.
>
> Here's that link again:
>
> http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: preparable inceptor and validation

2008-12-16 Thread srinivasa_v .
Hi,
Can u explain me in more detail.



On Tue, Dec 16, 2008 at 7:37 PM, Andy Sykes  wrote:

> Hi,
>
> My simple solution to the same problem was to check if any validation
> errors had occurred at the end of the validation method [with
> hasFieldErrors()], then call my prepareXXX method from there.
>
>
>
> On 16 Dec 2008, at 05:39, srinivasa_v . wrote:
>
> Hi All,
>> I have sistutation  where I need to return to entryForm, if there any
>> validation errors,but before going to entryform for second time,
>> I need to get some prepopulated data , for this I am  using preparable
>> inceptor,
>>
>> I am able to get my prepopulated data fine,
>> but the I am not able to see my action errors,
>>
>> If I  try to remove preparable inceptor , it working fine,and no
>> prepopulated data
>>
>> can any one help me
>>
>> regards
>> srini..
>>
>
>
>  -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Fwd: export file data using formFile

2008-12-16 Thread elyes sallem
Hello Robert ,
so assume that i have an excel file on the server
and i have a button to download it for the client (of course with a browse
dialog)
could you show me how develop it , in your example ,  you call
writePDFDataToOutputStream
and it is a pdf file which is not my case

Thanks
Regards
Elyes





2008/12/15 Robert Graf-Waczenski 

> Here's an example:
>
> public class Downloader extends HttpServlet
> {
> private void doGet(HttpServletRequest req, HttpServletResponse resp) throws
> IOException
> {
>   resp.setHeader("Pragma", "no-cache");
>   resp.setHeader("Cache-control", "no-cache");
>   resp.setIntHeader("Expires", -1);
>   MyData data = new MyData();
>   resp.setHeader("content-type", "application/pdf");
>   resp.setHeader("content-encoding", "binary");
>   resp.setHeader("Content-Disposition", "attachment;
> filename=myfile.pdf");
>   data.writePDFDataToOutputStream(resp.getOutputStream());
>
> }
> }
>
>
> elyes sallem wrote:
>
>> ok, do you have an example?
>>
>> Thanks
>> Regards
>> Elyes
>>
>>
>> 2008/12/15 Dave Newton 
>>
>>
>>
>>> --- On Mon, 12/15/08, elyes sallem wrote:
>>>
>>>
 the problem is that with the html:file you must browse to an
 existant file, but in my case, i wanna browse to a new file,
 and then in the action i will make some treatment, generate
 data and export them to this file


>>> That's not how you do that.
>>>
>>> You stream the response back and the user gets a save-file dialog.
>>>
>>> Dave
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Elyes.


Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, red phoenix wrote:
> [...]
> MultiPartRequestWrapper multipartRequest =
> (MultiPartRequestWrapper) ServletActionContext.getRequest();
> [...]
> 
> org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to
> org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
> 
> Why raise above error?

Because StrutsRequestWrappers can't be cast to MultiPartRequestWrappers.

> How to correct it?

Use the built-in file upload capabilities of Struts 2; there's no reason to 
access the request manually.

Here's that link again:

http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

2008-12-16 Thread red phoenix
I use struts2.0.14,I want to use upload function,my jsp file is follows:


...


struts action is follows:
public String uploadFile() throws Exception{
MultiPartRequestWrapper
multipartRequest=((MultiPartRequestWrapper)ServletActionContext.getRequest());

...
return SUCCESS;
}

when I submit jsp to action,it raise following error:
java.lang.ClassCastException:
org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be cast to
org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper

Why raise above error? How to correct it?

Any idea will be appreciated!


Re: Graphical Configuration Utility

2008-12-16 Thread mpeccorini



ManiKanta G-2 wrote:
> 
> It is good to hear some one started and done some thing reg gui console.
> 

I'm very glad this was something that people wanted, I was afraid I could
get 100 messages pointing me to already developed applications :p


ManiKanta G-2 wrote:
> 
> Well I got the below error when I tried to run the
> Struts2GUI-0.1-alpha.jar
> from Struts2GUI-0.1-alfa-fulldist.zip
> 

I tried the following and worked perfectly:

1. Unzip Struts2GUI-0.1-alfa-fulldist.zip
2. In a Command Window / Terminal, change the directory to the folder where
the jar resides
3. Execute the following command:

In Windows:
java -classpath
lib\appframework-1.0.3.jar:lib\beansbinding-1.2.1.jar:lib\castor-1.2.jar:lib\castor-1.2-xml.jar:lib\castor-1.2-xml-schema.jar:lib\commons-logging-1.1.1.jar:lib\serializer.jar:lib\swing-worker-1.1.jar:lib\xercesImpl.jar:lib\xml-apis.jar
-jar Struts2GUI-0.1-alpha.jar

In Unix/Linux:
java -classpath
lib/appframework-1.0.3.jar:lib/beansbinding-1.2.1.jar:lib/castor-1.2.jar:lib/castor-1.2-xml.jar:lib/castor-1.2-xml-schema.jar:lib/commons-logging-1.1.1.jar:lib/serializer.jar:lib/swing-worker-1.1.jar:lib/xercesImpl.jar:lib/xml-apis.jar
-jar Struts2GUI-0.1-alpha.jar

That makes sure all the dependencies are available in the classpath.

Also, what java version are you using? I'm compiling for JDK5 but I'm
actually using JDK6 (1.6.0_11)

I hope this helps
-- 
View this message in context: 
http://www.nabble.com/Graphical-Configuration-Utility-tp21019003p21034793.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: preparable inceptor and validation

2008-12-16 Thread Andy Sykes

Hi,

My simple solution to the same problem was to check if any validation  
errors had occurred at the end of the validation method [with  
hasFieldErrors()], then call my prepareXXX method from there.



On 16 Dec 2008, at 05:39, srinivasa_v . wrote:


Hi All,
I have sistutation  where I need to return to entryForm, if there any
validation errors,but before going to entryform for second time,
I need to get some prepopulated data , for this I am  using preparable
inceptor,

I am able to get my prepopulated data fine,
but the I am not able to see my action errors,

If I  try to remove preparable inceptor , it working fine,and no
prepopulated data

can any one help me

regards
srini..



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: alignment problem in struts2

2008-12-16 Thread Andy Sykes

Hi,

No idea why it doesn't work - I found the XHTML theme to be a bit  
cumbersome for anything other than a stack of fields, one on top of  
the other.


Use the simple theme - it'll give you more flexibility. You can write  
your own themes as well.


For getting the validation errors in the simple theme, use the  
 tag.


Andy.

On 16 Dec 2008, at 10:17, VSG wrote:



Hi Manikanta,
   I have gone throgh the documents.
   so,With the default(XHTML) theme Im unable to put two fileds in  
the same

row?
   Can u pls tell why?
   Could u provide me a solution.

 i try to see with the following lines of code
  
  
  


 but it is not working.
is it the correct way?

VSG





ManiKanta G-2 wrote:




 It should appear in the same row.But the problem is here it is
apperaing
in two rows.
 Which i want in one row.And the same thing with the buttons  
cancel and

reset button should appear in   same row.



If u've seen the S2 docs, S2 uses templates/themes while  
constructing the

views.
By default XHTML theme will be used.

See
http://struts.apache.org/2.x/docs/why-do-the-form-tags-put-table-tags-around-controls.html
http://struts.apache.org/2.x/docs/themes-and-templates.html

ManiKanta




--
View this message in context: 
http://www.nabble.com/alignment-problem-in-struts2-tp21029381p21030443.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread Nils-Helge Garli Hegvik
So... are you:

1) Trying to upload a file to the server?
2) Trying to send a file the browser?
3) Both?

If 1) See if http://wiki.apache.org/struts/StrutsFileUpload can help.
If your API only accepts a file path, save the file as a temp file
locally on the server.
If 2) The solution has been provided to you in your previous thread:
Stream the file content to the browser.
If 3) See 1) and 2)

Nils-H

On Tue, Dec 16, 2008 at 2:09 PM, elyes sallem  wrote:
> to avoid any confusion,
> all i want to do is that :
> 1- i have data in a file, so through the formfile, i get the file path (now
> i make the test locally, but after it will be deployed on a server) and i
> load this data in a database, depending on the file's meta data, and its
> content
> 2- i allow the user to make some select , with some condition
> after setting his condition, through the interface (in the final it is a
> select with conditions ...)
> i allow the user to exports this data in an excel file
> that's all
> the trt of parsing the file metadata, and content , is done
> the trt of export data in an excel file based on a select is done
> now i have to make some choices of loading the  file , and saving the excel
> file
> i wish that it was clear
> furthermore,
> yes Dave , this is my proposition
> have you a better idea?
> as for the proposition to use servlet link, it was not clear
>
> Regards
> Elyes
>
>
> 2008/12/16 Dave Newton 
>
>> --- On Tue, 12/16/08, elyes sallem wrote:
>> > this library, take as input a file and depending on this
>> > file's metadata generates tables in a database and make trt
>> > after this (so as a constraint, i can't modify the class in
>> > this jar)
>>
>> So... you're *uploading* a file to the server (from the user of the browser
>> to the web application)??? Then you need to save the FormFile locally and
>> use *that* path when you call your library methods.
>>
>> Dave
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
> --
> Elyes.
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: tag

2008-12-16 Thread Dave Newton
Use the html:options [1] or html:optionsCollection tag [2]?

[1] http://struts.apache.org/1.2.9/userGuide/struts-html.html#options
[2] http://struts.apache.org/1.2.9/userGuide/struts-html.html#optionsCollection

Dave


--- On Tue, 12/16/08, m.harig  wrote:

> From: m.harig 
> Subject: Re:  tag
> To: user@struts.apache.org
> Date: Tuesday, December 16, 2008, 8:23 AM
> is there anyone to answer my question%-|
> 
> 
> 
> m.harig wrote:
> > 
> > hi all
> >  
> >  am getting no.of users from DAO class and all
> username are in the form of
> > User Object.
> > 
> > ArrayList list = new ArrayList();
> >   while(rs.next()){
> > User user = new User();
> >  user.setUsername("abc");
> > list.add(user);
> >}
> > 
> >  this is my code . 
> ><%
> >   ArrayList userList =
> > (ArrayList)request.getAttribute("users");
> >%>
> > 
> > 
> >property="username">
> >  collection="<%=userList%>"
> >
> length="<%=""+(userList.size()-1)%>">
> >  value=""> > property="username"/>
> > 
> > 
> > 
> >i can populate my User object by bean write
> . How do i set my
> > username value to  value="">.. anyone please let me clear
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/%3Chtml%3Aoption%3E-tag-tp21028416p21032987.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail:
> user-h...@struts.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, elyes sallem wrote:
> to avoid any confusion,

Too late!

> 1- i have data in a file, so through the formfile, i get
> the file path (now i make the test locally, but after it 
> will be deployed on a server) and i load this data in a 
> database, depending on the file's meta data, and its
> content

The file name in the FormFile is the file name from the *client*--NOT the local 
path on the application server.

In your case, since you're testing locally, it *is* the file path on the 
client--but only because the browser you're using includes the complete path. 
Not all browsers do; some will only give the filename. Please take this in to 
account.

> now i have to make some choices of loading the  file , and
> saving the excel file

By using the servlet example given, or the same thing but in an action (and 
returning null) the *browser* will give you the option to open or save the 
file. *You* don't code that.

I really think you should search the web for "struts +file download" or 
something similar; it seems like there are some fundamental web application 
things that might be helpful to know.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: tag

2008-12-16 Thread m.harig


   is there anyone to answer my question%-|



m.harig wrote:
> 
> hi all
>  
>  am getting no.of users from DAO class and all username are in the form of
> User Object.
> 
> ArrayList list = new ArrayList();
>   while(rs.next()){
> User user = new User();
>  user.setUsername("abc");
> list.add(user);
>}
> 
>  this is my code . 
><%
>   ArrayList userList =
> (ArrayList)request.getAttribute("users");
>%>
> 
> 
>   
>collection="<%=userList%>"
> length="<%=""+(userList.size()-1)%>">
>name="users"
> property="username"/>
>   
>   
> 
>i can populate my User object by bean write . How do i set my
> username value to .. anyone please let me clear
> 

-- 
View this message in context: 
http://www.nabble.com/%3Chtml%3Aoption%3E-tag-tp21028416p21032987.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread elyes sallem
to avoid any confusion,
all i want to do is that :
1- i have data in a file, so through the formfile, i get the file path (now
i make the test locally, but after it will be deployed on a server) and i
load this data in a database, depending on the file's meta data, and its
content
2- i allow the user to make some select , with some condition
after setting his condition, through the interface (in the final it is a
select with conditions ...)
i allow the user to exports this data in an excel file
that's all
the trt of parsing the file metadata, and content , is done
the trt of export data in an excel file based on a select is done
now i have to make some choices of loading the  file , and saving the excel
file
i wish that it was clear
furthermore,
yes Dave , this is my proposition
have you a better idea?
as for the proposition to use servlet link, it was not clear

Regards
Elyes


2008/12/16 Dave Newton 

> --- On Tue, 12/16/08, elyes sallem wrote:
> > this library, take as input a file and depending on this
> > file's metadata generates tables in a database and make trt
> > after this (so as a constraint, i can't modify the class in
> > this jar)
>
> So... you're *uploading* a file to the server (from the user of the browser
> to the web application)??? Then you need to save the FormFile locally and
> use *that* path when you call your library methods.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Elyes.


Re: get file path from FormFile

2008-12-16 Thread Nils-Helge Garli Hegvik
Ah...finally someone cracked the code!

Nils-H

On Tue, Dec 16, 2008 at 1:55 PM, Dave Newton  wrote:
> --- On Tue, 12/16/08, elyes sallem wrote:
>> this library, take as input a file and depending on this
>> file's metadata generates tables in a database and make trt
>> after this (so as a constraint, i can't modify the class in
>> this jar)
>
> So... you're *uploading* a file to the server (from the user of the browser 
> to the web application)??? Then you need to save the FormFile locally and use 
> *that* path when you call your library methods.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



TypeConversionException and the conversionError interceptor

2008-12-16 Thread Daniel Baldes

Hello,

I got a problem with type conversion errors.

I have several custom type converters which throw a 
TypeConversionException in case the conversion fails. However, the 
conversionError interceptor does not add any field errors to the action 
in that case; furthermore, it seems that struts rather tries to set the 
un-converted String, leading to an error message from the parameters 
interceptor:


SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception 
caught setting 'xxx.ipAddress' on 'class 
xxx.NidsCustomerApplicationAction: Error setting expression 
'xxx.ipAddress' with value '[Ljava.lang.String;@6dafa36'


(There is no setIpAddress(String) method, which is correct; I think this 
should never happen in the first place)


When there is no TypeConversionException, everything works fine (=> the 
type converter is called and works).


I have verified (using a debugger) that the ConversionErrorInterceptor 
gets called. It calls invocationContext.getConversionErrors(), but that 
method returns an empty map. However, after the TypeConversionException 
is thrown, an error message is added to the context in 
XworkConverter.handleConversionException(...). It must get lost 
somewhere on the way to the ConversionErrorInterceptor (?).


So my questions:

- Why does struts or xwork try to set the non-converted value as string
  after conversion fails?
- Where are my error messages?
- What am I doing wrong?

Maybe there is an incompatibility among the libraries I use?

Environment:

 struts 2.0.12
 xwork 2.0.6
 ognl 2.6.11

 (tomcat 6.0.16, java 1.6.0_10 ...)

interceptor stack:

  staticParams
  prepare
  chain
  checkbox
  params
  conversionError
  validation
  workflow

(This list is reduced to the possibly relevant interceptors; there are 
several custom interceptors before and after these in my stack, but I 
think they should not interfere with this problem)


I would appreciate any help on with issue - thanks in advance!

Regards,
Daniel



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, elyes sallem wrote:
> this library, take as input a file and depending on this
> file's metadata generates tables in a database and make trt 
> after this (so as a constraint, i can't modify the class in 
> this jar)

So... you're *uploading* a file to the server (from the user of the browser to 
the web application)??? Then you need to save the FormFile locally and use 
*that* path when you call your library methods.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



error and messages in jsp page

2008-12-16 Thread elyes sallem
Hello,
i want to display some message and some errors, if there is an exception
but the problem is that , in the jsp page, i get only the first line of the
error message
here is the code :

ActionMessage message = new
ActionMessage("error.fichierEntree.chargement",e.getCause().getMessage());
messages.add(ActionMessages.GLOBAL_MESSAGE, message);
saveErrors(request, messages);

and i put  in the jsp

Regards
Elyes.


Re: get file path from FormFile

2008-12-16 Thread elyes sallem
this library, take as input a file and depending on this file's metadata
generates tables in a database and make trt after this (so as a constraint,
i can't modify the class in this jar)

Regards
Elyes




2008/12/16 Nils-Helge Garli Hegvik 

> What library (jar) is this? I assume that you mean that this library
> generates the actual file content that you want to send back to the
> browser? As you suggest, one way is to create a temp file which you
> read and stream back to the browser. Or you could save the file in a
> public area where it can be downloaded by the user.
>
> Nils-H
>
> On Tue, Dec 16, 2008 at 12:24 PM, elyes sallem 
> wrote:
> > Hello,
> > after publishing this question, i conclude that it is not possible de get
> > back the absolute path from FormFile
> > but the problem is that i import a jar file, in which i call a method
> that
> > accept only path of file
> > so what do you propose, i get the inputstream , then i create temporarly
> a
> > file and i delete it at the end
> > or you have an other ideai?
> >
> > Thanks
> > Regards
> > Elyes.
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Elyes.


Re: get file path from FormFile

2008-12-16 Thread Robert Graf-Waczenski
Looking at your previous posts, i think that you are wasting your time 
even thinking about using a java applet. Go back a few steps and think 
again, maybe answering the following simple sequence of questions:


1) Your web application server has access to some data somewhere. The 
data can be anything, let's call the data "Blurb".
2) You want to allow your users to export "Blurb" from your web server 
to a file.
3) The file name shall be supplied by the user via a standard "Save As" 
dialog.

4) After the user has chosen the file, "Blurb" is saved in the file.

This is a download link, plain and simple, i.e. a link that points to a 
servlet url (see my example earlier) or (as you prefer it) an action url 
(see another post in your previous thread on how to accomplish the same 
thing with a struts action). If you follow my example, then you get 
*EXACTLY* the behavior you desire. No applet. No fumbling around with 
FormFile properties. No file upload.


Robert

elyes sallem wrote:

Hello,
after publishing this question, i conclude that it is not possible de get
back the absolute path from FormFile
but the problem is that i import a jar file, in which i call a method that
accept only path of file
so what do you propose, i get the inputstream , then i create temporarly a
file and i delete it at the end
or you have an other ideai?

Thanks
Regards
Elyes.

  



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: html:form windowstate

2008-12-16 Thread Nils-Helge Garli Hegvik
You can probably use the 'var' attribute of the portlet:actionURL tag
to store the url as a variable which you can reference by an
expression in the html:form tag. Take a look at the tag reference for
the portlet tags (PLT.22.2) in the JSR168 spec [1] for details.

Nils-H

[1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html

On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts  wrote:
> Hi all,
>
> Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
> attribute that submits the form to a maximized window state, like possible 
> with the actionURL tag:
>
>  WindowState.MAXIMIZED.toString() %>">
>
>"
>method="POST">
>
> Is there a way to do this? Maybe with a hidden form input?
>
> Thanks,
> Evert Lammerts
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



html:form windowstate

2008-12-16 Thread Evert Lammerts
Hi all,

Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form 
attribute that submits the form to a maximized window state, like possible with 
the actionURL tag:

">

"
method="POST">

Is there a way to do this? Maybe with a hidden form input?

Thanks,
Evert Lammerts


Re: howto get useable protocol string

2008-12-16 Thread cpanon
Hi Dave
Thanks, however where can I get a list of the methods of the available implicit 
object that I can get access to with struts beans and their proper syntax 
calls?  I tried the object and they just provide generic calls.  Also is it 
possible to just get http/https or do I have to parse out which one it is?  
Also why does a naive use as property="isSecure" fail?  


--- On Mon, 12/15/08, Dave Newton  wrote:

> From: Dave Newton 
> Subject: Re: howto get useable protocol string
> To: "Struts Users Mailing List" 
> Date: Monday, December 15, 2008, 10:08 PM
> getProtocol and/or isSecure?
> 
> 
> --- On Mon, 12/15/08, cpanon 
> wrote:
> 
> > From: cpanon 
> > Subject: Re: howto get useable protocol string
> > To: "Struts Users Mailing List"
> 
> > Date: Monday, December 15, 2008, 10:04 PM
> > Hi
> > Sorry to repeat, however I still can figure this out. 
> I am
> > using  > property="request"> to get at the
> serverName,
> > serverPort and contextPath.  I want to get at whether
> it is
> > http/https.  Is there a way to do that?  tia.
> > 
> > 
> > --- On Mon, 12/15/08, cpanon 
> > wrote:
> > 
> > > From: cpanon 
> > > Subject: howto get useable protocol string
> > > To: "Struts Users Mailing List"
> > 
> > > Date: Monday, December 15, 2008, 2:33 PM
> > > Hello
> > > Using the struts bean tags, how/syntax to get at
> the
> > > protocol that I can use rather than parse, either
> http
> > or
> > > https.  What I am getting is HTTP/1.1.  Is there
> any
> > way to
> > > get it "cleaner"? tia.
> > > 
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail:
> > > user-h...@struts.apache.org
> > 
> >
> -
> > To unsubscribe, e-mail:
> user-unsubscr...@struts.apache.org
> > For additional commands, e-mail:
> > user-h...@struts.apache.org
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail:
> user-h...@struts.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread Dave Newton
--- On Tue, 12/16/08, elyes sallem wrote:
> after publishing this question, i conclude that it is not
> possible de get back the absolute path from FormFile but 
> the problem is that i import a jar file, in which i call 
> a method that accept only path of file so what do you propose, 
> i get the inputstream , then i create temporarly a file and 
> i delete it at the end or you have an other ideai?

What, exactly, are you trying to do?

I thought you were creating a result stream that you wanted the client to be 
able to download: a normal web application download.

Dave


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: get file path from FormFile

2008-12-16 Thread Nils-Helge Garli Hegvik
What library (jar) is this? I assume that you mean that this library
generates the actual file content that you want to send back to the
browser? As you suggest, one way is to create a temp file which you
read and stream back to the browser. Or you could save the file in a
public area where it can be downloaded by the user.

Nils-H

On Tue, Dec 16, 2008 at 12:24 PM, elyes sallem  wrote:
> Hello,
> after publishing this question, i conclude that it is not possible de get
> back the absolute path from FormFile
> but the problem is that i import a jar file, in which i call a method that
> accept only path of file
> so what do you propose, i get the inputstream , then i create temporarly a
> file and i delete it at the end
> or you have an other ideai?
>
> Thanks
> Regards
> Elyes.
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Login twice

2008-12-16 Thread Lorenzo Carnevale

Put a check in the Login Action :
if there is alreay an user logged in, the check should return an error to 
the user.



Hi All,

I could logged in twice in the same session.

How to block it second time in struts oriented .

Please send with solution.





Thank you,

Seshagiri V

seshagi...@kensium.com.



US Main: 877 KENSIUM (536.7486)

US Fax:   312.242.3029



Kensium

200 S Wacker Dr, Suite 3100

Chicago, IL 60606



Confidentiality Note:

-

The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.

If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.













Nessun virus nel messaggio in arrivo.
Controllato da AVG - http://www.avg.com
Versione: 8.0.176 / Database dei virus: 270.9.18/1850 -  Data di rilascio: 
15/12/2008 17.04



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



get file path from FormFile

2008-12-16 Thread elyes sallem
Hello,
after publishing this question, i conclude that it is not possible de get
back the absolute path from FormFile
but the problem is that i import a jar file, in which i call a method that
accept only path of file
so what do you propose, i get the inputstream , then i create temporarly a
file and i delete it at the end
or you have an other ideai?

Thanks
Regards
Elyes.


Re: alignment problem in struts2

2008-12-16 Thread VSG

Hi Manikanta,
I have gone throgh the documents.
so,With the default(XHTML) theme Im unable to put two fileds in the same
row?
Can u pls tell why?
Could u provide me a solution.

  i try to see with the following lines of code
   
   
   
 

  but it is not working.
 is it the correct way?

 VSG
  




ManiKanta G-2 wrote:
> 
>>
>>   It should appear in the same row.But the problem is here it is
>> apperaing
>> in two rows.
>>   Which i want in one row.And the same thing with the buttons cancel and
>> reset button should appear in   same row.
>>
> 
> If u've seen the S2 docs, S2 uses templates/themes while constructing the
> views.
> By default XHTML theme will be used.
> 
> See
> http://struts.apache.org/2.x/docs/why-do-the-form-tags-put-table-tags-around-controls.html
> http://struts.apache.org/2.x/docs/themes-and-templates.html
> 
> ManiKanta
> 
> 

-- 
View this message in context: 
http://www.nabble.com/alignment-problem-in-struts2-tp21029381p21030443.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: preparable inceptor and validation

2008-12-16 Thread Lukasz Lenart
Do you use custom interceptor stack? Please check that [1]

[1] 
http://struts.apache.org/2.x/docs/why-isnt-our-prepare-interceptor-being-executed.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: alignment problem in struts2

2008-12-16 Thread ManiKanta G
>
>   It should appear in the same row.But the problem is here it is apperaing
> in two rows.
>   Which i want in one row.And the same thing with the buttons cancel and
> reset button should appear in   same row.
>

If u've seen the S2 docs, S2 uses templates/themes while constructing the
views.
By default XHTML theme will be used.

See
http://struts.apache.org/2.x/docs/why-do-the-form-tags-put-table-tags-around-controls.html
http://struts.apache.org/2.x/docs/themes-and-templates.html

ManiKanta


alignment problem in struts2

2008-12-16 Thread VSG

Hi,
 
 I am using default form theme.Means i am not putting any thing in the
form attribute
 
 

In this form i need two fields in the same row. Like
   
   

   It should appear in the same row.But the problem is here it is apperaing
in two rows.
   Which i want in one row.And the same thing with the buttons cancel and
reset button should appear in   same row.

 if i use simple theme than labels are not working and i also fear of not
working validations and any more features of struts 2.
 Is it correct?

Regards,
VSG.

 
-- 
View this message in context: 
http://www.nabble.com/alignment-problem-in-struts2-tp21029381p21029381.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Message properties on actions level

2008-12-16 Thread Marsman


newton.dave wrote:
> 
> I don't really see it as a problem, quite frankly; it sounds like your
> package layout is either too tightly-coupled or you're trying to make your
> messages too fine-grained.
> 

Yes, maybe I do so. But I had classified the action dependent properties as
a nice feature and was a little bit disapointed about the behavior with
forms after hitting the submit button and displaying the form again (with
another action and message keys in all labels). Maybe it would be better, if
message-properties could be connected to views instead of actions.

Titus


-- 
View this message in context: 
http://www.nabble.com/Message-properties-on-actions-level-tp21012612p21029148.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] ServletDispatcherResult (dispatcher) and forwarding to Actions

2008-12-16 Thread Dirk Forchel

okay, I could strip off the context path from my "referer", but using a
relative URL like "/welcome.action" or "/demostore/welcome.action" doesn't
work either. Only something like "/jsp/pages/welcome.jsp" or similiar (a
relative URL with a JSP resource) works for me. But I wanna use Tiles, so
this result doesn't help me and I need a forward to a "Action" rather than a
JSP. If validation fails on my search action, the field error should be
displayed on the same page the input error occured. The seach form is used
on almost every page. 
This problem drives me almost insane!!! You can test it by your own.
Here is my Test-Configuration (without Tiles) and almost the complete code:

struts.xml:


   
  

  

  
${referer}
  

  
/jsp/pages/search.result.jsp
  

  
  
 /jsp/pages/{1}.jsp
  
  



BaseAction.java:

public class BaseAction extends ActionSupport implements
ServletRequestAware, Preparable
{
   private String referer;
   protected HttpServletRequest request;

   @Override
   public void setServletRequest(HttpServletRequest request)
   {
  this.request = request;
   }

   @Override
   public void prepare() throws Exception {
  referer = request.getHeader( "Referer" );
  if (referer==null)
 referer = request.getContextPath();
   }

   public String getReferer() {
  // THIS WORKS
  // return "/jsp/pages/welcome.jsp";
  // THIS DOES'NT WORK
  // return "/welcome.action";
  // THIS DOESN'T WORK EITHER
  return referer;
   }
}

ForwardAction.java:

public class ForwardAction extends BaseAction 
{
   public String execute() throws Exception 
   {
  addToHistory(getServletRequest());
  return executeInternal();
   }

   protected void addToHistory(HttpServletRequest request)
   {
  // Request History
  // History.addEntry(request);
   }

   protected String executeInternal() throws Exception 
   {
  return SUCCESS;
   }
}

SearchAction.java:

public class SearchAction extends BaseAction
{
   private String searchString;

   public String execute() throws Exception 
   {
  // DO SOME SEARCH
  return SUCCESS;
   }

   public void setSearchString(String searchString) {
  this.searchString = searchString;
   }

   public String getSearchString() {
  return searchString;
   }
}

welcome.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" 
import="com.exedio.demostore.web.Constants" %>
<%@ taglib uri="/struts-tags" prefix="s" %>

   
  
  

  

   
  
  
   


form.search.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" 
import="com.exedio.demostore.web.Constants" %>
<%@ taglib uri="/struts-tags" prefix="s" %>

  
  
  


SearchAction-validation.xml:

http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>











Nils-Helge Garli wrote:
> 
>>
>> The getter-method for the referer property returns something like
>> "http://localhost:9001/welcome.action";, cos the search-form is included
>> in
>> my welcome-page. I've got the feeling, that Tomcat's
>> ApplicationDispatcher
>> makes some request string modifications in accordance to the servlet
>> context
>> path.
>> The location after creating the dispatcher is
>> "//http:/localhost:9001/welcome.action". An obviously complete useless
>> URI.
>>
>>
> 
> According to the servlet specification, the path to the request
> dispatcher must be relative to the root of the servlet context,
> starting with the '/' character, so an absolute url won't work.
> 
> Nils-H
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--ServletDispatcherResult-%28dispatcher%29-and-forwarding-to-Actions-tp20950033p21028954.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Login twice

2008-12-16 Thread Nils-Helge Garli Hegvik
Sessions are managed by the container, so there's no "Struts" way to
block this. It all depends on what you're doing, and how you're doing
security/login. Are you for instance using the correct scope in your
beans if you're using Spring? Without more information about your
setup, we can't help you.

Nils-H

On Tue, Dec 16, 2008 at 9:04 AM, Seshagiri V  wrote:
> Hi All,
>
> I could logged in twice in the same session.
>
> How to block it second time in struts oriented .
>
> Please send with solution.
>
>
>
>
>
> Thank you,
>
> Seshagiri V
>
> seshagi...@kensium.com.
>
>
>
> US Main: 877 KENSIUM (536.7486)
>
> US Fax:   312.242.3029
>
>
>
> Kensium
>
> 200 S Wacker Dr, Suite 3100
>
> Chicago, IL 60606
>
>
>
> Confidentiality Note:
>
> -
>
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
>
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
>
>
>
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Login twice

2008-12-16 Thread Seshagiri V
Hi All,

I could logged in twice in the same session.

How to block it second time in struts oriented .

Please send with solution.

 

 

Thank you,

Seshagiri V

seshagi...@kensium.com. 

 

US Main: 877 KENSIUM (536.7486)

US Fax:   312.242.3029

 

Kensium

200 S Wacker Dr, Suite 3100

Chicago, IL 60606

 

Confidentiality Note:

-

The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.

If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.

 

 



RE: Disabling i18n support on Struts1/Struts2

2008-12-16 Thread Seshagiri V
Please same code  commented in strus.xml
file.

Thank you,
Seshagiri V
seshagi...@kensium.com. 
 
US Main: 877 KENSIUM (536.7486)
US Fax:   312.242.3029
 
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606
 
Confidentiality Note:
-
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.
 
 

-Original Message-
From: Seshagiri V [mailto:seshagi...@kensium.com] 
Sent: Tuesday, December 16, 2008 12:59 PM
To: 'Struts Users Mailing List'
Subject: RE: Disabling i18n support on Struts1/Struts2


Hi All,
Please use following code in struts.xml file.



This is one of the solutions. Please try it.

Thank you,
Seshagiri V
seshagi...@kensium.com. 
 
US Main: 877 KENSIUM (536.7486)
US Fax:   312.242.3029
 
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606
 
Confidentiality Note:
-
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.
 
 
-Original Message-
From: nodje [mailto:nodje...@gmail.com] 
Sent: Tuesday, December 16, 2008 12:45 PM
To: user@struts.apache.org
Subject: Disabling i18n support on Struts1/Struts2


Is there a way to disable i18n support on respectively Struts1 and Struts2?

cheers

-nodje
-- 
View this message in context:
http://www.nabble.com/Disabling-i18n-support-on-Struts1-Struts2-tp21028365p2
1028365.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.9.18/1850 - Release Date: 12/15/2008
5:04 PM


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org