Re: Struts Tiles Problem

2010-11-06 Thread Lukasz Lenart
2010/11/5 Rafael Medeiros mederaf...@gmail.com:
 How to use plugin-tiles in struts 1.3.8:

Check the documentation
http://struts.apache.org/1.x/struts-tiles/installation.html


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl

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



Re: Have you ever used InputConfig annotation?

2010-11-06 Thread Li Ying
Actually, I am using interface [ValidationWorkflowAware] instead of
annotation [InputConfig] for the purpose of repopulation when input
validation fail happen.

You can see how ValidationWorkflowAware work when you read the source
code of DefaultWorkflowInterceptor.

Basically, the idea is similar. But, [InputConfig] need you to appoint
a method name every time.
So I think it is more convenient if I use ValidationWorkflowAware.

My solution looks like:
(1)Define a class BaseAction as the base class for all my Action class
(2)In BaseAction, implement [ValidationWorkflowAware]
(3)In the method [getInputResultName], call a protected method
[loadData] which is empty(for now), and then return [INPUT] as the
result name
(4)In specific action class, override the method [loadData], and do
the real repolulation job for this page

So I can keep all the action class do the same work in the same way.
When the project and the develop team get large, I think the
consistency of code convention
is much important than just get the job done.

Hope this helps.



2010/11/6 Alfredo Manuel Osorio Martinez alfredo.oso...@afirme.com:
 Hello,

 By looking at DefaultWorkflowInterceptor I saw an annotation that I
 didn't know existed. I am talking about:

 com.opensymphony.xwork2.interceptor.annotations.InputConfig

 I think it can be used for input repopulation and can be used as an
 alternative to Preparable and s:action/.

 What surprised me was that there is a little documentation about the use
 of the annotation or examples.

 Haver you ever used this one before?

 Is it a good idea to use it for input repopulation for example
 collections for selects in case a validation fails?

 Thanks

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
  if I click the button to move the items, it doesn't work.

Does any javascript error show up?

Can you show us your entire source code?

2010/11/6 Mead Lai laiqi...@gmail.com:
 Hi All,

 I am now using s:optiontransferselect tag with simple theme.
 It shows two select-list fine, but if I click the button to move the items,
 it doesn't work.
 Any clue can help me?
 Now I am trying to write a double-select with JQury  HTML.
 Thank you in advance.

 Regards,
 Mead


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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Mead Lai
Thanks for you reply.
There is a JavaScript Error, showsno object found, and I checked the page
HTML source, found there was no JavaScript files included.
Than I add a tag head theme=ajax/, it cause a exception  no freeMark
template found. It seems the tag head theme=ajax/ was obsolete.

Regards,
Mead


Re: Setting css of a row

2010-11-06 Thread Mead Lai
right, set a property in Action.
private String color;
private String css;
then generate get/set.
table bgcolor='${color}' class='{$css}'
...
table/

Regards,
Mead


Re: How to pass date from action to custom jsp tag?

2010-11-06 Thread Li Ying
The value passed to tag attribute is a simple String.
You have to EVALUATE IT as a expression to get the real value.

You can read the source of Struts2 tag lib to study how they evaluate
the expression.

For example:
in class [org.apache.struts2.components.Property]
(This class is invoked by tag s:property)

it calls:
actualValue = (String) getStack().findValue(value, String.class,
throwExceptionOnELFailure);
to retrieve the real value from the value expression

Hope this helps.

2010/11/6 holod serega.shey...@gmail.com:

 Hello, I want to create simple dummy tag.
 I have an action:

 class MyAction extends ActionSupport{

  /** Some code*/
  public Department getRoot(){
    /** Some code foes here...*/
    return departmentInstance;
  }
 }

 a tag:
 %...@tag language=java pageEncoding=UTF-8  body-content=empty  %%@
 attribute name=tree required=true%%@ taglib
 uri=http://java.sun.com/portlet_2_0; prefix=p%p:defineObjects /%...@tag
 import=ejb.model.Department%%
        Object attrTree = pageContext.getAttribute(tree);
        System.out.println(TreeTagHelper-tree=[+attrTree+]);
        if(attrTree!=null){

 System.out.println(TreeTagHelper-tree.class=[+attrTree.getClass().getName()+]);
        }else{
                System.out.println(TreeTagHelper-tree.class=[!!NULL!!!]);
        }
        try{
        //some code...
        }catch(Exception e){
                System.out.println(Error while drawing 
 tree[+e.getMessage()+]);
        }
 %

 and my jsp with tag:

 pext:drawTree tree=root/

 What do I have to do if I want to pass result of MyAction#getRoot to my
 dummy tag?

 I've tried to these:
 pext:drawTree tree=root/
 pext:drawTree tree=#{root}/
 pext:drawTree tree=${root}/
 pext:drawTree tree=%{root}/

 Nothing happens, i tag I get String with value root or get null.

 I can't pass an object to tag attribute... 

 What do I do wrong?
 --
 View this message in context: 
 http://old.nabble.com/How-to-pass-date-from-action-to-custom-jsp-tag--tp30144287p30144287.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: Have you ever used InputConfig annotation?

2010-11-06 Thread Maurizio Cucchiara
InputConfig works as documented. I reccomend to use Li's suggestion
for inheritance matter. When you need to overwrite base class
behavior, then mark method with InputConfig annotation.

2010/11/5 Alfredo Manuel Osorio Martinez alfredo.oso...@afirme.com:
 Hello,

 By looking at DefaultWorkflowInterceptor I saw an annotation that I
 didn't know existed. I am talking about:

 com.opensymphony.xwork2.interceptor.annotations.InputConfig

 I think it can be used for input repopulation and can be used as an
 alternative to Preparable and s:action/.

 What surprised me was that there is a little documentation about the use
 of the annotation or examples.

 Haver you ever used this one before?

 Is it a good idea to use it for input repopulation for example
 collections for selects in case a validation fails?

 Thanks



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





-- 
Maurizio Cucchiara

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
no object found looks like some javascript is running, but it could
not found an object in the HTML DOM.
so, it looks like not an error of javascript file, but an error of
your HTML DOM.
For example, ID of some element is missed.

Again, I need read the entire source code before I can tell what is
getting wrong.



2010/11/6 Mead Lai laiqi...@gmail.com:
 Thanks for you reply.
 There is a JavaScript Error, showsno object found, and I checked the page
 HTML source, found there was no JavaScript files included.
 Than I add a tag head theme=ajax/, it cause a exception  no freeMark
 template found. It seems the tag head theme=ajax/ was obsolete.

 Regards,
 Mead


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



Re: Setting css of a row

2010-11-06 Thread Maurizio Cucchiara
As Dave suggested CSS style is the best candidate for this purpose.
The only things that could change my mind, it's if is a model-related
property (f.e. user defined color, preference, etc)

2010/11/6 cellterry cellte...@gmail.com:

 Dear all,

 I want to set a table row with a color retrieved from an action class, could
 I do that?

 If yes, how to do that?

 Terry.

 --
 View this message in context: 
 http://old.nabble.com/Setting-css-of-a-row-tp30146983p30146983.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





-- 
Maurizio Cucchiara

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Mead Lai
Hi Li,
Thank you very much.
s:optiontransferselect doubleList={'testing','funning'}
list={'spring','hibernate'} doubleName=/s:optiontransferselect
There is no struts JavaScript included in the
Error in Chrome browser.:
Failed to load resource: the server responded with a status of 404 (Not
Found)
 
IndexAction_index.action:300http://localhost:8080/sysmanage/groupmanage/IndexAction_index.actionUncaught
ReferenceError: moveSelectedOptions is not defined
 
IndexAction_index.action:298http://localhost:8080/sysmanage/groupmanage/IndexAction_index.actionUncaught
ReferenceError: moveSelectedOptions is not defined


Regards,
Mead


On Sat, Nov 6, 2010 at 3:37 PM, Li Ying liying.cn.2...@gmail.com wrote:

 no object found looks like some javascript is running, but it could
 not found an object in the HTML DOM.
 so, it looks like not an error of javascript file, but an error of
 your HTML DOM.
 For example, ID of some element is missed.

 Again, I need read the entire source code before I can tell what is
 getting wrong.



 2010/11/6 Mead Lai laiqi...@gmail.com:
  Thanks for you reply.
  There is a JavaScript Error, showsno object found, and I checked the
 page
  HTML source, found there was no JavaScript files included.
  Than I add a tag head theme=ajax/, it cause a exception  no freeMark
  template found. It seems the tag head theme=ajax/ was obsolete.
 
  Regards,
  Mead
 

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




Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
 s:optiontransferselect doubleList={'testing','funning'}
 list={'spring','hibernate'} doubleName=/s:optiontransferselect


Looks like you missed the attribute [name]

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Dave Newton
The JavaScript isn't being included. This is not an Ajax tag, and the s:
head tag needs to be there.

Dave
 On Nov 6, 2010 2:59 AM, Li Ying liying.cn.2...@gmail.com wrote:
 s:optiontransferselect doubleList={'testing','funning'}
 list={'spring','hibernate'} doubleName=/s:optiontransferselect


 Looks like you missed the attribute [name]

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



Re: Have you ever used InputConfig annotation?

2010-11-06 Thread Dave Newton
I still don't believe using a framework-defined method, whose intent is to
return a string result name, to load data is an expressive design.
 On Nov 6, 2010 2:36 AM, Maurizio Cucchiara maurizio.cucchi...@gmail.com
wrote:
 InputConfig works as documented. I reccomend to use Li's suggestion
 for inheritance matter. When you need to overwrite base class
 behavior, then mark method with InputConfig annotation.

 2010/11/5 Alfredo Manuel Osorio Martinez alfredo.oso...@afirme.com:
 Hello,

 By looking at DefaultWorkflowInterceptor I saw an annotation that I
 didn't know existed. I am talking about:

 com.opensymphony.xwork2.interceptor.annotations.InputConfig

 I think it can be used for input repopulation and can be used as an
 alternative to Preparable and s:action/.

 What surprised me was that there is a little documentation about the use
 of the annotation or examples.

 Haver you ever used this one before?

 Is it a good idea to use it for input repopulation for example
 collections for selects in case a validation fails?

 Thanks



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





 --
 Maurizio Cucchiara

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



Re: How to pass date from action to custom jsp tag?

2010-11-06 Thread Dave Newton
If you're getting the string root then the JSP EL isn't being evaluated,
but we don't know which iteration caused that behavior. If you're getting
null, you may be passing null. I'm not sure why you're not just using EL to
get the tag argument in the tag. IIRC you can also define the expected type
of the attribute.

Portlets don't always act like a regular web app, so I'd also make sure what
you're trying to do is possible the way you're trying to do it.

Dave
 On Nov 5, 2010 2:17 PM, holod serega.shey...@gmail.com wrote:


Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
I read the source of optiontransferselect, it's template will
include the JS file [/struts/optiontransferselect.js] automatically.

The JS file included by head tag is [/struts/utils.js]. The is
nothing relate to optiontransferselect in it.

2010/11/6 Dave Newton davelnew...@gmail.com:
 The JavaScript isn't being included. This is not an Ajax tag, and the s:
 head tag needs to be there.

 Dave
  On Nov 6, 2010 2:59 AM, Li Ying liying.cn.2...@gmail.com wrote:
 s:optiontransferselect doubleList={'testing','funning'}
 list={'spring','hibernate'} doubleName=/s:optiontransferselect


 Looks like you missed the attribute [name]

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
Sorry, type error:

The is nothing ...

should be

There is nothing ...

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



Re: How to use s:optiontransferselect/

2010-11-06 Thread Mead Lai
Appreciate all of you very much.
Is the /struts/optiontransferselect.js included in the struts-core.jar?
I am confused why the optiontransferselect.js was not automatically
imported/generated into HTML page.
I config the struts.theme = simple for entire project.

Regards,
Mead


On Sat, Nov 6, 2010 at 9:08 PM, Li Ying liying.cn.2...@gmail.com wrote:

 Sorry, type error:

 The is nothing ...

 should be

 There is nothing ...

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




Re: How to use s:optiontransferselect/

2010-11-06 Thread Li Ying
The template of optiontransferselect has these code:

#if !stack.findValue(#optiontransferselect_js_included)??#t/
script type=text/javascript src=@s.url
value=/struts/optiontransferselect.js encode='false'
includeParams='none'//script
#assign temporaryVariable =
stack.setValue(#optiontransferselect_js_included, true) /#t/
/#if

These code should generate some HTML code which import the JS file.

And, the JS file is in the struts2-core-2.2.1.jar, under the path
[/org/apache/struts2/static/].


 I am confused why the optiontransferselect.js was not automatically 
 imported/generated into HTML page

Maybe there are something else getting wrong.
(1)check if the HTML code is right
(2)check if there are error messages on the client side
(3)check if there are  exceptions on the server side
Maybe you can find something.






2010/11/7 Mead Lai laiqi...@gmail.com:
 Appreciate all of you very much.
 Is the /struts/optiontransferselect.js included in the struts-core.jar?
 I am confused why the optiontransferselect.js was not automatically
 imported/generated into HTML page.
 I config the struts.theme = simple for entire project.

 Regards,
 Mead


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



Re: Implmentation of RESfull ecache in S2-REST

2010-11-06 Thread Stefan Magnus Landrø
you will typically have to use something like axis or jersey to put / get
cache entries from the ehcache server (instead of using the standard ehcache
api)

Stefan


On Fri, Nov 5, 2010 at 6:41 AM, Frans Thamura fr...@meruvian.org wrote:

 hi all

 just got this

 http://ehcache.org/documentation/cache_server.html

 but i still dont get how to implement it in S2-REST

 anyone can share and help my stacked brain

 F




-- 
BEKK Open
http://open.bekk.no


Re: Implmentation of RESfull ecache in S2-REST

2010-11-06 Thread Frans Thamura
I believe using jersey is create a rest outside struts2 rest and we cannt 
benefit using s2


/m/

-Original Message-
From: Stefan Magnus Landrø stefan.lan...@gmail.com
Date: Sat, 6 Nov 2010 21:41:07 
To: Struts Users Mailing Listuser@struts.apache.org
Reply-To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Implmentation of RESfull ecache in S2-REST

you will typically have to use something like axis or jersey to put / get
cache entries from the ehcache server (instead of using the standard ehcache
api)

Stefan


On Fri, Nov 5, 2010 at 6:41 AM, Frans Thamura fr...@meruvian.org wrote:

 hi all

 just got this

 http://ehcache.org/documentation/cache_server.html

 but i still dont get how to implement it in S2-REST

 anyone can share and help my stacked brain

 F




-- 
BEKK Open
http://open.bekk.no



Re: Setting css of a row

2010-11-06 Thread cellterry

OK, I think a possible way, which is, for example, the following, will show
color or style if a record is cancelled or not.

s:iterator value=pos status=st
s:if test=(pos[#st.index].statusmaskCancel)!=0
tr s:if test=#st.oddclass=data_cancelled0/s:if
s:elseclass=data_cancelled1/s:else
/s:if

But if I want to compute css of all records with 3 days before outstanding
day, I will need to add a temporary field in data model for ease of
computation of stylesheet as I want to keep logic not in view side.

Terry.


Dave Newton-6 wrote:
 
 The same way you retrieve any action property.
 
 That said, I'm not a fan of mixing layers like that: * possibly* get
 something business- oriented from the action and use CSS to style it...
 but
 a color from the action is poor design.
 
 Dave
  On Nov 6, 2010 12:46 AM, cellterry cellte...@gmail.com wrote:

 Dear all,

 I want to set a table row with a color retrieved from an action class,
 could
 I do that?

 If yes, how to do that?

 Terry.

 --
 View this message in context:
 http://old.nabble.com/Setting-css-of-a-row-tp30146983p30146983.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

 
 

-- 
View this message in context: 
http://old.nabble.com/Re%3A-Setting-css-of-a-row-tp30147066p30152211.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