Locale SEO permanent link URLs in Struts2

2010-01-03 Thread Ignacio de Córdoba

Hi there,
I have several working struts2 applications using i18n bu have an issue I
need to solve.
From the user perspective, the struts2 request_locale parameter approach is
perfect but as locale information is stored in session, urls visited by a
user (or robot) are not locale specific.
Is there a recommended approach in struts2 to do something like:

http://www.mysite.com/index.action  (english)
http://www.mysite.com/es/index.action 
http://www.mysite.com/fr/index.action 

Both should return the same code, changing only the locale. The main english
site should always return content in english locale, even if user has
visited the /es/index.action and so has changed the locale to spanish.

I've been thinking about extending the i18n interceptor to make struts work
this way and not storing locale in session, but maybe I'm missing something.

Of course, I also have the problem of mapping the /LANGUAGE/*.action
I wouldn't like to add mapping for every language I plan to use.

(I've also been thinking about using www.mysite.com for english,
es.mysite.com, fr.mysite.com, ... and making the custom incerceptor force
locale based on subdomain... I don't really like this option anyway)

thanks for any comments/ideas/directions,

Ignacio
-- 
View this message in context: 
http://old.nabble.com/Locale-SEO-permanent-link-URLs-in-Struts2-tp27007987p27007987.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions

2009-12-07 Thread Ignacio de Córdoba

Which  appserver are you using?
I use JBoss for struts2 plugin. I hace to modifyit as it didn't support
JBoss 5 naming conventions (at least for me) and it only looked for
annotations in current class, so if you injected a Session Bean in a
super.execute() method in a parent class, it was not looked up.

Anyway, I am considering moving to EJB 3.1 and hope I can find a new way of
injecting new EJBs...


Fernandes Celinio wrote:
 
 Hi,
 I know that it is not possible to inject EJB in Struts 2 actions.
 The following annotation would not work :
 @EJB
 MyBeanLocal mybean;
  
 But how come ? Since a Struts action is a servlet and injection works in
 a servlet, injection should work.
  
 Thanks for enlightening me.
  
 
 

-- 
View this message in context: 
http://old.nabble.com/-Struts-2-%2B-EJB-3--injection-of-EJBs-into-struts-2-actions-tp26641329p26683752.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



EJb 3.1 (dependency injection) and Struts2 actions ¿CDI/Weld needed?

2009-12-07 Thread Ignacio de Córdoba

Hi there,
I'd like to know if there is a recommended approach to deal with dependency
injection on new EJB 3.1 EJBs.
I am using now a modified version of JBoss Struts2 plugin with works great
but it really does nothing more than regular JNDI lookups on every action
request call.
I wonder if there is a new approach to getting EJB 3.1 session beans
(stateless to be precise) which is what mostly I have to deal with. I've
seen in the DEV forum that a plugin for CDI/Weld is coming (hopefully soon).
Should we have to wait for this plugin or there is a simple approach to just
inject new EJBs in struts2 actions? (@EJB... ? :-) )
Of course, I have already tested new GlassFish v3, even though I'll probably
be using new JBoss 6 (I have already tested it with my previous EJB3 Struts2
projects and works ok, so I'd like to start my new projects directly with
EJB 3.1)

Thanks for any directions.
-- 
View this message in context: 
http://old.nabble.com/EJb-3.1-%28dependency-injection%29-and-Struts2-actions-%C2%BFCDI-Weld-needed--tp26684100p26684100.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



s2: validation of checkbox a radio button

2009-11-18 Thread Ignacio de Córdoba

Hello,
I am trying to use client side validations through ...-validation.xml in
struts2
I have it working but only for text and file input fields. I need to
validate if a checkbox is checked. using required or requiredstring
validators always validates as the field as a value even if you don't
checkit. I guess the same happens with a group of radio buttons. (all with
the same field name). They have a value.

I have not found a OGNL expression that might work.

Anybody know how to solve this? I'd like to use simple client side
validation.

Thanks,
Ignacio
-- 
View this message in context: 
http://old.nabble.com/s2%3A-validation-of-checkbox-a-radio-button-tp26418892p26418892.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Localized key values in s:select

2009-11-12 Thread Ignacio de Córdoba

Hello, 
I wonder if it is possible to make s:select tag localize the content of
option elements. I am using: 

s:select labelposition=left key=category id=category
list=%{categories}  listKey=id listValue=name emptyOption=true/ 

I'd like attribute listValue=name property value if the objects iterated
not to be shown as is but to be used as a key to the language property
files... just like the key attribute value (category in this example) is
localized. 

¿Is it possible or I must pre-populate the list with already localized
strings? 

Thanks, 
Ignacio
-- 
View this message in context: 
http://old.nabble.com/Localized-key-values-in-s%3Aselect-tp26323814p26323814.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Using Struts2 JQuery drag drop

2009-11-04 Thread Ignacio de Córdoba

Hello,
I agree with your point of view, but sj: tags are a good start point to get
introduced to JQuery. I'll look anyway at remote divs the jQuery direct
way...

Thanks for your reply


Sparecreative wrote:
 
 Hey Ignacio,
 
 I’m not a big fan of integrated ajax functionality. While it provides a
 simple solution at first when you need something a little more complex or
 customised it starts to show it’s limitations.
 
 Rather than using the sx;div tag why not just use a plain div and then use
 a
 jQuery ajax call, which can be triggered by your drag and drop event, to
 retrieve the content from the server side. I suspect that you want to pass
 your event coordinates to the server and display something appropriate.
 
 I don’t use S2 ajax plugin as I’ve been burnt by it too often. So,
 somebody
 else may be of more help on that front.
 
 Z.
 
 Hello Z.,
 you are right. I am really new to JQuery  Javascript as I've just
 focused
 into server side programming. I'm not a javascript fan... I have to use
 it
 anyway.
 I have already solved the coords. problem  in JQuery dragdrop. There
 seem
 to be many docs about it in the net. Anyway, I haven't solved the other
 important problem and is how to trigger a struts2 remote div from
 javascript. The JQuery drop listener is a javascript function. I have the
 available and need to invoke a sx:div (old method) or the new sj:div to
 process them and show the result in the same page ; Any example over
 there?
 
 Thanks
 
 I'll get that JQuery book :-)
 
 
 Sparecreative wrote:
  
  Hi Ignacio,
  
  It not jQuery specific but more extracting the coordinates of the
 event
  using javascript. Depending on what your doing you have six pairs to
  choose
  from:
  
  clientX,clientY
  layerX,layerY
  offsetX,offsetY
  pageX,pageY
  screenX,screenY
  x,y
  
  Without knowing exactly what you¹re doing, I can only really give you
  general advice, but you could take the coordinates from the event and
 pass
  them via ajax and then use the response as required.
  
  I¹m apologise if I¹m being presumptuous but I suspect that you¹d
 really
  benefit from a good book on both javascript and jQuery.
  
  Z.
  
  
  Hello,
  I am looking at last version of Struts2 JQuery plugin and looks
 graet.
  Unfortunately I am really new to JQuery. I've been doing things with
  discontinued Dogo plugin but have found that the drag  drop tags in
  JQuery
  plugin could really fit for a Rich Int. App I have in mind. Hope
 somebody
  here can help me with a simple scenario.
  I would need to drop a small image into a bigger image; as far as
 I've
  seen
  that's no problem. The problem is that example in the showcase just
 shows
  a
  simple javascript subscribing to the drop action. I would need to
 get the
  coords where the small image/div was dropped and execute a remote
 DIV (to
  a
  struts2 action) sending those coords as parameter so that the remote
 div
  shows the results some processing with that simple data.
  
  Anybody could point me on how to:
  A) Get the coords inside the big div where the small image was
 dropped.
  B) How to set those x  y coords as a remote div action parameters.
  
  Hope this is simple to achieve.
  
  Thanks for any directions,
  Ignacio
  
  
  
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Using-Struts2-JQuery-drag---drop-tp26147665p26193636.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Using Struts2 JQuery drag drop

2009-11-02 Thread Ignacio de Córdoba

Hello Z.,
you are right. I am really new to JQuery  Javascript as I've just focused
into server side programming. I'm not a javascript fan... I have to use it
anyway.
I have already solved the coords. problem  in JQuery dragdrop. There seem
to be many docs about it in the net. Anyway, I haven't solved the other
important problem and is how to trigger a struts2 remote div from
javascript. The JQuery drop listener is a javascript function. I have the
available and need to invoke a sx:div (old method) or the new sj:div to
process them and show the result in the same page ; Any example over there?

Thanks

I'll get that JQuery book :-)


Sparecreative wrote:
 
 Hi Ignacio,
 
 It not jQuery specific but more extracting the coordinates of the event
 using javascript. Depending on what your doing you have six pairs to
 choose
 from:
 
 clientX,clientY
 layerX,layerY
 offsetX,offsetY
 pageX,pageY
 screenX,screenY
 x,y
 
 Without knowing exactly what you¹re doing, I can only really give you
 general advice, but you could take the coordinates from the event and pass
 them via ajax and then use the response as required.
 
 I¹m apologise if I¹m being presumptuous but I suspect that you¹d really
 benefit from a good book on both javascript and jQuery.
 
 Z.
 
 
 Hello,
 I am looking at last version of Struts2 JQuery plugin and looks graet.
 Unfortunately I am really new to JQuery. I've been doing things with
 discontinued Dogo plugin but have found that the drag  drop tags in
 JQuery
 plugin could really fit for a Rich Int. App I have in mind. Hope somebody
 here can help me with a simple scenario.
 I would need to drop a small image into a bigger image; as far as I've
 seen
 that's no problem. The problem is that example in the showcase just shows
 a
 simple javascript subscribing to the drop action. I would need to get the
 coords where the small image/div was dropped and execute a remote DIV (to
 a
 struts2 action) sending those coords as parameter so that the remote div
 shows the results some processing with that simple data.
 
 Anybody could point me on how to:
 A) Get the coords inside the big div where the small image was dropped.
 B) How to set those x  y coords as a remote div action parameters.
 
 Hope this is simple to achieve.
 
 Thanks for any directions,
 Ignacio
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Using-Struts2-JQuery-drag---drop-tp26147665p26156663.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Using Struts2 JQuery drag drop

2009-10-31 Thread Ignacio de Córdoba

Hello,
I am looking at last version of Struts2 JQuery plugin and looks graet.
Unfortunately I am really new to JQuery. I've been doing things with
discontinued Dogo plugin but have found that the drag  drop tags in JQuery
plugin could really fit for a Rich Int. App I have in mind. Hope somebody
here can help me with a simple scenario.
I would need to drop a small image into a bigger image; as far as I've seen
that's no problem. The problem is that example in the showcase just shows a
simple javascript subscribing to the drop action. I would need to get the
coords where the small image/div was dropped and execute a remote DIV (to a
struts2 action) sending those coords as parameter so that the remote div
shows the results some processing with that simple data.

Anybody could point me on how to:
A) Get the coords inside the big div where the small image was dropped.
B) How to set those x  y coords as a remote div action parameters.

Hope this is simple to achieve.

Thanks for any directions,
Ignacio
-- 
View this message in context: 
http://old.nabble.com/Using-Struts2-JQuery-drag---drop-tp26147665p26147665.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Redirecting from mapping error exceptions

2009-10-17 Thread Ignacio de Córdoba

Hello,
2 years now from your question I wonder if you solved this. I'd like to do
exactly the same thing... redirecting any non existing action or error from
the user when entering the actin URL to the home page. (I mean, any 404
error)

At first I thought about using httpd error handling for this, but struts2
standard mapping now maps everything to the struts2 filter, even static
content, so now I get the There is no Action... error for any non existing
URL in my site. I guess that means Struts has to handle it or to change the
configuration and make struts2 handle only .action calls (which is complex
as there are a lot of .js, images, etc. now in struts jars which would have
to be uncompressed)


meeboo wrote:
 
 Hey all
 
 I have the following lines in Struts.xml
 
 global-results
   result name=error/index/result
 /global-results
 global-exception-mappings
   exception-mapping result=error exception=java.lang.Throwable/
 /global-exception-mappings
 
 But it won't catch exceptions where the user has typed in an unmapped
 address, all I get is
 There is no Action mapped for namespace / and action name xxx (with status
 report 500)
 
 Can I somehow redirect all these exceptions to my index page?
 
 Thanks!
 

-- 
View this message in context: 
http://www.nabble.com/Redirecting-from-mapping-error-exceptions-tp10638948p25939426.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



localization properties files working in WEB-INF/classes and not in WEB-INF/lib/NAME.jar

2009-10-13 Thread Ignacio de Córdoba

Hi there,
I am facing a strange problem. My properties files work fine when I put them
unjarred in
/WEB-INF/classes/com/mypackage/package_en.properties 
/WEB-INF/classes/com/mypackage/package_en.properties 

but struts2 actions and tags (s:text) won't find them if I include them in
the same jar file with the actions:
/WEB-INF/lib/myActions.jar

I name them package_LANGUAGE.properties

The weird thing is that they do work in /WEB-INF/classes dir. Thanks for any
ideas on what I might be missing,

Ignacio
-- 
View this message in context: 
http://www.nabble.com/localization-properties-files-working-in-WEB-INF-classes-and-not-in-WEB-INF-lib-NAME.jar-tp25873486p25873486.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: sx:textarea border (and label...)

2009-09-24 Thread Ignacio de Córdoba

I'm sorry I haven't. To be honest, I have forgotten about sx:textarea tag and
I am using new CKEditor 3.0 ... simple to install and easy to connect into
struts2 actions (it has a file uploader option with works ok with a struts2
action). Now i'm figuring out how to include a File Dialog, but that is a
minor issue for me. CKEditor is just impressive.


h-m-g wrote:
 
 
 
 Ignacio de Córdoba wrote:
 
 Hi,
 I am using sx:textarea in several pages and the HTML visutal text editor
 renders and works ok. I'd just like to make it have a simple border, like
 every input type text or type textarea has. I'd like to do this directly
 and avoid enclosing sx:textarea in some type of div class=border to
 make it look have a real border.
 Any ideas on how to do this?
 
 Thanks,
 Ignacio
 
 P.D.: By the way... how to make label and labelposition work for
 sx:textarea?
 
 
 
 Hi Ignacio
 I am facing the same issue, by any chance did you figure out how it works?
 
 Thanks
 Hemant
 

-- 
View this message in context: 
http://www.nabble.com/sx%3Atextarea-border-%28and-label...%29-tp23377969p25579221.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Page waits to load initially with Div Dojo tag

2009-09-10 Thread Ignacio de Córdoba

Hello,
I wonder if you solved this. I'm facing the same problema and saw no info on
the docs. Also have tried with delay=0 and preload=true


Mekna wrote:
 
 I would appreciate any kind of Help, Thanks
 
 Hi,
 
 I am struts user. upgrading app from struts 2.0.11.2 to struts 2.1.6.
 
 Initial load works fine with s:div, I am not sure what am i missing using
 sx:div.
 Why does it wait for 5 secs (updateFreq value) for the first time load.
 
 Code with struts 2.0.11.2
 s:url id=d_url action=DetailAction / s:div showLoadingText=false
 id=details href=%{d_url} theme=ajax
 formId=frm_demo updateFreq=5000
 /s:div
 
 modified above code to the below one using struts 2.1.6
 s:url id=d_url action=DetailAction / sx:div showLoadingText=false
 id=details href=%{d_url} theme=ajax
 formId=frm_demo updateFreq=5000 preload=true
 /sx:div
 
 But after upgrading to sx:div the page waits for 5 secs (updateFreq value)
 even for the initial (first time load) page load.
 I tried adding preload=true for sx:div tag but still facing the same
 issue. I couldn't get information in net on this issue.
 
 Please help. Thanks in advance.
 Mekna
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Page-waits-to-load-initially-with-Div-Dojo-tag-tp22959309p25392577.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



s:checkbox inside a s:iterator and values in a Integer[]

2009-07-12 Thread Ignacio de Córdoba

Hello,
I've browsed nabble, google, ... but can't find a simple example on how to
do something very simple.

I need to iterate through, let's say, a picture category list, showing each
category as a s:checkbox. The picture belongs to some of these categories
(and user can changed that, or course, thanks to the checkboxes), so some of
the checkboxes must be pre-checked. Which of them are checked is shown in a
Integer[] (could be String[] if necesary, no problem). I guessed the right
way to do it is using a String or Integer array as checked values will be
sent to the struts2 action through that same property.
Is it that difficult to use s:checkbox for this? I know how to do it using
s:checkboxlist but can't here as I need special format in the iteration.

For some reason the following:
s:iterator value=categoryTree
s:checkbox labelposition=right name=categoryId fieldValue=%{id}
label=%{name}/
/s:iterator

(categoryId is a Integer[] having which id values should be checked but all
checkboxes appear as checked)

For some reason I've found more people with this same problem but they got
no answers. Thanks for any example or ideas if I must change the way
pre-checked data is got from the action.
Ignacio
-- 
View this message in context: 
http://www.nabble.com/s%3Acheckbox-inside-a-s%3Aiterator-and-values-in-a-Integer---tp24452969p24452969.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: s:checkbox inside a s:iterator and values in a Integer[]

2009-07-12 Thread Ignacio de Córdoba

Thanks a lot for reply. It works OK that way. I had to make a getter for the
Category objects as a List and maintain the setter for the categoryId
Integer array. It would be great if s:checkbox could also check when to
pre-check the checkbox in the same way as s:checkboxlist does (I think I
used s:checkboxlist getting checked fields from the Integer[] id getter. It
makes sense to use the same property to get checkbox status and to set
checkbox status)

Anyway, thanks a lot for your example.
Ignacio


Musachy Barroso wrote:
 
 you need to specify the value attribute, which is the one that will
 make it checked or not, for example, assume possibleValues is the
 list of possible values, and selectedValues is the list of currently
 selected values, and both lists contain objects that have an int id
 field (same type of objects):
 
 s:iterator value=%{possibleValues}
 s:checkbox name=categoryId fieldValue=%{id}
 value=%{#selectedValues.contains(top)} /
 /s:iterator
 
 musachy
 
 2009/7/12 Ignacio de Córdoba icord...@skios.es:

 Hello,
 I've browsed nabble, google, ... but can't find a simple example on how
 to
 do something very simple.

 I need to iterate through, let's say, a picture category list, showing
 each
 category as a s:checkbox. The picture belongs to some of these categories
 (and user can changed that, or course, thanks to the checkboxes), so some
 of
 the checkboxes must be pre-checked. Which of them are checked is shown in
 a
 Integer[] (could be String[] if necesary, no problem). I guessed the
 right
 way to do it is using a String or Integer array as checked values will be
 sent to the struts2 action through that same property.
 Is it that difficult to use s:checkbox for this? I know how to do it
 using
 s:checkboxlist but can't here as I need special format in the iteration.

 For some reason the following:
 s:iterator value=categoryTree
 s:checkbox labelposition=right name=categoryId fieldValue=%{id}
 label=%{name}/
 /s:iterator

 (categoryId is a Integer[] having which id values should be checked but
 all
 checkboxes appear as checked)

 For some reason I've found more people with this same problem but they
 got
 no answers. Thanks for any example or ideas if I must change the way
 pre-checked data is got from the action.
 Ignacio
 --
 View this message in context:
 http://www.nabble.com/s%3Acheckbox-inside-a-s%3Aiterator-and-values-in-a-Integer---tp24452969p24452969.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/s%3Acheckbox-inside-a-s%3Aiterator-and-values-in-a-Integer---tp24452969p24453782.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



emptyoption with s:select and Integer values

2009-06-21 Thread Ignacio de Córdoba

Hello,
I need to use s:select with emptyoption=true attribute. it works OK with
Strings but can't make it work with Integers. As empty option generates an
empty string option parameter value, Struts2 seems unable to convert it to a
null value if setter method in the Action is Integer. I get:

ognl.MethodFailedException: Method setPlaceId failed for object
com.servengine.pim.eventadminacti...@336f9bc6
[java.lang.NoSuchMethodException: setPlaceId([Ljava.lang.String;)]

(An array of Strings? I am just selecting the empty value... anyway...)

Any ideas or workarrounds. I would like to avoid moving all this type of
properties to String.

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/emptyoption-with-s%3Aselect-and-Integer-values-tp24139712p24139712.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: s:text undesired behaviour - getting action properties in struts 2

2009-05-07 Thread Ignacio de Córdoba

Hello,
did you manage to solve this? I don't know if it is the desired behaviour or
it is a bug. It is really annoying getting the property value in place of
the localized text just because they have the same name.
I am in the same situation as you and don't get to find any solution.

Anybody else?

thanks for any help,
Ignacio


Vinicius Cubas Brand wrote:
 
 Hello. I have an action that haves the method getOperador() . Also, in 
 my messages.properties file with internationalized strings there are two 
 lines:
 
 
 operador.telefone=string1
 telefone=string2
 
 
 I am using in the jsp the tag
 
 s:text name=operador.telefone/s:text
 
 
 with this I want this 'operador.telefone' string to be translated to 
 'string1', however it is being translated as 'string2'. This behaviour 
 only happens when the action class running under the jsp haves the 
 getOperador() method.
 
 I want to know if it is possible to make just the 'operador.telefone' 
 string dont be sensitive to the action's method getOperador().
 
 Note: I could only try to change the string 'operador.telefone' for 
 something else, however this s:text  tag is being generated by a 
 automatic translator that searchs jsp files for translatable strings, 
 generating keys and put them into messages.properties.
 
 
 Note 2: my web.xml haves the following piece of xml that specifies the 
 messages, just in case you want to know.
 
 context-param
 param-name
 javax.servlet.jsp.jstl.fmt.localizationContext
 /param-name
 param-valuemessages/param-value
 /context-param
 
 Thank in advance for any help/hints.
 
 Regards
 
 
 -- 
 
 *Vinicius Cubas Brand
 DATAPROM®*
 Software para Clientes
 Tel.: +55 41 3014-1333
 Fax.: +55 41 3014-1201
 
 vinicius.br...@dataprom.com
 
 www.dataprom.com
 
 
 

-- 
View this message in context: 
http://www.nabble.com/s%3Atext-undesired-behaviour---getting-action-properties-in-struts-2-tp19201496p23428536.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Integer s:checkbox sends false value to action setter

2009-05-05 Thread Ignacio de Córdoba

Hi,
I've seen this has not been solved or replied here. Could anybody give me
any directions on how to post a JIRA issue for this?
I've seen https://issues.apache.org/struts/secure/BrowseProject.jspa but
can't get to the area for posting new issues/bugs.

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Integer-s%3Acheckbox-sends-%22false%22-value-to-action-setter-tp22210478p23390245.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Integer s:checkbox sends false value to action setter

2009-05-05 Thread Ignacio de Córdoba

OK, I understand but I am using checkboxes for the typical remove entries in
this forum action. The value are integesr (primary keys of the entries) and
so the setter in the action is:

public void setRemoveEntry(Integer[] id)
{
}

When i check no checkboxes in the form, I get the exception, as struts is
sending false (string) to a Integer array property. I'll try the
interceptor you point. Thanks,
Ignacio 



Rubbinio wrote:
 
 I do not believe this is a bug. Setting the value to false when unchecked
 is most useful for a lot of cases. I hated when in S1 you had to reset all
 your checkboxes in code in order to get unchecked values that were
 previously checked when the page loaded.
 
 Furthermore, there are struts 2 books out there that explain how this
 could work. Did you try this:
 
 interceptor-ref name=completeDefault
   -1
 /interceptor-ref
 
 
 
 -Original Message-
 From: Ignacio de Córdoba [mailto:icord...@skios.es]
 Sent: May 5, 2009 11:48 AM
 To: user@struts.apache.org
 Subject: Re: Integer s:checkbox sends false value to action setter
 
 
 Hi,
 I've seen this has not been solved or replied here. Could anybody give me
 any directions on how to post a JIRA issue for this?
 I've seen https://issues.apache.org/struts/secure/BrowseProject.jspa but
 can't get to the area for posting new issues/bugs.
 
 Thanks,
 Ignacio
 --
 View this message in context:
 http://www.nabble.com/Integer-s%3Acheckbox-sends-%22false%22-value-to-action-setter-tp22210478p23390245.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Integer-s%3Acheckbox-sends-%22false%22-value-to-action-setter-tp22210478p23390777.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



sx:textarea border (and label...)

2009-05-04 Thread Ignacio de Córdoba

Hi,
I am using sx:textarea in several pages and the HTML visutal text editor
renders and works ok. I'd just like to make it have a simple border, like
every input type text or type textarea has. I'd like to do this directly and
avoid enclosing sx:textarea in some type of div class=border to make it
look have a real border.
Any ideas on how to do this?

Thanks,
Ignacio

P.D.: By the way... how to make label and labelposition work for
sx:textarea?
-- 
View this message in context: 
http://www.nabble.com/sx%3Atextarea-border-%28and-label...%29-tp23377969p23377969.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to define a String array in FreeMarker

2009-04-24 Thread Ignacio de Córdoba

Hi there,
i am using FreeMarker to generate HTML content for mails in my application
(not for the web presentation; I use JSP for that).
I so use FreeMarker directly, not integrated to struts.

My problem is localizing messages with parameters. I am invoking the
freemaker template passing the action (it self) as an object. Then I get the
text invoking struts2 ActionSupport getText method:

This works ok when there are no parameters ( ${action.getText(hello)} )

but suppose portalid is a string variable and I try:

${action.getText(pleaseConfirmYouWantToChangeYourPassword,portalid)}

The problem is that portalid variable should be an array of strings, not a
string. I am new to freemarker and don't know if it is possible to define a
string array inside the template. Something equivalent to java:

String[] portalidArray = new String[]{portalid};

Is it possible? How?

Thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-define-a-String-array-in-FreeMarker-tp23220643p23220643.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Hi there,
i am using css_xhtml them and renders all form elements quite ok but it
inserts a align=right in the div enclosing every submit button.
Is there anyway to remove that right alignment? I guess all this should be a
matter of css and not an alignment in the HTML code. Don't know if it is a
bug of the theme or the desired code rendered.
I've searched here but found no info on how to extend or modify a builtin
them in struts2.

thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Thanks for your reply... ... my tag:

s:submit key='store' cssClass=myClass/

renders:

div align=rightid=wwctrl_Category_store_action_storeinput
type=submit id=Category_store_action_store name=store value=Store
class=myClass//div

As you see, div enclosing the input tag has no class. Just align and
id fields. To override that align i'll have to add a entry for every
s:submit in my application. I don't know how to add a class to that div.
Anyway, that would make me change all s:submits.

¿ Is it that complex to override s:submit and make it just render:
div id=wwctrl_Category_store_action_storeinput type=submit
id=Category_store_action_store name=store value=Store
class=myClass//div
?

Maybe I'm missing something... i'll try wrapping css_xhtml them into a new
theme as explained in the docs. Thanks for any other ideas on this...


felipe.lorenz wrote:
 
 You can change it by using CSS!
 
 2009/4/14 Ignacio de Córdoba icord...@skios.es
 

 Hi there,
 i am using css_xhtml them and renders all form elements quite ok but it
 inserts a align=right in the div enclosing every submit button.
 Is there anyway to remove that right alignment? I guess all this should
 be
 a
 matter of css and not an alignment in the HTML code. Don't know if it is
 a
 bug of the theme or the desired code rendered.
 I've searched here but found no info on how to extend or modify a builtin
 them in struts2.

 thanks for any help,
 Ignacio
 --
 View this message in context:
 http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037513.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 -- 
 Felipe A. Lorenz
 Idealogic Software
 http://www.idealogic.com.br
 
 

-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23037715.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Thanks Dave,
I did that (myClass) but the class is only added to the input / tag, not
to the div enclosing it, which is the one that has that magnificent align
parameter. I'm on my way extending css_xhtml them to try to solve this. I'll
post about it here...


newton.dave wrote:
 
 
 
 Or you could add a CSS class for submits, if they're all going to be the 
 same.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23038903.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Hi again Dave,
I am using Struts 2.1.2 (I believe it is last public version).

I'll try to make that patch. Got a private message from other user with
directions about which classes to check (SubmitTag, AbstractUITag and
AbstractClosingTag)... anyway, I've never made such a patch so I'm sure I'll
take me a lot of time. I'll try anyway but also post here any solutions I've
found.

Thanks,
Ignacio


newton.dave wrote:
 
 Ignacio de Córdoba wrote:
 Thanks Dave,
 I did that (myClass) but the class is only added to the input / tag,
 not
 to the div enclosing it, which is the one that has that magnificent align
 parameter. I'm on my way extending css_xhtml them to try to solve this.
 I'll
 post about it here...
 
 Oh, right. Which version of S2 are you using? There were at least a 
 couple of issues with non-CSS-ish behavior in the CSS theme that may 
 have been addressed at some point (like br/ tags etc.)
 
 If it hasn't been fixed already consider creating a patch against the 
 current S2 trunk to clean up any remaining issues.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23039403.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Hi there,
Maybe this helps someone else... I just solved my problem by unpacking
struts2-core-2.1.6.jar and placing submit.ftl file in webapp dir
/WEB-INF/classes/template/... commenting the following:

#--if parameters.align??
align=${parameters.align?html}#t/
/#if--

(Lines 20-30)

I noted that these didn't work for sx:submit, which I also use a lot; I had
to unpack struts2-dojo-plugin-2.1.6.jar (which contains ajax template) and
do the same (/template/ajax/...) In this case, align parameter appears
twice.

I'll figure out how to do the patch. I guess that at least for css_xhtml
theme, no align code should ever appear in HTML code.

Ignacio
-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23039837.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Removing the align=right from s:submit tag

2009-04-14 Thread Ignacio de Córdoba

Hi again,
I have successfully extended css_xhtml theme but I am having a problem form
sx:submit.
I specify struts.ui.theme=servengine in struts.properties and the new theme
works OK (servengine y the name of my new theme)

My problem is... sx:submit still uses ajax theme (I had to replace
submit:ftl also for this) Obviously I have to also extend ajax theme
(servengine_ajax) but... how do I specify the framework to use that new
theme for sx tags in struts.properties?

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Removing-the-align%3D%22right%22-from-%3Cs%3Asubmit%3E-tag-tp23037513p23040460.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: EJB3 plugin struts2

2009-04-14 Thread Ignacio de Córdoba

Hi there...just google struts2 ejb3 plugin

In the 2 first links you'll find the plugin and the doc page about it. I
personally use a the JBoss plugin, which includes a cache. I've extended it
to do lookups annotated on parent classes.

Try which ever fits you and write here abut any concrete problems.

Regards,
Ignacio


Stefano Tranquillini wrote:
 
 Someone can explain me how to use (and find) the ejb3 plugin for sturts2?
 thanks folks
 
 -- 
 Stefano
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/EJB3-plugin-struts2-tp23041889p23044375.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: EJB3 plugin struts2

2009-04-14 Thread Ignacio de Córdoba

Are you including the interceptor in your interceptor-stack?


Stefano Tranquillini wrote:
 
 I'd try.
 i've use the @InjectEJB(name=..)
 
 but the variable is null
 
 tomorrow i take a better look.
 
 thanks.
 
 anyway, i can use the ejb2 jndi method, works and no contradiction (or
 not?)
 
 2009/4/14 Ignacio de Córdoba icord...@skios.es:

 Hi there...just google struts2 ejb3 plugin

 In the 2 first links you'll find the plugin and the doc page about it. I
 personally use a the JBoss plugin, which includes a cache. I've extended
 it
 to do lookups annotated on parent classes.

 Try which ever fits you and write here abut any concrete problems.

 Regards,
 Ignacio


 Stefano Tranquillini wrote:

 Someone can explain me how to use (and find) the ejb3 plugin for
 sturts2?
 thanks folks

 --
 Stefano

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 --
 View this message in context:
 http://www.nabble.com/EJB3-plugin-struts2-tp23041889p23044375.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Stefano
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/EJB3-plugin-struts2-tp23041889p23049778.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts and EJB 3

2009-04-11 Thread Ignacio de Córdoba

Hi, I use JDeveloper but I just ad jars in the standard tiles and struts
distributions without any changes. Anyway, what is your exception when
trying to start the web-app? Maybe you should start there. Look at the
missing class and ensure it is in a jar inside WEB-INF/lib. Also, how do you
deploy EJBs? I use a different .ear file so to isolate layers (model -
view)


Stefano Tranquillini wrote:
 
 Hi,
 Have you got a list of the libraries or a blank-simply application
 that contains struts2 tiles2 and ejb3 extension.
 
 i usually use netbeans, do you put the library inside web-inf/lib and
 put these libraries into the project? nothing else?
 
 thanks.
 
 2009/4/10 Ignacio de Córdoba icord...@skios.es:

 Hi there,
 I am using struts2 and tiles2 with JBoss 4 without any problems. I use no
 other frameworks or libraries. I got the EJB3 extension for struts2
 (which
 does JNDI call internally as an interceptor) and even added a new
 functionality (it only locates EJBs in current class but coder forgot
 that
 there can be a parent class which also has de Annotation().
 Where are you putting those struts jars so that jboss webapps don't find
 them? I put them in WEB-INF/lib without any problems.

 Regards,
 Ignacio


 Stefano Tranquillini wrote:

 I'm not familiar with jsf and other stuff.
 first taken struts1 I'll try to use struts2 tiles2 jboss, struts2 has
 a plugin for the ejb3 (i think is an interceptor) but tiles2 and
 struts2 doesn't work with jboss (struts2 without tiles2 works, with
 tiles2 doesn't), jboss can't find the struts tags (it might be a bug,
 some one knows something about these stuff?).
 so i'm came back to the previous version 1.X (i don't remember exactly
 the number).

 so, in my case the simpler way is to use the jndi given the context
 and recall the remote object. is not so bad as solution but using
 ejb3.0 i loose something like the auto-jndi.

 well, i take a look about google guice anyway.

 thanks folks



 On Fri, Apr 10, 2009 at 17:14, Struts Two struts...@yahoo.ca wrote:

 @EJB annotation can be used only with container managed components like
 Servlet and JSF beans. Other than that either you have to use spring or
 right a customized EJB3 interceptor for struts 2 or modify request
 processing command chains for struts 1.3 to inject EJB 3 beans.

 Keep in mind you can also use Google Guice to do that as well [if you
 are
 not using any other spring goodies, Guice should very easy to set up]



 --- On Fri, 4/10/09, Stefano Tranquillini
 stefano.tranquill...@gmail.com wrote:

 From: Stefano Tranquillini stefano.tranquill...@gmail.com
 Subject: Re: Struts and EJB 3
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, April 10, 2009, 2:39 PM
 Yes, i'll try to use, but the ejb
 with annotation gives me a
 nullpointer exception.
 i've to call the ejb using the old style jndi call.

 On Fri, Apr 10, 2009 at 15:25, Lukasz Lenart
 lukasz.len...@googlemail.com
 wrote:
  2009/4/10 Stefano elste...@gmail.com:
  in struts1 what's the way to use EJB3.0?
 
  there's no possibility to use annotation?
  i need to use classical jndi? why?
 
  You can use annotations with Struts1, is not a problem
 with framework
  but with Java platform you're using. THe best solution
 is to use
  Spring to connect Struts1 Actions with EJB3 beans.
 
 
  Regards
  --
  Lukasz
  http://www.lenart.org.pl/
 
 
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Stefano

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




      __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark
 your
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org





 --
 Stefano

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 --
 View this message in context:
 http://www.nabble.com/Struts-and-EJB-3-tp22368697p22993709.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Stefano
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org

Re: Struts and EJB 3

2009-04-10 Thread Ignacio de Córdoba

Hi there,
I am using struts2 and tiles2 with JBoss 4 without any problems. I use no
other frameworks or libraries. I got the EJB3 extension for struts2 (which
does JNDI call internally as an interceptor) and even added a new
functionality (it only locates EJBs in current class but coder forgot that
there can be a parent class which also has de Annotation().
Where are you putting those struts jars so that jboss webapps don't find
them? I put them in WEB-INF/lib without any problems.

Regards,
Ignacio


Stefano Tranquillini wrote:
 
 I'm not familiar with jsf and other stuff.
 first taken struts1 I'll try to use struts2 tiles2 jboss, struts2 has
 a plugin for the ejb3 (i think is an interceptor) but tiles2 and
 struts2 doesn't work with jboss (struts2 without tiles2 works, with
 tiles2 doesn't), jboss can't find the struts tags (it might be a bug,
 some one knows something about these stuff?).
 so i'm came back to the previous version 1.X (i don't remember exactly
 the number).
 
 so, in my case the simpler way is to use the jndi given the context
 and recall the remote object. is not so bad as solution but using
 ejb3.0 i loose something like the auto-jndi.
 
 well, i take a look about google guice anyway.
 
 thanks folks
 
 
 
 On Fri, Apr 10, 2009 at 17:14, Struts Two struts...@yahoo.ca wrote:

 @EJB annotation can be used only with container managed components like
 Servlet and JSF beans. Other than that either you have to use spring or
 right a customized EJB3 interceptor for struts 2 or modify request
 processing command chains for struts 1.3 to inject EJB 3 beans.

 Keep in mind you can also use Google Guice to do that as well [if you are
 not using any other spring goodies, Guice should very easy to set up]



 --- On Fri, 4/10/09, Stefano Tranquillini
 stefano.tranquill...@gmail.com wrote:

 From: Stefano Tranquillini stefano.tranquill...@gmail.com
 Subject: Re: Struts and EJB 3
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, April 10, 2009, 2:39 PM
 Yes, i'll try to use, but the ejb
 with annotation gives me a
 nullpointer exception.
 i've to call the ejb using the old style jndi call.

 On Fri, Apr 10, 2009 at 15:25, Lukasz Lenart
 lukasz.len...@googlemail.com
 wrote:
  2009/4/10 Stefano elste...@gmail.com:
  in struts1 what's the way to use EJB3.0?
 
  there's no possibility to use annotation?
  i need to use classical jndi? why?
 
  You can use annotations with Struts1, is not a problem
 with framework
  but with Java platform you're using. THe best solution
 is to use
  Spring to connect Struts1 Actions with EJB3 beans.
 
 
  Regards
  --
  Lukasz
  http://www.lenart.org.pl/
 
 
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Stefano

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




      __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Stefano
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-and-EJB-3-tp22368697p22993709.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Invoking a method in the Action from a FreeMarker template

2009-04-08 Thread Ignacio de Córdoba

Hi there,
I am trying to invoke a method in a struts2 action from a FreeMarker
template. To do this, I put the action as an object named action and
then I reference it, for example, as:

#list action.sortedFields as field

(Sorted fields is a method: getSortedFields())

this works OK, but I cannot invoke methods with parameters... not just
getters. For example I try:

${action.getTheFieldEntry(7)}

I get

freemarker.core.InvalidReferenceException: Expression
action.getTheFieldEntry(7) is undefined on line 6, column 57 in
formprocessor/formEntryMail.ftl.

(getTheFieldEntry has the following signature:
public String getTheFieldEntry(int fieldId){...}
)

Is it only possible to invoke object getters and setters? I've read
Fremarker docs and regular methods can be invoked.

Thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Invoking-a-method-in-the-Action-from-a-FreeMarker-template-tp22955789p22955789.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



again... dynamic s:tree

2009-03-30 Thread Ignacio de Córdoba

Hi there,
I am trying to build a dynamic tree in my application. I used to do it with
struts1, nested tags and making it recurse by including a JSP file
recursively. I don't find the nested: tags in struts2 and after searching
nabble it seems that s:tree tag is not finished to be able to obtain a
dynamic tree (coming from a persisted object structure... I mean... like a
file directory structure for example).
Anybody can give any directions on how to build this type of structure in
struts2? As I see it I maybe I have to code HTML in the action (!) to
obtain it. I'd like not to do that...
(I dont need the tree to expand and collapse... I just need to draw it)

thanks for any help.
-- 
View this message in context: 
http://www.nabble.com/again...-dynamic-s%3Atree-tp22796166p22796166.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Making labelposition=left default

2009-03-29 Thread Ignacio de Córdoba

Hi there,
I asked this some time ago but after doing, again, some search here and
googling I still need find a way  to make my forms s:textfield have a
default labelposition=left attribute. I am using css_html theme... 
I have done a find/replace to make all my s:textfield have that property in
the html but maybe it can be done a simpler way in a properties file or
extending the theme...

thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Making-labelposition%3D%22left%22-default-tp22771676p22771676.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



sx:textarea and label

2009-03-16 Thread Ignacio de Córdoba

Hi there,
I have just replaced s:textarea with sx:textarea to get the HTML editor. It
works OK but now I don't see the labels for these textarea fields:

sx:textarea key=headline name=headline/

¿Anybody knows if that is the suppoused behaviour and I must add label
tags my self?

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/sx%3Atextarea-and-label-tp22543691p22543691.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: OGNL problem in s:checkbox

2009-03-09 Thread Ignacio de Córdoba

Hi,
I fond the answer to my problem. Maybe it helps anyone here...

if service is the var from a s:iterator doing

%{serviceNames.contains(service)}

will not work but

%{serviceNames.contains(#attr.service)}

will work.

I don't know how. Must be related of how objects are set into OGNL
valueStack
-- 
View this message in context: 
http://www.nabble.com/OGNL-problem-in-s%3Acheckbox-tp22404619p22411372.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



OGNL problem in s:checkbox

2009-03-08 Thread Ignacio de Córdoba

Hi there,
I am trying to activate some checkboxes if a certain condition is matched:

s:checkbox name=activeServices
value=%{userSession.portal.serviceNames.contains(service)}
fieldValue=%{service}/

service is a String var which contains my site service names. I get it
iterating over a collection. checkbox should be checked when serviceNames
contains the String in service var.

It works OK if I replace service var with a string:
%{userSession.portal.serviceNames.contains('mail')}
but using avar won't work. Any idea why I can't replace mail literal with
a var there?

Thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/OGNL-problem-in-s%3Acheckbox-tp22404619p22404619.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts and EJB 3

2009-03-06 Thread Ignacio de Córdoba

Hi,
I'm us¡ng JBoss and @EJB doesn't work either. Are you using Struts1 or
Struts2? If Struts2, You can use the extension for EJB3 for Struts2. It
works OK (interceptor).


senderj wrote:
 
 My env is Netbean with Glassfish. I am able to create a servlet to call
 EJB with this code:
 
 public class TryAdvise_create extends HttpServlet {
 @EJB
 AdviseFacadeRemote advBean;
 ..
 protected void processRequest(HttpServletRequest request,  {
 ..
 Advise adv = new Advise(123, 123 Company);
 advBean.create(adv);

 It works great. But when doing the same on a Struts Action:
 
 public class TryAdviseAction extends Action {
 @EJB
 AdviseFacadeRemote advBean;
 ..
 public ActionForward execute(ActionMapping mapping, . {
 Advise a = advBean.find(new Long(1));
 
 advBean is always null. Why? Please help.
 

-- 
View this message in context: 
http://www.nabble.com/Struts-and-EJB-3-tp22368697p22369485.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: FreeMarker error when trying to use AJAX Theme

2009-02-26 Thread Ignacio de Córdoba

thanks for your reply...
If I understood you, then css theme actionerror.ftl or at least simple theme
actionerror.ftl should be picked and rendered. Can you think of the reason
for these templates not shown? (If seen more people with this same problem
asked in forums but now answer to them)

thanks,
Ignacio


mitch.gorman wrote:
 
 Ignacio de Córdoba wrote:
 I see actionerror.ftl exists for simple theme but not for ajax theme. Any
 workarrounds?
   
 i don't have a solution to your actual problem, but the issue you
 note in the sentence above is actually not an issue.  if a template
 doesn't explicitly exist for a theme, the theme's parent is checked, and
 so on.  so for actionerror.ftl, it'd first look for it within ajax.  if
 not found there, it'll look in the xhtml theme.  if it's not there
 either, it'll look in the simple theme.
 
 of course, if it's not there, either, then you're well and truly
 screwed... ;)
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FreeMarker-error-when-trying-to-use-AJAX-Theme-tp22179332p22238727.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Integer s:checkbox sends false value to action setter

2009-02-25 Thread Ignacio de Córdoba

Hi there,
I am trying to start using struts2 checkboxes via s:checkbox tag:

s:checkbox name=removeExtraUserdataFieldId theme=simple
fieldValue=%{id}/

This renders:

input type=checkbox name=removeExtraUserdataFieldId value=3
id=index_storePreferences_action_removeExtraUserdataFieldId/
input type=hidden
id=__checkbox_index_storePreferences_action_removeExtraUserdataFieldId
name=__checkbox_removeExtraUserdataFieldId value=3 /

I was getting an error which sais String setter was required, and not a
Integer setter. I didn't understand why as values where ints but now I've
changed setter in the action to:
public void setRemoveExtraUserdataFieldId(String[]
removeExtraUserdataFieldId){}

I get a conversion error as when no checkbox are checked, that setter is
invoked with a false string argument. (If I check one of the checkboxes,
no problem).
Why is that false string used. In old Struts1 no setter was invoked in the
ActionForm if no checkbox was checked.

thanks for any ideas,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Integer-s%3Acheckbox-sends-%22false%22-value-to-action-setter-tp22210478p22210478.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



FreeMarker error when trying to use AJAX Theme

2009-02-24 Thread Ignacio de Córdoba

Hi there,
i am trying to use AJAX theme to use sx:datetimepicker tag but whether or
not I use that tag I am getting the following error only by adding the ajax
header:

sx:head debug=true cache=false compressed=false /

I thought it was caused by the date picker, but it happens on every page (I
use Tiles2 with struts2.1)

Thanks for any help/directions:

FreeMarker template error!



Expression parameters.pushId is undefined on line 24, column 6 in
template/ajax/a-close.ftl.
The problematic instruction:
--
==gt; if parameters.pushId [on line 24, column 1 in
template/ajax/a-close.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression parameters.pushId is
undefined on line 24, column 6 in template/ajax/a-close.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.isTrue(Expression.java:145)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.Environment.process(Environment.java:188)
at freemarker.template.Template.process(Template.java:237)
at
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:182)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
at org.apache.struts2.components.UIBean.end(UIBean.java:513)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005fa_005f1(path_jsp.java:651)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005felse_005f1(path_jsp.java:605)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005fiterator_005f1(path_jsp.java:513)
at org.apache.jsp.include.admin.path_jsp._jspService(path_jsp.java:125)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
-- 
View this message in context: 
http://www.nabble.com/FreeMarker-error-when-trying-to-use-AJAX-Theme-tp22179332p22179332.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: FreeMarker error when trying to use AJAX Theme

2009-02-24 Thread Ignacio de Córdoba

I've been doing some changes but now I'm still getting an error related to
the ajax theme...

I see actionerror.ftl exists for simple theme but not for ajax theme. Any
workarrounds?

Thanks for any help


2009-02-24 12:06:37,299 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[local.atlantida.com].[/].[jsp]]
El Servlet.service() para servlet jsp lanzó una excepción
java.io.FileNotFoundException: Template /template/ajax/actionerror.ftl not
found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)
at freemarker.template.Configuration.getTemplate(Configuration.java:452)
at
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:120)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
at org.apache.struts2.components.UIBean.end(UIBean.java:513)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
at
org.apache.jsp.include.admin.error_jsp._jspx_meth_s_005factionerror_005f0(error_jsp.java:355)
at org.apache.jsp.include.admin.error_jsp._jspService(error_jsp.java:89)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)

-- 
View this message in context: 
http://www.nabble.com/FreeMarker-error-when-trying-to-use-AJAX-Theme-tp22179332p22179885.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



DateTimePicker FreeMarker template error!

2009-02-23 Thread Ignacio de Córdoba

Hi there,
I am trying to use DateTimePicker with struts 2.1.2
I get the following error:
¿Any ideas? ¡Thanks!

Expression parameters.pushId is undefined on line 24, column 6 in
template/ajax/a-close.ftl.
The problematic instruction:
--
== if parameters.pushId [on line 24, column 1 in template/ajax/a-close.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression parameters.pushId is
undefined on line 24, column 6 in template/ajax/a-close.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.isTrue(Expression.java:145)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.Environment.process(Environment.java:188)
at freemarker.template.Template.process(Template.java:237)
at
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:182)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
at org.apache.struts2.components.UIBean.end(UIBean.java:513)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005fa_005f1(path_jsp.java:651)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005felse_005f1(path_jsp.java:605)
at
org.apache.jsp.include.admin.path_jsp._jspx_meth_s_005fiterator_005f1(path_jsp.java:513)
at org.apache.jsp.include.admin.path_jsp._jspService(path_jsp.java:125)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
-- 
View this message in context: 
http://www.nabble.com/DateTimePicker-FreeMarker-template-error%21-tp22173729p22173729.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Simplets way to make default labelposition=left on css_html theme

2009-02-20 Thread Ignacio de Córdoba

Hi there,
after doing some search here and googling I still need some directions on
the simplest way to make my forms s:textfield have a default
labelposition=left attribute. I am using css_html theme... ¿do I need to
extend it?

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Simplets-way-to-make-default-labelposition%3Dleft-on-css_html-theme-tp22131248p22131248.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to get request method from OGN using s:if

2009-02-17 Thread Ignacio de Córdoba

Hi there,
I need to know the method of current request from the page using OGNL. I
used to do:

c:if test='${request.method==GET}'

¿Can I access the request object, not just request parameters, from OGNL to
do this test?

s:if test='%{#request.method==GET}' is not working

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-get-request-method-from-OGN-using-s%3Aif-tp22065007p22065007.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to render a JSP/Struts2 action to send it (mail, ...)

2009-02-12 Thread Ignacio de Córdoba

Hi there,
I had a working solution that was fine for struts1 and doesn't work with
struts2.
The scenario is evey time the application needs to send a mail from an
action (for example, when a user signs up, the system sends him a welcome
mail)

My solution got the JSP the following way:

public String getResourceAsString(String path) throws ServletException,
IOException
{
HttpServletRequest request =
org.apache.struts2.ServletActionContext.getRequest();
HttpServletResponse response = 
ServletActionContext.getResponse();
try
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
RequestDispatcher dispatcher = 
request.getRequestDispatcher(path);
RedirectingServletResponse dummyResponse = new
RedirectingServletResponse(response, out);
dispatcher.include(request, dummyResponse);
return out.toString();
} catch (NullPointerException e)
{
return pNo such template:  + path + /p;
}
}
 
(RedirectingServletResponse class just extends HttpServletResponseWrapper
and captures output to a ByteArrayOutputStream)


The JSP needs a small scriptlet at its end:
% out.flush(); %

Without it, the mail is sent blank as the JSP is not rendered to HTML/text
as the request has not ended (I use the current thread request because: 1) I
don't know how to create a brand new request/response 2) This way I can use
all request parameters, attributes... in the mail sent and so not use just
plain HTML but real JSP.

The problem now is that struts2 shows the following exception:

java.io.IOException: Stream closed

   
org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204)
   
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:173)
   
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:956)
   
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)
   
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:123)
   
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
   
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
   
com.servengine.struts2.InjectEJBInterceptor.intercept(InjectEJBInterceptor.java:89)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
   
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
   
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
   
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
   
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206

Any ideas on this... or better... any directions on how can I instanciate a
fake response not based on current struts2 Action ServletResponse object
(and so flush() or close() will not affect it).

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-render-a-JSP-Struts2-action-to-send-it-%28mail%2C-...%29-tp21982445p21982445.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to render a JSP/Struts2 action to send it (mail, ...)

2009-02-12 Thread Ignacio de Córdoba

hi again,
thanks for your reply. I've never used FreeMaker or Velocity. I use
Tiles2... can you figure out if your solution can be solved with Tiles2. I
wouldn't like to get into those, I'm sure great, technologies only for this.

Thanks,
Ignacio


Musachy Barroso wrote:
 
 I don't know how to fix it, but i would never use JSP for this. I
 would suggest you use FreeMarker or Velocity which will be very easy
 to get working and won't break across different containers/versions.
 For example, for FreeMarker (which will be in the classpath already),
 I use this:
 
 public static void process(ServletContext context, String template,
 MapString, Object values, Writer writer) throws IOException,
 TemplateException {
 Configuration cfg = new Configuration();
 cfg.setDirectoryForTemplateLoading(new
 File(context.getRealPath(/templates)));
 cfg.setObjectWrapper(new DefaultObjectWrapper());
 
 BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
 TemplateHashModel staticModels = wrapper.getStaticModels();
 Template temp = cfg.getTemplate(template);
 temp.process(values, writer);
 writer.flush();
 }
 
 //also JSP has not way to deal with empty spaces and such
 
 musachy
 
 On Thu, Feb 12, 2009 at 1:49 PM, Ignacio de Córdoba icord...@skios.es
 wrote:

 Hi there,
 I had a working solution that was fine for struts1 and doesn't work with
 struts2.
 The scenario is evey time the application needs to send a mail from an
 action (for example, when a user signs up, the system sends him a welcome
 mail)

 My solution got the JSP the following way:

public String getResourceAsString(String path) throws
 ServletException,
 IOException
{
HttpServletRequest request =
 org.apache.struts2.ServletActionContext.getRequest();
HttpServletResponse response =
 ServletActionContext.getResponse();
try
{
ByteArrayOutputStream out = new
 ByteArrayOutputStream();
RequestDispatcher dispatcher =
 request.getRequestDispatcher(path);
RedirectingServletResponse dummyResponse = new
 RedirectingServletResponse(response, out);
dispatcher.include(request, dummyResponse);
return out.toString();
} catch (NullPointerException e)
{
return pNo such template:  + path + /p;
}
}

 (RedirectingServletResponse class just extends HttpServletResponseWrapper
 and captures output to a ByteArrayOutputStream)


 The JSP needs a small scriptlet at its end:
 % out.flush(); %

 Without it, the mail is sent blank as the JSP is not rendered to
 HTML/text
 as the request has not ended (I use the current thread request because:
 1) I
 don't know how to create a brand new request/response 2) This way I can
 use
 all request parameters, attributes... in the mail sent and so not use
 just
 plain HTML but real JSP.

 The problem now is that struts2 shows the following exception:

 java.io.IOException: Stream closed


 org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204)

 org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:173)

 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:956)

 org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)

 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:123)

 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)

 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)

 com.servengine.struts2.InjectEJBInterceptor.intercept(InjectEJBInterceptor.java:89)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)

 org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)

 org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206

 Any ideas on this... or better... any directions on how can I instanciate
 a
 fake response not based on current struts2 Action ServletResponse
 object
 (and so flush() or close() will not affect it).

 Thanks,
 Ignacio
 --
 View this message in context:
 http://www.nabble.com/How-to-render-a-JSP-Struts2-action-to-send-it-%28mail%2C-...%29-tp21982445p21982445.html
 Sent from the Struts - User mailing list archive at Nabble.com

Re: How to render a JSP/Struts2 action to send it (mail, ...)

2009-02-12 Thread Ignacio de Córdoba

OK. Thanks for the advice. I tried to use Tiles2 because my user interface is
used with Tiles2. If I get a Tile for the email, the email received has the
same lookfeel as the web pages. And I can re-use JSP/JSTL/OGNL parts.

I'll give FreeMarker a try... just a question... in the code you sent... the
String template argument is just the file name of the Freemarket content
(mail.ftl) file?

Thanks,
Ignacio


Musachy Barroso wrote:
 
 The thing is that neither JSP nor Tiles are designed for what you want
 to do. BTW, FreeMarker is already in your application.
 
 musachy
 
 On Thu, Feb 12, 2009 at 2:19 PM, Ignacio de Córdoba icord...@skios.es
 wrote:

 hi again,
 thanks for your reply. I've never used FreeMaker or Velocity. I use
 Tiles2... can you figure out if your solution can be solved with Tiles2.
 I
 wouldn't like to get into those, I'm sure great, technologies only for
 this.

 Thanks,
 Ignacio


 Musachy Barroso wrote:

 I don't know how to fix it, but i would never use JSP for this. I
 would suggest you use FreeMarker or Velocity which will be very easy
 to get working and won't break across different containers/versions.
 For example, for FreeMarker (which will be in the classpath already),
 I use this:

 public static void process(ServletContext context, String template,
 MapString, Object values, Writer writer) throws IOException,
 TemplateException {
 Configuration cfg = new Configuration();
 cfg.setDirectoryForTemplateLoading(new
 File(context.getRealPath(/templates)));
 cfg.setObjectWrapper(new DefaultObjectWrapper());

 BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
 TemplateHashModel staticModels = wrapper.getStaticModels();
 Template temp = cfg.getTemplate(template);
 temp.process(values, writer);
 writer.flush();
 }

 //also JSP has not way to deal with empty spaces and such

 musachy

 On Thu, Feb 12, 2009 at 1:49 PM, Ignacio de Córdoba icord...@skios.es
 wrote:

 Hi there,
 I had a working solution that was fine for struts1 and doesn't work
 with
 struts2.
 The scenario is evey time the application needs to send a mail from an
 action (for example, when a user signs up, the system sends him a
 welcome
 mail)

 My solution got the JSP the following way:

public String getResourceAsString(String path) throws
 ServletException,
 IOException
{
HttpServletRequest request =
 org.apache.struts2.ServletActionContext.getRequest();
HttpServletResponse response =
 ServletActionContext.getResponse();
try
{
ByteArrayOutputStream out = new
 ByteArrayOutputStream();
RequestDispatcher dispatcher =
 request.getRequestDispatcher(path);
RedirectingServletResponse dummyResponse = new
 RedirectingServletResponse(response, out);
dispatcher.include(request, dummyResponse);
return out.toString();
} catch (NullPointerException e)
{
return pNo such template:  + path + /p;
}
}

 (RedirectingServletResponse class just extends
 HttpServletResponseWrapper
 and captures output to a ByteArrayOutputStream)


 The JSP needs a small scriptlet at its end:
 % out.flush(); %

 Without it, the mail is sent blank as the JSP is not rendered to
 HTML/text
 as the request has not ended (I use the current thread request because:
 1) I
 don't know how to create a brand new request/response 2) This way I can
 use
 all request parameters, attributes... in the mail sent and so not use
 just
 plain HTML but real JSP.

 The problem now is that struts2 shows the following exception:

 java.io.IOException: Stream closed


 org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204)

 org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
   
 org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:173)

 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:956)

 org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)

 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:123)

 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)

 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)

 com.servengine.struts2.InjectEJBInterceptor.intercept(InjectEJBInterceptor.java:89)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)

 org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)

 org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395

Re: Text link to submit a form ¿struts2 way?

2009-02-11 Thread Ignacio de Córdoba

Are you really sure that s:a generates a a.../ tag that submits the form???
I just get a regular link pointing to a regular URL, no form or form data
anywhere.
By the way, formId property is not a property for s:a tag, at least not in
docs and TagLibDocs.


mitch.gorman wrote:
 
 mitch gorman wrote:
 s:url id=homeurl action=goHome /
 s:form id=gohome
  s:textfield label=enter some data name=data /
 /s:form
 s:a href=%{#homeurl} formId=gohome Go home/s:a
 actually, the form doesn't need to use struts tags, there... could
 just be a plain html form.  just so long as the form tag has the id
 attribute set, and that id is used in the s:a tag, it'll work.
 
 

-- 
View this message in context: 
http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21960196.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Text link to submit a form ¿struts2 way?

2009-02-10 Thread Ignacio de Córdoba

I love submit buttons but in this design I must use text as submit buttons.
Buttons were to big for the graphic designer to fit them.


Jack Qu wrote:
 
 Can submit button meet your request!
 
 --
 From: Ignacio de Córdoba icord...@skios.es
 Sent: Monday, February 09, 2009 7:31 AM
 To: user@struts.apache.org
 Subject: Text link to submit a form ¿struts2 way?
 

 Hi there,
 I just wonder if there is any proposed way or struts2 tag to generate a 
 text
 link that submits a form. I've checked s:a and sx:a tags and can't find 
 any
 info. I'd like to avoid using javascript directly if possible (even
 though
 I've been doing it in the past with struts1)
 Thanks for any directions.

 Ignacio
 -- 
 View this message in context: 
 http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21904849.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org

 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21933609.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Text link to submit a form ¿struts2 way?

2009-02-10 Thread Ignacio de Córdoba

OK... I know I must use javascript. My question really was about if struts2
s:a or sx:a tags had an option to generate that javascript submit text link,
in a similar way as s:submit generates the input type=submit. I guest not.
:-(
Maybe it is an interesting option for a future release.

thanks,
Ignacio


Jack Qu wrote:
 
 In that way ,there has no way to do it excluding from javascript
 --
 From: Ignacio de Córdoba icord...@skios.es
 Sent: Tuesday, February 10, 2009 9:29 PM
 To: user@struts.apache.org
 Subject: Re: Text link to submit a form ¿struts2 way?
 

 I love submit buttons but in this design I must use text as submit 
 buttons.
 Buttons were to big for the graphic designer to fit them.


 Jack Qu wrote:

 Can submit button meet your request!

 --
 From: Ignacio de Córdoba icord...@skios.es
 Sent: Monday, February 09, 2009 7:31 AM
 To: user@struts.apache.org
 Subject: Text link to submit a form ¿struts2 way?


 Hi there,
 I just wonder if there is any proposed way or struts2 tag to generate a
 text
 link that submits a form. I've checked s:a and sx:a tags and can't find
 any
 info. I'd like to avoid using javascript directly if possible (even
 though
 I've been doing it in the past with struts1)
 Thanks for any directions.

 Ignacio
 -- 
 View this message in context:
 http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21904849.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 -- 
 View this message in context: 
 http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21933609.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org

 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21933833.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Indexed properties in forms

2009-02-10 Thread Ignacio de Córdoba

Hi there,
I am trying to migrate a form population module from struts1 to struts2 and
I am not sure if struts2 supports indexed/mapped value properties.

After reading OGNL docs I see that indexed properties are supported both
with ints and objects. I guess they refer just to red de properties, not
to set them in the action... so I am trying:

s:textfield label=%{name} name='fieldEntry[%{id}]' / Where id is an
integer.

My action has the method:
public void setFieldEntry(String fieldId, String value){}
(I've tried fieldID with int, Integer and String)
(Also I've tried String value and String[] value just in case it expects an
array of strings)

When I submit the form I get:

2009-02-11 02:14:49,195 WARN  [com.opensymphony.xwork2.ognl.OgnlValueStack]
Could not find property [struts.valueStack]
2009-02-11 02:14:49,198 INFO  [STDOUT] ognl.OgnlException: target is null
for setProperty(null, 1, [Ljava.lang.String;@410ef400)
2009-02-11 02:14:49,198 INFO  [STDOUT]  at
ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
2009-02-11 02:14:49,198 INFO  [STDOUT]  at
ognl.ASTProperty.setValueBody(ASTProperty.java:101)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
ognl.SimpleNode.setValue(SimpleNode.java:246)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
ognl.ASTChain.setValueBody(ASTChain.java:172)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
ognl.SimpleNode.setValue(SimpleNode.java:246)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at ognl.Ognl.setValue(Ognl.java:476)
2009-02-11 02:14:49,199 INFO  [STDOUT]  at
com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)

Thanks for any help

-- 
View this message in context: 
http://www.nabble.com/Indexed-properties-in-forms-tp21946572p21946572.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to generate a URL with s:url encoded in UTF-8

2009-02-09 Thread Ignacio de Córdoba

Hi there,
I am trying to generate a URL with s:url and s:param so that parameters are
encoded in URL. Special characters are not processed ok. (The struts action
works fine as I have posted that same URL data with a form encoded in UTF-8
and they are decoded fine in my java code)
I've tried doing s:params:property ... escape=true/s:param but no
luck. Chars are escaped but not encoded UTF-8.
Any ideas if this is possible?

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-generate-a-URL-with-s%3Aurl-encoded-in-UTF-8-tp21919013p21919013.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Text link to submit a form ¿struts2 way?

2009-02-08 Thread Ignacio de Córdoba

Hi there,
I just wonder if there is any proposed way or struts2 tag to generate a text
link that submits a form. I've checked s:a and sx:a tags and can't find any
info. I'd like to avoid using javascript directly if possible (even though
I've been doing it in the past with struts1)
Thanks for any directions.

Ignacio
-- 
View this message in context: 
http://www.nabble.com/Text-link-to-submit-a-form-%C2%BFstruts2-way--tp21904849p21904849.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: s:iterator ¿begin - end?

2009-02-05 Thread Ignacio de Córdoba

We have it standard in spanish keyboards close to the downside up one :-)


Wes Wannemacher wrote:
 
 On Wednesday 04 February 2009 23:05:06 Martin Gainty wrote:
 Dave and Crew

 Where is the upside down question-mark key???

 
 It's ALT-F4
 
 :)
 
 -Wes
 
 -- 
 
 Wes Wannemacher
 Author - Struts 2 In Practice 
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/s%3Aiterator-%C2%BFbegin--%3E-end--tp21832209p21849005.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



s:iterator ¿begin - end?

2009-02-04 Thread Ignacio de Córdoba

Hi there,
I've checked struts2 docs and this forum and have found no inside syntax for
s:iterator tag to do:
c:forEach var='' value='${}' being='1' end='4'/

Examples in docs just show how to count from 1 to 5 ¿? I'd like to avoid
counting and using indexed property to access an iterator. The last example
in docs doesnt seem to work if I replace this with the property/objet I
want to iterate.

I am sure struts2 team has thought of a way to do some partial iterator (I
can also do the full iterator and do a s:if to show only 5 values using
status.index, but doesn't seem a nice solution.

Thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/s%3Aiterator-%C2%BFbegin--%3E-end--tp21832209p21832209.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Is possible to set encoding=false as default?

2009-02-04 Thread Ignacio de Córdoba

Hi there,
I am having a problem with encoding and s:property... (and other tags). As
default it encodes non ASCII chars and I get:

categor#xED;a y tecnolog#xED;a

where I should get accented chars:

categoría y tecnología

I've seen adding encoding=false to the s:property tag solves this. Can I
configure this behaviour as default and not have to ad that parameter to all
s:property in my project?

thanks for any advice,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Is-possible-to-set-encoding%3D%22false%22-as-default--tp21843895p21843895.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: s:iterator ¿begin - end?

2009-02-04 Thread Ignacio de Córdoba

Hi,
thanks for your reply.
Well... I have to iterate through a collection accesible in a struts2
Action. I can make that object visible to the page/request scope and then
access it from JSTL c:forEach; in fact I am doing that for dynamic images
as strugs2 has no IMG tag to use OGNL directly. Very painful when someone is
used to access the object from the tag itself. Moreover... I am really
trying to forget about EL and JSTL. I really don't find my self confortable
using 3 different expression languages / tag libs in my pages. I didn't have
to (in struts1) but maybe I have to accept that idea now.
Moreover, EL is obsolete when compared to OGNL (oh god... when I discovered
I could do #{people.size()} I just didn't believe it!!! Direct access to
methods. JSTL hasn't been improved for 4 (5?) years! Method access,
valuestack... and I am new to OGNL. Don't know 50% of its power!

More situations: I made my HTML designers learn JSTL. Now I have to make
them learn OGNL and I am sure they'll have problems with both things mixed.
Of course, I'd like new people in the company thinking about the
presentation layer just to handle one thing.

Why doesn't OGNL team focus on making it possible to forget about JSTL+EL
and just use OGNL for every thing? It nearly does and just because a
couple of minor glitches we can't. (Another example... s:a tag doesn't have
target attribute. I have then to use HTML   tag directly, what forces me
to transfer the href data in the Action to an object in the page scope and
use EL where. Painful for something that should be straightforward.

Well... sorry for the long text. Please don't take me wrong. Just love
struts2 and would love to forget about old technnologies. I wish I had time
and knowledge to help on all this. Now I just can't.


newton.dave wrote:
 
 Ignacio de Córdoba wrote:
 Hi there,
 I've checked struts2 docs and this forum and have found no inside syntax
 for
 s:iterator tag to do:
 c:forEach var='' value='${}' being='1' end='4'/
 
 Examples in docs just show how to count from 1 to 5 ¿? I'd like to avoid
 counting and using indexed property to access an iterator. The last
 example
 in docs doesnt seem to work if I replace this with the property/objet I
 want to iterate.
 
 I am sure struts2 team has thought of a way to do some partial iterator
 (I
 can also do the full iterator and do a s:if to show only 5 values using
 status.index, but doesn't seem a nice solution.
 
 Any reason you can't use c:forEach...? s:iterator doesn't have the 
 same functionality.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/s%3Aiterator-%C2%BFbegin--%3E-end--tp21832209p21844359.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to change locale inside an Action method

2009-02-01 Thread Ignacio de Córdoba

Hi there,
I've been searching through struts2 docs and old threads here but I've found
no way of changing current locale from inside an action. I know I can pass a
parameter in the request, and maybe other ways to change it... but I am
looking for a method that allows me to change current locale from inside the
action.
I used to do setLocale(...) but that method doesn't seem to be implemented
in ActionSupport.

Thanks for any help,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-change-locale-inside-an-Action-method-tp21776908p21776908.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to change locale inside an Action method

2009-02-01 Thread Ignacio de Córdoba

Thanks for your reply,
I had read the i18n docs you refer but still find no info about changing the
session locale inside an Action.
Anyway, after reading the source of the Interceptor, I understand that
doing:

session.put(i18nInterceptor.DEFAULT_SESSION_ATTRIBUTE,myNewLocale);

in my Action should change the locale in the session. Do you believe that's
right and nothing extra needs to be done?

thanks,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-change-locale-inside-an-Action-method-tp21776908p21777515.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to change locale inside an Action method

2009-02-01 Thread Ignacio de Córdoba

OK. Thanks again... after reading some other docs I'll be doing:

ActionContext.getContext().setLocale(locale);
session.put(com.opensymphony.xwork2.interceptor.I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE,locale);
  
session.put(Config.FMT_LOCALE, locale); //Also for JSTL, not only Struts.
session.put(javax.servlet.jsp.jstl.fmt.locale.session, locale);//Just to
be really sure

(I hope this will really change locale)

Ignacio
-- 
View this message in context: 
http://www.nabble.com/How-to-change-locale-inside-an-Action-method-tp21776908p21777642.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to change locale inside an Action method

2009-02-01 Thread Ignacio de Córdoba

Great attitude yours :-)

I'll explain my (simplified) case... I am migrating a struts1 content
manager to struts2; maybe I still stick to struts1 concepts but... imagine
there are several articles in the users screen. They might be written in
different languages; an article language is set in a property in the
ArticleEJB, so the view layer doesn't know which language they are written.
When the user clicks in an article, if current locale is not the one in that
article, I want my action to change the session locale. I might not want to
change that locale depending on other article properties.
I know this can be done by getting the locale from the article and adding it
as a request_locale parameter in the link but I will not always want to
change locale, only for some articles. I want that decision to be taken in
that Action, not in the view JSP layer or in previous Action.

I am already using the request_locale i18n interceptor aproach in other
circumstances, when I know in advance I want to change the locale. It's
perfect for that but maybe not for the case exposed.

Ignacio

-- 
View this message in context: 
http://www.nabble.com/How-to-change-locale-inside-an-Action-method-tp21776908p21778002.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Best global parameter aproach for struts2

2009-01-28 Thread Ignacio de Córdoba

Oh yes, I have no problem with EJB3 init parameters. The only thing I am
really missing is where to put struts2 actions init paramers.
-- 
View this message in context: 
http://www.nabble.com/Best-global-parameter-aproach-for-struts2-tp21698744p21702585.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts2 + Guice JNDI names as a parameter

2009-01-27 Thread Ignacio de Córdoba

Hi there,
I am trying to use Guice to take care of the injection of Local Stateless
Session Beans (I use Jboss 4).
My problem is that all solutions I've found using guice involve hard coding
the application ear name. (JBoss sets JNDI of EJBs depending on the ear file
name).
I've read Struts2 Guice plugin docs and examples but I've found no way to
pass the application name as a parameter (getting the ServletContext name
should be enough) into com.google.inject.Module.

Anybody knows if I can use any parameters in struts.xml? Now I am using the
proposed, struts.objectFactory and guice.module constants.

P.D: I've extended struts2ejb3-jboss-plugin to solve this with interceptor
aproach if anybody is interested.

thanks for any ideas,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Struts2-%2B-Guice-JNDI-names-as-a-parameter-tp21693520p21693520.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Best global parameter aproach for struts2

2009-01-27 Thread Ignacio de Córdoba

Hi there,
after starting some serious migration from struts to struts2 I am wondering
is there is any best practices for global application parameters.
I used to store this parameters in web.xml, but as struts2 finds important
not to be tied to the http thing (I read it very often in docs... about
unit testing, etc.) I find myself with problems every time I want to get a
web.xml init parameter.
In actions it is not that difficult, but it is in interceptors, as there is
no way to get the ServletContext as they have no init method getting it as a
parameter. (I am now lazy loading that parameter at first Action invocation
to the interceptor)
I wonder if there is another aproach to set init parameters and forget about
web.xml... I need some init parameters easily readable from both actions and
interceptors... struts.xml, struts.properties, ...

Thanks for any ideas,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Best-global-parameter-aproach-for-struts2-tp21698744p21698744.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Best global parameter aproach for struts2

2009-01-27 Thread Ignacio de Córdoba

Thanks for your reply,
I have lots of code developed for struts1+tiles+EJB3 (Jboss). I am migrating
struts-tiles to struts2 + tiles2. I have too much EJB3 code and I don't have
a clear picture of where I can fit Spring there. I have so much time to
invest just to move to struts2... and absolutely I don't want to touch a
line of code in the bussiness layer. I can't afford it.

Ignacio
-- 
View this message in context: 
http://www.nabble.com/Best-global-parameter-aproach-for-struts2-tp21698744p21698912.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Accesing Cookies from a custom interceptor

2009-01-20 Thread Ignacio de Córdoba

Hi there,
I am writing a custom authentication and authorization interceptor and need
access to cookies. I've checked in Struts2 and other docs both ways of
getting access to cookies. I can't  use CookieInterceptor or CookiesAware
interface as I need cookies in the interceptor, not in an action, so the
only way I've found is using the static method at
org.apache.struts2.ServletActionContext.getRequest() to get the request and
getting cookies from it.
I'd like to know if there is another path to get cookies in my interceptor.
I've been developing on struts for a couple of years but I'm pretty newbie
to struts2.

Thanks for any help/directions,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Accesing-Cookies-from-a-custom-interceptor-tp21565072p21565072.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Injecting in Interceptors

2009-01-20 Thread Ignacio de Córdoba

Hi there,
I am developing a Authorization interceptor and need to perform a JNDI
lookup to get some Stateless EJBs from JBoss.

My problem is that this interceptor init() method gets no parameters. I need
to get at least the ServletContext of the web application to specify the
main JNDI lookup name. (EJBs might be deployed in different JNDIs dirs
depending on which application I deploy them).

Anybody has an idea on how can I get info about ServletContext in the init()
method of an interceptor? I'd like to lookup EJBs there and not lookup them
for every request (I know I can get the info I need from ActionInvocation
object that every intercept() gets)

I'm using Struts 2.1

Thanks for any ideas,
Ignacio
-- 
View this message in context: 
http://www.nabble.com/Injecting-in-Interceptors-tp21570523p21570523.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Injecting in Interceptors

2009-01-20 Thread Ignacio de Córdoba

Hi Musachy and thanks for your reply but that static invocation in that class
is not working if called from an interceptor or, at least, from the init()
method of the interceptor.

Probably this is due to the way it gets the ServletContext. Probably it
first gets the request or the session, and uses current thread for that. As
in the init() method there is no Action (remember Interceptors are not
binded to an action or request, but instanciated only once at the web
application deployment) there is no request/response/session, and so I
returns null. No ServletContext. :-(

Any other ideas? :-)

Thanks,
Ignacio


Musachy Barroso wrote:
 
 org.apache.struts2.ServletActionContext.getServletContext() is what you
 want.
 
 musachy
 
 On Tue, Jan 20, 2009 at 3:03 PM, Ignacio de Córdoba icord...@skios.es
 wrote:

 Hi there,
 I am developing a Authorization interceptor and need to perform a JNDI
 lookup to get some Stateless EJBs from JBoss.

 My problem is that this interceptor init() method gets no parameters. I
 need
 to get at least the ServletContext of the web application to specify the
 main JNDI lookup name. (EJBs might be deployed in different JNDIs dirs
 depending on which application I deploy them).

 Anybody has an idea on how can I get info about ServletContext in the
 init()
 method of an interceptor? I'd like to lookup EJBs there and not lookup
 them
 for every request (I know I can get the info I need from ActionInvocation
 object that every intercept() gets)

 I'm using Struts 2.1

 Thanks for any ideas,
 Ignacio
 --
 View this message in context:
 http://www.nabble.com/Injecting-in-Interceptors-tp21570523p21570523.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Injecting-in-Interceptors-tp21570523p21571037.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Injecting in Interceptors

2009-01-20 Thread Ignacio de Córdoba

Thanks for your reply Dave,
I'll have to solve it that way... but I wanted to use the init() method and
so avoid the if() checking for the EJBS existance... 
Without any info about the environment I don't really get how that method is
useful for anything.

Thanks,
Ignacio



newton.dave wrote:
 
 Ignacio de Córdoba wrote:
 Hi Musachy and thanks for your reply but that static invocation in that
 class
 is not working if called from an interceptor or, at least, from the
 init()
 method of the interceptor.
 
 You don't need to get JNDI resources on every request--use the lazy 
 initialization pattern and only get it the first time. Since 
 interceptors aren't re-instantiated this should work fine.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Injecting-in-Interceptors-tp21570523p21571306.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Injecting in Interceptors

2009-01-20 Thread Ignacio de Córdoba

Hi,
I saw that plugin but it solves the application name subdir to be supplied
in the JNDI lookup with a parameter in the Annotation, which makes it code
dependant. I need to get that data from the ServletContext (application
name) or at least a webapp init parameter.
As I see it, the lazy load aproach seems the best for the moment.


Lukasz Lenart wrote:
 
 2009/1/20 Ignacio de Córdoba icord...@skios.es:
 Anybody has an idea on how can I get info about ServletContext in the
 init()
 method of an interceptor? I'd like to lookup EJBs there and not lookup
 them
 for every request (I know I can get the info I need from ActionInvocation
 object that every intercept() gets)
 
 Did you try to use that plugin [1], you can ever base on it, build
 your own specific solution
 
 [1] http://code.google.com/p/struts2ejb3/
 
 
 Regards
 -- 
 Lukasz
 http://www.lenart.org.pl/
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Injecting-in-Interceptors-tp21570523p21573532.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Loosing content type encoding in bean:include

2008-05-10 Thread Ignacio de Córdoba

Hi there,
I am having a problem when trying to include a page using bean:include. I
loose the encoding even the included page has the right @page encoding ...
attributes.
Is this a bug or I am doing something wrong?
I am using struts 1.3
I've tried to use othre include options, but bean:include is the one that
doesn't make struts change module in the request (I use different modules
but wich jsp:include or c:import including an action from other module makes
the current module be changed and so html:form's don't work.

Thanks for any help... any of both issues would solve my problem as
jsp:include or c:import handle correctly the page encoding.

Ignacio
-- 
View this message in context: 
http://www.nabble.com/Loosing-content-type-encoding-in-bean%3Ainclude-tp17168120p17168120.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]