Handling navigation language in the URL

2011-05-07 Thread GF
Hello i've a site that behave this way: ContextPath = /myapp Namespace = /user Action = view So, I deploy an application called mypath.war and I handle urls like: /myapp/user/view.action I wish to handle multilanguage and i wish to handle it in the url, like /en /de /fr /de and so on. Since

Re: Handling navigation language in the URL

2011-05-07 Thread GF
Yes, but i want to make some nice SEO urls. Thanks anyway On Fri, Apr 15, 2011 at 11:09 AM, Partha Chakraborty par...@ontrackindia.com wrote: You can send that as parameter Partha Chk -Original Message- From: GF [mailto:gan...@gmail.com] Sent: Saturday 7 May 2011 1:53 PM

Handling wildcard action names with dot.

2011-03-01 Thread GF
I configured struts to handle url mapping with no extensions this way constant name=struts.action.extension value=,, / With this action mapping action name=* class=myAction method=myMethod param name=myId{1}/param result type=tilesmyTile/result /action

Alternative UrlRenderer bean

2010-11-15 Thread GF
Hello everyone. i want to use a custom UrlRenderer bean. reading Struts2 source code i found that is used to render the URLs generated by s:url .. If in my struts.xml I insert: bean type=org.apache.struts2.components.UrlRenderer name=mystruts class=org.apache.struts2.components.MyUrlRenderer/

Struts 2.1.8.1 custom freemarker template path

2010-02-04 Thread GF
Hello. is anyone using successfully Struts 2.1.8.1 using a CUSTOM freemarker template path (placed in the Web Application and not in the classpath)? I mean: constant name=struts.ui.theme value=css_xhtml / constant name=struts.ui.templateDir value=customdirectory / It seems that

Re: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
Thank You for the nice comment. I just wrote some code snippets for the tutorials.. i didn't have enough time to build a full eclipse web project, if you have some difficulties, ask :-) On Mon, Jul 13, 2009 at 12:33 AM, Frans Thamurafr...@meruvian.org wrote: Cool. Can I have the full code? Frans

Re: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
You're absolutely right, but there is a security reason, in real-world application, the objects i get from business service, are usually JPA entities, and putting a full JPA entity on the json result will lead to issues in the case there are some properties of that object that have to kept hidden

Re: Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-13 Thread GF
You're right too ;-) I didn't want to substitute to the plugin documentation. I'd prefer the include properties behaviour anyway. I believe a good idea could be to use @JsonInclude annotation on the entity properties to define (just ONE time on the entities) which of their properties are safe to

Struts2, JQuery and JSON result to create a dynamic ajax website

2009-07-12 Thread GF
Hello all, i wrote a simple guide that explains how to use together Struts2 and JQuery to create dynamic content with Ajax and JSON. http://www.zulutown.com/blog/2009/07/12/ajax-dynamic-content-with-struts2-jquery-and-json-plugin/ I hope someone can appreciate it Thank You

Re: REST Plugin only for some actions

2009-03-24 Thread GF
Is this a TODO or is it already available? On Tue, Mar 24, 2009 at 4:06 AM, dusty dustin_pea...@yahoo.com wrote: Ultimately, we should declare what are resources and get the free mapping from the REST plugin for those Controllers.  Seems like that is what the NamspaceBasedActionMapper is, but

Struts 2.1 Rest and Convention Tutorial

2009-01-28 Thread GF
Hello everyone. After the release of Struts 2.1 as GA (in 2.1.6) I decided to write a quite simple tutorial about creating a basic application that uses the features of Struts2 Rest Plugin and some of Convention Plugin. If someone might be interested, here you can read it:

[S2] Testing, getting jsp output.

2008-09-26 Thread GF
Hello I'm writing tests on application that uses Struts2. To test the actions, I use about a technique similar to the one described here http://itefforts.blogspot.com/2007/08/struts2-spring-junit.html I wish to do more and test the Jsp (and Tiles) output too. That code does this: response = new

Re: [S2] Testing, getting jsp output.

2008-09-26 Thread GF
Thanks for your answer. Really now i prefer to keep on standard testing from java side. Anyway I bookmarked selenium website. 2008/9/26 Paweł Wielgus [EMAIL PROTECTED]: Hi GF, it's not exactly answear for Your question but i find selenium family very usefull. But i don't know if it's

Server Side caching of .action(s)

2008-08-07 Thread GF
Hello. I want to do some server side caching of some specific .action of my websites. I am currently working on the CacheFilter of OsCache, but it doesn't seem very good and has some limitations I don't like. Can you suggest me some good open source alternatives to analyze? Thanks

Re: Server Side caching of .action(s)

2008-08-07 Thread GF
] wrote: Apache HTTPD :- http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#forwardreverse GF wrote: Hello. I want to do some server side caching of some specific .action of my websites. I am currently working on the CacheFilter of OsCache, but it doesn't seem very good and has some

Fwd: [s2] Google XML Pages (GXP) to replace Freemarker in tags?

2008-08-07 Thread GF
I'm curious to know more about this. Which google apps do use Struts2? Thanks! On Sat, Jul 26, 2008 at 7:02 AM, Don Brown [EMAIL PROTECTED] wrote: It is pretty well known that Google uses WebWork 2 and Struts 2 in many of its applications,

[S2] Spring: Interceptors, prototype or singleton?

2008-04-14 Thread GF
an interceptor as Prototype, or is it ok? Thanks GF

Re: s:property in s:* not interpreted

2008-03-19 Thread GF
Is this the standard JSP syntax? On Mon, Mar 17, 2008 at 3:08 PM, Dave Newton [EMAIL PROTECTED] wrote: --- GF [EMAIL PROTECTED] wrote: ...unless you use the XML syntax available from JSP 2.0 and later ;-) And in this case, how can you resolve the div id=s:property... ? div id=${aProperty

Re: s:property in s:* not interpreted

2008-03-19 Thread GF
I noticed that since some version of Struts2 it is now forbidden inside s: tag attributes.. right? On Wed, Mar 19, 2008 at 2:54 PM, Dave Newton [EMAIL PROTECTED] wrote: --- GF [EMAIL PROTECTED] wrote: Is this the standard JSP syntax? JSP 2.0 EL. Dave

[S2] variable of variable in OGNL?

2008-03-17 Thread GF
I have something like %{#application.one.two.three} is it possible to do something like: %{#application.%{stringVariable}.two.three} Thanks.

Re: Struts 2 scheduler

2008-03-17 Thread GF
Yes, I usually use Quartz inside Spring. If I remember correctly there is a chapter about Scheduling in the big Spring manual On Fri, Mar 14, 2008 at 3:47 AM, alex xander [EMAIL PROTECTED] wrote: thx all, i solve my problem with quartz, i used it with spring thx so much

Re: should I learn struts 1 first before learning struts 2?

2008-03-17 Thread GF
I learned Struts2 without knowing anything about Struts1. But I'm a little curious to take a look to Struts1 too. But just for personal knowledge. On Fri, Mar 14, 2008 at 7:51 PM, akoo [EMAIL PROTECTED] wrote: Hi, forgive me if this has been asked before. I am just starting on struts and

Re: How to initialize business service objects?

2008-03-17 Thread GF
I suggest you to read this simple but useful tutorial to have an idea about how much is simple to use Struts2+Spring+Hibernate together. http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html On Thu, Mar 13, 2008 at 10:32 PM, Frank Fischer [EMAIL PROTECTED] wrote: Now i don't

Re: s:property in s:* not interpreted

2008-03-17 Thread GF
...unless you use the XML syntax available from JSP 2.0 and later ;-) And in this case, how can you resolve the div id=s:property... ?

Re: [S2] accessing #application and #request from a Interceptor

2008-03-17 Thread GF
On Mon, Mar 17, 2008 at 10:06 AM, GF [EMAIL PROTECTED] wrote: I have some data stored in #application.mymap Inside and interceptor I want to put some of this data in #request.anothermap How can I access them? About the #request, is it right to do this? final ActionContext context

[S2] accessing #application and #request from a Interceptor

2008-03-17 Thread GF
I have some data stored in #application.mymap Inside and interceptor I want to put some of this data in #request.anothermap How can I access them? About the #request, is it right to do this? final ActionContext context = invocation.getInvocationContext(); request =

[S2] Mapping a result string for all the actions

2008-03-10 Thread GF
I've an action like this: action name=myAction class=myClass method=myMethod ... result name=myResultName type=redirect/path/my.action/result /action I would like that, when any action method in my application returns myResultName, a redirect to /path/my.action should be executed. Any idea about

Re: [S2] Mapping a result string for all the actions

2008-03-10 Thread GF
Thank you It's exactly what I was looking for! On Mon, Mar 10, 2008 at 3:34 PM, Lukasz Lenart [EMAIL PROTECTED] wrote: Hi, You can use global-results http://struts.apache.org/2.0.6/docs/result-configuration.html

[S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread GF
I want to do a simple thing, I have an action like this public class MyAction { private String myVar; public setMyVar(String myVar) { this.myVar = myVar; } } Inside my Interceptor i want to put in my Action a string inside myVar property of the Action. In few words, I need to discover if the

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread GF
On Thu, Mar 6, 2008 at 1:52 PM, Adam Hardy [EMAIL PROTECTED] wrote: I didn't see the second half of your message until I'd sent that. What calls to the setters are you asking about? Do you mean any random property? Are you talking about HTTP parameters? In few words, I have a property

Re: [struts] about paramsPrepareParamsStack

2008-02-14 Thread GF
Almost. Really it should be the other way around, since you don't want user-set parameters to override your static parameters. I agree with you. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

about paramsPrepareParamsStack

2008-02-13 Thread GF
paramsPrepareParamsStack is defined this way: interceptor-stack name=paramsPrepareParamsStack interceptor-ref name=exception/ interceptor-ref name=alias/ interceptor-ref name=params/ interceptor-ref name=servletConfig/

[s2] alternative path for the validation xml?

2008-02-05 Thread GF
Is there anything alternative (apart annotation) to place validation xml for the action method in the same package of the action classes? I don't like to place .xml in the same directory of the .java Any idea (apart annotation) thanks.

Editing an entity in Struts2

2008-02-05 Thread GF
I want to edit an entity, i.e. a Message i would set the .jsp field this way s:textfield name=message.title / on the MessageAction i would have a edit method that takes the messageID and then call the business service to load the Message object, so in the .jsp the file the textfield are loaded

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
Hi Antonio, as I mentioned in a previous post, it's not so simple as the href attribute of s:a can legally contain javascript or vbscript. I think that the problem about a in href attribute is the double quote character, because it will close the href attribute, then with a greater than

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
On Jan 15, 2008 2:45 PM, Martin Gainty [EMAIL PROTECTED] wrote: Hi Ganfab Are you suggesting the href contents disable javascript to disable XSS script attacks?Martin No, I think that maybe can be useful to think if doing some checks to href attribute of s:a is possible to look for double

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
It could be a solution, but: a href=javascript:alert(quot;byequot;)Greet/a simply works. Didn't know. I'm not very into javascript coding :-) However I think that preventing double quote in some way, can be good. - To

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
Are you suggesting that javascript injection in href be disabled to prevent XSS attacks? I'm suggesting that is better that the variable inside s:a href=%{myVar} should NOT close the generated a because this would make the browser to execute the eventual javascript automatically on the page

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
Or better, escape them with their corresponding entity. What do you think about s:a href=%{myVar} doubleQuoteEncoding=none | urlEncode | htmlEncode | convertToSingleQuote .../s:a - To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-15 Thread GF
Well, Or better, escape them with their corresponding entity. Antonio Myabe i'm wrong, but: In XHTML this is wrong: a href=javascript:window.alert(Example of a link that displays an alert box); because i use double quotes inside a javascript, inside a href tag delimited by double quotes.

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-14 Thread GF
the cookies (and sessions...) of our users... In few words if a hacker found where we put a variable from the DB in a s:a and he has a way to store in that DB record a malicious code.. the security of every user of our website will be in danger. Can be acceptable such a thing? Any thoughts? GF On Jan

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-14 Thread GF
It is a bug, since ganfab (sorry I cannot read your name :-) ) tried I'm Fabio Gandola. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-14 Thread GF
I think that there are two levels of encoding: 1) in s:url, the parameters values must be encoded, to create a valid (and safe) URL. 2) in s:a, the whole URL must be encoded, simply because it is used inside an HTML element (a) between double quotes. For example, '' becomes amp; So do you

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-14 Thread GF
Fabio, one little question. I don't see how this code can write the parameter passed to the JSP page. Probably you pasted the wrong code in the s:url part. Just add (i.e. in IE6) after the ? the following query string: 'scriptalert('helloworld')/script

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-14 Thread GF
Sorry again Fabio, but I need to understand: the querystring does not seem to have a param=value structure, and s:url has test as action, and does not take any dynamic value (i.e. parameter), but maybe I am missing something. The bug is calling that page itself (I mean XSS.jsp) passing via

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-13 Thread GF
I don't think this is a critical problem sheerly because the high prevalence of such vulnerabilities means some of the responsibility falls on the developer to not trust user-entered data.. The specific vulnerability is that when includeParams != none, the request URL was rendered unmodified

Re: [S2] No JavaScript in TabbedPanel

2008-01-13 Thread GF
Johannes i got same problem time ago. The script/script is removed from page included by s:div and the only thing you've is a execution on first page load.. but in few words you cannot keep function definition inside the page included with a s:div. It's really a strange thing.. but it is. On Jan

Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-12 Thread GF
I posted this bug report on the issue tracker: https://issues.apache.org/struts/browse/WW-2414 In simple words, if you use s:url ... to build an url that is used with s:a ... the HTML written out will not have the querystring encoded.. and this lead to very dangerous XSS attacks. %@ page

Re: [S2] No JavaScript in TabbedPanel

2008-01-12 Thread GF
Time ago I noticed that javascript were removed in the pages linked by s:div .. is this your case too? On Jan 12, 2008 12:34 PM, Johannes Geppert [EMAIL PROTECTED] wrote: Hello, I have a Tabbed Panel and will execute JavaScript in the div Tabs. But the Scripts will not be executed, I use

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-12 Thread GF
The javascript is executed using Internet Explorer 6 with all of its patches installed. The exact query string to do an XSS attack is this 'scriptalert(document.cookie)/script However I think the problem is not browser related, if you use s:url and a: as I wrote before, it echoes a non encoded

Re: Feedback: WW-2414, XSS attack is possible if using s:url ... and s:a ...

2008-01-12 Thread GF
Of course, to raise this security issues, the includeParams attribute parameter of s:url should be different by none - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Struts2 actions' extension

2008-01-12 Thread GF
If you are using apache+tomcat, you can place static file in a directory not handled with mod_jk On Jan 12, 2008 6:28 PM, Filipe David Manana [EMAIL PROTECTED] wrote: Hi, I have set the property struts.action.extension to the empty string. I can now invoke my actions with the default .action

Re: Progress Bar

2008-01-12 Thread GF
Well, i think you should keep on the server some tracking of the complete percentile of the task. Then with some ajax you periodically ask to the server the task status and update the html page. Just an idea. On Jan 11, 2008 10:14 PM, fea jabi [EMAIL PROTECTED] wrote: Working a process which

[S2] s:url / encode

2008-01-11 Thread GF
Hi all I'm using Struts 2.0.6 If I try to set encode to true and I pass in the URL get some bad characters.. such as '', '' it doesn't encode them when it generates the URL with s:url Is this a bug? Has been fixed in recent version? Thanks

[S2] simple question about s:set

2008-01-08 Thread GF
.. Thanks GF - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: learning struts/spring?

2008-01-08 Thread GF
is there any nice tutorial which covers the basic with step by step examples so that i can catch up. I think this is the best place to start http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html - To unsubscribe,

Re: struts2 spring plugin

2008-01-08 Thread GF
Yes, on Spring 2 it is : scope=prototype On Jan 7, 2008 8:41 AM, Joachim Ansorg [EMAIL PROTECTED] wrote: Brian, I guess you are using Spring 2.x. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: [S2] simple question about s:set

2008-01-08 Thread GF
Oh.. Thanks so much! You saved me from a lot of troubles. If possibile it would be great to add it on the wiki page.. Thank you! GF The value attribute is treated an OGNL expression so John Jackson means its trying to access a property with that name. Instead, you need to tell it you're

[S2] rendering a matrix (like a chessboard)

2008-01-07 Thread GF
I have matrix of objects.. somekind like ChessBoardPosition[][] I want to render it using Struts2. You can imagine my matrix as a Chessboard.. I use 2 iterators, to iterate over columns and rows, and finally i want to render the single object inside the matrix, that will be a empty position of

Re: [S2] Adding a new interceptor to every package.

2008-01-05 Thread GF
Really I have still some issues. my struts.xml is built in this way: struts include file=struts1.xml / include file=struts2.xml / include file=struts3.xml / In every included xml i define a different package for a different section of the, i.e. in struts1.xml I define the package name=one If I

[S2] Adding a new interceptor to every package.

2008-01-04 Thread GF
default-interceptor-ref name=myStack/ ... /package But I should do this to Every one.. and it is not nice.. Can you suggest me a quicker (and more elegant) way? Thank you! GF - To unsubscribe, e

[S2] and XSS

2008-01-04 Thread GF
Hi all. Is there any document about how to automatically handle security issues related to Cross Site Scripting on websites managed with Struts2? I'm thinking about my own strategy, but I would like to know if anything already exists. Thank you GF

[S2] getting the Servlet Exception in a custom error page.

2007-12-27 Thread GF
Hi everyone. I'm using Struts2, and i'm trying to create a custom error page. The default Tomcat error page show something like this: _ HTTP Status 500 type Exception report message description The server encountered an internal error () that prevented it from fulfilling this

Re: localization issue for Italian language (package_it.properties)

2007-12-05 Thread GF
it's the N-th time you post the same stuff. On Dec 4, 2007 6:03 PM, Gigliotti, Andrea [EMAIL PROTECTED] wrote: If you have struts 2.0.11 or 2.0.9 you can deploy the struts2-blank-2.0.11.war file located into the apps folder (ex. C:\struts-2.0.11\apps). Before deploying the web app you have

Re: [S2] Ognl in s:if

2007-12-05 Thread GF
Have you tried: aContainerObject.set2.contains(#top) On Dec 5, 2007 11:27 AM, LEONARD Julien (Consulting for ACCOR Hotels) [EMAIL PROTECTED] wrote: Hello all, I have two Set of objects. The set1 is the reference set (with all objects) and set2 some on list1 elements. All elements are the

Re: startup action in struts2

2007-12-05 Thread GF
I suggest you to consider Spring Framework and Quartz. On Dec 4, 2007 4:52 AM, Christopher Cheng [EMAIL PROTECTED] wrote: In struts1, I have a few plugin to preconfigure some services such as QuartzPlugIn during startup public void init(ActionServlet actionServlet,

Re: [S2] Ognl in s:if

2007-12-05 Thread GF
work too. -Message d'origine- De : GF [mailto:[EMAIL PROTECTED] Envoyé : mercredi 5 décembre 2007 12:30 À : Struts Users Mailing List Objet : Re: [S2] Ognl in s:if Have you tried: aContainerObject.set2.contains(#top) On Dec 5, 2007 11:27 AM, LEONARD Julien (Consulting for ACCOR

[s2] (non trivial) custom made Interceptor and Action testing.

2007-11-21 Thread GF
Hello, maybe someone of you have any good link about a non-trivial custom made interceptor and about some action testing? Thank you very much. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: [s2][ognl] s:set .. and s:if .. with a string.

2007-11-20 Thread GF
Ok, thank you again. On Nov 20, 2007 11:21 AM, LEONARD Julien (Consulting for ACCOR Hotels) [EMAIL PROTECTED] wrote: In fact belong my experience of Struts2, the good way to make an expression is with %{ }. And for all variables declared in JSP (s:set, or status of s:iterator ) are

[s2][ognl] s:set .. and s:if .. with a string.

2007-11-20 Thread GF
I have this code: s:if test=myVar == 'myvalue' XXX /s:if s:set name=otherVar value=%{myVar} / s:if test=otherVar == 'myvalue' YYY /s:if This code shows XXX but doesn't show YYY. How can I satisfay the second test? Thank you.

Re: [s2][ognl] s:set .. and s:if .. with a string.

2007-11-20 Thread GF
Wow. Now It works. Can you explain me the difference with my version? Or have you any good link to some guide to understand what I did wrong? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,