Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 13 Jul 2008 20:43:41 -0000 Issue 8137

user-digest-help

2008-07-13


Author LoginPost Reply

user Digest 13 Jul 2008 20:43:41 -0000 Issue 8137

Topics (messages 188768 through 188797):

Re: Struts2 application doesn't work with Firefox 3
 188768 by: Pierrot52
 188771 by: Dave Newton
 188776 by: Pierrot52
 188777 by: Pierrot52
 188781 by: Dave Newton

Re: Problem with s:set and s:if
 188769 by: Dave Newton
 188778 by: Othon Reyes Sanchez
 188780 by: Gabriel Belingueres

Re: [S2] Recipe for Action and View
 188770 by: Dave Newton
 188779 by: Gabriel Belingueres
 188784 by: Andreas Mähler
 188785 by: Gabriel Belingueres
 188786 by: Dave Newton
 188787 by: Andreas Mähler

Re: REST plugin URL syntax
 188772 by: Jeromy Evans

Re: For the authors of Mannings Struts 2 in Action, a question
 188773 by: Lyallex
 188774 by: Dave Newton
 188775 by: Don Brown

Struts2 - JasperReport Plugin - Subreport Problem
 188782 by: Bruce Phillips
 188790 by: Bruce Phillips

CodeBehind and index action?
 188783 by: Paul Benedict
 188791 by: Jeromy Evans

error only in eclipse not in tomcat
 188788 by: nani2ratna

Thoughts of using explicit regexps instead of wilcards for action mappings?
 188789 by: Karr, David
 188792 by: Jeromy Evans

Re: question about submitting checkboxes
 188793 by: Jeromy Evans
 188795 by: Jishnu Viswanath

Struts Text & Property together(s:text and s:property
 188794 by: Jishnu Viswanath
 188796 by: Jeromy Evans

[S2] action mapping with merely default action
 188797 by: Pierre Thibaudeau

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_188768.ezm (zipped)

Well, the application works fine with Firefox 2, Safari, Opera, IE6 and IE7
but not with Firefox 3.

What can I add more? Firefox 3 has a bug! I'm not going to debug my
application.

Regards.


newton.dave wrote:
>
> You don't say what the problem is, so it's hard to know how to help.
>
> There's a known issue with Dojo [1] which may or may not be the issue
> you're facing-kinda hard to say. It's helpful to provide enough
> information to know where to start looking.
>
> Dave
>
> [1]
> http://dojotoolkit.org/support/faq/why-does-dojo-fail-load-file-urls-firefox-3
>
> (Although it's wrong, it's close, and it provides links to relevant FF
> pages.)
>
>
> --- On Fri, 7/11/08, Pierrot52 <pierre.lasante@(protected):
>
>> From: Pierrot52 <pierre.lasante@(protected)>
>> Subject: Re: Struts2 application doesn't work with Firefox 3
>> To: user@(protected)
>> Date: Friday, July 11, 2008, 6:57 PM
>> I'm replying to myself to say that I've told my
>> customers to use anything but
>> Firefox 3 until Mozilla provides us with a patch that
>> clears this problem.
>>
>> Regards.
>>
>>
>> Pierrot52 wrote:
>> >
>> > Hello,
>> > I have developed a Struts2 application that works well
>> under Firefox 2, IE
>> > 6, IE 7, Safari, and Opera.
>> > Unfortunately it doesn't work under Firefox 3.
>> > Has anybody made this observation and found a solution
>> to this problem?
>> > Regards.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Struts2-application-doesn%27t-work-with-Firefox-3-tp18237909p18413950.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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


Attachment: user_188771.ezm (zipped)
--- On Fri, 7/11/08, Pierrot52 wrote:
> Well, the application works fine with Firefox 2, Safari,
> Opera, IE6 and IE7 but not with Firefox 3.
>
> What can I add more?

You could say HOW it doesn't work. "It doesn't work" is essentially useless as a diagnostic tool. I use FF3 with S2 apps all the time, so it's obvious (to me) that there's an interaction between your app and FF3 that I would *think* you'd want examined. I know *I* would, but I'm funny like that.

> Firefox 3 has a bug! I'm not going to debug my application.

Well, there you have it then.

Here's something that might help:

http://www.catb.org/~esr/faqs/smart-questions.html
http://www.catb.org/~esr/faqs/smart-questions.html#beprecise

Dave


Attachment: user_188776.ezm (zipped)

With the tag <s:head theme="ajax" /> the pages load and then become blank
while Firefox hangs trying to load something.

Well if I change the <s:head theme="ajax" /> to <s:head theme="xhtml"> it
works fine.

On the other hand I lose the ajax functionality. The widgets provided by
dojo are not displayed.

Regards.


newton.dave wrote:
>
> --- On Fri, 7/11/08, Pierrot52 wrote:
>> Well, the application works fine with Firefox 2, Safari,
>> Opera, IE6 and IE7 but not with Firefox 3.
>>
>> What can I add more?
>
> You could say HOW it doesn't work. "It doesn't work" is essentially
> useless as a diagnostic tool. I use FF3 with S2 apps all the time, so it's
> obvious (to me) that there's an interaction between your app and FF3 that
> I would *think* you'd want examined. I know *I* would, but I'm funny like
> that.
>
>> Firefox 3 has a bug! I'm not going to debug my application.
>
> Well, there you have it then.
>
> Here's something that might help:
>
> http://www.catb.org/~esr/faqs/smart-questions.html
> http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
>
> 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.


Attachment: user_188777.ezm (zipped)

Again

My application works fine with Firefox 2, IE6, IE7, Opera 9.51, and Safari
3.1.2 but not with Firefox 3.

I reported the problem to Firefox 3 Mozilla and they told me that Firefox 3
works fine with Dojo 1.x

I agree but there are problems with Struts2 and with Dojo 0.4 that is
bundled with.

Until there is a workaround available other than redesign my whole
application I was told to make sure the application works fine with all the
browsers but Firefox 3.

Regards.


Pierrot52 wrote:
>
> With the tag <s:head theme="ajax" /> the pages load and then become blank
> while Firefox hangs trying to load something.
>
> Well if I change the <s:head theme="ajax" /> to <s:head theme="xhtml"> it
> works fine.
>
> On the other hand I lose the ajax functionality. The widgets provided by
> dojo are not displayed.
>
> Regards.
>
>
> newton.dave wrote:
>>
>> --- On Fri, 7/11/08, Pierrot52 wrote:
>>> Well, the application works fine with Firefox 2, Safari,
>>> Opera, IE6 and IE7 but not with Firefox 3.
>>>
>>> What can I add more?
>>
>> You could say HOW it doesn't work. "It doesn't work" is essentially
>> useless as a diagnostic tool. I use FF3 with S2 apps all the time, so
>> it's obvious (to me) that there's an interaction between your app and FF3
>> that I would *think* you'd want examined. I know *I* would, but I'm funny
>> like that.
>>
>>> Firefox 3 has a bug! I'm not going to debug my application.
>>
>> Well, there you have it then.
>>
>> Here's something that might help:
>>
>> http://www.catb.org/~esr/faqs/smart-questions.html
>> http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
>>
>> 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.


Attachment: user_188781.ezm (zipped)
There *is* a workaround, and I provided the link for it yesterday.

Dave

--- On Sat, 7/12/08, Pierrot52 <pierre.lasante@(protected):

> From: Pierrot52 <pierre.lasante@(protected)>
> Subject: Re: Struts2 application doesn't work with Firefox 3
> To: user@(protected)
> Date: Saturday, July 12, 2008, 9:06 AM
> With the tag <s:head theme="ajax" /> the
> pages load and then become blank
> while Firefox hangs trying to load something.
>
> Well if I change the <s:head theme="ajax"
> /> to <s:head theme="xhtml"> it
> works fine.
>
> On the other hand I lose the ajax functionality. The
> widgets provided by
> dojo are not displayed.
>
> Regards.
>
>
> newton.dave wrote:
> >
> > --- On Fri, 7/11/08, Pierrot52 wrote:
> >> Well, the application works fine with Firefox 2,
> Safari,
> >> Opera, IE6 and IE7 but not with Firefox 3.
> >>
> >> What can I add more?
> >
> > You could say HOW it doesn't work. "It
> doesn't work" is essentially
> > useless as a diagnostic tool. I use FF3 with S2 apps
> all the time, so it's
> > obvious (to me) that there's an interaction
> between your app and FF3 that
> > I would *think* you'd want examined. I know *I*
> would, but I'm funny like
> > that.
> >
> >> Firefox 3 has a bug! I'm not going to debug my
> application.
> >
> > Well, there you have it then.
> >
> > Here's something that might help:
> >
> > http://www.catb.org/~esr/faqs/smart-questions.html
> >
> http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
> >
> > Dave
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Struts2-application-doesn%27t-work-with-Firefox-3-tp18237909p18419471.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_188769.ezm (zipped)
Is #page one of the stack context vars? I'd consider using #attr, unless you can confirm that it is (I always forget). Or just use #request.

Dave

--- On Fri, 7/11/08, Othon Reyes Sanchez <othon.reyes@(protected):
> I have a problem with the following code:
>
> <s:set name="aver" scope="page"
> value="one"></s:set
> ...
> <s:if test="#page.aver=='one'">
> <%-- Some code goes here --%>
> </s:if>
>
> I don't know what is happening but the code
> conditionated by the if is not
> executed.
> If i use request instead of page in the s:set tag, and
> obiosly in the s:if
> tag, the code works fine.
>
> can somebody tell me what i'm doing wrong?

Attachment: user_188778.ezm (zipped)
#page is not an instance of a user class.
page is an implicit object of jsp like request, session, application, etc.

i don't know what is happening if i use <s:set name="aver" scope="page"
value="one"></s:set>
to put the variable "aver" in the page object it works fine. i mean, i can
use EL to use this var i.e. ( ${pageScope.aver} ).

I think that my problem is that i don't know is how Io refer to the variable
aver that "lives" in the page implicit object.
I suppose there should be a way to do this, and i'm supposing this because
JSTL lets you do it like the following code:

<c:if test="${pageScope.aver=='one'} ">
</c:if>

i know S2 and JSTL is not the same but i think that this funcionality is
basic and S2 should allow you, unless there is a reason to not put a
instance in the page implicit object, but that doesn't have any sense. why
does S2 works with request or session but not with page?.

Did i made myself clear?.

BTW thanks for your help Dave.



On Fri, Jul 11, 2008 at 10:07 PM, Dave Newton <newton.dave@(protected):

> Is #page one of the stack context vars? I'd consider using #attr, unless
> you can confirm that it is (I always forget). Or just use #request.
>
> Dave
>
> --- On Fri, 7/11/08, Othon Reyes Sanchez <othon.reyes@(protected):
> > I have a problem with the following code:
> >
> > <s:set name="aver" scope="page"
> > value="one"></s:set
> > ...
> > <s:if test="#page.aver=='one'">
> > <%-- Some code goes here --%>
> > </s:if>
> >
> > I don't know what is happening but the code
> > conditionated by the if is not
> > executed.
> > If i use request instead of page in the s:set tag, and
> > obiosly in the s:if
> > tag, the code works fine.
> >
> > can somebody tell me what i'm doing wrong?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188780.ezm (zipped)
Looking at the docs:
http://struts.apache.org/2.1.2/docs/ognl.html

there is no #page notation when using struts taglibs, since they all
use OGNL syntax.
If you need to access a page scoped object, you need to use the #attr notation.

2008/7/12 Othon Reyes Sanchez <othon.reyes@(protected)>:
> #page is not an instance of a user class.
> page is an implicit object of jsp like request, session, application, etc.
>
> i don't know what is happening if i use <s:set name="aver" scope="page"
> value="one"></s:set>
> to put the variable "aver" in the page object it works fine. i mean, i can
> use EL to use this var i.e. ( ${pageScope.aver} ).
>
> I think that my problem is that i don't know is how Io refer to the variable
> aver that "lives" in the page implicit object.
> I suppose there should be a way to do this, and i'm supposing this because
> JSTL lets you do it like the following code:
>
> <c:if test="${pageScope.aver=='one'} ">
> </c:if>
>
> i know S2 and JSTL is not the same but i think that this funcionality is
> basic and S2 should allow you, unless there is a reason to not put a
> instance in the page implicit object, but that doesn't have any sense. why
> does S2 works with request or session but not with page?.
>
> Did i made myself clear?.
>
> BTW thanks for your help Dave.
>
>
>
> On Fri, Jul 11, 2008 at 10:07 PM, Dave Newton <newton.dave@(protected):
>
>> Is #page one of the stack context vars? I'd consider using #attr, unless
>> you can confirm that it is (I always forget). Or just use #request.
>>
>> Dave
>>
>> --- On Fri, 7/11/08, Othon Reyes Sanchez <othon.reyes@(protected):
>> > I have a problem with the following code:
>> >
>> > <s:set name="aver" scope="page"
>> > value="one"></s:set
>> > ...
>> > <s:if test="#page.aver=='one'">
>> > <%-- Some code goes here --%>
>> > </s:if>
>> >
>> > I don't know what is happening but the code
>> > conditionated by the if is not
>> > executed.
>> > If i use request instead of page in the s:set tag, and
>> > obiosly in the s:if
>> > tag, the code works fine.
>> >
>> > can somebody tell me what i'm doing wrong?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment: user_188770.ezm (zipped)
Personally I'd either map an action to the input method or differentiate based on GET/POST requests, but that's just personal preference.

Dave

--- On Fri, 7/11/08, Andreas Mähler <andreas.maehler@(protected):

> From: Andreas Mähler <andreas.maehler@(protected)>
> Subject: Re: [S2] Recipe for Action and View
> To: user@(protected)
> Date: Friday, July 11, 2008, 10:10 PM
> Hello Gabriel,
>
> yes, I indeed took that into consideration, but if i am not
> wrong, there
> are two drawbacks:
>
> 1: When I create my own base class, and would like to use
> the
> prepare-method for something else, too, I need to overwrite
> the old
> method and mustn't forget to call super.prepare() in my
> implementation.
> IMO, this is a likely source of bugs.
>
> 2: I would have had to mess with the defaultStack anyway,
> since prepare
> is located before some other important interceptors (e.g.
> i18n) so I
> would have lost this functionality by taking an "early
> shortcut".
>
> The Interceptor was done in 10mins and as far as i could
> test it, it
> seems to work fine.
>
> public class SubmitInterceptor implements Interceptor
> {
>  public static final String INPUT = "input";
>
>  public void destroy() {}
>  public void init() {}
>
>
>  private String paramNames;
>  
>  public void setParamNames( String paramNames )
>  {
>    this.paramNames = paramNames;
>  }  
>  
>
>  public String intercept( ActionInvocation ai ) throws
> Exception
>  {
>    Map params = ai.getInvocationContext().getParameters();
>
>    String[] paramNames = this.paramNames.split(
> "," );
>    
>    for( String param : paramNames )
>    {
>      if( params.get( param.trim() ) != null )
>        return ai.invoke();
>    }
>    
>    return INPUT;
>  }
> }
>
> I created a new interceptor stack for my webapp that is
> like
> defaultStack, but with the SubmitInterceptor inserted right
> before
> conversionError:
>
> <interceptor-ref name="submit">
>  <param
> name="paramNames">submit</param>
> </interceptor-ref>
>
> As for the view, i am currently setting the
> "submit" parameter (as
> configured to be looked for above) for the Button:
>
> <s:submit name="submit" label="OK"
> value="true" type="button" />
>
> Comments and suggestions are welcome :-)
>
> ~Andreas
>
>
>
> Gabriel Belingueres schrieb:
> > You can also opt for sharing the prepare() code
> through inheritance,
> > meaning that you create a superclass action holding
> the prepare()
> > code, instead of coding a custom interceptor.
> >
> > 2008/7/11 Andreas Mähler
> <andreas.maehler@(protected)>:
> >> Thanks for your Answer, Lukasz.
> >>
> >> I already know the PrepareInterceptor and it can
> be used for what I would
> >> like to do. But I consider a special interceptor
> more convinient, since I
> >> intend to use it for more than one pair of view
> and action. (Using
> >> PrepareInterceptor would imply the need to add the
> code to every single
> >> action.)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_188779.ezm (zipped)
Without knowing what are you actually trying to accomplish with this
interceptor, I would warn that when an interceptor messes up with the
parameters, you need to carefully think where in the interceptor chain
this interceptor will execute.

2008/7/11 Andreas Mähler <andreas.maehler@(protected)>:
> Hello Gabriel,
>
> yes, I indeed took that into consideration, but if i am not wrong, there are
> two drawbacks:
>
> 1: When I create my own base class, and would like to use the prepare-method
> for something else, too, I need to overwrite the old method and mustn't
> forget to call super.prepare() in my implementation. IMO, this is a likely
> source of bugs.
>
> 2: I would have had to mess with the defaultStack anyway, since prepare is
> located before some other important interceptors (e.g. i18n) so I would have
> lost this functionality by taking an "early shortcut".
>
> The Interceptor was done in 10mins and as far as i could test it, it seems
> to work fine.
>
> public class SubmitInterceptor implements Interceptor
> {
>     public static final String INPUT = "input";
>
>     public void destroy() {}
>     public void init() {}
>
>
>     private String paramNames;
>
>     public void setParamNames( String paramNames )
>     {
>           this.paramNames = paramNames;
>     }
>
>
>     public String intercept( ActionInvocation ai ) throws Exception
>     {
>           Map params = ai.getInvocationContext().getParameters();
>
>           String[] paramNames = this.paramNames.split( "," );
>
>           for( String param : paramNames )
>           {
>                if( params.get( param.trim() ) != null )
>                     return ai.invoke();
>           }
>
>           return INPUT;
>     }
> }
>
> I created a new interceptor stack for my webapp that is like defaultStack,
> but with the SubmitInterceptor inserted right before conversionError:
>
> <interceptor-ref name="submit">
>     <param name="paramNames">submit</param>
> </interceptor-ref>
>
> As for the view, i am currently setting the "submit" parameter (as
> configured to be looked for above) for the Button:
>
> <s:submit name="submit" label="OK" value="true" type="button" />
>
> Comments and suggestions are welcome :-)
>
> ~Andreas
>
>
>
> Gabriel Belingueres schrieb:
>>
>> You can also opt for sharing the prepare() code through inheritance,
>> meaning that you create a superclass action holding the prepare()
>> code, instead of coding a custom interceptor.
>>
>> 2008/7/11 Andreas Mähler <andreas.maehler@(protected)>:
>>>
>>> Thanks for your Answer, Lukasz.
>>>
>>> I already know the PrepareInterceptor and it can be used for what I would
>>> like to do. But I consider a special interceptor more convinient, since I
>>> intend to use it for more than one pair of view and action. (Using
>>> PrepareInterceptor would imply the need to add the code to every single
>>> action.)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188784.ezm (zipped)
Hello again,

Gabriel Belingueres schrieb:
> Without knowing what are you actually trying to accomplish with this
> interceptor, I would warn that when an interceptor messes up with the
> parameters, you need to carefully think where in the interceptor chain
> this interceptor will execute.

I explain what I am trying to do in my first post[1].

What do you mean by messing up with the parameters? The Interceptor only
checks for the presence of at least one of the specified parameters. It
does not change anything. Are there any interceptors that actually
change the parameter map? As I said, I am a S2 newbie and haven't heard
of many things, but I would consider it as bad style.

Greetings,
~Andreas


[1] http://article.gmane.org/gmane.comp.jakarta.struts.user/158395


Attachment: user_188785.ezm (zipped)
Sorry it seems I entered the conversation later and didn't saw that email.

The problem you want to solve is very common (skipping form validation
the first time you call an action) and, as Dave wrote, it is commonly
solved by invoking the action with the input() method [1]. This method
will do nothing and will return INPUT as the result, thus forwarding
the response to the page with the form.

[1] http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#input()

2008/7/12 Andreas Mähler <andreas.maehler@(protected)>:
> Hello again,
>
> Gabriel Belingueres schrieb:
>>
>> Without knowing what are you actually trying to accomplish with this
>> interceptor, I would warn that when an interceptor messes up with the
>> parameters, you need to carefully think where in the interceptor chain
>> this interceptor will execute.
>
> I explain what I am trying to do in my first post[1].
>
> What do you mean by messing up with the parameters? The Interceptor only
> checks for the presence of at least one of the specified parameters. It does
> not change anything. Are there any interceptors that actually change the
> parameter map? As I said, I am a S2 newbie and haven't heard of many things,
> but I would consider it as bad style.
>
> Greetings,
> ~Andreas
>
>
> [1] http://article.gmane.org/gmane.comp.jakarta.struts.user/158395
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188786.ezm (zipped)
--- On Sat, 7/12/08, Andreas Mähler wrote:
> Are there any interceptors that actually change the parameter map?
> As I said, I am a S2 newbie and haven't heard of many things, but I
> would consider it as bad style.

As an example, the checkbox interceptor removes the hidden checkbox parameters from the map to avoid an attempt to set them on the action or its results, instead munging the hidden field name to get the checkbox property name.

I don't think this is particularly typical, but it is kind of cool, in a treacherous kind of way. Mucking with the parameter map can do some interesting things under controlled circumstances.

Dave


Attachment: user_188787.ezm (zipped)
Hi !

Gabriel Belingueres schrieb:
> The problem you want to solve is very common (skipping form validation
> the first time you call an action)

Aah - I thought so - that's why I was asking for a recipe.

> and, as Dave wrote, it is commonly
> solved by invoking the action with the input() method [1]. This method
> will do nothing and will return INPUT as the result, thus forwarding
> the response to the page with the form.

You guys are right - that is a better solution.
Sorry Dave - I did not get it at first, but that's the thing I was
looking for :-)

BTW: I can't rely on distinguishing between GET and POST, as I use GET
also in forms when it doesn't change the state on the server (e.g. a
simple search form). I'm sometimes annoyed by webapps that use POST for
all forms, because then my browser comes up with this "Are you sure?"
message whenever I want to refresh the result page.


Thanx alot!
~Andreas


Attachment: user_188772.ezm (zipped)
Jeromy Evans wrote:
>
>
> Dusty, you're right. I just had a quick look and I do have a custom
> action mapper that checks whether the pattern above references an
> action or method for that exact reason (it checks the list of
> available actions and gives precedence to those). Works great for me.
>
> I released another actionmapper that solved the problem using a
> different approach. It will be deprecated, but it's still up for info:
> http://code.google.com/p/struts2urlplugin/

I had an opportunity to throw together a sample application. Apologies
for the delay.

Relevant source and commentary are included in the demo.
http://www.blueskyminds.com.au/url-hierarchy/

From the description:
"This webapp demonstrates a technique to access resources with
hierarchical relationships in Struts 2.

The model is a Book with a list of Chapters. Each Book has a unique URI:
eg. /book/1 (book #1)

Each chapter also has a unique URI:
eg. /book/1/chapter/2 (chapter #2 in book #1)

Following Struts2 conventions, the list of books and list of chapters in
a book are also available:
eg. /book (list of books)
eg. /book/1/chapter (list of chapters in book #1)

regards,
Jeromy Evans



Attachment: user_188773.ezm (zipped)
:- There are decent forums at manning.com that might be a better place to put
:- this note -- I know the authors read the forums there.

Well I did try posting to the authors blog on the Manning site but the
post was thrown out because of the XML
...

>> I'm not one of the authors, but I helped...
>>
>> The example in the book doesn't work the way that typical container
>> managed authentication / authorization worked.

I do understand that the example is there to provide an example of an
interceptor and is not really intended to be an industrial strength
security solution. I also understand that once validated any secure
action can be accessed because the required token (User, Account
whatever) is on the session.

It just sounded like the Login action could be used regardless of initial Action

Wouldn't it be great to have the redirect resultType parameterised in
some way so that the target could be set depending on which action was
selected ...

Anyway

Thanks for taking the time to reply

lyallex

Attachment: user_188774.ezm (zipped)
--- On Sat, 7/12/08, Lyallex <lyallex@(protected):
> Well I did try posting to the authors blog on the Manning
> site but the post was thrown out because of the XML...

Using a service like pastebin, paste2, nopaste, etc. solves that problem, and can be a better alternative for long-ish snippets even when XML is supported.

Dave


Attachment: user_188775.ezm (zipped)
On Sat, Jul 12, 2008 at 5:56 PM, Lyallex <lyallex@(protected):
> Wouldn't it be great to have the redirect resultType parameterised in
> some way so that the target could be set depending on which action was
> selected ..

You can. Try something like this:

<action name="Login" class="manning.chapterFour.Login">
<result type="redirect">
    ${destination}
</result>
<result name="input">/chapterFour/Login.jsp</result>
</action>

The key is to have the code that redirects to the login use a request
parameter, say, "destination", which contains the current URL. The
login action will get that parameter and use it for the redirect.
Alternatively, you could forgo the "redirect" result and have the
login action method return an instance of ServletRedirectResult
directly, initialized with the "destination" value.

Don (one of the authors)

Attachment: user_188782.ezm (zipped)
I'm having a problem getting the Struts2 JasperReport plugin to work when my JasperReport main report uses a sub-report.

I can get the the plugin to work fine
with a JasperReport that doesn't use a subreport. But when I add
a sub-report to the main report that uses an new
JRBeanCollectionDataSource as the datasource expression I get an error:

javax.servlet.ServletException: javax.servlet.ServletException: Error evaluating expression :
 Source text : new JRBeanCollectionDataSource($F{phones})


The JasperReport main and sub-report works fine in iReport.

Any help would be greatly appreciated.

Bruce
_________________________________________________________________
It’s a talkathon – but it’s not just talk.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk

Attachment: user_188790.ezm (zipped)
Thanks to some great help from Dave Newton, I was able to figure out how to use Struts2, JasperReports, a main report and a sub-report in my web application.

I blogged about how I got it all to work here:

http://tinyurl.com/5h7nvv

on my blog at http://www.brucephillips.name/blog

In that blog entry you can download a complete war file with source code including the .jrxml files.

Bruce



> From: phillips1021@(protected)
> To: user@(protected)
> Subject: Struts2 - JasperReport Plugin - Subreport Problem
> Date: Sat, 12 Jul 2008 13:15:48 -0500
>
> I'm having a problem getting the Struts2 JasperReport plugin to work when my JasperReport main report uses a sub-report.
>
> I can get the the plugin to work fine
> with a JasperReport that doesn't use a subreport. But when I add
> a sub-report to the main report that uses an new
> JRBeanCollectionDataSource as the datasource expression I get an error:
>
> javax.servlet.ServletException: javax.servlet.ServletException: Error evaluating expression :
>  Source text : new JRBeanCollectionDataSource($F{phones})
>
>
> The JasperReport main and sub-report works fine in iReport.
>
> Any help would be greatly appreciated.
>
> Bruce
> _________________________________________________________________
> It’s a talkathon – but it’s not just talk.
> http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk

_________________________________________________________________
Making the world a better place one message at a time.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace

Attachment: user_188783.ezm (zipped)
Does the CodeBehind plugin allow me to specify a default action for a
directory? So that way I can just do /dir instead of /dir/index.action? If
not, how can I do it? I want any directory to go invoke index.action

I am using Struts 2.0.11

Paul

Attachment: user_188791.ezm (zipped)
Paul Benedict wrote:
> Does the CodeBehind plugin allow me to specify a default action for a
> directory? So that way I can just do /dir instead of /dir/index.action? If
> not, how can I do it? I want any directory to go invoke index.action
>
> I am using Struts 2.0.11
>
> Paul
>  

No, that's a feature of the Convention plugin in 2.1.x though.

A simple alternative is to write a custom ActionMapper that extends the
default and sets the action name to index if there was no other match
and no extension.


Attachment: user_188788.ezm (zipped)

Hi,

I am doing small example, when i start the application (means running the
tomcat server from eclipse) i am getting exception like this

Unable to load configuration. - bean -
jar:file:/C:/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/quickstart/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178
 at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (ConfigurationManager.java:58)
 at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (Dispatcher.java:371)
If i deploy the same thing without changing single in the tomcat server
webapps folder, i am not getting this exception.
Can anybody tell me what is the problem

Thanks and Regards
Ratna
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_188789.ezm (zipped)
One thing that's always bothered me a bit about using wildcards for
action mappings is that it's somewhat less self-documenting than I'd
like. Although I like being more concise, I'd really rather have an
alternative form that is still concise but still specifies what possible
wildcard values to expect.

For instance, if instead of specifying an action name like "MyStuff_*",
I instead used a regular expression, like
"MyStuff_(add|save|load|delete)", that is still more concise than having
to repeat all the almost duplicate actions, but it says specifically
what patterns to expect. The simplified wildcard system doesn't allow
for this.

Obviously, this would require a code change to allow regular expression
action name matching instead of the simplified regexp that is used now.

Has anyone ever considered this?

Attachment: user_188792.ezm (zipped)
Karr, David wrote:
> "MyStuff_(add|save|load|delete)", that is still more concise than having
>
>
> Has anyone ever considered this?
>
>  
I threw this together but don't use it any more:  
http://code.google.com/p/struts2urlplugin/

You can plugin a regex matcher (default) or plaintext or others.

After using it for a while I found it more effective to build custom
action mappers instead of over-engineer an all-purpose actionmapper.

Attachment: user_188793.ezm (zipped)
Eric Hamacher wrote:
> Hello:
>
>
>
> I have a form on which there can, in theory, be an infinite number of
> checkboxes (Users are selecting files from a tree and there is no
> telling how many will be selected). The name of each checkbox is
> determined at runtime (= to the path of the file). That being the case,
> how can I set up an action to read these parameters? Or do it need to
> go back to the servlet API?
>
>  
If you're using Struts 2, don't name your checkboxes like that.
Create an array or list property in your action and include the index in
each checkbox name:

List<String> filenames = new LinkedList<String>();

<input type="checkbox" name="filenames[0]" value="filenameA">
<input type="checkbox" name="filenames[1]" value="filenameB">
<input type="checkbox" name="filenames[2]" value="filenameC">


Attachment: user_188795.ezm (zipped)
Eric,
 If you are using struts 2, Eric have u tried s:checkboxList ??
Syntax: <s:checkboxlist list="" listKey="" listValue="" name=""/>

If its just a Boolean object ignore the key value :D


Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@(protected)]
Sent: Sunday, July 13, 2008 1:38 PM
To: Struts Users Mailing List
Subject: Re: question about submitting checkboxes

Eric Hamacher wrote:
> Hello:
>
>
>
> I have a form on which there can, in theory, be an infinite number of
> checkboxes (Users are selecting files from a tree and there is no
> telling how many will be selected). The name of each checkbox is
> determined at runtime (= to the path of the file). That being the
case,
> how can I set up an action to read these parameters? Or do it need to
> go back to the servlet API?
>
>  
If you're using Struts 2, don't name your checkboxes like that.
Create an array or list property in your action and include the index in

each checkbox name:

List<String> filenames = new LinkedList<String>();

<input type="checkbox" name="filenames[0]" value="filenameA">
<input type="checkbox" name="filenames[1]" value="filenameB">
<input type="checkbox" name="filenames[2]" value="filenameC">


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

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.


Attachment: user_188794.ezm (zipped)

Hi all,
 I would like to achieve something like this <s:text name=<s:
property value="someProperty" /> />

I know this code is not going to work; in short the name that should
come is inside a property,

Eg:-
someProperty = "my.text.label"
<s:property value=" someProperty "/> gives me my.text.label

<s:text name="my.text.label"/> give me the value I wanted.
But how can I get both at same time?

Any one has any idea?

PS: I am using struts 2 :)


Regards,

Jishnu Viswanath


Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.


Attachment: user_188796.ezm (zipped)
Jishnu Viswanath wrote:
> Hi all,
>  I would like to achieve something like this <s:text name=<s:
> property value="someProperty" /> />
>
>  
If your action extends ActionSupport, or implements TextProvider, or a
TextProvider is in the ValueStack, then you can call one of the various
getText() methods to access resources.

Something like the following should work:

<s:property value="getText(someProperty)"/>

ie. evaluate someProperty, then invoke the getText(String) method to get
the resource with that name.



Attachment: user_188797.ezm (zipped)
With Struts1, if I wished to render a JSP page without bothering with the
machinery of an action (yet going through the filters/interceptors), I would
have an action mapping as follows:

    <action path="/home" forward="/static/home.jsp" />

With Struts2, in the same situation, I would do:

    <action name="home" class="com.opensymphony.xwork2.ActionSupport">
       <result>/static/home.jsp</result>
    </action>

This is a case where Struts2 is a lot wordier than Struts1. (I have to do
this about 15 times, for the site's "static" pages...)

Is there a shorthand version?
©2008 gg3721.com - Jax Systems, LLC, U.S.A.