Re: Internalization problem: two internalizations for the same key

2008-05-08 Thread Toni Lyytikäinen
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

Re: Disabling Browser AutoComplete in Struts tags

2008-04-23 Thread Toni Lyytikäinen
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

Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-21 Thread Toni Lyytikäinen
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

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
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

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
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

Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
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

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Toni Lyytikäinen
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

Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
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

Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
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

Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
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

Re: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Toni Lyytikäinen
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).

Re: persistence and doubts on usage of hibernate in struts 2

2008-02-29 Thread Toni Lyytikäinen
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

Re: How to get method name in interceptor

2008-02-21 Thread Toni Lyytikäinen
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

How to get method name in interceptor

2008-02-20 Thread Toni Lyytikäinen
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

Re: How to get method name in interceptor

2008-02-20 Thread Toni Lyytikäinen
. 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

Trouble configuring spring plugin

2008-02-08 Thread Toni Lyytikäinen
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): ###

Re: Displaytag problems

2007-09-04 Thread Toni Lyytikäinen
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

Re: tabltags

2007-08-27 Thread Toni Lyytikäinen
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

Re: Sanitize Text

2007-08-23 Thread Toni Lyytikäinen
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

Re: Save Action Invocation

2007-08-23 Thread Toni Lyytikäinen
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

Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
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:

Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
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

Re: Configuring OpenSessionInViewInterceptor as S2's interceptor

2007-08-22 Thread Toni Lyytikäinen
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

Re: Having problem with Swedish characters in request

2007-08-21 Thread Toni Lyytikäinen
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

Re: capturing the value of a s:checkbox tag in an action

2007-08-14 Thread Toni Lyytikäinen
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

Re: struts 2.0.8 problem implementing filter

2007-08-10 Thread Toni Lyytikäinen
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

Re: struts 2.0.8 problem implementing filter

2007-08-10 Thread Toni Lyytikäinen
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

Localizing the list in a s:select-tag?

2007-08-08 Thread Toni Lyytikäinen
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

Re: How to list a property in a display:table (Struts 2)

2007-08-08 Thread Toni Lyytikäinen
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]

Re: Struts 2 Validation multiple validators on same field

2007-08-07 Thread Toni Lyytikäinen
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,

Re: Gettin the selected item in a s:tree

2007-08-06 Thread Toni Lyytikäinen
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:

Re: populating input fields on page load

2007-08-06 Thread Toni Lyytikäinen
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

Re: populating input fields on page load

2007-08-06 Thread Toni Lyytikäinen
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 -

Re: Gettin the selected item in a s:tree

2007-08-06 Thread Toni Lyytikäinen
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,

Re: HTML Encoding in Struts2

2007-08-01 Thread Toni Lyytikäinen
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 );

Re: Contacting struts 2 documentation writers

2007-07-31 Thread Toni Lyytikäinen
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

Re: Struts 2 performance

2007-07-16 Thread Toni Lyytikäinen
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

Re: ParameterAware Not Working

2007-07-14 Thread Toni Lyytikäinen
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

Re: [S2] autocompleter, predefining initial value

2007-07-13 Thread Toni Lyytikäinen
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

Re: [S2] autocompleter, predefining initial value

2007-07-13 Thread Toni Lyytikäinen
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

Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen
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,

Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen
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

Re: [S2] autocompleter, predefining initial value

2007-07-12 Thread Toni Lyytikäinen
/ 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

Re: redirecting a non-secure request to one that uses https

2007-07-11 Thread Toni Lyytikäinen
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

Re: Struts 2 performance

2007-07-11 Thread Toni Lyytikäinen
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

Re: Tab Persistance

2007-07-11 Thread Toni Lyytikäinen
? 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

Re: redirecting a non-secure request to one that uses https

2007-07-10 Thread Toni Lyytikäinen
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

Re: Tab Persistance

2007-07-10 Thread Toni Lyytikäinen
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

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
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

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
. 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

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
-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

The s:tree -tag - how to use properly?

2007-07-02 Thread Toni Lyytikäinen
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

How to pass messages that survive redirects?

2007-06-29 Thread Toni Lyytikäinen
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());

Re: Struts 2 Login example using a session

2007-06-27 Thread Toni Lyytikäinen
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,

Re: S2: autocompletion trouble in 2.0.8

2007-06-26 Thread Toni Lyytikäinen
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

Re: integration of hibernate3 in struts2

2007-06-21 Thread Toni Lyytikäinen
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