stanlick wrote:
>
> The logic considers the action name without regard to the package the
> action
> is contained within.
>
I'm confused by this also. I thought an example implied either a real-world
or contrived scenario where the problem in question manifests itself.
--
View this messag
Hi all,
I've been spending time with Struts 2.1.6, and the
NamedVariablePatternMatcher, and I've come across a potential issue.
The issue comes into play when defining a class such as this :
@Namespace("/content/{year}/{month}")
public class ContentAction extends ActionSupport {
private In
be a way to active the EL in the Attributes..
>
>
> Manuel Correa.
>
> -Original Message-
> From: cilquirm [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 29, 2007 3:17 PM
> To: user@struts.apache.org
> Subject: Re: [struts] S2: EL in tags 2.0.11
>
>
ion method, then we might
be able to say
#request.request.contextPath.
DNewfield wrote:
>
> cilquirm wrote:
>> you could do this
>>
>>
>>
>>
>>
>>
>
> Isn't the request on the valuestack?
you could do this
Basically, stuff the object into the pageContext somehow and then reference
it again via ognl.
It's a pain, but a very slight one.
-a
Manuel Correa wrote:
>
> How I get the contextPath with OGNL?? Or the other request methods?
>
> Manuel Correa.
>
> -Original M
I believe this was a security fix, as there was an issue where ognl
expressions could be used to do something drastic to the application server
( like System.exit ).
I believe the expectation is that you can get around it by creating your own
customized tld or something like :
hth,
-a
Man
A failed type conversion will incur a field error as well.
wild_oscar wrote:
>
>
>
> newton.dave wrote:
>>
>> --- wild_oscar <[EMAIL PROTECTED]> wrote:
>>> In a form I have a parameter passed like:
>>>
>>>
>>>
>>> where sop is of class I created.
>>>
>>> When I execute the action I g
web/WEB-INF/classes/struts.xml:10:109
>
> Caused by: Bean type interface com.opensymphony.xwork2.TextProvider with
> the name xwork1 has already been loaded by [unknown location] - bean -
> file:/D:/projects/Karakas1.1/build/web/WEB-INF/classes/struts.xml:10:109
>
>
>
&g
you can redefine it in your struts.xml, much like how you would specify the
object factory to override the default object factory .
-a
Igor Vlasov wrote:
>
> Hello.
> I want to change some information in struts-default.xml.
>
> I can move it to classes directoty and do any change:-)
>
>
You can, if you grab the ValueStck and traverse up it till you get to your
previous action.
Igor Vlasov wrote:
>
>
>
> I have action "one" and it calls action "two" throw:
> two
>
>
> I can use ChainingInterceptor to copy properties of "one" action to "two"
> action.
>
> I get behaviour
as to get around the barrier of entry of engaging people to
add and modify stuff. Getting someone else to maybe do it doesn't seem like
a form of engagement.
newton.dave wrote:
>
> --- cilquirm <[EMAIL PROTECTED]> wrote:
>> Any thought given to using a secondary wiki
Sorry to hijack this thread, because I fully agree with Wes that this is
good stuff to put into a wiki.
It's a little trickier with the apache wiki because you need to sign and
send over the CLA ( not terribly hard, but sometimes may not be possible. )
Any thought given to using a secondary wiki
I use Zero Conf and codebehind a lot, and I think they're both incredibly
useful. especially in this newer world of convention over configuration,
etc... When I have a package hierarchy all set up, i don't feel the need to
muck with struts.xml, because I can get directly down to coding.
There
You can throw an exception , which you can specify in your
@Transactional( rollbackFor = )
to have it rollback.
jon_french wrote:
>
> Yes. But I am using Spring managed transactions that in my understanding
> are outside of the struts Interceptor stack.
>
> My DAO's are annotated with th
There's nothing preventing you from adding back commons-beanutils or OSCore (
http://www.opensymphony.com/oscore/ ) to get back to that level of
functionality.
I'm not 100% sure why this mechanism is necessary. If you name your getter
on your TestBean appropriately, S2 should take care of it.
;t the same as the
> one provided in XWork2?
>
>
> cilquirm wrote:
>>
>> Indeed, the problem is that EnumTypeConverter, as provided by Struts2
>> only works for single values.
>>
>> Can you make selectedNutrients a List?
>>
>> If so, you might
rients[] must be mapped using
> EnumTypeConverter
>
>
> cilquirm wrote:
>>
>> Are enums type-converted automatically now?
>>
>> I recall early on I had to specify
>> http://struts.apache.org/2.0.9/struts2-core/apidocs/com/opensymphony/xwork2/
Are enums type-converted automatically now?
I recall early on I had to specify
http://struts.apache.org/2.0.9/struts2-core/apidocs/com/opensymphony/xwork2/util/EnumTypeConverter.html
Have you tried specifying that?
with
Element_selectedNutrients = com.opensymphony.xwork2.util.EnumTypeConvert
Nope, since IAs and sitemaps are very site specific.
Java does, tho. It's called java.util.Stack ( or at your leisure,
commons-collections has ArrayStack )
:-)
-a
stanlick wrote:
>
> Can you tell me if Struts 2 has a facility for breadcrumbs?
>
> On 9/25/07, Antonio Petrelli <[EMAIL PROT
You can also map each method to a name in your struts.xml by using the method
attribute of the action tag.
Ganebnyi Genadii wrote:
>
> Requesting action like /web-path/someAction!someMethod.action, calls
> SomeAction.doSomeMethod().
>
> 2007/9/21, michetag <[EMAIL PROTECTED]>:
>>
>>
>> Hi
I'm not sure I follow this 100%.
Are you saying that a single null propery being passed into the setter of
your model caused a whole new model object to be created?
So you have : firstName, lastName, and address1
address1 was read-only ( disabled or whatever you want to call it ).
your actio
I'm not sure I follow how validation is more flexible when using annotations
vs. xml files.
Aliases are how you tell xwork that this method is the one to be executed,
so there's a 1-to-1 mapping between aliases and methods.
File based validation is, in a sense, more flexible, because you can def
;
>
> true
>
>
>
> ...
>
>
>
>
>
> cilquirm <[EMAIL PROTECTED]>
> 17/09/2007 16:50
> Veuillez répondre à
> "Struts Users Mailing List"
>
>
> A
> user@struts.apache.org
> cc
>
> Objet
> Re: [S2] C
I'm pretty sure that making FilterDispatcher a Filter was a design decision
so converting it to a servletdispatcher may not be as easy or as
straightforward as one might think.
If memory serves ( and these days, that's not guaranteed ), it actually used
to be a filter/servlet combination before i
somewhat hackish, but you can accomplish this by using expressions :
#params['attrib'] != null ? attrib in ('a','list','of','values')
(this is just an example stating that you can check for the existence of the
variable in the parameter and then execute an expression like you normally
would )
I don't believe OGNL supports concatenation of lists, but such functionality
could be achieved using chained subexpressions :
( ticketStates.add(0,new MyObject(-1,"All")), ticketStates )
which would insert the new object into the head of the list, and then return
the ticketStates object as the r
Al Sutton-4 wrote:
>
> Ok, Looks like the first part is confusion in terminology. I took Action
> to
> mean an action as defined in struts.xml, but I now see Richard meant a
> single class used to declare two actions.
>
> Your solution to the second part doesn't seem right to me. My
> underst
Al Sutton-4 wrote:
>
> Hi Richard,
>
> Thanks for the pointer.
>
> I'm using 2 actions because my current belief is that using a single
> action
> would cause problems with result names because you can't define separate
> SUCCESS results for the form prep and the form submission if you only ha
In my experience, just having OSIV doesn't automatically imply that you
expect all your data to be retrieved ad-hoc. (maybe the users do :)
OSIV doesn't prevent the user from using eager fetching when necessary or
useful ( and my experience delays it until your application is working and
you'r
the way to construct a map in ognl is
%{ key : value , key : vale }
http://www.opensymphony.com/ognl/html/LanguageGuide/collectionConstruction.html#mapConstruction
hth,
-a
Hartrich, James CTR USTRANSCOM J6 wrote:
>
> I'm iterating a collection (keys) from s:action to get corresponding
>
That's a mouthful.
OGNL does have an 'in' operator
customer.creditCards[0].type in [ 'AMERICAN_EXPRESS', 'VISA', 'DISCOVER' ,
'MASTERCARD']
note that you don't have to do toString() if type is already a string ;
ognl's equality operator ( == ) already uses equals.
If it's not of type String, y
I think you have to 'know' somebody to get it incubated. i.e. Just because
you're offering, doesn't mean they'll bite. (And I don't mean that in a bad
way, either. )
Check out the incubation docs for more info :
http://incubator.apache.org/incubation/Incubation_Policy.html
Barring that, yo
By the looks of it, your classpath is messed up.
Is the hibernate3 jar in the right place?
I can't think of any other reason it wouldn't be able to find
org.hibernate.MappingNotFoundException
LucaLuca wrote:
>
> Hi,
>
> I've tried to make some changes to make it work..But nothing!. These ar
It's relatively easy.
You want the WTP ( unless you're using some customized version like
MyEclipse, at which point, I can't help ).
a) Create a Dynamic Web Project.
b) Set up your Server Runtime (1) (2)
c) Drop your jars into WebResources/WEB-INF/lib (3)(4)
4) write up your struts.xml :
ht
for my sake, i hope it's still 1.5.
i'm not allowed to go near 1.6 because of some obscure bug in some oracle
driver somewhere.
Ted Husted wrote:
>
> Are we targeting 1.6 now, or is the S2 target platform still 1.5?
>
> -T.
>
> On 7/12/07, James Holmes <[EMAIL PROTECTED]> wrote:
>> Perfect!
Frank, would you care to give the same tests a shot with ognl 2.7 and
javassist in the mix.
Although none of this is purely scientific, at least evaluations on that
regard give us some level of subjective information.
The ognl 2.7 and javassist jar are available via the tapestry-4.2-libs
downl
I've found that static html pages are blazing fast, especially those that
don't involve stylesheets, images, or javascript includes. :-)
Seriously, though, I don't think there's any disagreement that ognl ( or any
runtime expression language ) adds a certain amount of overhead, but I've
never se
The session object is wrapped by a SessionMap, so every time you do a put or
remove, the appropriate underlying method on the session is called.
So, in a nutshell, no, nothing to worry about.
Like most of struts2, it just works :-)
-a
Hoying, Ken-2 wrote:
>
> I am currently utilizing the Se
panpan wrote:
>
> The session is open, why do I need to reattach them?
>
You wouldn't need to if you loaded and discarded your objects in a single
request, but let's say you have objects that lived around longer than a
single request ( i.e., a User object in your http session ). You might
h
Seems like you should be able to say
>
>
>
> But since there's no getAction in the ActionContext, I doubt that will
> work. Maybe it should be added?
> (*Chris*)
>
> On 7/9/07, cilquirm <[EMAIL PROTECTED]> wrote:
>>
>>
>> the easiest solut
early on, and
watch your transaction boundaries.
Ask away if you have particular questions :-)
hth,
-a
panpan wrote:
>
> Thank you cilquirm. I think i'm a little bit confused and the filter is
> the one I needed.
> There is one thing which is unclear to me. If I only apply
the easiest solution would be to s:set the property name you want to
reference with a different name
and then access it in your loop under the new name.
stanlick wrote:
>
> There is no searching up the stack beyond the top?
>
> On 7/9/07, Dave Newton <[EMAIL PROTECTED]> wrote:
>>
>>
I think you may be confusing Struts2 (S2) interceptors with Spring
Interceptors.
The two are not the same.
S2 interceptors provide some "aop-like" functionality by allowing code to
modify request processing in some fashion; however it's not truly based
around an aop standard ( i.e. aopallliance )
I should correct myself. My problem may not be related, since it was due to
the CookieInterceptor's handling of setValue.
Can you post your pojo and your query string?
cilquirm wrote:
>
> Do you have struts.devMode = true?
>
> I had the same problem and I was
Do you have struts.devMode = true?
I had the same problem and I was forced to change struts.devMode = false
I believe this is a change from 2.0.6 ( and in some regards, a worse one at
that ).
I'm still investigating it, but please try turning devMode off and seeing if
it helps.
Scott Kingdo
You should be able to do
or (I'm assuming you have access to the jstl) , you can always do
hth,
-a
meeboo wrote:
>
>
> Hey all
>
> How can I achieve something like this:
> <%session.removeAttribute("successMessage");%>
>
> with the tag?
>
> I tried but it
> didn't work.
>
> Thanks
bunch of good guys on this forum.
> The thing is that I am not using intentionally the JSF framewrok. I just
> added an interceptor to the application. What is the problem here ?
>
>
>
> cilquirm wrote:
>>
>> This is most probably not related to Struts.
>>
&g
This is most probably not related to Struts.
I can't claim to know the intrinsics of your setup but it looks like you're
missing some jars need for JSF.
It might be that you're running an older version of the J2EE stack.
javax.el.ExpressionFactory comes with J2EE 5, and is part of JSF 1.2
GED
ss" I use
> "http://mydomain.com/public/css/design.css"; - good enough for me at the
> moment.
>
>
> cilquirm wrote:
>>
>> I don't believe this can be cleanly handled with just the web 2.4 spec
>> and struts2.
>>
>> Some
it is possible, if you extend and modify whatever theme you're using.
Then you can put that code wherever you want it to show up right inside the
freemarker template that renders it.
http://struts.apache.org/2.x/docs/extending-themes.html
hth,
-a
Skip Hollowell wrote:
>
> Trying again, due to
Try declaring a boolean setter in your Action with the checkbox name.
i.e.
setCheckboxName( boolean val ) { this.checkboxName = val ; }
and using that instead.
I'm not sure why you're trying to get the value from the
ActionContext.getParameters(). That will return the raw, globbed values
I don't believe this can be cleanly handled with just the web 2.4 spec and
struts2.
Some container, like Resin, allow for url-patterns to be regexes, which
would help in this scenario.
meeboo wrote:
>
> The problem is that I have a lot of URL:s which look like /user/username,
> movie/movieTit
Just FYI, Nabble does provide RSS feeds on a per-list/forum level.
I Live-bookmark http://www.nabble.com/Struts---User-f206.html
Frank W. Zammetti wrote:
>
> I think the thought behind not splitting the lists to this point is that
> Apache experience has been that it tends to divide a comm
Struts 2 tags support pretty much all the attributes that their html
counterparts do.
I haven't used NewCal ( seen it, but not used it )
but you can try something like this :
javascript:NewCal('myfield','ddmmm',true,24) images/cal.gif
Skip Hollowell wrote:
>
> I tried the s:datetimepi
Hi,
Does
...
not work for you?
Will Berger wrote:
>
> How does one in struts 2 process a list of req parameters using ognl?
>
> In jsp, this gets the job done.
> <%
> String emailList[] = request.getParameterValues("email"));
> for (int i=0;i {
> out.println(
The second way, %{test['AnyString'].att} or even, explicitly,
%{test['AnyString'].getAtt()} should both work.
I know it might sound dumb, but is there a value to att? ( using that class
as an example, there's no way to set it :-)
-a
Felipe Rodrigues wrote:
>
> Hi guys,
>
> I have this case
You actually can do that with the default mapper, using wildcarding.
Here's an example of what we do :
{1}
The only trick is that you have to remember to suffix your url appropriately
when calling so that S2's dispatchfilter is able to run and pick up on the
url mapping.
i.e. ( our s
You actually can do that with the default mapper, using wildcarding.
Here's an example of what we do :
{1}
The only trick is that you have to remember to suffix your url appropriately
when calling so that S2's dispatchfilter is able to run and pick up on the
url mapping.
i.e. ( our s
You actually can do that with the default mapper, using wildcarding.
Here's an example of what we do :
{1}
The only trick is that you have to remember to suffix your url appropriately
when calling so that S2's dispatchfilter is able to run and pick up on the
url mapping.
i.e. ( our s
Dave Newton-4 wrote:
>
>
> Spend the $50; good grief.
>
>
Having been down this road, I would venture with the "Don't bother." side
of the argument
In my opinion, while the price is fantastic, you're generally stuck with
versions that lag behind their completely free implementations ( i.e
I think the answer is a 2 part solution, but you're on the right track.
1) Create the interceptor that returns Action.LOGIN ( or whatever it is when
the user isn't authenticated ).
2) set up your login page in your global results type. See this page for
more information :
http://struts.apache.or
There are a number of tools in the Eclipse space that can do this ( i.e.
they run as Eclipse plugins/features and using the underlying GEF framework
).
One that I can think of off the top of my head is StrutsIDE :
http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=StrutsIDE
Exadel
I don't know if this helps, but when I validate a list or array , i use
OGNL's selection/projection facility :
i.e. :
customers.{ ? #this.age gt 0 and #this.username neq null }.size() eq
customers.size
creates a list of all customers whose age is greater than zero and who have
a username and
If your actions occur in sequence, (
i.e. submit to an action -> display action
),
it's possible to use action chaining to share objects.
http://struts.apache.org/2.x/docs/action-chaining.html
Roger Varley wrote:
>
> Hi
>
> I need to share an object between two actions. As I'm famili
Create a setter with the same name as your param.
ex :
for :
This value
in MyAction :
public class MyAction implements Action {
private String myValue;
public void setMyValue( String value) { this.myValue = value; }
}
Type conversion's done on this param value just like any other par
why can't you add parameters in chain?
In your action, can't you :
1) implement ParameterAware
2) set a parameter value in the map that's passed in
3) chain to your action
4) have the value be set in your chained action, via the params interceptor
-a
Laurie Harper wrote:
>
> Mike Barou
I do it like so :
Map contextMap = ActionContext.getContext().getContextMap();
ApplicationContext applicationContext = (ApplicationContext) ((Map)
contextMap
.get("application")).get(org.springframework.web.context.WebApplicationContext.ROOT_WEB_A
I do.
It looks vicious, but is pretty harmless.
You could wipe it out of your logs by setting the class that throws it to
only log ERROR and greater.
Piero Sartini-3 wrote:
>
> Am Dienstag, 27. Februar 2007 schrieb cilquirm:
>> I see errors like that on occasion ( mine is with th
st use a "SpringClassLoader"?
>
> Thanks again,
> Joao
>
> PS: The stacktrace is pretty much what I've send you.
>
> On 2/27/07, cilquirm <[EMAIL PROTECTED]> wrote:
>>
>> Technically, this isn't necessary when you have the
>> struts-sp
I see errors like that on occasion ( mine is with the JSONResult type and the
location property ), but they've always been warnings.
Is yours logged at the ERROR level?
Piero Sartini-3 wrote:
>
> upgraded to 2.0.6 - now the error below is thrown when accessing an Action
> with validators.
>
Technically, this isn't necessary when you have the struts-spring-plugin.jar
in your WEB-INF/lib
since it's already specified by the struts-plugin.xml file
I think, however, seeing a more complete stack trace for the CNFE would be
helpful since I have 2.0.6 with the spring plugin just fine.
P
That example is using the null property handling feature of the XW
type-conversion system :
http://struts.apache.org/2.x/docs/type-conversion.html
Basically, when xw/ognl sees ( evaluates ) person.firstName, it calls
getPerson() , which returns null.
XW goes to work and creates an empty Perso
in your resulting page
you can set
@page contentType = 'application/x-java-jnlp-file'
and return the body of your jnlp file ( possibly even read via c:import or
some such mechanism )
Maya menon wrote:
>
> Have anyone used java web start[JNLP files] with struts ?
>
> I have a project
This is so odd, yet I'm surprised no one's come across this.
This is S2 built off the 2_0_X branch ( no modifications, straight clean
build ), running under Java 1.5 in both resin and tomcat.
Given a snippet like so :
the output of the id is a formatted string :
Please, Helpme
Be
I believe you can use validation annotation to specify validation routines at
the method level.
ros wrote:
>
> Hi!
>
> How to configure struts2 validation for only one method in action?
>
> Thanks.
>
--
View this message in context:
http://www.nabble.com/struts2-validation-for-only-one-
x27;ve not used 'redirect-action' with extra parameters like below, but I have
done so using 'redirect' ( and the former is extended from the latter ) with
success.
-a
Dave Newton-4 wrote:
>
> --- cilquirm <[EMAIL PROTECTED]> wrote:
>> By specifying the
The error seems self-explanatory.
By specifying the "queryReportBeanName" inside the tag, you're
actually setting the value on the redirect-action object ( known also by
it's java name org.apache.struts2.dispatcher.ServletActionRedirectResult ).
if you want to set a static param on your own a
>From my experience, it is possible to run Struts1 and Struts2 side by side
As far as I've seen and worked with, other than keeping the "org.apache"
start of the package name, the namespaces and class names are different.
Bruno Melloni-2 wrote:
>
>
> Are all the package.class names different
your persistence.xml must be in META-INF directory in the classpath ( so
basically, it needs to end up either in your jars in WEB-INF/lib or in your
WEB-INF/classes directory )
shahab wrote:
>
> Hi:
>
> I have persistence.xml under META-INF
>
> (both WEB-INF and META-INF are under tomcat_ho
Just FYI,
I think this lesson was less about OGNL per se, and more about
Java,Servlets, and the Parameter map.
#parameters.addrType is of type String[], because that's how it's collated
( since you can have multiple values to a single name.. )
hth,
-a
Wesley Wannemacher wrote:
>
> Okay, I'
I don't think this will work as you expect it to for 2 reasons :
1) prepare comes before validate ( at least in all the interceptor stacks
that i saw, obviously you're free to change the order )
2) validation, at least in my perusal of the source, doesn't short circuit
the interceptor stack
ht
I've created
https://issues.apache.org/struts/browse/WW-1648
and attached a patch.
cilquirm wrote:
>
>
>
> Hi, I think I noticed an NPE in Restful2, which is set as my default
> action mapper. I'd like to resolve it but I'm not sure my logic on the
>
scratch my original comment ( though the part regarding using the jstl is
still valid. )
the problem for you is that since listOfBooks is not in the valuestack
directly, you would have to reference it via the request object, like so
...
walidito wrote:
>
> Hi everybody.
> I have a problem
I don't know particularly about the s:iterator, but since you said you're
using JSP, you can access the model via the jstl tags just as easily :
${book.author}
though, looking at your code again, I suspect it's because your getter is
class private.
It would have to be public.
-a
walid
Hi, I think I noticed an NPE in Restful2, which is set as my default action
mapper. I'd like to resolve it but I'm not sure my logic on the matter is
correct and hopefully someone on the list can set me straight :
The error :
java.lang.NullPointerException
org.apache.struts2.dispatcher.mappe
According to http://struts.apache.org/2.x/docs/validation-annotation.html
you can specify annotations at the method level.
André Faria-3 wrote:
>
> Hi People!!!
>
> Is there a way to use Validation Annotations only for a method or always
> for the action...
>
> Example, if I have a action
Dariusz Wojtas wrote:
>
> Want to have a bean separate from the action and just reference it?
> Define your bean (whatever you want) and just declare it as a variable
> on your action.
> Nothing more.
> Add getter and setter.
>
> class MyAction ... {
>private MyBeanClass myBean;
>
> }
>
87 matches
Mail list logo