Re: Struts vs JSF

2007-01-30 Thread Piero Sartini
I had the same problem some time ago. At the end I decided to go with struts2 
instead of JSF for several reasons:

- development time (i am familar with action based frameworks - it reflects 
better how i think of web application)
- there is no good JSF framework out there in my eyes. nothing that can 
compare to the out-of-box functionality of struts2.
- i dont think it will be replaced anytime soon - and the team has proven that 
they support the framework very well (struts1) and for a long time.

anyway, if you intend to use visual tool support to build your webapp, JSF is 
the better(only) choice.

after all i came to the conclusion not to think about what will be the next 
standard, what will be the better choice from technology point but to ask 
myself: what framework will solve my problem best _now_.

by the way: until now I am very happy with my choice :-)

regards,
piero


Am Montag, 29. Januar 2007 19:46 schrieb Zhang, Larry (L.):
 Can some one say something about the direction of Struts? Can we say it
 will be replaced by JSF eventually? Is it easy to migrate struts to JSF?

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

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



Re: Exceptions design

2007-02-04 Thread Piero Sartini
Hello,

it sure is a matter of taste - but I think its not good to use exceptions for 
this kind of things. After all User not found is not an _exception_. Its a 
well defined case and it happens frequently. (Except you rely on that the 
user exists, eg. in step 2 of a registration process)

I have a rule: If something is defined and I know it will happen often, it 
should not be an exception. It is a path in the application.

Am Sonntag, 4. Februar 2007 18:01 schrieb Francisco Exposito Aguilera:
 Hello all,

 I have a doubt about how design the exceptions in my struts project. I have
 the action classes and the bean classes. The action classes execute methods
 from bean classes, which connect to the database.

 Supposing I am trying to create a user in one of my web pages and the user
 I want to create exists. What is the best way to show the user this sql
 error?

 1.Throw the exception in the bean class to the struts ModuleException and
 show a typical error page. (I hope this is not the best way because I don´t
 like it).

 2.Before execute the createUser bean method, execute another method to
 check if the user already exists. If it exists, use ActionMessages in the
 action class to show the error in the same createUser.jsp file.

 That means that if the user doesn´t exist, the action method will access,
 at least twice to the database, one for check if the user exists and one
 for create it.

 3.Execute the createUser bean method using try and finally but without
 catch; and throw the SQL exception.

 public OTDUser validUser (String dni, String passwd) throws SQLException
 {
   try
   {
   Connection to the database and results
   }
   finally
   {
   Close resultSet, statement and connection
   }
 }

 The exception will be catched by the action class, where there is a
 catch(SQLException), which will receive the exception from the bean method

 java.sql.SQLException: ORA-1: unique restriction (PK_USER) violated

 And with ActionMessages show it in the same createUser.jsp. But now, can I
 know if the SQLException is caused by:

 a) Primary key is violated (java.sql.SQLException: ORA-1: unique
 restriction (PK_USER) violated)

 b) Name and both surnames are unique (java.sql.SQLException: ORA-1:
 unique restriction (U_NAME_SURNAME1_SURNAME2_U) violated)

 Depending on the exception, I want to show “primary key exists” or “name
 and surnames exists with another primary key”

 4.Any suggestion?

 Thanks a lot.

 _
 Horóscopo, tarot, numerología... Escucha lo que te dicen los astros.
 http://astrocentro.msn.es/


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

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



Authentication / RolesInterceptor

2007-02-08 Thread Piero Sartini
Hello List,

i try figuring out how security will work with struts2. I have an EJB3 
application - the frontend will be written using s2.

I added the RolesInterceptor to an action:
- code 
interceptor-ref name=roles
param name=allowedRolesportalUser/param
/interceptor-ref
- code 

Accessing this action does give me a 403 - thats ok, because I am not logged 
in. But how do I login?

My web.xml looks like that:
- code 
login-config
auth-methodFORM/auth-method
realm-nameMyCustomRealm/realm-name
form-login-config
form-login-page/Login_input.action/form-login-page
form-error-page/Login_error.action/form-error-page
/form-login-config
 /login-config
security-role
descriptionregistered portal user/description
role-nameportalUser/role-name
/security-role
- code 

is this correct? Is it even possible to use FORM-based authentication with 
struts2? If not, could you please give me a hint how this will work? 

Goal is that the user is presented with the login form if he is not 
authenticated - if he logged in successfully within that form, the 
intercepted action should continue.

Thanks in advance,
Piero

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



Re: Authentication / RolesInterceptor

2007-02-09 Thread Piero Sartini
Am Donnerstag, 8. Februar 2007 schrieb Ian Roughley:
 You probably don't need to send it to an action, you just need to render
 the HTML form for authentication.  So, login.jsp would suffice.  As far
 as s2 is concerned, authentication is completely external.  The role
 interceptor just uses the HttpServletRequest to obtain the roles that
 the current user is logged in under.

If security is completely external, what is the Interceptor for? Defining a 
SecurityConstraint in the web.xml file will prevent unauthorized access as 
well, wouldnt it? (It seems to be the wrong way to me - I define the actions 
in struts.xml, I do not see the point to include them in web.xml as well for 
security)

But the interceptor just responds a 403 if the user is not authoriuzed - is 
there no possibility to present another action in this case (the login 
form?).

Or do I misunderstand this whole thing completely?

- code -
security-constraint
display-nameConstraint1/display-name
web-resource-collection
web-resource-nameprofile/web-resource-name
descriptionchange user profile/description
url-pattern/EditProfile_input.action/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
http-methodHEAD/http-method
http-methodPUT/http-method
http-methodOPTIONS/http-method
http-methodTRACE/http-method
http-methodDELETE/http-method
/web-resource-collection
auth-constraint
description/
role-nameportalUser/role-name
/auth-constraint
/security-constraint
 code -

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



[s2] s:url with JSPX?

2007-02-14 Thread Piero Sartini
--- code ---
lia href=s:url action=Register/Register/a/li
--- code ---

This is form the doc of the s:url tag. With jspx this does not work (malformed 
xml). How do I use it? 

I need it for the css in the header, so s:a does not help me.

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



Problem with 2.0.6

2007-02-27 Thread Piero Sartini
upgraded to 2.0.6 - now the error below is thrown when accessing an Action 
with validators.

dont know if it is important, but ajax-validation is enabled and the 
annotation looks like this:

--- code ---
   @RequiredStringValidator(message = Login is required, key 
= error.loginname.missing)
public String getLogin() {
return login;
}
--- code ---


Exec[0]: validator.doPost()
Caught OgnlException while setting property 'methodName' on 
type 'com.opensymphony.xwork2.validator.validators.RequiredStringValidator'.
ognl.NoSuchPropertyException: 
com.opensymphony.xwork2.validator.validators.RequiredStringValidator.methodName
at 
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at 
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at 
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:103)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:90)
at 
com.opensymphony.xwork2.ObjectFactory.buildValidator(ObjectFactory.java:234)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.getValidator(ValidatorFactory.java:252)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:79)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:134)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:109)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:96)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:142)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:148)
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)




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



Re: [S2] Problem with 2.0.6

2007-02-28 Thread Piero Sartini
Am Dienstag, 27. Februar 2007 schrieb cilquirm:
 I see errors like that on occasion ( mine is with the JSONResult type and
 the location property ), but they've always been warnings.

 Is yours logged at the ERROR level?

they are logged at WARNING level. Should I just ignore them? I do not feel 
good with this errors..

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



Re: [S2] Problem with 2.0.6

2007-02-28 Thread Piero Sartini
 I do.
 It looks vicious, but is pretty harmless.
 You could wipe it out of your logs by setting the class that throws it to
 only log ERROR and greater.

I will do it for development - but I hope this gets fixed. Exceptions are the 
slowest parts in the jvm as far as I know. Performance cant be good if lots 
of exceptions are thrown each time an action gets called ...

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



Re: Problem with 2.0.6

2007-02-28 Thread Piero Sartini
Am Mittwoch, 28. Februar 2007 schrieb Ted Husted:
 Is DevMode set to false?

no, its set to true.

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



Re: Problem with 2.0.6

2007-02-28 Thread Piero Sartini
Thanks for clearing this config option.
But the error does not go away with DevMode set to false.

Am Donnerstag, 1. März 2007 schrieb Ted Husted:
 In DevMode, the framework logs a number of extra warnings. In this
 case, a control is being submitted that doesn't have a corresponding
 property. This might be OK (and probably is), but in DevMode, the
 framework nags us just to be sure.

 In production or late development, always set DevMode to false, since
 in DevMode the framework does a number of other similar things that
 can be helpful during development but are painful otherwise.

 I opened a ticket today to default our example applications to
 DevMode=false so as to alleviate some of the confusion.

 -Ted.

 On 2/28/07, Piero Sartini [EMAIL PROTECTED] wrote:
  Am Mittwoch, 28. Februar 2007 schrieb Ted Husted:
   Is DevMode set to false?
 
  no, its set to true.

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

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



AJAX Theme / submit form to new page?

2007-03-08 Thread Piero Sartini
I am using the ajax theme mainly because of the validator and some features 
like tabbed pane etc.

But if I submit a form, I want to submit that form and go to the result of the 
action - not load it into a div. the result gets decorated again, and I do 
not want to force the users into activating javascript.

how do I get the normal behaviour for the submit buttons?

piero.

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



Re: AJAX Theme / submit form to new page?

2007-03-08 Thread Piero Sartini
But my form tag contains theme=ajax because of the validation. is it right 
to make the submit button theme=css_xhtml to avoid the ajax-submit?


Am Donnerstag, 8. März 2007 schrieb Musachy Barroso:
 Just use the regular submit tag. (no theme=ajax).

 musachy

 On 3/8/07, Piero Sartini [EMAIL PROTECTED] wrote:
  I am using the ajax theme mainly because of the validator and some
  features
  like tabbed pane etc.
 
  But if I submit a form, I want to submit that form and go to the result
  of the
  action - not load it into a div. the result gets decorated again, and I
  do not want to force the users into activating javascript.
 
  how do I get the normal behaviour for the submit buttons?
 
  piero.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: AJAX Theme / submit form to new page?

2007-03-08 Thread Piero Sartini
Am Donnerstag, 8. März 2007 schrieb Piero Sartini:
 But my form tag contains theme=ajax because of the validation. is it
 right to make the submit button theme=css_xhtml to avoid the ajax-submit?

it needs to be xhtml theme on the submit button.
not very elegant in my oppinion - but it works :)

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



Re: [S2] Newbie question about HTTP Sessions

2007-03-08 Thread Piero Sartini
Hello.

 A couple of newbie questions. Firstly, does Struts2 automatically
 create an HTTP Session or do I need to explicitly create it. 

Sessions are managed by the servlet-container. Struts does not need to create 
them.

 Early 
 experimentation suggests that it's automatically created as I'm seeing
 the JSESSIONID parameter in the Urls generated without doing anything,
 but I'd like to be sure. 

Yes - you are right. The sessions are generated automatically by the container 
(tomcat, etc).

 Secondly I need to know when a session is 
 ended. Is there an established Struts 2 practice for this or do I
 still create an HTTPSessionListener object and register it in web.xml
 as I would with a basic web-app.

HTTPSessionListener?

You can use 
--- code ---
session-config
  session-timeout30/session-timeout 
/session-config
--- code ---

the timeout is given in minutes. after this time the session is destroyed.

Piero.

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



Re: [S2] Newbie question about HTTP Sessions

2007-03-08 Thread Piero Sartini
  Secondly I need to know when a session is
  ended. Is there an established Struts 2 practice for this or do I
  still create an HTTPSessionListener object and register it in web.xml
  as I would with a basic web-app.

 HTTPSessionListener?

 You can use
 --- code ---
 session-config
   session-timeout30/session-timeout
 /session-config
 --- code ---

 the timeout is given in minutes. after this time the session is destroyed.

Ups, sorry. Did not understand it right ;)
If you need to know when a session is ended I would do it like in every other 
web application.

Piero.

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



OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Hello,

I get the following error when trying to create a list with ognl:

org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48) 
#{'F':'Female','M':'Male'} 
contains invalid expression(s): javax.el.ELException: Error Parsing: 
#{'F':'Female','M':'Male'}

the code in jspx:
s:select label=%{getText('profile.gender')}
  name=gender
  headerKey=-1 
headerValue=%{getText('profile.selectgender')}
  list=#{'F':'Female','M':'Male'}
  value=gender
  required=true/

It seems it thinks it is JSP EL (what makes sense in a jsp file). I am using 
JSP 2.1 - is this a problem for s2?

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Found the answer in the opensymphony forum:
http://forums.opensymphony.com/thread.jspa?messageID=100059

On glassfish, it seems you have to disable EL:
  !-- = Disable the JSP-EL, it messes up on pages with OGNL 
=== --
  jsp-config
jsp-property-group
  url-pattern*.jspx/url-pattern
  el-ignoredtrue/el-ignored
/jsp-property-group
  /jsp-config

Will this issue get resolved in the future?


Am Dienstag, 13. März 2007 schrieb Piero Sartini:
 Hello,

 I get the following error when trying to create a list with ognl:

 org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48)
 #{'F':'Female','M':'Male'} contains invalid expression(s):
 javax.el.ELException: Error Parsing: #{'F':'Female','M':'Male'}

 the code in jspx:
 s:select label=%{getText('profile.gender')}
   name=gender
   headerKey=-1
 headerValue=%{getText('profile.selectgender')}
   list=#{'F':'Female','M':'Male'}
   value=gender
   required=true/

 It seems it thinks it is JSP EL (what makes sense in a jsp file). I am
 using JSP 2.1 - is this a problem for s2?

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

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



Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
  Will this issue get resolved in the future?

 That may have to do with the JSF EL, which also uses #
 as its escape char.

 If that's the case, probably not?

That is the case. But why not? Its not JSF EL but JSP EL.
I don't think its good to be incompatible with JSP..

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



Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
I do have the same Problem. But my map does not come from app-context.

The error is the same:
tag 'select', field 'list', name 'country': The requested list 
key 'countryMap' could not be resolved as a 
collection/array/map/enumeration/iterator type. Example: people or people.
{name} - [unknown location]

my action-code:
--- code ---
public Map getCountryMap() {
return Constants.getCountryMap();
}
--- code ---

my jspx code:
--- code ---
s:select label=%{getText('profile.country')}
  name=country
  headerKey=-1 
headerValue=%{getText('profile.selectcountry')}
  list=countryMap
  value=countryCode
  required=true/  
--- code ---

Am Donnerstag, 15. März 2007 schrieb David Harland:
 How do you provide a Map from the application scope for the list of a
 s:select.

 I keep getting the following error

 The requested list key 'referenceLookup.idQuestionOptions' could not be
 resolved as a collection/array/map/enumeration/iterator type. Example:
 people or people.{name} - [unknown location]

 __
 Ufi Limited
 Registered in England No.  3980770
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP

 learndirect Solutions Ltd
 Registered in England No. 5081669
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP

 UFI Charitable Trust
 Registered in England No.  3658378
 Registered Charity No.  1081028
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP

 This email has been scanned by the MessageLabs Email Security System.

 __

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



Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
 --- Piero Sartini wrote:
  return Constants.getCountryMap();

 What does Constants.getCountryMap() return?

the map looks like:
{de=de, it=it, en=en}

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



Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
It just testing-code and does not make much sense. but here we go.
I had a list before .. so the map is constructed from the list.

--- code ---
public static ListString countryCodes = new ArrayListString(
Arrays.asList(
de, en, it
));

public static MapString,String countryMap = null;

public static Map getCountryMap() {
if (countryMap == null) {
countryMap = new HashMapString,String();
for (String s : countryCodes) {
countryMap.put(s,s);
}
}
return countryMap;
}
--- code ---

Am Donnerstag, 15. März 2007 schrieb Dave Newton:
 --- Piero Sartini [EMAIL PROTECTED] wrote:
  Am Donnerstag, 15. März 2007 schrieb Dave Newton:
   --- Piero Sartini wrote:
return Constants.getCountryMap();
  
   What does Constants.getCountryMap() return?
 
  the map looks like:
  {de=de, it=it, en=en}

 No, I want the actual code for the map's construction
 and retrieval method, because so far I have no idea
 why it wouldn't work.

 d.




 ___
_ TV dinner still cooling?
 Check out Tonight's Picks on Yahoo! TV.
 http://tv.yahoo.com/

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

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



Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-19 Thread Piero Sartini
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
 --- Piero Sartini [EMAIL PROTECTED] wrote:
  --- code ---

 Are you sure you are using the right Action to reach
 the JSP? I cannot duplicate the problem with identical
 code. (I am not using JSPX, although I'm not sure that
 would matter.)

Uh - you are right. My fault, sorry. I created a result in my Login action 
that presented the profile jsp if some data was missing. I added the list for 
the select box to the Profile action ...

Redirect to Profile action instead of just displaying the jsp seams to be 
better ;) Guess I need a lot more practice with s2.

Piero.

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



[s2] Possibility to hide input fields if not empty?

2007-03-19 Thread Piero Sartini
Just wondering how you guys would make something like this:
When a Field in a form is null or empty it should be displayed, if it is 
already filled it should disappear.

Is there an easy way to do this with s2? Use-Case is to ask the user missing 
information after login.

Piero.

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



Re: s.autocompleter with JSON Plugin

2007-03-20 Thread Piero Sartini
I tried to apply the patch that is in JIRA - but it does not work. I guess it 
is not only the change in the JavaScript but somewhere in the Java classes as 
well.

Is there a prepackaged 2.0.7 somewhere? Or do I have to build it by myself?

Need to present s2 soon and it would be great if I get this to work till then.

Regards,
Piero

Am Samstag, 17. März 2007 schrieb Musachy Barroso:
 This was an issue in 2.0.6 and it is fixed on 2.0.7:

 https://issues.apache.org/struts/browse/WW-1659

 As Dave mentioned in 2.0.6 the autocompleter was expecting an array of
 arrays. Now the autocompleter will use the following logic to determine how
 to load the data:

 1. If the response is an array, use it
 2. If the response is an object, and has a field  that matches the
 dataFieldName attribute in the autocompleter, use it.
 3. If the response is an object, and has a field that starts with the
 name of the autcompleter use it
 4. If a field of type array is found, use it

 so the following cases will work:

 public class MyAction {
private String[][] states;  //data here
 }

 s:autocompleter dataFieldName=states .. // #2
 s:autocompleter name=state ..  //#3
 s:autocompleter ... //#4

 regards
 musachy

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



Re: s.autocompleter with JSON Plugin

2007-03-20 Thread Piero Sartini
Am Dienstag, 20. März 2007 schrieb Musachy Barroso:
 I think the daily builds are for 2.1 only. If you want to build it:

 http://struts.apache.org/2.x/docs/building-with-maven.html

I tried to build tags/STRUTS_2_0_7 as well as trunk. both seem to be broken:
[surefire] Running org.apache.struts2.views.xslt.XSLTResultTest
2007-03-20 23:41:57,404 ERROR [XSLTResult.java:365] : Unable to render XSLT 
Template, 'nofile.xsl'
javax.xml.transform.TransformerException: Stylesheet nofile.xsl not found in 
resources.

 The autocompleter tag can be used without the json plugin, check showcase
 for examples.

Seems to be my only chance, thanks :)

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



Re: [s2] Possibility to hide input fields if not empty?

2007-03-21 Thread Piero Sartini
Thanks, this will work. But I was not specific enough.
If there is a way to use the Validators for this task, that would be really 
handy (if valid then do not display).


Am Dienstag, 20. März 2007 schrieb joey:
 Just use condition tag to hide your fields,like this:
 s:if test=user.email==null
 s:textfield key=user.email name=user.email /
 /s:if

 On 3/20/07, Piero Sartini [EMAIL PROTECTED] wrote:
  Just wondering how you guys would make something like this:
  When a Field in a form is null or empty it should be displayed, if it is
  already filled it should disappear.
 
  Is there an easy way to do this with s2? Use-Case is to ask the user
  missing
  information after login.
 
  Piero.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: [S2 Tip] Use namespaces to organize your application into logical modules

2007-03-23 Thread Piero Sartini
Thank you Ted,

like Harring I also wondered what namespaces are all about and decided they 
arent that important to me - however, already tried to make action names 
like foo/bar. Now I consider namespaces very useful.

Maybe this should be included in the wiki somewhere. (Tips  Tricks Corner?)

I would love to see more such posts :-)

Piero

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



Re: [s2] accessing servlet context from an action

2007-03-23 Thread Piero Sartini
 However, I am completely lost with Struts 2. Everything servlet
 dependent is abstracted away somewhere. I've been looking at the
 tutorials and they don't cover this kind of thing at all.

 How do I go about putting the equivalent in an action with Struts 2?

An action class can implement ServletContextAware - you have to implement a 
method setServletContext(ServletContext servletContext) then.

Another way is to use ServletActionContext.getServletContext();

Piero

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



Re: [s2] accessing servlet context from an action

2007-03-23 Thread Piero Sartini
 I will create a FAQ entry.

good idea.
maybe it makes sense to merge it with this one:
http://struts.apache.org/2.0.6/docs/how-can-we-access-the-httpservletrequest.html

Piero

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



Re: [s2] accessing servlet context from an action

2007-03-23 Thread Piero Sartini
 I'm looking at the javadoc for this, it doesn't say much. Do I just
 create a class scope variable for the session context and then set
 that from the argument in the set method?

That is exactly how it works. You might want to look at ServletSessionAware, 
ServletRequestAware, ServletResponseAware as well - it works the same way.

 Is this set method called automagically by the framework when the
 action is first accessed or when the web app is deployed? 

I think it is called when the action is instantiated, but I am not totally 
sure.

 If I put 
 this in the base action class and extend that for my other actions,
 will this cause problems, or does each final action class need to
 implement this?

This should not make any problems. You can extend a generic action that 
implements all the stuff that is common to all your actions. I am doing it 
the same way and it works well.

One thing you have to take care of is that there are issues if you want access 
in the constructor of an action (struts has no chance to call the set method 
then).

Piero.

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



Re: Struts 2.0.6 Spring - Struts 2.0.1 work very well

2007-03-23 Thread Piero Sartini
Am Freitag, 23. März 2007 schrieb Dave Newton:
 --- Daniel Felix [EMAIL PROTECTED] wrote:
  [ the two JAR files ]

 I still think it's the double-JAR problem.

yes, looks like that. the error message says it all.
struts2-spring-plugin is loaded in 2 places:

acnsf/struts2-spring-plugin-2.0.6.jar
and
acnsf/acnsf_war_war/WEB-INF/lib/struts2-spring-plugin-2.0.6.jar

It looks like the lib is added to the ear project as well as to the war 
project contained within the ear.

Piero

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



Re: @ExpressionValidator annotation ognl.NoSuchPropertyException: com.opensymphony.xwork2.validator.validators.ExpressionValidator.methodName

2007-03-23 Thread Piero Sartini
I see this warning as well when using ajax-validation. It seems ognl expects 
a .methodName method which is not there in the struts validators.

There is another thread regarding this problem with the Topic Problem with 
2.0.6. The warning is there in 2.0.7 as well.

Ted suggested to turn off devMode, but the warning remains.

Piero

Am Montag, 5. März 2007 schrieb Alex Wibowo:
 Gday...


 I am using the @ExpressionValidator annotation. So far it is working
 alright, apart from this exception I was getting:

 WARNING: Caught OgnlException while setting property 'methodName' on type '
 com.opensymphony.xwork2.validator.validators.ExpressionValidator'.
 ognl.NoSuchPropertyException:
 com.opensymphony.xwork2.validator.validators.ExpressionValidator.methodName

 Did anyone else get this error? According to the API, the
 @ExpressionValidator does not require any methodName parameter. So I am
 not sure
 what this exception is all about. I havent looked at the source code yet..

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



Re: Accessing a Bean from a bean using EL with STRUTS 2 - I really need help

2007-04-07 Thread Piero Sartini
On Saturday 07 April 2007 22:15:18 [EMAIL PROTECTED] wrote:
 Now since it looks like I am running into compatibility issues, is there
 any alternative for this tag lib ?
 I need some thing very similar that provides paging and to be as easy an
 .net control components.
 Does struts provides a similar components ?

There is the table-tag plugin which is currently in beta stage. Maybe this is 
what you are looking for:
http://cwiki.apache.org/S2PLUGINS/table-tags.html

Piero

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



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-04-07 Thread Piero Sartini
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Error listenerStart
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/person] startup failed due to previous errors

looks like there is a problem with a listener in your web.xml

 I tried to 
 setup a log4j properties file. But, I am new to Eclipse Web development
 environment, I couldn't fine a right place for the log4j.properties file
 and also what properties I should setup catch the problems.

The log4j.properties file should be in the root of your classpath.
btw if you are new to Eclipse, give NetBeans a try as well.

Piero

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



Re: sub-struts

2007-04-07 Thread Piero Sartini
 I want each widget to be programmed with struts, meaning that:
 Each widget must have it's own control configuration (struts.xml) and
 it's own set of classes. 

If you are using struts2, you could develop your widgets within their own 
packages and namespaces within your main application.

See the following threads as well:
http://www.mail-archive.com/user%40struts.apache.org/msg57255.html
http://www.mail-archive.com/user%40struts.apache.org/msg57600.html

Piero

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



Re: sub-struts

2007-04-07 Thread Piero Sartini
On Sunday 08 April 2007 01:13:33 Asaf Paris Mandoki wrote:
 How can I call an action of a widget form an action of the application
 and have the result returned as a string?

Look at the action tag [1]. You can execute an action and store its result 
within a request property.

Piero

[1] http://cwiki.apache.org/WW/action.html

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



Re: sub-struts

2007-04-07 Thread Piero Sartini
On Sunday 08 April 2007 02:01:24 Asaf Paris Mandoki wrote:
 I forgot to say that the directory structure i wrote on my first post
 (which was wrong [forgot the web-inf directory]), should be inside a
 directory of the application. So each widget should have it's own
 classes directory, struts.xml, etc.

 The directory nesting is not necessary, but the widgets will work as
 children to the main application will be nested so it makes more sense
 to me.

 The objective is to have struts within struts.

Yes, I did understand that. Just did not understand why you would want that 
and tried to show other solutions that may solve your needs :-)

If you really want to make several struts2 applications and compose them 
somehow, you could use sitemesh to do so. But I think configuring and 
developing several stand-alone webapps is much more work than developing 
everything within one s2 application.

Piero

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



Re: [S2] wiki edit

2007-04-08 Thread Piero Sartini
On Monday 09 April 2007 03:30:27 Jae K wrote:
 Can users get access to edit the wiki? It's driving me crazy.

You have to sign a CLA first. More information: 
http://struts.apache.org/helping.html#documentation

Piero

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



Re: [s2] Struts Dependency Injection and EJB3 - support ? or how can i Do it?

2007-04-08 Thread Piero Sartini
I coded this today, just used the field instead of a setter method. Your 
pseudo code was very helpful, thanks :-)

Maybe the following snippet is useful for someone with the same problem.
Should I post this on the wiki as well? I am not sure if it is a good 
solution - but it works for me.

Can someone please tell me if it is ok to call this every time an action needs 
the service, or would it be better to cache the service somewhere in 
application scope? I am quite new to this whole ejb thing.

Piero


 EJBInterceptor.java 
public class EJBInterceptor extends AbstractInterceptor implements Interceptor 
{
public String intercept(ActionInvocation actionInvocation) throws 
Exception {
Object action = actionInvocation.getAction();
for (Field f : action.getClass().getDeclaredFields()) {
if (f.isAnnotationPresent(EJB.class)) {
f.setAccessible(true);
String serviceName = f.getType().getName();
Object service = null;
try {
InitialContext ic = new InitialContext();
service = ic.lookup(serviceName);
} catch (Exception ex) {
System.out.println(Error: +ex.getMessage());
}
f.set(action, f.getType().cast(service));
break;
}
}
return actionInvocation.invoke();
}
}
 code 

 EJB.java 
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface EJB {
}
- code 


On Tuesday 23 January 2007 01:05:57 Ian Roughley wrote:
 I can't provide the code - it is owned my a client.  But here is the
 pseudo code:

 class EJB3Interceptor implements Interceptor {

public String intercept(ActionInvocation actionInvocation) throws
 java.lang.Exception {
 Object action = actionInvocation.getAction();
 for all methods {
   if( this is a setter and it is annotated as expected ) {
  look up the EJB
  set the EJB on the action
   }
}
 }

 }

  From here you would need to ensure that the interceptor is applied to
 the actions that need ejb's.

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



Re: what version of struts is better?

2007-04-10 Thread Piero Sartini
for new projects where you have the choice what to use, I suggest struts2. 

On Tuesday 10 April 2007 20:30:21 dire wrote:
 sorry for my English!

 in my term paper i want to use Struts. Before this time i don`t have a deal
 with it. in http://struts.apache.org/ i saw that struts had two versions. i
 try to found what version is preferable, but can`t...

 Can anybody says how many differencies bitween them? Or, at least, tell me,
 please, where i can found answer for my question.

 thanx for your attention!

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



Re: what version of struts is better?

2007-04-10 Thread Piero Sartini
I did look at JSF/Seam/Shale and other web frameworks before I decided to use 
Struts2.
There were several reasons for my decision and I have not regret it since now.

After many years of web development an action based framework like s2 for me 
is much more natural than a component based approach.

I think I am much more productive with s2. If someone wants tooling support 
and a visual designer, maybe it would be better to look at JSF. But in my 
oppinion there is missing a good framework for JSF. (No, I do not think that 
JSF is a framework - it is a technology).

Shale is a good start, but has a long way to go. Seam is too much coupled with 
JBoss/Hibernate for my feeling.

Visual Web Editor and from the netbeans project is nice - but IMHO not suited 
for bigger projects. I really came to the conclusion that JSF is nice for 
small projects with a few pages and if you really want a desktop-like 
development approach. 

I am sure there are many other opinions out there, but more cents are always 
good ;-)

Piero


On Tuesday 10 April 2007 22:50:12 Frank Russo wrote:
 Not to show any disrespect, but if you are starting a new project with a
 clean slate, I'd seriously look at JSF/Facelets if I were you.

 Both frameworks have their pros/cons, but I think JSF's pros well outweigh
 the cons. Plus, if you are going to take the time and learn a new
 framework, which if you haven't worked with Struts2 or WebWorks that is
 what you are doing, then you may want to weigh your options with JSF. I
 would highly recommend, though, that if you do consider it, Facelets, and
 not JSP's are the way to go.

 Just my 2 cents...

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



Re: Cannot define a display style class in s:a

2007-04-10 Thread Piero Sartini
There is the cssClass parameter for (all?) struts2 tags.
s:a href=resultPageUrl cssClass=taboffview search results/s:a

More information:
http://struts.apache.org/2.x/docs/a.html

Piero

On Wednesday 11 April 2007 01:10:43 Minerva CC wrote:
 Hi,

 I tried to define a display style class in s:a tag as follows

 s:url id=resultPageUrl action=searchResult
 s:param name=id value=%{#parameters.id} /
 /s:url
 s:a href=resultPageUrl class=taboffview search results/s:a

 But, when I run it, I got org.apache.jasper.JasperException:
 /pages/searchRequest.jsp(81,4) Attribute class invalid for tag a according
 to TLD error.

 My question is how can we define a style for a url link?

 Thanks,
 Willa



 ___
_ Don't get soaked.  Take a quick peak at the forecast
 with the Yahoo! Search weather shortcut.
 http://tools.search.yahoo.com/shortcuts/#loc_weather

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



Re: Can we *please* havea seperate Struts *2* - User list?

2007-04-10 Thread Piero Sartini
On Wednesday 11 April 2007 01:49:01 Asaf Paris Mandoki wrote:
 Wouldn't a forum be more appropriate for this kind of exchange?

I am not sure. Personally I do prefer mailing lists. They save a lot of time, 
especially if you are subscribed to a lot of lists. Navigating to different 
forums is not what I would like to do every day. Just checking my inbox is 
much better :-)

But I know that a lot of users like web forums more than mailing lists. There 
was a discussion at the developer list about communicating a forum some time 
ago, but without result.

You can always use nabble as a forum interface to this list, its pretty good:
http://www.nabble.com/Struts---User-f206.html

Piero

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



Re: what version of struts is better?

2007-04-11 Thread Piero Sartini
On Wednesday 11 April 2007 15:19:27 Frank Russo wrote:
 Actually, I disagree. JSF is a framework. I used MyFaces and their
 component library exclusively, without using Shale, Seam or anything
 else...

I used JSP and Servlets exclusively to build web apps years ago. JSP is no 
framework for most people. But I do agree that JSF has some functionalities 
where a webframework was needed before.

Maybe its just a question of what we call a web framework. For me, it is 
something like struts. There is no need to build another framework on top of 
it. With JSF, things are different. There IS a need to build a web framework 
on top of it (Seam, Shale, etc). At least for me it does not feel complete 
enough to build my applications with it.

Craig said in another thread [1] at this list that JSF focuses on the 
component APIs and the foundations for application needs and that 
a framework on top of JSF is a reasonable thing for an application 
developer to want.

Piero

[1] http://www.mail-archive.com/user%40struts.apache.org/msg53891.html

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



Re: [OT] Re: Eclipse WTP / Struts 2 - Not working!!

2007-04-12 Thread Piero Sartini
If I do understand it right then your s2 app works when deploying the war 
manually to tomcat. But if you try to start within eclipse it does not work?

There _must_ be some configuration issue with WTP. I guess there are some 
libraries from s2 that are packaged in the war but are not included if you 
deploy your ide project-path. 

I am a netbeans user so I can not help you much, sorry.

Piero

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



Struts2, Shale, Seam, pure JSF - what to use?

2006-12-19 Thread Piero Sartini
Hello list,

the last days I've read a lot about web frameworks in java. And the more I 
read, the more questions I have. Just writing this down, maybe someone has 
some thoughts that can help me.

My problem is simple, or lets say it should be simple: What webframework is a 
good choice to start a new web application?

After all, JSF seams to be popular, it is supported by big vendors and it is a 
standard. My problem with JSF is that its way too basic in my eyes. It does 
not give me best practices, its just there and says: use me. But it does 
not give me an idea how it is used best. But maybe I missed that. My feeling 
is that its a core technology like jsp ... someone should build a framework 
with it ...

I am missing this framework around JSF that does speed up development. Is 
shale meant to be this framework? It matured a lot since I last looked at it. 
But for me, it looks like its not really accepted - maybe I am wrong. Is 
shale what I am searching for?

There is JBoss Seam. I don't want to use jboss AS and not sure if its the best 
choice..

I looked at struts2 and it feels like it could be what I searched for. There 
is good documentation, many examples, an maven archetype, lots of users and 
the possibility to use third party technologies like freemarker. But my 
problem is that I am not sure if its not better to use JSF to be compatible 
with future technologies. There are a lot of ajax-components for example, and 
we can wait that a lot of third party libraries and tools will be 
available...

Is there a simple answer?


Regards,
Piero

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



Re: Struts2, Shale, Seam, pure JSF - what to use?

2006-12-19 Thread Piero Sartini
 JSF is considered a MVC framework, just as ASP.NET is a MVC framework.
 These frameworks are component-centric. You build pages by assembling
 components, and the components can each fire their own actions to
 obtain and maintain state. Frameworks like Struts and Spring MVC are
 action-centric. You build actions that obtain and maintain state, and
 then use pages to present the state.

 Component-based frameworks tend to appeal to people who like to use an
 IDE to build a visual representation of the page, and then use glue
 code to paste the components together. Action-based frameworks tend to
 appeal to people who like to hand-code pages and normalize code.

This is my main problem I think. Not sure if I should use an action based 
framework or go with JSF. Don't care about an IDE Designer - but I do care 
about what will be in 2 years and if my application will be easy to maintain 
and easy to extend for an even longer time.

Everything you read out there is about JSF, and that it will be the future. 
Spring2 has the possibility to use it. But it overlaps functionality .. so 
its not the best solution in my eyes.

The simplest answer I know is to pick a use case from your application
and implement it using each solution under consideration. It doesn't
have to be a big use case, maybe just a search form that brings back a
list. The important thing is to try it yourself, and choose what works
best for you.

I really hoped to get an answer like: Go for this technology, its the best 
thing you can do right now
Since it seems that it's not that easy, I will do what you suggested .. just 
try out myself and see what fits my need :-)

Thanks for your long answer!

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



Re: Struts2, Shale, Seam, pure JSF - what to use?

2006-12-19 Thread Piero Sartini
 As Don mentions, you can use JSF components with Struts2 pretty easily, and
 that can be a good avenue if you primarily want JSF for the visual
 components part, and don't need/want the managed beans and lifecycle
 controller parts.  If a framework on top of JSF is what you are after
 (which is a reasonable thing for an application developer to want -- JSF
 focuses on the component APIs and the foundations for application needs),
 you can definitely look towards Shale[1] (we're putting the finishing
 touches on what we hope will be a GA release) or Seam[2] (just released 1.1
 ).

Thanks, I will have a closer look at Shale and Seam. A framework on top of 
JSF sounds like what I am searching for.

After reading this post of you, I am not sure if struts2 is what I want.
- http://marc.theaimsgroup.com/?l=struts-devm=115090201630610w=2

 If you like tooling assistance around your development efforts, you might
 also want to take a look at what support your favorite IDE provides.  If
 you happen to be in the NetBeans camp, the Visual Web Pack plugin is
 totally focused around visual drag-and-drop, and includes a built in
 framework with a lot of similarity to the view controller function in
 Shale, plus there is pretty nice non-visual support for straight JSF coding
 (including code generation for CRUD apps).  You'll also see great support
 for JSF in Oracle's JDeveloper, and basic but getting there support in
 Eclipse.  I can't speak to Idea's support for JSF, but wouldn't be
 surprised if it is comparable.

In the NetBeans camp and I know the VWP. Unfortunately it does not fit in my 
project, mainly because of missing templates. We discussed that on nbusers a 
few days ago ;-)

Piero

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



Re: How to get initialized at startup

2007-10-22 Thread Piero Sartini
 I have some code I need to initialize when the servlet comes up for the
 first time.  How do I do that when I'm using struts and I do not have my
 own servlet?  Do I create a servlet just for this purpose?

If you need something that is initialized when your webapp starts, I would 
suggest to write a ContextListener. For more information look at:
http://wiki.metawerx.net/wiki/ContextListener

Btw, in Struts 2 you do not use servlets but Actions.

Piero

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



Re: [S1] Ping another page from within a struts application

2007-10-23 Thread Piero Sartini
Am Montag, 22. Oktober 2007 19:27:59 schrieb enthucoder:
 I have requirement where, i need to send session id of app2 to a listener
 page in app1 (i.e non jee based one and i am allowed to send this
 information as a 'get'), everytime the a new page loads or user goes to new
 page in app2, without transferring control to app1 .

 Can somebody point me towards how best i can achieve this?

If you want to execute something everytime an action is called in struts2 you 
could use a custom interceptor.

http://struts.apache.org/2.0.9/docs/interceptors.html
http://struts.apache.org/2.0.9/docs/writing-interceptors.html

Piero

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



Re: Why does update action fire on load

2007-10-23 Thread Piero Sartini
Am Montag, 22. Oktober 2007 13:23:38 schrieb zul;jami:
 Still I am getting the error,
 my execute also fires update on load.
 There is no img tag with empty src attribute

execute() is triggered when the action is called, not only when you submit 
your data.

Piero

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



Re: what login securityencription are good for struts...?

2007-11-13 Thread Piero Sartini
  its a very nice example which u have sent but  i have a doubt that
 as u are using salt(generation) adding to the encripting code that will be
 fine for registeration but what ab the login time how you are going to
 decript the data base code? 

You do not need to decrypt - you just operate on the encrypted hash. (encode 
the given password at login time and match it against the hash in db)
You will have no chance to get the clear text password again.

 and authenticate... and one more thing is are 
 u using Hibernate?

Struts2 does not help you when it comes to authorization and authentication. 
You have some possibilities: In an enterprise environments you might want to 
use the container based security just like in a normal webapp.. there is a 
RolesInterceptor for struts that you can use.

Otherwise you have to build a custom security implementation. Or use something 
like ACEGI that offers a security framework but depends on spring.

The point is: struts2 does not offer security out of the box.

Piero

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



Re: REST Showcase

2007-12-09 Thread Piero Sartini
 If you've used Maven before you're probably better off checking out the
 source and performing your own build.  It would take less than 10-30
 mins to setup.
 http://struts.apache.org/2.x/docs/building-the-framework-from-source.html

If maven is used, 2.1.1-SNAPSHOT should work:

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-rest-plugin/artifactId
version2.1.1-SNAPSHOT/version
/dependency

repository
idstruts2 snapshots/id
urlhttp://people.apache.org/repo/m2-snapshot-repository//url
/repository

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



Re: REST Showcase

2007-12-09 Thread Piero Sartini
   pluginRepository
 idapache.snapshots/id
 nameApache Maven Repository (Snapshots and Test
 Builds)/name !--
 urlhttp://people.apache.org/repo/m2-snapshot-repository//url --

 urlhttp://people.apache.org/repo/m2-snapshot-repository//url
 releasesenabledfalse/enabled/releases
 snapshotsenabledfalse/enabled/snapshots
 /pluginRepository

You disabled releases as well as snapshots?
Don't know if this is the reason for the error...

I am using 

[EMAIL PROTECTED]:~$ mvn -v
Maven version: 2.0.8
Java version: 1.6.0_03
OS name: linux version: 2.6.22-14-generic arch: i386 Family: unix

and it works :)

Piero

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



Re: Struts 2.1.0

2008-01-14 Thread Piero Sartini
Am Montag, 14. Januar 2008 17:37:19 schrieb Frans Thamura:
 hi there

 i just testing struts2 2.1.0,

 can help me how to test the REST plugins,

 am i have to get from SVN or can use this?

 i know that 2.1.0 is the pre relase for 2.1.1


If you are using maven, just include the following dependency in your pom.xml:
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-rest-plugin/artifactId
version2.1.1-SNAPSHOT/version
/dependency

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



Re: Get the plugins

2008-01-14 Thread Piero Sartini
Am Montag, 14. Januar 2008 17:41:06 schrieb Frans Thamura:
 hi there

 where is the place so i can download the codebehind plugins?

If you just start, I would suggest trying the new convention plugin. You can 
find it here: 
http://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2-convention-plugin

it will replace the codebehind plugin in next struts version.

Piero

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



Re: i want to use the source luke.

2008-01-15 Thread Piero Sartini
 However, i
 did not see
 the source for any of the com.opensymphony.xwork2.* classes.  Is the
 source
 for these classes available?

XWork is a seperate project at opensymphony. You can get the sources from
https://svn.opensymphony.com/svn/xwork/

Piero

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



Re: action mapping - how can I map ALL incoming urls to one action?

2008-02-13 Thread Piero Sartini
 I need to map all incomming urls to one and the same action.

 This action works like a dispatcher - acctording to some data taken from
 the data base, decides where to redirect the request.

 I''ll appreciate any ideas!

I think an Interceptor would be a better solution for this:
http://struts.apache.org/2.x/docs/interceptors.html

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



Re: Struts 2.1?

2008-02-22 Thread Piero Sartini
Am Donnerstag, 21. Februar 2008 20:21:33 schrieb Maria Lujan Salvadori:
 Hello, is it available the new version 2.1? Where can I download it? We
 want to migrate our project from 2.0.11 to 2.1 but we cannot find it

Be aware that there are a lot of incompatible changes between 2.0 and 2.1, so 
migrating an existing project could be a lot of work depending on how big it 
is.

That said, if you are using maven2, there are 2.1.1 snapshots in the 
repository: http://people.apache.org/repo/m2-snapshot-repository/

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version2.1.1-SNAPSHOT/version
/dependency


Piero

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



[S2.1.1] How to use an Interceptor from a plugin?

2008-02-26 Thread Piero Sartini
Hello,

I am trying to write an authentication plugin for struts2. Goal is to reuse it 
across several projects so a plugin seems the way to go..

There is an Interceptor defined in struts-plugin.xml, lets call it 
AuthenticationInterceptor. Problem is that I am not able to use it in my main 
struts.xml from the project that includes my plugin.

Is it that I am allowed use this interceptor in my plugin only?
Also tried to define a package in the plugin and extend it in my main project, 
but this does not work as well.

Is it possible to use the plugin system from struts2 for my purpose? If not, 
maybe there is some better way?

Piero

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



Re: [S2.1.1] How to use an Interceptor from a plugin?

2008-02-26 Thread Piero Sartini
Am Mittwoch, 27. Februar 2008 01:59:36 schrieb Jeromy Evans:
 You're following the right approach.
 ..
 In any case, the approach works so you probably just have a minor config
 error. Post your config (struts-plugin.xml and struts.xml) if the
 statement above doesn't help.

Thank you, that helped! It was indeed a minor config error like you suspected.

Piero

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



Re: [struts] [S2.1.1] How to use an Interceptor from a plugin?

2008-02-27 Thread Piero Sartini
 If you don't intend to have your application's package extend the
 package defined in your plugin (which doesn't scale to multiple
 plugins), what's the benefit of having this be a plugin as opposed to
 just a .jar file?

I hoped that the plugin architecture will help me with the configuration part 
of the module. There are some interfaces that have to be implemented from the 
main application.

Now, my problem is how to configure this. Is it possible to use the 
struts2-mechanism of bean and constant without writing an own 
BeanSelectionProvider?

Piero

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



Re: How to initialize business service objects?

2008-03-17 Thread Piero Sartini
Am Donnerstag, 13. März 2008 22:32:34 schrieb Frank Fischer:
 Now i don't understand (1) where to create/initialize these business logic
 classes and (2) how to get access to them from the action classes.

Just build your business logic without thinking about s2 too much. From your 
action classes you can access your business logic like everything else. Its 
really more of a java problem how to do this =)

If you have to run initialization code at startup, maybe a normal Listener is 
what you are looking for...

Piero



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



Re: struts 2 ajax how to

2008-03-26 Thread Piero Sartini
Am Mittwoch, 26. März 2008 14:35:26 schrieb Daniel:
 Hello,
 What is the best solution to integrate struts 2 and ajax? What libraries?

DOJO is shipped with Struts2 - but my impression is that most people do use 
other frameworks like jQuery or prototype, writing their AJAX code by hand.

I will do it this way in my next project using the simple theme (or maybe 
writing a custom one...). The s2 ajax theme has too many issues and is not 
flexible enough in my oppinion.

Piero

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



Re: how to confirm eclipse wtp contain struts 2.x?

2008-03-30 Thread Piero Sartini
 yes, I did go to the site. but, i'm not sure on how to make it as a
 plugin to deploy in eclipse 3.3.

There is no plugin for Eclipse or any other IDE that I know. There is the 
beginning of a NetBeans plugin... but I did not look at it yet.

 i did downloaded the war file and import into eclipse 3.3, it 's working
 fine. is it every project I just need to copy 5 files to Web App Libraries,
 commons-logging-1.0.4.jar
 freemarker=2.3.8.jar
 ognl-2.6.11.jar
 struts2-core-2.0.11.jar
 xwork-2.0.4.jar
 ?

These and any struts2 plugins you want to use. The Blank Application is a 
good starting point for own applications. 

If you do use maven2, there is an easier way:
mvn archetype:create -DgroupId=org.yoursite \
   -DartifactId=appname \
   -DarchetypeGroupId=org.apache.struts \
   -DarchetypeArtifactId=struts2-archetype-starter \
   -DarchetypeVersion=2.0.11 \
   
-DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository

 then, consider is struts enabled?

The JARs alone do not enable s2. You need the right entrys in web.xml and put 
the struts configuration file in place.


Piero

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



[s2.1] Real-Time AJAX Validation when filling out the form?

2007-07-24 Thread Piero Sartini
I want to use s2.1 for a new project. Now I try to figure out how it is 
possible to make a realtime validator that is fired when the user switches 
fields.

With 2.0.8 there was DWR and the ajax theme. Now I do have the dojo plugin and 
the interceptor.  sx:submit tag .. but there are no sx:form or sx:input tags. 
Is this functionality already present in 2.1?

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



Is it possible to pass a dynamic parameter to a redirectAction?

2007-08-02 Thread Piero Sartini
I have the following situation:
a searchfield is on top of a table presenting results. if there is only one 
result, the user should be redirected without the need of clicking on the 
list..

now my problem is how to redirect to an action and passing a parameter from 
within my original action..

I am working around this by putting the ID information into the user 
session ... but I am sure there is a cleaner way of doing this ;)

Piero

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



Re: struts1 or struts 2?

2007-08-07 Thread Piero Sartini
 - For a new project, which I would like to eventually move it to JSF?

choose the technology (component based or action based) before choosing the 
framework.

if you want to go for a component based approach like JSF then choose a 
framework like Apache Shale or JBoss Seam. Even VWP may be considered a 
framework (and allows nice gui editing).

if you decide to go with an action based framework, you should come back to 
the question s1 or s2... personally, I would go with s2.

Piero.

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



Re: Struts2 POJO Forms

2007-08-24 Thread Piero Sartini
On Thursday 23 August 2007 23:43:40 Pavel Sapozhnikov wrote:
 Hi everybody. I remember in Struts1 we have those things ActionForms and
 when you submit a form everything gets copied to into a form in fact you
 can make your own form in Struts1. Is the same possible in Struts2 for
 instance I heard about the POJO Forms. How would I tell struts to use that
 POJO Form for this action?

First, in s2 your action may be a POJO itself or implement ModelDriven.
See http://struts.apache.org/2.0.9/docs/model-driven-interceptor.html
for more information.










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



Re: Struts2 POJO Forms

2007-08-24 Thread Piero Sartini
On Friday 24 August 2007 12:29:23 Laszlo Borsos wrote:
 If some properties are in the action bean (e.g. hidden fields) and
 others in the model bean, will both be populated, because both object
 are found on the stack? If so, is the model object the upmost stack
 element?

I am not sure if both are populated. What I can say is that if a property is 
not found in the model, the action property is populated if present.

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



Re: [FRIDAY] JPA War Stories?

2007-09-17 Thread Piero Sartini
We do use TopLink Essentials. Beside the somewhat confusing error messages 
already mentioned by musachy we are very happy with this choice.

JPA is just great :-)

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



Re: s:include tag

2007-09-18 Thread Piero Sartini
Am Dienstag, 18. September 2007 20:22:41 schrieb Sairam01:
 I'm unable to include a jsp dynamically. The include tag doesn't evaluate
 VALUE of the expression.

 s:include value=%{someName}.jsp/

 someName is a attribute on my action code. Should this work..?

s:include value=%{someName}.jsp/

is this a typo in the email? it should read
s:include value=%{someName}.jsp/

if there is a proper getSomeName() method in your action, this should work.. 

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



Re: Starting of Tomcat failed, the server port 8084 is already in use.

2007-09-24 Thread Piero Sartini
 Starting server Bundled Tomcat (5.5.17)
 Starting of Tomcat failed, the server port 8084 is already in use.
 ...
 please give me suggestions,how i can run my program.

If there are errors when running tomcat (eg. not enough PermGen space / Out of 
Memory) netbeans 5.5.x cannot control it anymore. The process does run in the 
background and blocks the port 8084.

Just kill/stop the tomcat process and it will work again.

Piero

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



[S2.1] smarturls

2007-09-28 Thread Piero Sartini
Should smarturls 2.0.18 work with struts 2.1?

I get the following error:

Caused by: Unable to load bean: 
type:org.texturemedia.smarturls.ResultMapBuilder 
class:org.texturemedia.smarturls.DefaultResultMapBuilder - bean - 
jar:file:/home/ps/devel/projects/cfmc/target/cfmc/WEB-INF/lib/smarturls-2.0.18.jar!/struts-plugin.xml:15:120
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:215)
at 
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:150)
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:53)
... 28 more
Caused by: java.lang.NoClassDefFoundError: 
net/java/lang/AbstractClassLoaderResolver$Test
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
... 31 more

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



Re: Where to find detailed changes over Struts versions?

2007-09-29 Thread Piero Sartini
 I am searching a table comparison like this for all features and
 enhancements from 1.x to 2.x:

There is nothing like that because Struts 2 is not based on Struts 1 but on 
WebWork - it has a complete different code base.

Maybe this comparison does help:
http://www.roseindia.net/struts/struts2/Struts2vsStruts1.shtml

Piero

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



Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Piero Sartini
 Since my Model is acquired from the Hibernate session (during the
 prepare() Action method), it is a transactional persistent instance.
 Note this from the hibernate documentation:

 Transactional persistent instances (ie. objects loaded, saved, created or
 queried by the Session) may be manipulated by the application and any
 changes to persistent state will be persisted when the Session  is flushed
 (discussed later in this chapter). There is no need to call a particular
 method (like update(), which has a different purpose) to make your
 modifications persistent.

I do not know hibernate but you could try the following solutions:

* don't flush the session and destroy the object

* instantiate a temporary bean used for the form only:
BeanUtils.copyProperties(tempBean, yourBean);

* manage your entities with JPA's EntityManager, merge them manually.

Piero

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



Re: Struts URLs for perfectionists like Ebay's URLs

2007-10-01 Thread Piero Sartini
Am Montag 01 Oktober 2007 23:33:01 schrieb Emi Lu:
 Is there a way to hide .action  .do by using filter  url-pattern?

Have a look at
http://code.google.com/p/smarturls-s2/wiki/WalkThrough (last paragraph: 
Extensionless URLs)

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



Re: Struts 2.x versions and documentation

2008-04-21 Thread Piero Sartini
Am Montag, 21. April 2008 23:59:46 schrieb Chase:
 Given that the doc in question was last edited July 2007 to include 2.1
 information has 2.1 been released already and I'm just not looking in
 the right place?

Struts 2.1 has no GA release yet. That said, I think it is very stable and 
possibly much better than 2.0.x

If using Maven2, you can use this repo:
http://people.apache.org/repo/m2-snapshot-repository/

afaik 2.1.2-SNAPSHOT should be the newest version:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/struts/struts2-core/2.1.2-SNAPSHOT/

Piero

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



Re: Do we have such alternative?

2008-07-14 Thread Piero Sartini
Hello,

  Do we have some similar mechanism is JSP 2 + struts2?

 Or Do i must use struts2++  library?

JSP can not do that out of the box. But there are very good solutions 
available. Have a look at Sitemesh or Tiles2:

- http://struts.apache.org/2.x/docs/sitemesh-plugin.html
- http://struts.apache.org/2.x/docs/tiles-plugin.html

Piero

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



[S2] NPE when using struts form tags in sitemesh decorator

2008-07-14 Thread Piero Sartini
The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time 
ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer 
builds.

The problem seems to be that Freemarker can't get its configuration at this 
point. But ActionContextCleanUp is the first filter in chain, and tags like 
@s.url do work, only the form and input fields do not work.

If I try the exact same form outside the decorator in a normal, decorated 
page, everything works like expected.

Any ideas?

java.lang.NullPointerException
at 
org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(FreemarkerManager.java:159)
at 
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:90)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558)
at org.apache.struts2.components.Submit.end(Submit.java:109)
at 
org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackWriter.java:84)
at freemarker.core.Environment.visit(Environment.java:299)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
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.include(Environment.java:1477)
at freemarker.core.Include.accept(Include.java:169)
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.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerPageFilter.java:160)
at 
org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageFilter.java:116)
at 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
...
...
...

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



Re: AW: Struts2 configuration problems

2008-07-14 Thread Piero Sartini
Maybe the header of your struts.xml does use the wrong DTD.
The correct header looks like this:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE struts PUBLIC 
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;


Am Montag, 14. Juli 2008 15:31:47 schrieb Jan Froehlich:
 Well, ok thats really odd... The libs and configuration I added are
 definetely s2.

 If you take a look at the other error I got - executed actions but in
 properties just returns the DefaultTextProvider - can you give me a hint
 about that? Might be that I got two issues

 Thanks in advance!

 -Ursprüngliche Nachricht-
 Von: Gabriel Belingueres [mailto:[EMAIL PROTECTED]
 Gesendet: Montag, 14. Juli 2008 14:47
 An: Struts Users Mailing List
 Betreff: Re: Struts2 configuration problems

 struts-config is not a the document root element of S2's struts.xml
 file. That's the root element of S1 configuration file.

 2008/7/14 Jan Froehlich [EMAIL PROTECTED]:
  Hello List...
 
  I tried to extend a existing webapp based on a own framework with some
  actions using struts2.
  After I added all necessary libraries, the struts2 filter and the
  struts.xml I have some errors when the tomcat starts up. (see further
  below)
 
  Whats odd about that - I can call a defined action and in the debugger I
  can see that the execute method is called. But when I try to access
  properties of the action with s:property value=MyValue / it is
  empty. Trying it with s:property / shows the class
  DefaultTextProvider.
 
  Tried to find something about that issue on the list, but I am not sure
  for what I should search.
  The exception gave just a few responses, but with no clue how to fix it.
 
  Thanks in advance!
  Jan Froehlich
 
   Parse Error at line 2 column 16: Document root element struts-config,
  must match DOCTYPE root null.
  org.xml.sax.SAXParseException: Document root element struts-config,
  must match DOCTYPE root null.
 at
  org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno
  wn Source)
 at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
  Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
  Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
  Source)
 at
  org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown
  Source)
 at
  org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
  Source)
 at
  org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
 at
  org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U
  nknown Source)
 at
  org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot
  ElementHook(Unknown Source)
 at
  org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
  patcher.dispatch(Unknown Source)
 at
  org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
  wn Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
  Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
  Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
  Source)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:344)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:120)
 at org.apache.struts.digester.Digester.parse(Digester.java:755)
 at
  org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:13
  32)
 at
  org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at
  org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
  a:1139)
 at
  org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
 at
  org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
  ava:3956)
 at
  org.apache.catalina.core.StandardContext.start(StandardContext.java:4230
  )
 at
  org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
  va:760)
 at
  org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
 at
  org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
 at
  org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:
  626)
 at
  org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java
 
  :553)
 
 at
  org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
 at
  org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
 at
  org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31
  1)
 at
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
  pport.java:120)

Re: Problem url decoding with mutated vowels (Umlaute??)

2008-07-14 Thread Piero Sartini
Hello,

you can try the following settings in struts.xml:
constant name=struts.i18n.encoding value=UTF-8/
constant name=struts.locale value=de_DE/

Please let me know if this resolves your issue.

Piero

Am Montag, 14. Juli 2008 15:25:14 schrieb Marc Eckart:
 Hi,

 we have an action which we call with url paramters from other applications.

 But now we found out, that we have problems with mutated wowels like äöü.

 Instead of  tls-hölter we get tls-hölter in the parameterMap of  the
 servletRequest (I debugged).
 I assume that the parameters are decoded with iso ISO-8859-1 instead
 of utf-8 or otherwise.

 Is there an option to tell struts2 which charset it should use to decode?

 The url looks like this:
 http://localhost:8080/bpc/search.action?ctxSid=20080714082158393251000user
Id=xxxpageTitle=BlareturnUrl=http://localhost:9080?methodToCall=loadWithCu
stDetailssimpleSearch=tls-h%C3%B6lter

 We call the application running on tomcat from an application running
 on websphere 6.1.

 Thanks in advance...

 Best regards,
 Marc

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

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



Re: [S2] NPE when using struts form tags in sitemesh decorator

2008-07-14 Thread Piero Sartini
Ok, the problem was that since 2.1.3 the filters changed:

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
instead of ActionContextCleanup and
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
instead of the FilterDispatcher.

Now everything works like expected. I will update the wiki of the sitemesh 
plugin ..

Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini:
 The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some
 time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in
 newer builds.

 The problem seems to be that Freemarker can't get its configuration at this
 point. But ActionContextCleanUp is the first filter in chain, and tags like
 @s.url do work, only the form and input fields do not work.

 If I try the exact same form outside the decorator in a normal, decorated
 page, everything works like expected.

 Any ideas?

 java.lang.NullPointerException
 at
 org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(Free
markerManager.java:159) at
 org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTempl
ate(FreemarkerTemplateEngine.java:90) at
 org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at
 org.apache.struts2.components.Submit.end(Submit.java:109) at
 org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(CallbackW
riter.java:84) at freemarker.core.Environment.visit(Environment.java:299) at
 freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) 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.include(Environment.java:1477) at
 freemarker.core.Include.accept(Include.java:169)
   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.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMarkerP
ageFilter.java:160) at
 org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageF
ilter.java:116) at
 com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java
:62) at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
nFilterChain.java:246) ...
 ...
 ...

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

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



Re: [S2] NPE when using struts form tags in sitemesh decorator

2008-07-14 Thread Piero Sartini
I added a warning box with title Struts 2.1.3 to the wiki page of  
struts2-sitemesh-plugin. Hope this is ok... I looked there before searching 
the code, maybe it helps others.

Is there a solution for the version problem in the wiki now? I remember 
there was no way to handle this some time ago. I could help out updating the 
docs if you say me in what way this should be done. (Dont want to make 
changes you have to revert afterwards ;-)

Piero

Am Montag, 14. Juli 2008 20:09:30 schrieb Musachy Barroso:
 Don is still working on those changes, you could open a ticket to make
 sure everything gets documented.

 musachy

 On Mon, Jul 14, 2008 at 1:22 PM, Piero Sartini [EMAIL PROTECTED] 
wrote:
  Ok, the problem was that since 2.1.3 the filters changed:
 
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
  instead of ActionContextCleanup and
  org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
  instead of the FilterDispatcher.
 
  Now everything works like expected. I will update the wiki of the
  sitemesh plugin ..
 
  Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini:
  The S2 version is 2.1.3-SNAPSHOT. The exact same project was working
  some time ago with 2.1.1-SNAPSHOT. So maybe this is something that got
  broken in newer builds.
 
  The problem seems to be that Freemarker can't get its configuration at
  this point. But ActionContextCleanUp is the first filter in chain, and
  tags like @s.url do work, only the form and input fields do not work.
 
  If I try the exact same form outside the decorator in a normal,
  decorated page, everything works like expected.
 
  Any ideas?
 
  java.lang.NullPointerException
  at
  org.apache.struts2.views.freemarker.FreemarkerManager.getConfiguration(F
 ree markerManager.java:159) at
  org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTe
 mpl ate(FreemarkerTemplateEngine.java:90) at
  org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:558) at
  org.apache.struts2.components.Submit.end(Submit.java:109) at
  org.apache.struts2.views.freemarker.tags.CallbackWriter.afterBody(Callba
 ckW riter.java:84) at
  freemarker.core.Environment.visit(Environment.java:299) at
  freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) 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.include(Environment.java:1477) at
  freemarker.core.Include.accept(Include.java:169)
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.sitemesh.FreeMarkerPageFilter.applyDecorator(FreeMark
 erP ageFilter.java:160) at
  org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePa
 geF ilter.java:116) at
  com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.j
 ava
 
 :62) at
 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
 tio nFilterChain.java:246) ...
  ...
  ...
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: [OT] What slows you down?

2008-07-16 Thread Piero Sartini
Am Freitag, 20. Juni 2008 13:43:00 schrieb Ted Husted:
 But why does web application still seem so difficult or so
 time-consuming? Are there time bandits that still suck days or weeks
 out of your development schedule? Are there time gremlins that
 nickel-and-dime you every hour of every day? Is there anything more
 that frameworks like Apache Struts can do to help? Or are just there
 intractable problems with web development itself?

I had to work on a RCP application the last months - and I can't tell you how 
happy I am to be back at the web and struts2. So in my oppinion there is no 
real problem with web development... Struts2 is great, and it helps a lot in 
being productive. The flexibility is unmatched, the possibilities endless.

The only problem I see is that it is not as easy to learn the framework as it 
should be. That starts with the documentation, the many plugins which all do 
the same things and the fact that there is no defined way of doing standard 
jobs. Once you managed to select what you need, the world is ok. And you 
learn to love the flexibility. But to get there is hard work.

What would really help is a good freemarker plugin for my favorite IDE - not 
exactly freemarker but freemarker on top of html. Think that's my biggest 
time killer atm.

Piero

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



Re: Struts and EAR Files - questions about how it deals with the classloader

2008-07-22 Thread Piero Sartini
  |-/libs/struts.jar
  |-WAR
  |
|-/index.jsp
  |
  |-EJB.jar

/libs/ is for general libraries used by your application (logging comes to 
mind, StringUtils or just about anything that is used among your modules).

The struts.jar has to go into the WAR. Under /WEB-INF/lib/.
You do not change anything within your WAR just because you package it into an 
Enterprise Archive (EAR).

Piero

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



Re: [S2] how to have the form horizontally?

2008-07-24 Thread Piero Sartini
You can use the simple theme. Or customize the templates of the xhtml theme.
If you use the css theme then you may style it via css as well.

I am using the simple theme - it gives the most control. IMHO the other themes 
are not flexible enough and make more work than they save.

Piero

Am Donnerstag, 24. Juli 2008 18:41:15 schrieb xianwinwin:
 I have a form in which I wish to have it align horizontally.
 If I use the tags like this:

 s:form action=register_addTraveler method=post 

 s:textfield name=traveler.firstName size=10/
 s:textfield name=traveler.lastName size=10/
 s:textfield name=traveler.dob size=10/

 /s:form


 I get it in a vertical way. Does anyone know how to set it horizontally?

 * the idea is to create a table and let the end-user fill the information
 as if he sees an excel table:

 first namelast name.dob
 [   ][   ][   ]
 [   ][   ][   ]
 [   ][   ][   ]
 [   ][   ][   ]

 Thanks for any pointers
---

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



Re: Data Leakage in Struts 2

2008-07-26 Thread Piero Sartini
Struts2 does create a new Action for every request.
Do you use Spring? I think you can configure it to reuse the beans...

Piero

Am Samstag, 26. Juli 2008 19:48:47 schrieb Arun M:
 We are using struts 2.0.11

 We have lots of action class. Say one of them is CustomerRegisterAction
 (which extends ActionSupport  ) . When a say user  X registers himself on
 the website; this CustomerRegisterAction is populated (using OGNL) and the
 customer data is saved to DB. But after sometime some other user Y from
 some other PCcomes and clicks the Register link, then the data entered by X
 is prefilled now.
I think the CustomerRegisterAction is reused, instead of creating new
 instance every request.  we want to setup such that new
 CustomerRegisterAction is created every httprequest, so that data is not
 leaking between users.

 Please help us.

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



Re: Data Leakage in Struts 2

2008-07-26 Thread Piero Sartini
Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
 Yes , we are using spring and hibernate also along with struts.
 Could you suggest us, where to configure to resue the beans ??

The spring plugin is described in detail at 
http://struts.apache.org/2.x/docs/spring-plugin.html
I am not using spring and do not know it very well.

If you do not create your action with struts2 but with Spring, try s.th. like
bean id=bar class=com.my.BarAction singleton=false/
oin your applicationContext.xml

Piero

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



Re: s2: user-frendly urls in struts2

2008-07-27 Thread Piero Sartini
Am Sonntag, 27. Juli 2008 21:44:04 schrieb Chris Pratt:
 You might want to look into the RESTful URL's plugin.  But you can
 just override the extension.  I usually set mine to .html (to hide the
 technology being used), but I believe you can set it no nothing as
 well. I use the following in struts.xml, I believe you can set the
 value to  also.

   constant name=struts.action.extension value=html/

Setting the extension to  is a bad idea. In this case, the default action 
mapper thinks every ressource (png,jpg,js,css,etc) is an action.

However, this may work with the REST plugin.

Piero

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



Re: [S2] Testing if session variable is present

2008-07-31 Thread Piero Sartini
 No one have any idea how to access session variable in jsp in this kind of
 simple scenario ?

You may access your session variable just like you would do without S2. There 
is no difference. Then use either the s:test tag from struts or c:if from the 
standard tag library. 

Piero

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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Piero Sartini
 It's seems like that redirect action doesn't
 pass
 or set session to another action class.

If you can't give us the code, we aren't able to help you.
Session's don't need to be passed between actions. They are managed by the 
servlet container. But it is pretty safe to assume that Struts2 is not 
destroying your session.

Piero

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



Re: Struts 2 AJAX

2008-08-05 Thread Piero Sartini
 Is Struts 2.1.x still bound to DOJO?

It isn't - DOJO is available as a plugin since 2.1.x
But there is no possibility to use the AJAX theme without DOJO right now. 
There was an interesting discussion at struts-devel:
- 
http://www.nabble.com/-PROPOSAL--Deprecate-or-remove-Dojo-plugin-td18573704.html

Piero

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



Re: two forms, two submits

2008-09-22 Thread Piero Sartini
He mentioned html:submit - I guess we are talking about Struts 1, so there are 
no themes involved.

Piero

On Monday 22 September 2008 22:14:50 Kawczynski, David wrote:
 FYI, a theme can be specified in a s:form tag or any of its s: form
 elements via theme=simple|xhtml|ajax attribute.  If you didn't specify
 one it's using the xhtml theme.

 Do your forms submit to the same event handler?  It would be helpful if we
 could see the struts.xml and the web pages that house the forms.


 -Original Message-
 From: cpanon [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 22, 2008 3:57 PM
 To: Struts Users Mailing List
 Subject: Re: two forms, two submits

 Hi Pascal
 I dont understand the use of the word theme.  This is a very simplistic
 jsp that has two forms, each with a different action and a html:submit
 button that does not work for one of the two forms.  I hope I am clearer. 
 It is almost too simple to further describe.  tia. Notice:  This e-mail
 message, together with any attachments, contains information of Merck 
 Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889),
 and/or its affiliates (which may be known
 outside the United States as Merck Frosst, Merck Sharp  Dohme or
 MSD and in Japan, as Banyu - direct contact information for affiliates is
 available at http://www.merck.com/contact/contacts.html) that may be
 confidential, proprietary copyrighted and/or legally privileged. It is
 intended solely for the use of the individual or entity named on this
 message. If you are not the intended recipient, and have received this
 message in error, please notify us immediately by reply e-mail and
 then delete it from your system.


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


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



Re: howto implement a @before annotation ?

2009-02-09 Thread Piero Sartini
On Monday 09 February 2009 16:43:09 xianwinwin wrote:
 Hi all,
 here's a scenario:I have some methods that before executed, they should run
 an interceptor --to verify if the user is authorized to do something.

Write your own interceptor and check for your annotation. Something like this 
should work (I am using a custom annotation named @Secured):

public String intercept(ActionInvocation actionInvocation) throws 
Exception {
Object action = actionInvocation.getAction(); // get the action on 
which the interceptor is fired
Class[] ca = {};
Method m = 
action.getClass().getMethod(actionInvocation.getProxy().getMethod(), ca); // 
get executed method
Class c = action.getClass();
boolean classAnnotation = c.isAnnotationPresent(Secured.class);
boolean methodAnnotation = m.isAnnotationPresent(Secured.class);
// check if either method or class is annotated with @Secured
if (classAnnotation || methodAnnotation) {
...
...


Have fun :-)

Piero

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