Re: Passing Action parameter in struts.xml

2008-04-21 Thread Tommy Becker

I really should read the documentation ;)

http://struts.apache.org/2.x/docs/static-parameters-interceptor.html
http://www.motricity.com



Tommy Becker wrote:
I can't seem to get any parameters to actually pass to actions via 
struts.xml.  Here's an example action config out of my struts.xml 
(ignore the slashes in the action name, we're using a third party 
container):


   action name=EndUserWMLRingtonesHome
   class=/motricity/presentation/action/EndUserWMLHome 
method=input 

   param name=filterRingtones/param
   result name=success type=tilesbrowsePage/result
   /action

If I set a breakpoint in that action, the parameter isn't set.  Pretty 
much all our actions implement ModelDriven, so the setFilter method is 
actually on our model object.  But I even tried putting a setFilter 
directly on the action and it's still not working.  We're using a 
fairly stripped down interceptor stack, but we are running modelDriven 
and params.  Anyone have any ideas why this wouldn't work?

 Thanks. http://www.motricity.com

NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information 
of Motricity.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, 
please contact the sender by reply e-mail and destroy all copies of 
the original message.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Passing Action parameter in struts.xml

2008-04-21 Thread Tommy Becker
I can't seem to get any parameters to actually pass to actions via 
struts.xml.  Here's an example action config out of my struts.xml 
(ignore the slashes in the action name, we're using a third party 
container):


   action name=EndUserWMLRingtonesHome
   class=/motricity/presentation/action/EndUserWMLHome 
method=input 

   param name=filterRingtones/param
   result name=success type=tilesbrowsePage/result
   /action

If I set a breakpoint in that action, the parameter isn't set.  Pretty 
much all our actions implement ModelDriven, so the setFilter method is 
actually on our model object.  But I even tried putting a setFilter 
directly on the action and it's still not working.  We're using a fairly 
stripped down interceptor stack, but we are running modelDriven and 
params.  Anyone have any ideas why this wouldn't work?

 Thanks. http://www.motricity.com

NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



URL encoding question

2008-02-20 Thread Tommy Becker
I'm having trouble getting s:url to stop encoding a parameter.  Here's 
a snipped of my jsp code:


s:url id=couponUrl action=Buy encode=false
   s:param name=coup value=%{'$codeInput'}/
   s:param name=c1 value=c1/
   s:param name=c2 value=c2/
/s:url
s:textfield title=codeInput name=codeInput/br /
s:a href=%{couponUrl}Apply/s:a

Despite the encode=false, the url as rendered looks like this:

/sf/WML/Buy.action?c1=CFWAP2734amp;c2=CFWAP712amp;coup=%24codeInput

The problem is the $ is still being encoded.  Anyone have any ideas?  
This is a WML page, in case anyone was wondering why I'm not using a form.


-Tommy
http://www.motricity.com

NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Get current URL on a page

2008-02-12 Thread Tommy Becker
Ugh.  Thanks for the info, but now there's another problem.   I'm using 
Tiles 2, and apparently it's manipulating the request url.  When I do 
this, I'm getting back the url to the Tiles template I'm using to render 
the page, not the originally requested url  Any ideas on how to get 
around that?



Dave Newton wrote:

--- Tommy Becker [EMAIL PROTECTED] wrote:
  
Unfortunately it is.  I'm creating a url to another site using s:url 
and passing the current url as a parameter.  I suppose I don't *have* to 
use s:url  Is it not possible?



The S2 OGNL docs say there's access to the request *context*, which means the
request attributes.

If you're doing this in the result of an S2 action one way would be to expose
the request in the action. If you're a glutton:

s:property
value=#context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest').getRequestURL()/

Dave

  

Randy Burgess wrote:


If the value is not going into a struts tag then just use JSTL.
  

From: Tommy Becker [EMAIL PROTECTED]

Is there a way to get the URL for the current page using struts tags?  I
thought I had access to the HttpRequest, and therefore could just use
getRequestURL() but it appears the docs have led me astray :/
http://www.motricity.com





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Get current URL on a page

2008-02-12 Thread Tommy Becker
Unfortunately it is.  I'm creating a url to another site using s:url 
and passing the current url as a parameter.  I suppose I don't *have* to 
use s:url  Is it not possible?

/*

*/ http://www.motricity.com


Randy Burgess wrote:

If the value is not going into a struts tag then just use JSTL.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



  

From: Tommy Becker [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
Date: Tue, 12 Feb 2008 10:31:09 -0500
To: Struts Users Mailing List user@struts.apache.org
Subject: Get current URL on a page

Is there a way to get the URL for the current page using struts tags?  I
thought I had access to the HttpRequest, and therefore could just use
getRequestURL() but it appears the docs have led me astray :/
http://www.motricity.com


NOTICE: This e-mail message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information of Motricity.  Any
unauthorized review, use, disclosure or distribution is prohibited.  If you
are not the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






This email and any attachments (Message) may contain legally privileged 
and/or confidential information.  If you are not the addressee, or if this Message has 
been addressed to you in error, you are not authorized to read, copy, or distribute it, 
and we ask that you please delete it (including all copies) and notify the sender by 
return email.  Delivery of this Message to any person other than the intended 
recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Get current URL on a page

2008-02-12 Thread Tommy Becker
Is there a way to get the URL for the current page using struts tags?  I 
thought I had access to the HttpRequest, and therefore could just use 
getRequestURL() but it appears the docs have led me astray :/

http://www.motricity.com


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom OGNL PropertyAccessor

2008-02-06 Thread Tommy Becker
Thanks a lot for the info, it worked.  I saw a Struts bean definition 
like that somewhere that led me to believe that that was how it was 
done, but as you said, it appears that the accessor never actually gets 
registered that way.  As for the wisdom of doing thisin my view the 
real pain is being stuck with the class we're using the PropertyAccessor 
*for*, but unfortunately that's reality for now.  Using the 
PropertyAccessor just makes our pages much cleaner. 
http://www.motricity.com


Regards,
Tommy Becker

Jeromy Evans wrote:
My guess, and it is just a guess, is that your bean is being 
instantiated by the Struts2 container but it's not being injected 
anywhere.


Based on my almost-non-existent understanding of OGNL, the OgnlRuntime 
contains a static synchronized map of Class-PropertyAccessor which 
you can see being setup in OgnlRuntime.java


The static method OgnlRuntime.setPropertyAccessor(Class, 
PropertyAccessor) looks like what you're after.  A quick usage search 
shows it's not used in Struts2 or XWrok anywhere so I think you'll 
have to make a static call from you application to register your 
PropertyAccessor instance yourself.  That means you don't need to 
define a struts2 bean at all (unless you want to access it though the 
container)


Personally, I think you're setting yourself up for a world of pain 
creating a custom PropertyAccessor. I'd go the simplified bean  
service façade  route so to ensure I'm not locked into any particular 
expression language/library.


cheers,
Jeromy Evans

Tommy Becker wrote:
I have a question about using OGNL PropertyAccessors.  We have an 
object on the value stack that we expose to JSP pages that does not 
have standard JavaBeans getter/setter methods.  From what I can tell, 
this leaves us 2 options.  We can either call the getter methods 
explicitly via OGNL method calls in the pages, or we can wrap the 
object in a JavaBean-like object.  The second option is unworkable in 
all but the simplest of cases when you realize that the method calls 
can themselves return another object that needs to be wrapped, or 
even a collection of them.  So we've been using method calls in the 
pages (yeah I know).


Reading through the OGNL docs, it seems that what we need is a 
PropertyAccessor that knows how to operate on our object.  So we 
implemented one, and attempted to register it by placing this in our 
struts.xml:


bean type=ognl.PropertyAccessor name=class.we.need.access.to 
class=our.property.accessor.PropertyAccessor/


Unfortunately it doesn't work.  Can someone tell me what we're doing 
wrong, or even if what we're trying to do is possible?  Thanks!


http://www.motricity.com


NOTICE: This e-mail message is for the sole use of the intended 
recipient(s) and may contain confidential and privileged information 
of Motricity.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, 
please contact the sender by reply e-mail and destroy all copies of 
the original message.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom OGNL PropertyAccessor

2008-02-05 Thread Tommy Becker
I have a question about using OGNL PropertyAccessors.  We have an object on the 
value stack that we expose to JSP pages that does not have standard JavaBeans 
getter/setter methods.  From what I can tell, this leaves us 2 options.  We can 
either call the getter methods explicitly via OGNL method calls in the pages, or 
we can wrap the object in a JavaBean-like object.  The second option is 
unworkable in all but the simplest of cases when you realize that the method 
calls can themselves return another object that needs to be wrapped, or even a 
collection of them.  So we've been using method calls in the pages (yeah I know).


Reading through the OGNL docs, it seems that what we need is a PropertyAccessor 
that knows how to operate on our object.  So we implemented one, and attempted 
to register it by placing this in our struts.xml:


bean type=ognl.PropertyAccessor name=class.we.need.access.to 
class=our.property.accessor.PropertyAccessor/


Unfortunately it doesn't work.  Can someone tell me what we're doing wrong, or 
even if what we're trying to do is possible?  Thanks!


http://www.motricity.com


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom OGNL PropertyAccessor

2008-02-05 Thread Tommy Becker
If there were a better description, I'd be happy to give it.  As far as 
I can tell, our custom PropertyAccessor is not being used.  What we want 
is to be able to say property in an OGNL expression and have it call 
getPropertyValue(property), not getProperty().  It seems it's 
continuing to try getProperty() despite our attempt at registering a 
custom PropertyAccessor.



Laurie Harper wrote:

Tommy Becker wrote:
I have a question about using OGNL PropertyAccessors.  We have an 
object on the value stack that we expose to JSP pages that does not 
have standard JavaBeans getter/setter methods.  From what I can tell, 
this leaves us 2 options.  We can either call the getter methods 
explicitly via OGNL method calls in the pages, or we can wrap the 
object in a JavaBean-like object.  The second option is unworkable in 
all but the simplest of cases when you realize that the method calls 
can themselves return another object that needs to be wrapped, or 
even a collection of them.  So we've been using method calls in the 
pages (yeah I know).


Reading through the OGNL docs, it seems that what we need is a 
PropertyAccessor that knows how to operate on our object.  So we 
implemented one, and attempted to register it by placing this in our 
struts.xml:


bean type=ognl.PropertyAccessor name=class.we.need.access.to 
class=our.property.accessor.PropertyAccessor/


Unfortunately it doesn't work.  Can someone tell me what we're doing 
wrong, or even if what we're trying to do is possible?  Thanks!


I don't know anything about OGNL's PropertyAccessor, but I doubt 
anyone can offer much help without seeing the code and a better 
description of the failure than it doesn't work.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Custom OGNL PropertyAccessor

2008-02-05 Thread Tommy Becker

No I haven't.  How do I go about doing that?

Dave Newton wrote:

--- Tommy Becker [EMAIL PROTECTED] wrote:
  
If there were a better description, I'd be happy to give it.  As far as 
I can tell, our custom PropertyAccessor is not being used.  What we want 
is to be able to say property in an OGNL expression and have it call 
getPropertyValue(property), not getProperty().  It seems it's 
continuing to try getProperty() despite our attempt at registering a 
custom PropertyAccessor.



Have you turned up OGNL and XWork logging?

Dave

  

Laurie Harper wrote:


Tommy Becker wrote:
  
I have a question about using OGNL PropertyAccessors.  We have an 
object on the value stack that we expose to JSP pages that does not 
have standard JavaBeans getter/setter methods.  From what I can tell, 
this leaves us 2 options.  We can either call the getter methods 
explicitly via OGNL method calls in the pages, or we can wrap the 
object in a JavaBean-like object.  The second option is unworkable in 
all but the simplest of cases when you realize that the method calls 
can themselves return another object that needs to be wrapped, or 
even a collection of them.  So we've been using method calls in the 
pages (yeah I know).


Reading through the OGNL docs, it seems that what we need is a 
PropertyAccessor that knows how to operate on our object.  So we 
implemented one, and attempted to register it by placing this in our 
struts.xml:


bean type=ognl.PropertyAccessor name=class.we.need.access.to 
class=our.property.accessor.PropertyAccessor/


Unfortunately it doesn't work.  Can someone tell me what we're doing 
wrong, or even if what we're trying to do is possible?  Thanks!

I don't know anything about OGNL's PropertyAccessor, but I doubt 
anyone can offer much help without seeing the code and a better 
description of the failure than it doesn't work.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  

NOTICE: This e-mail message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information of
Motricity.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information of Motricity.  Any 
unauthorized review, use, disclosure or distribution is prohibited.  If you are 
not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]