Re: Struts 2 - problem updating page

2011-01-06 Thread Alex Rodriguez Lopez
Not completely sure, but doesn't this one: http://struts.apache.org/2.x/docs/token-session-interceptor.html handle this situation? developer researcher, 06-01-2011 01:55: Hello, I have the following problem: after submit a form, if it refresh (F5) the page the form is submitted

Re: unicode breaks s:select?

2010-12-16 Thread Alex Rodriguez Lopez
Have you got this on top of JSPs? %@ page contentType=text/html; charset=UTF-8 % Patrick Cosmo, 15-12-2010 17:40: Hi! When using s:select, if the list of data returned by my java class contains strings that have unicode characters in them, s:select fails to generate the entire tag, it dies

Re: AJAX file upload

2010-12-02 Thread Alex Rodriguez Lopez
Still off-topic, but recently I've been using this neat feature in GMail where one simply grabs an actual file from, say, your desktop, and drop it into a designated zone in the page when composing mail. The file starts uploading when droped, so I guess you could call this ajax upload. I

Re: Struts 2 s:action tag doesn't render action errors if any are present

2010-10-29 Thread Alex Rodriguez Lopez
I don't know if this aplies to the issue here, but I once used this interceptor: interceptor-ref name=store param name=operationModeAUTOMATIC/param /interceptor-ref So the errors / messages will be passed through actions and redirections if not retrieved / showed. As far as I recall it worked

Re: export to excel - displaytag

2010-10-26 Thread Alex Rodriguez Lopez
Hi, I had the same problem, but it was time ago. I asume from your code that you followed this: http://displaytag.sourceforge.net/1.2/export_filter.html and using Struts 1. If using this with Struts2 you should have to change the url-pattern to *.action or whatever extension you are using.

Re: After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...

2010-10-19 Thread Alex Rodriguez Lopez
I'm using a combination of empty extension and exclusions for static content which works well now. Got pretty confused too at beginnning when I changed to an empty extension though: http://struts.apache.org/2.2.1/docs/static-content.html in web.xml: filter filter-namestruts2/filter-name

Re: referencing javascript files from (action) jsp file

2010-10-14 Thread Alex Rodriguez Lopez
try it without the first / like script src=js/util.js Guy Thomas, 14-10-2010 14:54: changed javascript paths as follows: html head titleDomain Security Administrator: Pas gebruiker aan/title link href=/css/domainsecurityadmin.css rel=stylesheet type=text/css script src=/js/util.js

Re: Master-details JSP with Validation xml

2010-10-13 Thread Alex Rodriguez Lopez
Why is the params-prepare-params not in the default stack / behavior already? I think one of the first things S2 gets really useful at is the params / prepare stuff and a LOT of people keeps asking the same question, and getting the same answer use the params-prepare-params stack. Any reasons

Re: Javascript proble in sx:civ in struts2

2010-09-17 Thread Alex Rodriguez Lopez
I don't have a definite answer, but just keep in mind that: - The Dojo plugin is deprecated, you might want to consider other ways of achieving the same thing. - For the ajax tags to work you have to include the head tag ( sx:head/ ). Please read:

Re: How do we repopulate controls when validation fails?

2010-08-11 Thread Alex Rodriguez Lopez
Don't know if this solves your problem, but maybe it helps to use the params-prepare-params trick, calling params interceptor twice, so you have your params ready before prepare(). You have an already configured stack, the paramsPrepareParamsStack From struts-default.xml: !-- An example of

Re: File Upload

2010-08-03 Thread Alex Rodriguez Lopez
I think this is a browser/OS specific behaviour, not related to Struts or even to HTML at all. Em 26-07-2010 13:20, RogerV escreveu: Is there a way of specifying the start directory to be used when the user hits the browse button? As far as I can see, the system remembers where it was looking

Re: set a list from getmodel()

2010-07-01 Thread Alex Rodriguez Lopez
As far as I remember, for Struts to populate a list you just give the same name for a setter in the action that takes a List as a parameter as the element(s) in the Jsp. So you can have 1 textboxes *with same name*, and if this name happens to map to a list, the list will get populated

Re: Passing parameters to getter methods?

2010-06-25 Thread Alex Rodriguez Lopez
You can do this without parameters. Write a setter for this index property (to save it), and then in the getter you grab the saved value. Hi, I want to call s:iterator and fetch a list by passing it an index. This list will be dynamically generated. s:iterator value=products[#index]

Re: Page composition strategy

2010-06-23 Thread Alex Rodriguez Lopez
I've been using Tiles and always found it confusing a little bit, now that I'm starting to test Sitemesh my vote would be for this last one. They accomplish the same thing, only Tiles is like saying each time my page is made up of this, this and this. Sitemesh is more about taking a piece of a

Re: Page composition strategy

2010-06-23 Thread Alex Rodriguez Lopez
BTW, any of those two are easily integrated into S2 as plugins (in fact already bundled with S2 distribution, just add the jars): http://struts.apache.org/2.1.8.1/docs/tiles-plugin.html http://struts.apache.org/2.1.8.1/docs/sitemesh-plugin.html I've been using Tiles and always found it

Re: Iterating over a Collection and creating a html:checkbox / for each entry of it

2010-06-18 Thread Alex Rodriguez Lopez
http://struts.apache.org/2.x/docs/checkboxlist.html Hi! Is something like the following snippet possible to do? c:forEach items=${MyForm.list} var=entry tr td${entry.name}/td td${entry.forced}/td html:checkbox property=entry.checked / /tr /c:forEach Of

Re: Struts2 form token not matching session token

2010-06-18 Thread Alex Rodriguez Lopez
If you are not using it already, I suggest using FireBug to inspect the data sent along with each request, so maybe you can find where these values come from. Hi all, I am having a strange problem with the struts2 token tag and the token-session interceptor. It seems like the token added to

Re: Cookie Manipulation attack

2010-05-27 Thread Alex Rodriguez Lopez
Em 27-05-2010 11:27, Vishnu Vyasan Nelliparmbil escreveu: Hi Guys, I am handling a application in which we have application in two languages. There is a Locale action for setting locale to English or Arabic based on the parameter being passed from the respective index pages. I.e. index_en.jsp

Re: PRG pattern question

2010-05-27 Thread Alex Rodriguez Lopez
Em 26-05-2010 16:57, Chris Pratt escreveu: If you search the forum, someone posted an Interceptor (quite a while ago) that saves the Action/Field Errors/Messages in the Session so that they will survive a redirect. It could easily be extended to do what you require. (*Chris*) I think this

Re: Need Help For Struts2 Debugging

2010-05-25 Thread Alex Rodriguez Lopez
I use to find it impossible to do this... Then I started to use Maven, which can be used to download source code and attach it easily. If you use Eclipse I suggest using M2Eclipse plugin. After you get a Struts2 based project with Maven2 up and running it should be easy to do what you want,

ActionContext.getContext().getSession() vs. SessionAware injection (about servlet maps)

2010-05-20 Thread Alex Rodriguez Lopez
Hi Struts users! I was wondering, after reading about the ServletConfigInterceptor, if there are differences in obtaining the session map via the method ActionContext.getContext().getSession() or have it injected through SessionAware. The map that I end up with is the same so... why have to

Re: Interator values not showed

2010-05-19 Thread Alex Rodriguez Lopez
Hi, i'm trying the append tag and the list values of the appended lists are not showed. This is the main part of the jsp code: s:append var=metalBands s:param value=%{groups}/ s:param value=%{groups1}/ /s:append Total Bands:br s:iterator id=band value=%{#metalBands}

Re: how to set default focus field in s:form ?

2010-05-11 Thread Alex Rodriguez Lopez
Hi, I use to do this manually with javascript, didn't know it was part of s:form tag. So today I decided to give it a try but it is not working for me... how does this works? Does it need some plugin or additional config to make it work? Is it compatible with jquery, which I include in every

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Alex Rodriguez Lopez
Hi Thomas, use the paramsPrepareParams interceptor stack (or change yours), from struts-default.xml: !-- An example of the paramsPrepareParams trick. This stack is exactly the same as the defaultStack, except that it includes one extra interceptor before the

Re: Where is the documentation for Struts tags ....

2010-05-05 Thread Alex Rodriguez Lopez
Em 05-05-2010 07:57, RogerV escreveu: So if it's looking for a string, let's make sure you're giving it one, and not the .toString of an empty map that it got from your prepare method: s:checkboxlist name=%{'selectedroles'} list=%{availableroles} value=%{preselectedroles}/ I must admit I

Re: ExecAndWait interceptor parameters lost

2010-05-05 Thread Alex Rodriguez Lopez
Hi, you can store data in session and retrieve it later on. Data stored in session is persisted through requests. ActionContext.getContext().getSession(); http://struts.apache.org/2.1.8.1/struts2-core/apidocs/com/opensymphony/xwork2/ActionContext.html Hi, I have an issue in my code that I

Re: s:select help

2010-05-04 Thread Alex Rodriguez Lopez
Maybe using OGNL along with #this or #attr . Haven't checked that out but it should work some of these ways: http://struts.apache.org/2.0.14/docs/ognl-basics.html http://www.opensymphony.com/ognl/html/LanguageGuide/varref.html Em 04-05-2010 14:03, RogerV escreveu: Upasana Sharma wrote:

Re: Struts 2 and dynamics web page

2010-04-30 Thread Alex Rodriguez Lopez
This example proved helpful to me: http://struts2inaction.com/SimpleAjax.html In the end I ended up doing the same with jQuery: s:select ... onchange= $('#divIDthatWillGetChanged').load('some.action?' + params ); / You can get the selected option and pass as params to the called action.

Re: Annotation Validation

2010-04-29 Thread Alex Rodriguez Lopez
: Did you try something like this? @RequiredStringValidator( fieldName = label.name, key =error.required , message = Name required.)} Alex Rodriguez Lopez wrote: Hi struts users! I'm on my way to change from XML based validation to annotation validation. I've manage

Re: Struts 2 validation

2010-04-29 Thread Alex Rodriguez Lopez
If you define action alias for specific methods in your struts.xml (you can do so with wildcards too), then you can use this format actionClass-actionAlias-validation.xml as stated below. http://struts.apache.org/2.1.8.1/docs/validation.html Defining Validation Rules Validation rules can be

Annotation Validation

2010-04-28 Thread Alex Rodriguez Lopez
Hi struts users! I'm on my way to change from XML based validation to annotation validation. I've manage to get it working, but (probably due to my little knowledge of Java annotations) there are some things I can't get to work, so I apologise if this question is not entirelly Struts related.

Re: Struts2 XML based validation doesnt work !

2010-04-27 Thread Alex Rodriguez Lopez
I'm sure your problem is related to themes/templates. If you are using simple theme you have to provide your own labels for fields, so the field validation works and S2 knows where to place the messages (because you know validation happens, it's just the messages not displaying, right?).

Re: struts session help

2010-04-27 Thread Alex Rodriguez Lopez
Hi, you could put/get from session like so: ActionContext.getContext().getSession(); You can define a parent action (implementing preparable) with a prepare() method that retrieves data and store it in session for later (and check each time if data is already in session) and puts it into

Re: OptionTransferSelect in 2.1.8

2010-04-27 Thread Alex Rodriguez Lopez
http://www.manning-sandbox.com/thread.jspa?threadID=22922start=15tstart=0 maybe this post (and the first page) will help you, as they show a similar example and how the list relates to the properties in the action Em 27-04-2010 14:14, RogerV escreveu: mgainty wrote: the site you

Re: Custom types and select lists

2010-04-20 Thread Alex Rodriguez Lopez
How I do it with selects is having getter/setter for whatever you write in name= (in your case campus) as type Long (should be ListLong if select is multiple). In prepare() you put in campus the campus id of the campus that should be preselected (the one acording to the student id, right?),

Re: Syntax problem: Trying to display label for Select while iterating

2010-04-08 Thread Alex Rodriguez Lopez
I had similar problems with labels, most times they where related to themes. http://struts.apache.org/2.x/docs/themes-and-templates.html For example, if you turn on simple theme you'll have to provide your own tags for the labels as struts won't generate this markup. Em 08-04-2010 08:18,

Re: Why do I need a refresh to print a display:table ?

2010-04-07 Thread Alex Rodriguez Lopez
Hi Stéphane, did you try implementing the Preparable interface in your action and populating your List in the prepare() method? http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html Em 07-04-2010 05:16, Stephane Cosmeur escreveu: One week later, i'm still

Re: struts 2 s:url tag confution

2010-04-07 Thread Alex Rodriguez Lopez
Use this syntax: s:param name=directionforward/s:param Em 07-04-2010 06:52, Supratim Bandyopadhyaya escreveu: Greetings to all, I have been trying to gets:url to work properly. Here is the code. s:url id=paginationurl action=role namespace=/role s:param name=offset

Re: Why do I need a refresh to print a display:table ?

2010-04-07 Thread Alex Rodriguez Lopez
Is the PrepareInterceptor in your interceptor stack? The prepare() method is called by this interceptor. Sorry if you checked already this things, it is the only that comes to mind, otherwise it really seems like a strange behaviour. Em 07-04-2010 09:27, Stephane Cosmeur escreveu: Yes I

Re: i18n problem with Struts2 - getting weird

2010-04-05 Thread Alex Rodriguez Lopez
Do you have your struts.custom.i18n.resources property correctly assigned to your bundle(s)? Em 05-04-2010 11:27, Marc Logemann escreveu: Hi, imagine the following jsp (saved in UTF-8 encoding): -- snipp --- %@ taglib prefix=s uri=/struts-tags % html body Hauptmenübr/ s:text

Re: How to keep quotation marks

2010-04-05 Thread Alex Rodriguez Lopez
Try escape or escapeJavaScript atributes of s:property tag, never used them but maybe are helpful for your situation http://struts.apache.org/2.x/docs/property.html Em 05-04-2010 15:06, Craig Ricciuto escreveu: Hi there. I've run into situation that I'm not quite sure how to resolve. In one

Re: How to keep quotation marks

2010-04-05 Thread Alex Rodriguez Lopez
attribute (set it to false) and worked like a charm. Thanks again. On Mon, Apr 5, 2010 at 10:14 AM, Alex Rodriguez Lopez alo...@flordeutopia.pt wrote: Try escape or escapeJavaScript atributes ofs:property tag, never used them but maybe are helpful for your situation http://struts.apache.org/2.x

Populate: Implement preparable or richer getter approach

2010-03-30 Thread Alex Rodriguez Lopez
Hi to all, as I learn more things about S2 some questions emerge about best practices more experiences users might know how to do best. I believe it is a common problem having to populate fields like selects first thing (with data from DB or stored in session) before any task is done.

Re: [Struts 2.1.8.1] Internationalization: how to remain in the current page ?

2010-03-29 Thread Alex Rodriguez Lopez
Thanks Zoran for sharing your approach, greatly appreciated, I'm thinking about implementing a similar interceptor, and maybe replace the i18n one so work is done implicitly with only a change in struts.xml and the new interceptor. Em 29-03-2010 02:58, Zoran Avtarovski escreveu: Hi Guys, We

Re: Pagination with Struts 2.1.8 ?

2010-03-29 Thread Alex Rodriguez Lopez
Display tag, works like a charm: http://displaytag.sourceforge.net/1.2/tut_basic.html Works with lists and handles pagination, data export, I recommend it! Em 29-03-2010 11:07, Celinio Fernandes escreveu: Hi, This is a classic requirement. I have this table, in a JSP, that I have created with

Re: [Struts 2.1.8.1] Internationalization: how to remain in the current page ?

2010-03-29 Thread Alex Rodriguez Lopez
04:55, Alex Rodriguez Lopez a écrit : Thanks Zoran for sharing your approach, greatly appreciated, I'm thinking about implementing a similar interceptor, and maybe replace the i18n one so work is done implicitly with only a change in struts.xml and the new interceptor. Em 29-03-2010 02:58, Zoran

Re: Pagination with Struts 2.1.8 ?

2010-03-29 Thread Alex Rodriguez Lopez
Em 29-03-2010 15:09, Celinio Fernandes escreveu: Thanks. I already read about it but does it work well with Struts 2 ? Yes, I'm using it with S2. Include it in JSPs like this %@ taglib uri=http://displaytag.sf.net; prefix=display % then, for example for a listing of users: display:table

Re: [Struts 2.1.8.1] Internationalization: how to remain in the current page ?

2010-03-25 Thread Alex Rodriguez Lopez
Hi Zoran, would you mind sharing the code of this tag? It would be helpful to me, as somehow I've been able to link to the same sction with an empty url tag but unable to retain params. Thanks! Em 24-03-2010 22:42, Zoran Avtarovski escreveu: I wrote a small custom tag which builds the link

Re: Form values getting empty After validation failure

2010-03-24 Thread Alex Rodriguez Lopez
Hi, don't know if it will be usefull, but some days ago someone in the user list suggested using the getters and setters of the properties that map to your form to call get() and put() methods of the current session ( ActionContext.getContext().getSession() ) , so you get automatic session

Re: How to get s:select id and name under struts2 action?

2010-03-23 Thread Alex Rodriguez Lopez
Assuming your ids are of type long, you could do it with a list of Long like so in your action: private ListLong test = new ArrayListLong(); plus the getters and setters (getTest(), setTest()). test is the name you gave in the select (s:select name=test ... /). Struts2 will polulate the list

Re: How to get s:select id and name under struts2 action?

2010-03-23 Thread Alex Rodriguez Lopez
Forgot to mention, this is the case with a multiple select, if the select is simple and only one option can be selected, then a bean property for an int or long will sufice. Em 23-03-2010 09:33, Alex Rodriguez Lopez escreveu: Assuming your ids are of type long, you could do it with a list

Re: legend don't work under s:form of struts2

2010-03-15 Thread Alex Rodriguez Lopez
Hi! This might be related to the theme the form is using, http://struts.apache.org/2.1.8.1/docs/themes-and-templates.html This happened to me too, the default s2 theme adds table elements to forms for layout, and trying to use fieldsets results in them being rendered apart from the form

Freemarker error on form submit with checkboxlist

2010-03-15 Thread Alex Rodriguez Lopez
Hi all, I ran into a strange error when using a checkboxlist, backed by a list of usergroups (roles) objects. The error shows not when the form is displayed (it all works as expected) but when submitting the form with the checkboxes on it. Using 2.1.8.1 Could somebody please tell me if this

Re: Freemarker error on form submit with checkboxlist

2010-03-15 Thread Alex Rodriguez Lopez
Solved, the list and name atributes of checkboxlist cannot have the same name: name=roles list=roles this is what caused the problem. Em 15-03-2010 13:16, Alex Rodriguez Lopez escreveu: Hi all, I ran into a strange error when using a checkboxlist, backed by a list of usergroups (roles

Re: Encoding of french characters in s:property /

2010-03-11 Thread Alex Rodriguez Lopez
Hi Ulf, do you have your charset declared as utf8 like this? %@ page contentType=text/html; charset=UTF-8% Maybe you have to write the special characters in the string as html entities... Em 11-03-2010 09:10, Ulf Liedén escreveu: Hi all, my first post to this list :-). Sorry if I'm double

Re: About the better way to implement a JSP in read/edit mode

2010-03-10 Thread Alex Rodriguez Lopez
I do tend to think that the less files the better. Here it's the same with the number of files for actions/jsp, one can use more actions, ore less actions but more methods inside. Same with jsp, I do think it's better with less files, but a colleague here also thinks the opposite, sometimes

Changing locale and retaining previous query url params

2010-03-10 Thread Alex Rodriguez Lopez
Hi! I have the following code in a tile I use on nearly every page of my app: s:if test=%{#request.locale.language == 'pt'} a href=c:url value= c:param name=request_locale

Re: possible s:submit with parameter?

2010-03-08 Thread Alex Rodriguez Lopez
You can use hidden fields inside of the form which will be sent too on submit as GET or POST params(usually good for IDs). Alex Em 05-03-2010 23:13, Adam Pinder escreveu: Any form textfield will be submitted when page submitted which is effectively a parameter. Adam On 5 Mar 2010, at 19:46,

Re: struts 2 - framework question

2010-03-08 Thread Alex Rodriguez Lopez
It looks to me that you could use a combination of packages for each store with different namespaces, but to save code repetition it would be good idea to use wildcards (or go for the restful way as already suggested) in the config files and later on the action retrieve the full url to see

Re: AJAX Validation (calls to action methods work on submit, but messages not displayed nor page redirected)

2010-03-08 Thread Alex Rodriguez Lopez
I'm thinking this might be related to the AJAX Theme thing... is this required to work with AJAX validation? Any other requeriments aside from including the sx:head tag? Em 08-03-2010 11:11, Alex Rodriguez Lopez escreveu: Hi! I'm updating validations on my app to use AJAX. I followed

Re: Locale and custom variables

2010-03-04 Thread Alex Rodriguez Lopez
Em 04-03-2010 05:49, abhishek jain escreveu: Hi friends, I have a few variables who have diff values depending on the locale / country. I do want to use a message-resources for storing the values of those varaibles, I do not know how to get these variables in my Action (I want them in action

Re: Locale and custom variables

2010-03-04 Thread Alex Rodriguez Lopez
Em 04-03-2010 14:15, abhishek jain escreveu: On Thu, Mar 4, 2010 at 7:30 PM, Alex Rodriguez Lopezalo...@flordeutopia.pt wrote: Em 04-03-2010 05:49, abhishek jain escreveu: Hi friends, I have a few variables who have diff values depending on the locale / country. I do want to use a

Re: When I link to a *.do I get Page not found

2010-03-01 Thread Alex Rodriguez Lopez
Em 27-02-2010 13:30, Søren Blidorf escreveu: I have made a struts application and it works just fine on my testserver. I have now uploaded it to my hosted webserver and struts does not work. When I link to a *.do I get “Page not found” Could it be a Tomcat config problem. Placing the

Re: How to pass HTTPRequest between two JSP ?

2010-03-01 Thread Alex Rodriguez Lopez
Em 28-02-2010 23:26, Frederik Minatchy escreveu: Hello... Since a few days I am working with Struts 2. (2.1.6) I am facing a big problem with HttpRequest and JSPs. Well... I have to forward a HTTPRequest from page1.jsp to page2.jsp So... How can I pass HTTPRequest attribute betwen 2 pages?

Re: Nabble and mailing list archives

2010-02-26 Thread Alex Rodriguez Lopez
Em 25-02-2010 18:54, Greg Lindholm escreveu: This mailing list on Nabble seems to be gone, at least I can't find it. Nabble switched over to a new system and old system is now at old.nabble.com but doesn't seem to be getting updates anymore. Anyone working to get this mailing list archived on

Re: Way to forcefully reload struts.xml [struts2]

2010-02-26 Thread Alex Rodriguez Lopez
Em 26-02-2010 06:06, Bhaarat Sharma escreveu: We are seeing a situation where certain namespaces/actions are getting error There is no action mapped for namespace ... and action ... on the server. However, on our local we do not get this error. Which leads us to believe that struts.xml might

Description of current struts-2.1.8.1\lib content

2010-02-24 Thread Alex Rodriguez Lopez
Hi! I've recently started a job as a webapp developer. I've been some days already working out how Struts 2 works, I'm the kind of person who likes to know exactly what's going on at all moments, so I rather assemble my own app taking what I need at every moment that work from an example.

Re: Description of current struts-2.1.8.1\lib content

2010-02-24 Thread Alex Rodriguez Lopez
Em 24-02-2010 16:32, Lukasz Lenart escreveu: 2010/2/24 Alex Rodriguez Lopezalo...@flordeutopia.pt: Hi! I've recently started a job as a webapp developer. I've been some days already working out how Struts 2 works, I'm the kind of person who likes to know exactly what's going on at all