Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the
same situation. Are you using the i18n interceptor? Also, how did you name
your resource files?
On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa [EMAIL PROTECTED]
wrote:
Hi everyone,
I have the following lines in my
You could probably create your own theme and/or template for the tag where
you set the attribute in the template. But why not just use standard xhtml
tags for this - I mean just type it like this in the page:
input type=text name=userid autocomplete=off ... /
(extra space there to not make the
I'm using 2.1.1-SNAPSHOT from the people.apache.org maven snapshot
repository. I noticed 2.1.2-SNAPSHOT is already out, maybe I should try it.
I have scope=prototype in the actions that I've defined in the Spring
configuration file. The problem also affects actions that are not in the
Spring
a decent persistence layer that has 'second level cache' which
you can set up when you go live, rely on that instead for caching.
Toni Lyytikäinen on 21/04/08 11:02, wrote:
Thanks for the answer! Does the resultType=chain approach preserve the
fieldErrors and the values the user has
action fetches the dropdown list and puts it in
the request and results in the form jsp.
The form submits to Save and if validation fails, the Input result is
resultType=chain and pipes the request back to the Edit action.
HTH
Adam
Toni Lyytikäinen on 21/04/08 10:05, wrote:
Hello
Hello,
What is generally regarded as the best practise for populating a select
element in a form from database so that it works regardless of the action
and the result from which the form is displayed?
I've tried this:
action configuration:
action name=edit method=edit class=admin.Users
on the action.
Toni Lyytikäinen on 21/04/08 12:00, wrote:
Well, for the retrieval I use stateless session bean injected to the
action
with Spring, like this (simplified):
public User getUser() { return user; }
public String edit() {
user=dao.get(id);
return SUCCESS;
}
So
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=actionNameUsers_edit/param
param
file a bug and put it against 2.1.2
Don
On Fri, Apr 18, 2008 at 11:11 PM, Toni Lyytikäinen [EMAIL 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
be something simple we can spot before needing to log a bug.
Al.
- Original Message - From: Toni Lyytikäinen [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, April 18, 2008 2:28 PM
Subject: Re: Converting action configuration from 2.0 to 2.1 - how
Well, as I already posted in the issue, it turned out that this is somehow
caused by the Spring plugin. If I disable the Spring plugin, it works fine
(apart from the fact that my DAOs won't get injected to the actions, of
course).
Hard to say where the problem lies without having a look at the DAO code.
Are you using OpenSessionInViewFilter or similar mechanism for lazy loading
in the view? If yes, try setting the param singleSession to false like this:
filter-nameOSIVFilter/filter-name
filter-class
using Struts 2 is if you think it
should be possible, it probably is! What are you trying?
On Thu, Feb 21, 2008 at 1:29 AM, Toni Lyytikäinen [EMAIL PROTECTED]
wrote:
Thanks. This approach works, but isn't quite as elegant as I was hoping.
On Wed, Feb 20, 2008 at 2:47 PM, [EMAIL PROTECTED
Hi,
I'm trying to access the ActionMapping from an interceptor, like the
following test stub:
public String intercept(ActionInvocation invocation) throws Exception {
ActionMapping am=ServletActionContext.getActionMapping();
log.info(The method is +am.getMethod());
return
.
On Wed, Feb 20, 2008 at 5:40 AM, Toni Lyytikäinen [EMAIL PROTECTED]
wrote:
Hi,
I'm trying to access the ActionMapping from an interceptor, like the
following test stub:
public String intercept(ActionInvocation invocation) throws Exception {
ActionMapping am
Hi,
I recently started converting an older project to Struts 2.0.11 and maven.
The project uses spring plugin for injecting certain dependencies into the
actions. The problem is, that I would like to use the constructor
autowiring, as described in the configuration file (struts.properties):
###
Yes, there are several approaches to it, using AjaxTags, Ajax Anywhere, YUI,
Prototype etc. It might be possible to implement it in Dojo too, I don't
know enough about Dojo to say anything certain. All solutions are somewhat
hackish though, and I wouldn't really recommend using them. AjaxTags is
http://displaytag.sourceforge.net/11/export_filter.html
On 8/27/07, Manuel Correa [EMAIL PROTECTED] wrote:
Sorry is display tags:
http://displaytag.sourceforge.net/11/
Manuel Correa.
Application Analyst Specialist.
ITOS, Carl Vinson Institute of Government.
The University of
You could just override the string conversion in xwork:
http://struts.apache.org/2.x/docs/type-conversion.html
define something like this in xwork-conversion.properties
java.lang.String=org.example.MyConverter
Then create a class MyConverter that extends the XWorkBasicConverter and
override
It's quite possible. Take a look at the comments here:
http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor
On 8/23/07, Phillip Grenier [EMAIL PROTECTED] wrote:
I don't know if this is possible or not but I would like to have a
authentication interceptor that if a user is
You can't use the OpenSessionInViewInterceptor from Spring in Struts 2.
Struts 2 interceptors are not compatible with Spring interceptors as they
have their own interface. You'll have to use OpenSessionInViewFilter. Take a
look here:
And, is there a better alternative than using
OpenSessionInViewInterceptor?
Yes. It's important to realise that while OpenSessionInView feels very
handy, it is not a particularly nice design pattern, as it can stress your
database with lots of small queries. It's best to learn how to do eager
use eager fetching by
default and minimize the use of OSIV.
On 8/22/07, Toni Lyytikäinen [EMAIL PROTECTED] wrote:
And, is there a better alternative than using
OpenSessionInViewInterceptor?
Yes. It's important to realise that while OpenSessionInView feels very
handy
I don't remember having any similar problems with the Finnish locale which
is nearly the same as the Swedish one. The cause of the problem is probably
that the parameters are in wrong encoding (UTF-8 most probably). Since you
are using ISO-8859-1, check that the browser in the form page is
I don't know if you can capture the checkbox value to String, boolean should
work though (it works for me at least). Try changing the String element to
boolean.
On 8/14/07, Session A Mwamufiya [EMAIL PROTECTED] wrote:
Hi,
I started a thread on this topic a while back, but the example I was
Sorry, but why go the hard way when you can achieve the same with a simple
interceptor? You can return a global result from a interceptor (f.ex. return
errorPage) which is lot simpler than getting tangled with the
RequestDispatcher stuff.
On 8/10/07, Toni Lyytikäinen [EMAIL PROTECTED] wrote
Sorry, but why go the hard way when you can achieve the same with a simple
interceptor? You can return a global result from a filter (f.ex. return
errorPage) which is lot simpler than getting tangled with the
RequestDispatcher stuff.
On 8/10/07, Eugen Stoianovici [EMAIL PROTECTED] wrote:
i'm
Hello,
Is it possible to localize the options in the list attribute of the
s:select-tag? I've tried several approaches but none of them seem to work.
What I'm aiming at is something like the following:
s:select name=somename
list=#{
'01' : 'this should be some localized text from a
Set the uid attribute in the display:table -tag like this:
display:table uid=row name=... id=... ...
after that you can refer to the row from struts tags by using #attr.row
so the iterator should now works like this:
s:iterator value=#attr.row.roles
On 8/8/07, fergunet [EMAIL PROTECTED]
That validation config doesn't seem to make much sense to me. The field
accountNumber cannot be both int and string, so you have to use required
instead of requiredstring if you want to process the input as int. If you
want it as string, you have to use something else than the int validator,
I'm under the impression that the selected topic publishing isn't currently
working in Struts 2. At least the examples in the showcase app aren't
working for me (in Firefox 2.0.0.6). When I had to do something similar I
found this:
Does your class implement Preparable interface? Do you have the interceptor
in your interceptor stack? Also, check the syntax of the preparable method -
it should be void like this
public class TestAction extends SomeClass implements Preparable {
...
public void prepare() {
log.debug(This should
I believe the correct spelling is redirect-action
http://cwiki.apache.org/WW/action-configuration.html
On 8/6/07, Session A Mwamufiya [EMAIL PROTECTED] wrote:
I get the following:
Caused by: There is no result type defined for type 'redirectAction'
mapped with name 'createSMIG' - result -
YUI has great documentation, there are also nice examples at:
http://developer.yahoo.com/yui/treeview/
On 8/6/07, Session A Mwamufiya [EMAIL PROTECTED] wrote:
Do you have an example, because I know nothing about YUI.
Also, I saw in the link you provided that there is a workaround for dojo,
http://struts.apache.org/2.x/docs/property.html
The property tag escapes the string by default. Try s:property
escape=false /
On 8/1/07, Sawan [EMAIL PROTECTED] wrote:
Hi experts,
I have following code...
JAVA:
ArrayList obj = new ArrayList();
obj.add( www.google.com Visit google );
Those examples don't actually work the way they should, do they? The tree
renders fine, but the topics are not working correctly. The text on the side
prompts to click a node, but clicking the node does nothing. Looks like the
event handler never gets called.
On 7/31/07, Ted Husted [EMAIL
I tried this too, and I can confirm that it does actually shut down the
server. The return value of the method that the property tag references is
evaluated for some reason, which makes the application vulnerable to OGNL
injection attacks... this is a huge security problem.
On 7/16/07, Aram
It's not a String but an array of Strings. [ in front of the object
indicates an array.
On 7/14/07, Richard Sayre [EMAIL PROTECTED] wrote:
I am implemnting ParameterAware to get my request parameters:
http://cwiki.apache.org/WW/how-can-we-access-request-parameters-passed-into-an-action.html
for this case ?. In the
showcase example, uses a option.flt(value only), but I need two, key and
value instead.
Thanks
Herrera
Toni Lyytikäinen wrote:
Whoops, sorry I should probably think before I post. So you want to set
the
key, not the value of the input element. I did this by having
PROTECTED] wrote:
I agree , autocompleter is too slow...
Are you using the
http://cwiki.apache.org/confluence/display/S2PLUGINS/YUI+Plugin ?
Herrera
Toni Lyytikäinen wrote:
I used a JSON action which outputs an array of arrays like this:
[
[VALUE, KEY],
[VALUE2, KEY2],
...
]
I
The value attribute sets the preset value of the input element, if that is
what youre looking for.
s:autocompleter value=AS etc... /
On 7/12/07, Pedro Herrera [EMAIL PROTECTED] wrote:
I´m using autocompleter tag with Struts 2.0.8 and I need to show a default
value to the user.
For example,
Whoops, sorry I should probably think before I post. So you want to set the
key, not the value of the input element. I did this by having a
getElementKey-method in the Action class which returns the key you want as
the default. Element is the name of the input element.
On 7/12/07, Toni
/
I´ve setted the in the action countryIdKey = 29 and the combo comes
blank...
help me
Herrera
Toni Lyytikäinen wrote:
Whoops, sorry I should probably think before I post. So you want to set
the
key, not the value of the input element. I did this by having a
getElementKey-method
Google is your friend,
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletResponse.html#sendRedirect(java.lang.String)
You can get the URL with a method in the HttpServletRequest class,
getRequestURL(), substitute https for http in there and redirect to that
page with
After playing around with Firebug a little I found out that in our project
the most costly thing in the page loading process is loading the dojo
.js-files. For some reason they are included in the xhtml theme too. If I
substitute
s:head theme=xhtml /
with
link rel=stylesheet
?
Any idea where I went wrong?
Thanks,
brian-
On Jul 10, 2007, at 8:50 AM, Toni Lyytikäinen wrote:
I'd like to know the best practice too. I've done this setting a
parameter
in the request, and in my jsp I have
s:tabbedPanel id=adminpanel selectedTab=%{#parameters['active']}
not very
It may be an ugly hack, but it has worked for some of my actions. If you
return null instead of the action name to be invocated, you can use a
response object to send information directly to the user. The
HttpServletRequest object has method isSecure() which you can use to
determine whether the
I'd like to know the best practice too. I've done this setting a parameter
in the request, and in my jsp I have
s:tabbedPanel id=adminpanel selectedTab=%{#parameters['active']}
not very elegant but works.
On 7/10/07, Brian Trzupek [EMAIL PROTECTED] wrote:
I have a page with several Struts
I can't really say about Spring 1.2.8 because I've only ever used 2.0, but
here's what I did:
in web.xml:
web-app
filter
filter-nameOSIVFilter/filter-name
filter-class
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
/filter-class
/filter
...
filter-mapping
.
Thanks again!
Toni Lyytikäinen wrote:
I can't really say about Spring 1.2.8 because I've only ever used 2.0,
but
here's what I did:
in web.xml:
web-app
filter
filter-nameOSIVFilter/filter-name
filter-class
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
-of-opensessioninviewinterceptor.html
I don't know if this one work?
Toni Lyytikäinen wrote:
Sorry, I must have read the post too quickly and assumed you were
talking
about the filter, because I haven't really seen a working OSIV
interceptor
for Struts 2. If you want to use an interceptor, you'll probably have to
write one
I'm trying to make a simple page like the one in the struts showcase app
that displays a tree, and when the user clicks a node, the page will display
information about that node. The problem is however, that the documentation
on the tree-tag is scarce and the example in the showcase app (version
I've used to doing something like this in Ruby on Rails:
if @object.updateAttributes(params[:object])
flash[:notice]=Update succesful!
redirect_to :action='list'
else ...
Now that I'm using Struts 2 for a project I tried doing something similar:
try {
objectService.save(getObject());
Or better yet, create a Login interceptor or Login filter that checks the
session and redirects to login page if the required key is not there. Make
package(s) of the actions you want to expose to authenticated users only and
put the interceptor into that packages interceptor stack.
On 6/27/07,
Try removing the last comma from the list like this:
[
[ALABAMA STATE UNIV HORNETS],
[ALBANY ST UNIV GOLDEN RAMS],
[BALDWIN-WALLCE CLG YELLW JCKTS],
[BALL ST UNIV CARDINALS],
[BAYLOR UNIV BEARS],
[CATAWBA COLLEGE] -- removed comma
]
On
What kind of filter are you using? Have you made one yourself or is it the
one from the Spring framework? If not, consider looking into Spring. Spring
includes an OSIV filter that seems to work for me at least. I'm also using
the Spring declarative transactions in my DAOs which makes writing
56 matches
Mail list logo