Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 18 Apr 2008 14:20:20 -0000 Issue 7986

user-digest-help

2008-04-18


Author LoginPost Reply

user Digest 18 Apr 2008 14:20:20 -0000 Issue 7986

Topics (messages 185562 through 185586):

Re: datetimepicker doesn't show up
 185562 by: Dave Newton

help to solve Could not find property [theme],, etc
 185563 by: Eduardo Solanas

Re: Tiles2 runtime definition
 185564 by: Antonio Petrelli
 185567 by: stanlick.gmail.com
 185571 by: Antonio Petrelli

Re: Problem: Lost ActionMessages after redirect to another action
 185565 by: Antonio Petrelli

Re: Is there such a thing as flash in S2?
 185566 by: Guillaume Bilodeau
 185568 by: Brad A Cupit

Re: How to reflect table row data in the text boxes
 185569 by: Rishi Deepak

<s:url > doesn't have attribute in the tld.
 185570 by: zubair syed
 185574 by: Dave Newton

[S2] IE 7 - Secure and non-secure pop up message when using https
 185572 by: Simon Sew
 185577 by: Jeromy Evans

Struts2 Array of Elements
 185573 by: Arun
 185576 by: Dave Newton

Re: FileUpload exception
 185575 by: Pablo Vázquez Blázquez

Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions
 185578 by: Toni Lyytikäinen
 185579 by: Don Brown
 185580 by: Jukka Välimaa
 185581 by: Al Sutton
 185582 by: Toni Lyytikäinen
 185583 by: Dave Newton
 185584 by: Toni Lyytikäinen
 185585 by: Al Sutton
 185586 by: Toni Lyytikäinen

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_185562.ezm (zipped)
Prototype doesn't play nicely with much of anything.

You'll most likely need to load Prototype last and hope for the best; an
older application of mine used both and that was how I worked around it.

That said, I don't particularly recommend mixing Prototype with much of
anything else because of the non-safe prototypal manipulations it does: use
it alone, or use something else (like jQuery, or Plain Ol' Dojo, or whatever
other library you want). More recent versions of Prototype may play better
with others.

Dave

--- tristan_colson <tristan@(protected):
> I tried adding the debug="true", and got the following error when it
> rendered my JSP:
> FATAL exception raised: Could not load 'struts.widget.Bind'; last tried
> '__package__.js'
>
> Googling this leads me to believe that perhaps some libraries aren't
> playing
> well together.
> Here are the other libraries that are already referenced in my <head>:
> <script type="text/javascript" src="<c:url
> value='/scripts/prototype.js'/>"></script>
> <script type="text/javascript" src="<c:url
> value='/scripts/scriptaculous.js'/>"></script>
> <script type="text/javascript" src="<c:url
> value='/scripts/global.js'/>"></script>    
> <script type="text/javascript" src="<c:url value='/scripts/utilities.js'/>"
> ></script>
> <s:head theme="ajax" />
>
> Does anyone know of particular problems with any of these playing together
> (and what I should do about it if there are problems?)
>
> Thanks !
>
>
>
>
> Jeromy Evans - Blue Sky Minds wrote:
> >
> > It looks right.
> > Turn on debugging with s:head
> >
> > <s:head theme="ajax" debug="true"/>
> >
> > and use the FireFox FireBug plugin to determine if it failed to find any
> > resources.
> >
> > The template for the calendar is loaded via an ajax request. If that
> > request fails you see nothing.
> >
> > tristan_colson wrote:
> >> I am trying to use s:datetimepicker.
> >> I have the <s:head theme="ajax" /> in my <head> section.
> >> I have <s:datetimepicker> like this:
> >>   <s:datetimepicker name="campaign.startDate" /> to <s:datetimepicker
> >> name="campaign.endDate" />
> >>
> >> The html renders like this:
> >> <link rel="stylesheet" href="/struts/xhtml/styles.css" type="text/css"/>
> >> <script type="text/javascript">
> >>   // Dojo configuration
> >>   djConfig = {
> >>      baseRelativePath: "/struts/dojo",
> >>      isDebug: false,
> >>      bindEncoding: "UTF-8",
> >>      debugAtAllCosts: true // not needed, but allows the Venkman
> >> debugger
> >> to work with the includes
> >>   };
> >> </script>
> >> <script type="text/javascript"
> >>      src="/struts/dojo/dojo.js"></script>
> >> <script type="text/javascript"
> >>      src="/struts/simple/dojoRequire.js"></script>
> >> <script type="text/javascript"
> >>      src="/struts/ajax/dojoRequire.js"></script>
> >> <script type="text/javascript"
> >>      src="/struts/CommonFunctions.js"></script>
> >>
> >> .....
> >>
> >> script type="text/javascript">
> >>   dojo.require("dojo.widget.DatePicker");
> >> </script>
> >> <div
> >>      dojoType="dropdowndatepicker"  
> >> id="saveCampaign_campaign_startDate"   name="dojo.campaign.startDate"
>
> >> inputName="campaign.startDate" saveFormat="rfc"></div>
> >>
> >> Note that the above div tag is empty. Seems like there should be
> >> something
> >> in it.
> >> The datetimepicker doesn't show up on the page.
> >>
> >> Am I using the tag wrong? Or might my environment be missing something?
> >> Many thanks for any help!
> >>
> >>  
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/datetimepicker-doesn%27t-show-up-tp16737339p16748386.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_185563.ezm (zipped)
im using lastest struts 2.1 test release and pre test release and the
problem is the same, im getting errors in console like :
Could not find property [.freemarker.RequestParameters]
Could not find property [templateDir]
Could not find property [org.apache.catalina.jsp_file]
etc my project starts and work fine but its very annoying, any solutions?
thanks

Attachment: user_185564.ezm (zipped)
2008/4/17, stanlick@(protected)>:
> Right on Antonio! Can you tell me how to fish the web context root from the
> Preparer? I need to construct the page location from this and the nextPage
> itself. Is there a list of key names someplace? Finding this bit of data
> or that on the stack is typically where productivity takes a nosedive. I
> used this key to get the stack:
>
> stack = (ValueStack)
> tilesContext.getRequestScope().get(ServletActionContext.STRUTS_VALUESTACK_KEY);

Unfortunately, Tiles plugin is not "so integrated" to Struts 2, so you
have to access the value stack in another way.
The TilesRequestContext.getRequest returns the request object, simply
cast it to HttpServletRequest (in most cases).
And the use the ServletActionContext.getValueStackMethod:
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html#getValueStack(javax.servlet.http.HttpServletRequest)


HTH
Antonio

Attachment: user_185567.ezm (zipped)
I think the tiles definition attributes should be exposed through the
tiles-plugin XML file. My Wizard action is setting the nextPage so this
would eliminate the need to write a ViewPreparer to set the jsp in the tiles
definition. I am now meddling around in the Preparer trying to construct
the URL that contains the page. For this Preparer to be flexible, I really
don't want to presuppose anything.

    ValueStack stack = (ValueStack) tilesContext.getRequestScope().get(
          ServletActionContext.STRUTS_VALUESTACK_KEY);
    String nextPage = stack.findString("nextPage");
    HttpServletRequest request = (HttpServletRequest)
tilesContext.getRequest();

    String fullUrl = request.getRequestURL().toString();
    // find last slash and strip everything following
    // int index = fullUrl.lastIndexOf("/");
    // fullUrl = fullUrl.substring(0, index);
    // MORE MESSY CODE HERE <-----------

    // GROSS!!!
    nextPage = "/tiles/wizard/"+nextPage+".jsp";
    attributeContext.putAttribute(
       "body",
       new Attribute(nextPage));

On Thu, Apr 17, 2008 at 2:39 PM, Antonio Petrelli <
antonio.petrelli@(protected):

> 2008/4/17, stanlick@(protected)>:
> > Right on Antonio! Can you tell me how to fish the web context root from
> the
> > Preparer? I need to construct the page location from this and the
> nextPage
> > itself. Is there a list of key names someplace? Finding this bit of
> data
> > or that on the stack is typically where productivity takes a nosedive.
> I
> > used this key to get the stack:
> >
> > stack = (ValueStack)
> >
> tilesContext.getRequestScope().get(ServletActionContext.STRUTS_VALUESTACK_KEY);
>
> Unfortunately, Tiles plugin is not "so integrated" to Struts 2, so you
> have to access the value stack in another way.
> The TilesRequestContext.getRequest returns the request object, simply
> cast it to HttpServletRequest (in most cases).
> And the use the ServletActionContext.getValueStackMethod:
>
> http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html#getValueStack(javax.servlet.http.HttpServletRequest)<http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html#getValueStack%28javax.servlet.http.HttpServletRequest%29>
>
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Scott
stanlick@(protected)

Attachment: user_185571.ezm (zipped)
2008/4/17, stanlick@(protected)>:
>
> I think the tiles definition attributes should be exposed through the
> tiles-plugin XML file.



Can you elaborate on this? I wish to know what's your point.

Thanks
Antonio

Attachment: user_185565.ezm (zipped)
2008/4/17, Marc Eckart <marc.eckart@(protected)>:
> This works fine, but the action messages and action errors I want to display
> are lost.
> How can I store them over this action chain?

You can store them in the request scope, just as a normal attribute.

Antonio

Attachment: user_185566.ezm (zipped)

I'm aware of the chain result but I'd prefer to stick to the redirect result.

This hypothetical flash result could list the properties that should survive
the redirect, so I think we would avoid the problem with the CGLIB proxy.

I'll investigate writing such a result / interceptor pair. I suppose the
chaining interceptor would be a good reference?

Cheers,
GB


Brad A Cupit wrote:
>
>>> What would be great is if an interceptor would inject all
>>> properties that are shared by the previous and the current
>>> action (by name? by type?) in the current action, in a similar
>>> fashion to HTTP parameter injection.
>
> If you use an ActionChainResult it will automatically do this, but
> action chaining is not recommended in favor or redirect-after-post
> (a.k.a. POST-redirect-GET).
>
> If such a feature does exist (or were to exist) and copy the properties
> from Action1 to Action2 (with a redirect in between) it may actually
> cause problems similar to Action chaining: like when your Action is
> managed by Spring and Spring creates a CGLIB proxy and certain
> properties that are specific to CGLIB are copied from Action1 to Action2
> thereby messing up the proxy. :-(
>
> Brad Cupit
> Louisiana State University - UIS
>
>
> ---------------------------------------------------------------------
> 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_185568.ezm (zipped)
>> This hypothetical flash result could list the properties
>> that should survive the redirect
>> <snip/>
>> I'll investigate writing such a result / interceptor pair.

Wouldn't that be the same as the ServletActionRedirectResult, where
param values can be ognl expressions? (assuming a version of struts 2
where bug WW-2170 is fixed).

Now, if this result/interceptor pair instead reads annotations on
properties in the action, or, if it stores the results in the session
(and then removed them on the next request) rather than as parameters in
the url, then it definitely is different from
ServletActionRedirectResult.

Having said that, I question using the session, since
redirect-after-post was designed to help alleviate back and refresh
button problems. If we store information in the session for the
redirect, then the first GET will find that information, but subsequent
GETs (perhaps the result of pressing back or refresh) will not find that
information, so the GET will have been inconsistent.

I guess this just pertains to flash scope in general though, and not any
particular implementation.

Brad Cupit
Louisiana State University - UIS

Attachment: user_185569.ezm (zipped)
Thanks Sir, I will apply..

--- Lalchandra Rampersad
<lrampersaud@(protected):

> You can simply create a javascript function that is
> called when the onClick
> or onSelect event of the table triggered.
>
> Saludos
> Lalchandra
>
> -----Original Message-----
> From: Rishi Deepak [mailto:deepakrishi@(protected)]
> Sent: Thursday, April 17, 2008 5:05 AM
> To: user@(protected)
> Subject: How to reflect table row data in the text
> boxes
>
> Hi,
> My project has the requirement to display the
> records
> in table and when i click on a particular row, the
> data would be displayed in the text boxes.
>
> I have applied Struts frame work and data is
> displayed
> in table, now any body can help how to show that
> data
> in textboxes on click to a record in table.
>
> Is there ready made tool or sample code for that.
>
> thanks in advance..
> Deepak.
>
>
>
---------------------------------------------------------------------
> 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)
>
>



   ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment: user_185570.ezm (zipped)
Hi All,

the documentation or strut 2 core say <s:url> has a var as attribute . but
the tld doesn't define the var attribute.

please advice what is correct one.

Regards,
Zuber

Attachment: user_185574.ezm (zipped)
--- zubair syed <zuberali@(protected):
> the documentation or strut 2 core say <s:url> has a var as attribute . but
> the tld doesn't define the var attribute.
>
> please advice what is correct one.

S2.0: id, S2.1: var.

Dave


Attachment: user_185572.ezm (zipped)
Hi,
I'm trying to create a simple ajax using struts2. The ajax is running fine.But I'm trying to fix this error message when using https server. The alert message is "This page contains both secure and nonsecure items.

Do you wish to display the nonsecure items?".

Here's my code.

<%@(protected)" %>
<%@(protected)" %>
<%@(protected)" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<s:head theme="ajax" debug="false"/>
<body>
  <form id="report_form" name="report_form" method="get">
  <s:hidden name="rpt_main_cat_id" />  
  <s:hidden name="rpt_cat_id" />
          <s:hidden name="rpt_cat_desc_id" />
          <s:hidden name="rpt_hidden_date_from" />
          <s:hidden name="rpt_hidden_date_to" />
          <s:hidden name="rpt_hidden_dev_group" />
          <s:hidden name="rpt_hidden_dev_ip" />
          <s:hidden name="rpt_hidden_ip_class" />
  </form>
  <s:url id="report_dynamic" action="rpt" includeParams="none">
          <s:param name="task">view_on_demand_report</s:param>
    </s:url>
  <s:div id="contentReport" href="%{report_dynamic}" autoStart="false" listenTopics="/refreshContent" formId="report_form" showErrorTransportText="false" theme="ajax">
 
  </s:div>

</body>
</html>

Anyone knows what am I doing wrong here?
   
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Attachment: user_185577.ezm (zipped)
Simon Sew wrote:
> Hi,
> I'm trying to create a simple ajax using struts2. The ajax is running fine.But I'm trying to fix this error message when using https server. The alert message is "This page contains both secure and nonsecure items.
>
> Do you wish to display the nonsecure items?".
> ...
>   <s:div id="contentReport" href="%{report_dynamic}" autoStart="false" listenTopics="/refreshContent" formId="report_form" showErrorTransportText="false" theme="ajax">
>  
>   </s:div>
>
> </body>
> </html>
>
> Anyone knows what am I doing wrong here?
>    
>  

Unfortunately it's a bug in dojo 0.4 [Ticket#2390]. You have no option
but to patch it manually or upgrade to a new version. It's possible
that it's fixed in Struts 2.1 (using Dojo0.4.3) but is definitely
present in Struts 2.0.x (Dojo 0.4.0).

I don't use Dojo any more, but remarkably I kept notes about how I
patched it. You will need to extract dojo, modify it and recompress
using the instructions at :
http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html

http://trac.dojotoolkit.org/ticket/2390
To prevent the "This page contains both secure and nonsecure items"
issue present in IE7.
When you read the ticket and find the following file it will be obvious
what the change is:
src/html/iframe.js

var html="";
if (dojo.render.html.ie70) {
  html="<iframe src='about:blank'"
    + " style='position: absolute; left: 0px; top: 0px; width: 100%;
height: 100%;"
    + "z-index: -1; filter:Alpha(Opacity=\"0\");' "
    + ">";
} else {
  html="<iframe src='javascript:false'"
    + "' style='position: absolute; left: 0px; top: 0px; width:
100%; height: 100%;"
    + "z-index: -1; filter:Alpha(Opacity=\"0\");' "
    + ">";
}

Good luck,
Jeromy Evans




Attachment: user_185573.ezm (zipped)
Hi,

I have a neat strust2 app with spring/hibernate and jsp.
I have set of array properties.
How do I populate to action.
I am using JSP/JSTL and no ognl or struts tags.
I have
<iput type="text" name=arr[0] />
<iput type="text" name=arr[1] />
<iput type="text" name=arr[2] />

And in action class I have
private String[] arr;
and getter and setters.

But it causes an error .
How could I populate it .
Is there any way I can do this?
I have searched mailing list and could not find any reply.


--
Thanks
Arun George

Attachment: user_185576.ezm (zipped)
--- Arun <arun.george.1981@(protected):
> I have
> <iput type="text" name=arr[0] />
> <iput type="text" name=arr[1] />
> <iput type="text" name=arr[2] />
>
> And in action class I have
> private String[] arr;
> and getter and setters.
>
> But it causes an error .

It might be helpful to be more specific.

Dave


Attachment: user_185575.ezm (zipped)
Hi,

Any idea?

Pablo Vázquez Blázquez escribió:
> Hi!
>
> How and where can I catch a
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException
> to inform the user?
>
> Thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_185578.ezm (zipped)
Hello,

I'm in the process of converting a Struts 2.0.11 application to Struts
2.1.1, and ran into some trouble concerning the action result configuration
in struts.xml. Basically this is what I had in 2.0.11:

<result name="edit" type="redirect-action">
<param name="actionName">Users_edit</param>
<param name="parse">true</param>
<param name="name">${user.username}</param>
</result>

This resulted in an url like http://.../Users_edit.action?name=toni

But for 2.1.1 this approach isn't working, as it throws an exception:

There was an exception while instantiating the result of type
org.apache.struts2.dispatcher.ServletActionRedirectResult
Caught OgnlException while setting property 'name' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
ognl.ObjectPropertyAccessor
...
Caused by: ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.name

What do I need to do to make these kind of definitions compatible with
Struts 2.1.1?

Attachment: user_185579.ezm (zipped)
Hmm...what should happen is those exceptions should be logged as a
warn, but the process should continue like normal. If that isn't the
case, definitely file a bug and put it against 2.1.2

Don

On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected):
> Hello,
>
> I'm in the process of converting a Struts 2.0.11 application to Struts
> 2.1.1, and ran into some trouble concerning the action result configuration
> in struts.xml. Basically this is what I had in 2.0.11:
>
> <result name="edit" type="redirect-action">
>  <param name="actionName">Users_edit</param>
>  <param name="parse">true</param>
>  <param name="name">${user.username}</param>
> </result>
>
> This resulted in an url like http://.../Users_edit.action?name=toni
>
> But for 2.1.1 this approach isn't working, as it throws an exception:
>
> There was an exception while instantiating the result of type
> org.apache.struts2.dispatcher.ServletActionRedirectResult
> Caught OgnlException while setting property 'name' on type
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> ognl.ObjectPropertyAccessor
> ...
> Caused by: ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.name
>
> What do I need to do to make these kind of definitions compatible with
> Struts 2.1.1?
>

Attachment: user_185580.ezm (zipped)
For Struts 2.1.1, use type="redirectAction" instead of
type="redirect-action". I just had the pleasure of debugging some problems
caused by it.
On Fri, Apr 18, 2008 at 4:12 PM, Don Brown <donald.brown@(protected):

> Hmm...what should happen is those exceptions should be logged as a
> warn, but the process should continue like normal. If that isn't the
> case, definitely file a bug and put it against 2.1.2
>
> Don
>
> On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected)>
> wrote:
> > Hello,
> >
> > I'm in the process of converting a Struts 2.0.11 application to Struts
> > 2.1.1, and ran into some trouble concerning the action result
> configuration
> > in struts.xml. Basically this is what I had in 2.0.11:
> >
> > <result name="edit" type="redirect-action">
> >  <param name="actionName">Users_edit</param>
> >  <param name="parse">true</param>
> >  <param name="name">${user.username}</param>
> > </result>
> >
> > This resulted in an url like http://.../Users_edit.action?name=toni
> >
> > But for 2.1.1 this approach isn't working, as it throws an exception:
> >
> > There was an exception while instantiating the result of type
> > org.apache.struts2.dispatcher.ServletActionRedirectResult
> > Caught OgnlException while setting property 'name' on type
> > 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> > ognl.ObjectPropertyAccessor
> > ...
> > Caused by: ognl.NoSuchPropertyException:
> > org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> >
> > What do I need to do to make these kind of definitions compatible with
> > Struts 2.1.1?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185581.ezm (zipped)
Toni,

Try using redirectAction instead of redirect-action.

Al.

----- Original Message -----
From: "Don Brown" <donald.brown@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Friday, April 18, 2008 2:12 PM
Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
convert parameters to actions


Hmm...what should happen is those exceptions should be logged as a
warn, but the process should continue like normal. If that isn't the
case, definitely file a bug and put it against 2.1.2

Don

On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected):
> Hello,
>
> I'm in the process of converting a Struts 2.0.11 application to Struts
> 2.1.1, and ran into some trouble concerning the action result
> configuration
> in struts.xml. Basically this is what I had in 2.0.11:
>
> <result name="edit" type="redirect-action">
>  <param name="actionName">Users_edit</param>
>  <param name="parse">true</param>
>  <param name="name">${user.username}</param>
> </result>
>
> This resulted in an url like http://.../Users_edit.action?name=toni
>
> But for 2.1.1 this approach isn't working, as it throws an exception:
>
> There was an exception while instantiating the result of type
> org.apache.struts2.dispatcher.ServletActionRedirectResult
> Caught OgnlException while setting property 'name' on type
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> ognl.ObjectPropertyAccessor
> ...
> Caused by: ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.name
>
> What do I need to do to make these kind of definitions compatible with
> Struts 2.1.1?
>

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


Attachment: user_185582.ezm (zipped)
Yep, already did that as per the migration guide, but the problem could to
be the ognl expression which doesn't seem to work in 2.1.1. I'll have to
look into it further.

And yes, the exception actually causes an HTTP status 500 with


Caught OgnlException while setting property 'name' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - action
- file:/usr/local/glassfish-v2ur1/domains/domain1/applications/j2ee-modules/...


so I'll be filing a bug soon.


On Fri, Apr 18, 2008 at 4:18 PM, Al Sutton <al.sutton@(protected):

> Toni,
>
> Try using redirectAction instead of redirect-action.
>
> Al.
>
> ----- Original Message ----- From: "Don Brown" <donald.brown@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Friday, April 18, 2008 2:12 PM
> Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
> convert parameters to actions
>
>
>
> Hmm...what should happen is those exceptions should be logged as a
> warn, but the process should continue like normal. If that isn't the
> case, definitely file a bug and put it against 2.1.2
>
> Don
>
> On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected)>
> wrote:
>
> > Hello,
> >
> > I'm in the process of converting a Struts 2.0.11 application to Struts
> > 2.1.1, and ran into some trouble concerning the action result
> > configuration
> > in struts.xml. Basically this is what I had in 2.0.11:
> >
> > <result name="edit" type="redirect-action">
> > <param name="actionName">Users_edit</param>
> > <param name="parse">true</param>
> > <param name="name">${user.username}</param>
> > </result>
> >
> > This resulted in an url like http://.../Users_edit.action?name=toni
> >
> > But for 2.1.1 this approach isn't working, as it throws an exception:
> >
> > There was an exception while instantiating the result of type
> > org.apache.struts2.dispatcher.ServletActionRedirectResult
> > Caught OgnlException while setting property 'name' on type
> > 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> > ognl.ObjectPropertyAccessor
> > ...
> > Caused by: ognl.NoSuchPropertyException:
> > org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> >
> > What do I need to do to make these kind of definitions compatible with
> > Struts 2.1.1?
> >
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185583.ezm (zipped)
I'm confused; I didn't think "redirect-action" would even work; that result
type isn't mapped in 2.1 and you should get an exception stating exactly
that.

Dave

--- Jukka Välimaa <valimaa.jukka@(protected):

> For Struts 2.1.1, use type="redirectAction" instead of
> type="redirect-action". I just had the pleasure of debugging some problems
> caused by it.
> On Fri, Apr 18, 2008 at 4:12 PM, Don Brown <donald.brown@(protected):
>
> > Hmm...what should happen is those exceptions should be logged as a
> > warn, but the process should continue like normal. If that isn't the
> > case, definitely file a bug and put it against 2.1.2
> >
> > Don
> >
> > On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected)>
> > wrote:
> > > Hello,
> > >
> > > I'm in the process of converting a Struts 2.0.11 application to Struts
> > > 2.1.1, and ran into some trouble concerning the action result
> > configuration
> > > in struts.xml. Basically this is what I had in 2.0.11:
> > >
> > > <result name="edit" type="redirect-action">
> > >  <param name="actionName">Users_edit</param>
> > >  <param name="parse">true</param>
> > >  <param name="name">${user.username}</param>
> > > </result>
> > >
> > > This resulted in an url like http://.../Users_edit.action?name=toni
> > >
> > > But for 2.1.1 this approach isn't working, as it throws an exception:
> > >
> > > There was an exception while instantiating the result of type
> > > org.apache.struts2.dispatcher.ServletActionRedirectResult
> > > Caught OgnlException while setting property 'name' on type
> > > 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
> > > ognl.ObjectPropertyAccessor
> > > ...
> > > Caused by: ognl.NoSuchPropertyException:
> > > org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> > >
> > > What do I need to do to make these kind of definitions compatible
> with
> > > Struts 2.1.1?
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>


Attachment: user_185584.ezm (zipped)
Yes I forgot to mention in the original post that I already changed the
"redirect-action" to "redirectAction" as per the migration guide here:

http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html




On Fri, Apr 18, 2008 at 4:26 PM, Dave Newton <newton.dave@(protected):

> I'm confused; I didn't think "redirect-action" would even work; that
> result
> type isn't mapped in 2.1 and you should get an exception stating exactly
> that.
>
> Dave
>
> --- Jukka Välimaa <valimaa.jukka@(protected):
>
> > For Struts 2.1.1, use type="redirectAction" instead of
> > type="redirect-action". I just had the pleasure of debugging some
> problems
> > caused by it.
> > On Fri, Apr 18, 2008 at 4:12 PM, Don Brown <donald.brown@(protected)>
> wrote:
> >
> > > Hmm...what should happen is those exceptions should be logged as a
> > > warn, but the process should continue like normal. If that isn't the
> > > case, definitely file a bug and put it against 2.1.2
> > >
> > > Don
> > >
> > > On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected)>
> > > wrote:
> > > > Hello,
> > > >
> > > > I'm in the process of converting a Struts 2.0.11 application to
> Struts
> > > > 2.1.1, and ran into some trouble concerning the action result
> > > configuration
> > > > in struts.xml. Basically this is what I had in 2.0.11:
> > > >
> > > > <result name="edit" type="redirect-action">
> > > >  <param name="actionName">Users_edit</param>
> > > >  <param name="parse">true</param>
> > > >  <param name="name">${user.username}</param>
> > > > </result>
> > > >
> > > > This resulted in an url like http://.../Users_edit.action?name=toni
> > > >
> > > > But for 2.1.1 this approach isn't working, as it throws an
> exception:
> > > >
> > > > There was an exception while instantiating the result of type
> > > > org.apache.struts2.dispatcher.ServletActionRedirectResult
> > > > Caught OgnlException while setting property 'name' on type
> > > > 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. -
> Class:
> > > > ognl.ObjectPropertyAccessor
> > > > ...
> > > > Caused by: ognl.NoSuchPropertyException:
> > > > org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> > > >
> > > > What do I need to do to make these kind of definitions compatible
> > with
> > > > Struts 2.1.1?
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185585.ezm (zipped)
Toni,

Can you post your updated action config and the full stack trace here, there
may be something simple we can spot before needing to log a bug.

Al.

----- Original Message -----
From: "Toni Lyytikäinen" <tolyen@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Friday, April 18, 2008 2:28 PM
Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
convert parameters to actions


Yes I forgot to mention in the original post that I already changed the
"redirect-action" to "redirectAction" as per the migration guide here:

http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html




On Fri, Apr 18, 2008 at 4:26 PM, Dave Newton <newton.dave@(protected):

> I'm confused; I didn't think "redirect-action" would even work; that
> result
> type isn't mapped in 2.1 and you should get an exception stating exactly
> that.
>
> Dave
>
> --- Jukka Välimaa <valimaa.jukka@(protected):
>
> > For Struts 2.1.1, use type="redirectAction" instead of
> > type="redirect-action". I just had the pleasure of debugging some
> problems
> > caused by it.
> > On Fri, Apr 18, 2008 at 4:12 PM, Don Brown <donald.brown@(protected)>
> wrote:
> >
> > > Hmm...what should happen is those exceptions should be logged as a
> > > warn, but the process should continue like normal. If that isn't the
> > > case, definitely file a bug and put it against 2.1.2
> > >
> > > Don
> > >
> > > On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen <tolyen@(protected)>
> > > wrote:
> > > > Hello,
> > > >
> > > > I'm in the process of converting a Struts 2.0.11 application to
> Struts
> > > > 2.1.1, and ran into some trouble concerning the action result
> > > configuration
> > > > in struts.xml. Basically this is what I had in 2.0.11:
> > > >
> > > > <result name="edit" type="redirect-action">
> > > >  <param name="actionName">Users_edit</param>
> > > >  <param name="parse">true</param>
> > > >  <param name="name">${user.username}</param>
> > > > </result>
> > > >
> > > > This resulted in an url like http://.../Users_edit.action?name=toni
> > > >
> > > > But for 2.1.1 this approach isn't working, as it throws an
> exception:
> > > >
> > > > There was an exception while instantiating the result of type
> > > > org.apache.struts2.dispatcher.ServletActionRedirectResult
> > > > Caught OgnlException while setting property 'name' on type
> > > > 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. -
> Class:
> > > > ognl.ObjectPropertyAccessor
> > > > ...
> > > > Caused by: ognl.NoSuchPropertyException:
> > > > org.apache.struts2.dispatcher.ServletActionRedirectResult.name
> > > >
> > > > What do I need to do to make these kind of definitions compatible
> > with
> > > > Struts 2.1.1?
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_185586.ezm (zipped)
Well, I found out that the problem is not the ognl expression, as trying to
set static parameters won't work.

I already filed a bug, WW-2600

My action config is quite large, I wonder which are the relevant parts...?

Here's the interceptor stack:

       <interceptor-stack name="myDefaultStack">
          <interceptor-ref name="exception"/>
          <interceptor-ref name="alias"/>
          <interceptor-ref name="servletConfig"/>
          <interceptor-ref name="authentication"/>
          <interceptor-ref name="params"/>
          <interceptor-ref name="prepare"/>
          <interceptor-ref name="logging"/>
          <interceptor-ref name="i18n"/>
          <interceptor-ref name="chain"/>
          <interceptor-ref name="debugging"/>
          <interceptor-ref name="profiling"/>
          <interceptor-ref name="actionMappingParams"/>
          <interceptor-ref name="checkbox"/>
          <interceptor-ref name="staticParams"/>
          <interceptor-ref name="params"/>
          <interceptor-ref name="conversionError"/>
          <interceptor-ref name="validation">
            <param
name="excludeMethods">add,input,back,cancel</param>
          </interceptor-ref>
          <interceptor-ref name="workflow">
            <param
name="excludeMethods">add,input,back,cancel</param>
          </interceptor-ref>
          <interceptor-ref name="sidemenu">
            <param name="menu">user</param>
          </interceptor-ref>
       </interceptor-stack>

Here's the part with the actionmapping:

<action name="Users_save" method="save" class="net.x.y.web.Users">
       <result type="redirectAction">
          <param name="actionName">Users_list</param>
       </result>
       <result name="edit" type="redirectAction">
          <param name="actionName">Users_edit</param>
          <param name="parse">true</param>
          <param name="name">${user.username}</param>
       </result>
       <result
name="input">/WEB-INF/jsp/CustomerAdmin/Users_userForm.jsp</result>
    </action>

The error message and the full stacktrace is in the bug report here:

https://issues.apache.org/struts/browse/WW-2600

I'm using Struts 2.1.1-SNAPSHOT and XWork 2.1.1



On Fri, Apr 18, 2008 at 5:05 PM, Al Sutton <al.sutton@(protected):

> Toni,
>
> Can you post your updated action config and the full stack trace here,
> there may be something simple we can spot before needing to log a bug.
>
> Al.
>
> ----- Original Message ----- From: "Toni Lyytikäinen" <tolyen@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Friday, April 18, 2008 2:28 PM
> Subject: Re: Converting action configuration from 2.0 to 2.1 - how to
> convert parameters to actions
>
>
> Yes I forgot to mention in the original post that I already changed the
> "redirect-action" to "redirectAction" as per the migration guide here:
>
>
> http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html
>
>
>
>
>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.