Author Login
Post Reply
user Digest 14 Mar 2008 19:20:51 -0000 Issue 7927
Topics (messages 184254 through 184283):
Question regarding OGNL
184254 by: Thomas Ramapuram
184262 by: Rushikesh Thakkar
184277 by: Laurie Harper
184282 by: Dave Newton
Re: Getting error in using tag library : The Tag class '
org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'acceptCharset', (JSP 1.1 spec, 5.4.1)
184255 by: Antonio Petrelli
Re: struts wml
184256 by: Antonio Petrelli
184257 by: Al Sutton
184270 by: Laurie Harper
Re: Multiple Actions for a single page. Is this possible
184258 by: Ralf Fischer
184259 by: Bently Drake
184278 by: matt.payne
Issue In Autocompleter
184260 by: Ankur Agar
184281 by: Laurie Harper
Codebehind + zero config options
184261 by: Alex Shneyderman
Struts2 - Validating several fields depending on values of other fields
184263 by: Dirk Schumacher
184264 by: Dave Newton
184283 by: Laurie Harper
Re: Problem assiging elements in to list
184265 by: Cesar Arevalo
184266 by: Dave Newton
184267 by: Cesar Arevalo
184268 by: Dave Newton
184269 by: Dave Newton
Re: Latest Quickstart & Sitemesh
184271 by: Laurie Harper
[S2] DEBUG NPE
184272 by: Hoying, Ken
should I learn struts 1 first before learning struts 2?
184273 by: akoo
184274 by: Antonio Petrelli
184275 by: Musachy Barroso
184276 by: matt.payne
[OT] Re: should I learn struts 1 first before learning struts 2?
184279 by: Antonio Petrelli
Re: Best practices to reduce execution time in struts
184280 by: matt.payne
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_184254.ezm (zipped)Hi,
I have query regarding OGNL Expression.
Can the "#name" kind of expression be used anywhere? Or are they
applicable only in certain attributes of struts tags
Till now I was using the %{name} expression and that too in the some
attribute of a tag
I tried using #name expression but it does not work. Is there any
settings to be set (for example in web.xml)
Any pointers would be a great help.
Thanks
Thomas

Attachment:
user_184262.ezm (zipped)AFAIK you can use OGNL expression in any attribute of your struts2 tag.
Your problem could be 'what is the proper syntax for using OGNL
expression?'.
Can you post your relevant code? I might get an idea of what you are trying
to achieve.
-Rushikesh
On Fri, Mar 14, 2008 at 7:29 AM, Thomas Ramapuram <
thomas.ramapuram@(protected):
> Hi,
> I have query regarding OGNL Expression.
> Can the "#name" kind of expression be used anywhere? Or are they
> applicable only in certain attributes of struts tags
>
> Till now I was using the %{name} expression and that too in the some
> attribute of a tag
>
> I tried using #name expression but it does not work. Is there any
> settings to be set (for example in web.xml)
> Any pointers would be a great help.
> Thanks
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184277.ezm (zipped)Thomas Ramapuram wrote:
> Hi,
> I have query regarding OGNL Expression.
> Can the "#name" kind of expression be used anywhere? Or are they
> applicable only in certain attributes of struts tags
>
> Till now I was using the %{name} expression and that too in the some
> attribute of a tag
>
> I tried using #name expression but it does not work. Is there any
> settings to be set (for example in web.xml)
> Any pointers would be a great help.
> Thanks
> Thomas
The expressions %{name} and %{#name} have different meanings. Anywhere
one is valid, the other is valid too but obviously each will only 'work'
if the expression resolves to a value.
- %{name} will look for a property named 'name' on your action (i.e.
will result in a call to getName() on your action)
- %{#name} will look for a property or attribute named 'name' anywhere
in the value stack, including in the request/session/application scopes
AFAIK, %{#name} is equivalent to %{name} when there is a getName() on
the action, i.e. OGNL will look at the action first then search the rest
of the value stack.
L.

Attachment:
user_184282.ezm (zipped)--- Laurie Harper <laurie@(protected):
> AFAIK, %{#name} is equivalent to %{name} when there is a getName() on
> the action, i.e. OGNL will look at the action first then search the rest
> of the value stack.
Mmm, I'm not sure about that. The "#" should look explicitly for a named
object in the stack context rather than calling getXxx() on stack objects.
For example, if I have:
<p>Prop from Sanity action: <s:property value="sanityCheck"/></p>
<p>Prop from Sanity action: <s:property value="#sanityCheck"/></p>
only the first one will print the action's getSanityCheck() value.
Not that I just happened to have that example laying around or anything geeky
like that.
*ahem*
Chup Chups!
Dave

Attachment:
user_184255.ezm (zipped)2008/3/14, kannan_307 <kannan.kalirajan@(protected)>:
>
>
> I am using the struts version 1.2.4
It was a bug that seems to be fixed:
https://issues.apache.org/struts/browse/STR-1636
It is fixed in "1.2 Family": I checked and it is fixed in Struts 1.2.9.
I suggest you to upgrade to Struts 1.2.9 or, better, to 1.3.8.
Ciao
Antonio

Attachment:
user_184256.ezm (zipped)2008/3/13, CarloSilva <silva@(protected)>:
>
> Laurie Harper, email-me please. I think I have help to you.
> An emabrace
WTF?

Attachment:
user_184257.ezm (zipped)I think it's a babelfish (babel.altavista.com) translation from another
language.
Anyway, isn't it nice to offer free embraces :).
Al.
----- Original Message -----
From: "Antonio Petrelli" <antonio.petrelli@(protected)>
To: "Struts Users Mailing List" <user@(protected)"
<silva@(protected)>
Sent: Friday, March 14, 2008 8:17 AM
Subject: Re: struts wml
> 2008/3/13, CarloSilva <silva@(protected)>:
>>
>> Laurie Harper, email-me please. I think I have help to you.
>> An emabrace
>
>
>
> WTF?
>

Attachment:
user_184270.ezm (zipped)lol true :) I keep a jar of them on my desk for people passing by to
help themselves... oh, wait, that's Chup Chups ;-)
Al Sutton wrote:
> I think it's a babelfish (babel.altavista.com) translation from another
> language.
>
> Anyway, isn't it nice to offer free embraces :).
>
> Al.
>
>
> ----- Original Message ----- From: "Antonio Petrelli"
> <antonio.petrelli@(protected)>
> To: "Struts Users Mailing List" <user@(protected)"
> <silva@(protected)>
> Sent: Friday, March 14, 2008 8:17 AM
> Subject: Re: struts wml
>
>
>> 2008/3/13, CarloSilva <silva@(protected)>:
>>>
>>> Laurie Harper, email-me please. I think I have help to you.
>>> An emabrace
>>
>>
>>
>> WTF?
>>

Attachment:
user_184258.ezm (zipped)Hi,
On 3/14/08, ravi_eze <ravichandrac@(protected):
> We have two pages a.jsp and b.jsp developed with the action class mehods
> Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
> c.jsp which is combination of both a & b.jsps.
>
> i can include the jsps into the c.jsp. But what abt the action class behind?
> can they not get automatically invoked and the pages get populated? More
> over i have some logic to be performed based on the inputs made in the two
> sections of c.jsp. Is it possible for me to only do this part as a layer?
>
> any ideas as how to go abt this? pl help.
Check out the <s:action /> tag, when c.jsp is rendered you can place
actions on it. All the stuff including interceptors will be invoked
for each action by creating a new action proxy. Don't forget to set
executeResult="true" so the output gets' rendered.
The surrounding action (if c.jsp is an action result) will still be on
the stack.
Cheers,
-Ralf

Attachment:
user_184259.ezm (zipped)Hi,
Action class gets populated when you invoke them by clicking on any button or link or anywhere....
if you invoke the class a by clicking on a.jsp and same with b,
and when you include then into c.jsp
they will work as usual no change requires!!
please correct me if I didnt get your question,
Warm Regards,
----- Original Message ----
From: Ralf Fischer <themakii@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Friday, March 14, 2008 2:41:52 PM
Subject: Re: Multiple Actions for a single page. Is this possible
Hi,
On 3/14/08, ravi_eze <ravichandrac@(protected):
> We have two pages a.jsp and b.jsp developed with the action class mehods
> Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
> c.jsp which is combination of both a & b.jsps.
>
> i can include the jsps into the c.jsp. But what abt the action class behind?
> can they not get automatically invoked and the pages get populated? More
> over i have some logic to be performed based on the inputs made in the two
> sections of c.jsp. Is it possible for me to only do this part as a layer?
>
> any ideas as how to go abt this? pl help.
Check out the <s:action /> tag, when c.jsp is rendered you can place
actions on it. All the stuff including interceptors will be invoked
for each action by creating a new action proxy. Don't forget to set
executeResult="true" so the output gets' rendered.
The surrounding action (if c.jsp is an action result) will still be on
the stack.
Cheers,
-Ralf
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Attachment:
user_184278.ezm (zipped)
chaining is one way to accomplish this.
http://struts.apache.org/2.x/docs/action-chaining.html
ravi_eze wrote:
>
> hi,
>
> We have two pages a.jsp and b.jsp developed with the action class mehods
> Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
> c.jsp which is combination of both a & b.jsps.
>
> i can include the jsps into the c.jsp. But what abt the action class
> behind? can they not get automatically invoked and the pages get
> populated? More over i have some logic to be performed based on the inputs
> made in the two sections of c.jsp. Is it possible for me to only do this
> part as a layer?
>
> any ideas as how to go abt this? pl help.
>
> regards,
> ravi
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184260.ezm (zipped)
Hi All,
I am tryin to make an autocomplete work with its theme="ajax"
I am using struts 2.0.x
The data coming from the action is in JSON format
{"Arizona":"AZ","Arkansas":"AR","Armed":"AE","California":"CA","Florida":"FL"}
the jsp code is
<%@(protected)" %>
<html>
<head>
<s:head theme="ajax" debug="true"/>
</head>
<s:property value="jsonList"/>
<body>
<s:url id="ajaxCallUrl" value="autocompleter1.action">
</s:url>
<h1>Struts 2 Autocompleter Example!</h1>
<s:label name="stateName" value="Select State Name:" />
<br>
<s:autocompleter name="state" theme="ajax" href="%{ajaxCallUrl}"
loadOnTextChange="true" loadMinimumCount="1"/>
<br>
</body>
</html>
But still the autocomplete is not working gives a syntax error on page when
run in debug mode. In one of the links I found that struts-dojo-tags has to
be used as a plugin in struts 2.0.x But also in one of the links it was
specified that its embedded in struts-core.jar.
Please help me out.
Regards,
Ankur
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

Attachment:
user_184281.ezm (zipped)Ankur Agar wrote:
> Hi All,
> I am tryin to make an autocomplete work with its theme="ajax"
> I am using struts 2.0.x
> The data coming from the action is in JSON format
>
> [...]
>
> But still the autocomplete is not working gives a syntax error on page when
Including the actual error message would help. Is it reporting a JSP
syntax error? A Javascript error in the browser? Something else?...
> run in debug mode. In one of the links I found that struts-dojo-tags has to
> be used as a plugin in struts 2.0.x But also in one of the links it was
> specified that its embedded in struts-core.jar.
Dojo and the Ajax tags have been moved to a plugin in Struts 2.1.x. They
are bundled in 2.0.x.
L.

Attachment:
user_184261.ezm (zipped)I am a bit confused by how it works maybe you guys could shed some light :-)
I have a package structure and JSP pages structure that match. To be
concrete actions are placed like this:
/com/mypackge/my/namespace/IndexAction.java
/com/mypackge/my/namespace/EditAction.java
and pages are placed like so:
/WEB-INF/pages/my/namespace/index.jsp
/WEB-INF/pages/my/namespace/edit.jsp
now when I request a page I would like to configure struts/codebehind
combo so if I user requests:
/my/namespace -> index.action should kick in (of course it does not
exists so index.jsp should be the result with the help of codebehind
plugin. And in that page I can do what I need to
So, I tried to make an entry in struts.xml
<struts>
<constant name="struts.codebehind.pathPrefix" value="/WEB-INF/pages/" />
<package name="my.namespace" namespace="/my/namesapce">
<default-action-ref name="index" />
</package>
</struts>
this does not seem to work as I get
HTTP ERROR: 404
NOT_FOUND
Any idea on how I could achieve this ?
Thanks,
Alex.

Attachment:
user_184263.ezm (zipped)Hello out there,
I am relativley new to S2 and I got stuck on a validation problem.
2 fields/properties to be set on my Action:
startDate(String)
endDate(String)
When setting a value first of all the String must be parsed into a Date
object. I know how to handle that.
The endDate must be after the startDate. And that's the problem.
I'd like to annotate the properties-setters, so an implementing
validator takes care of the validation.
sth like this.:
@CustomizableS2Validator ( message="Insuffient Start Date",
when="before", otherDate="endDate" )
public void setStartDate(String inDate) {
date = inDate;
}
Implementing a FieldValidatorSupport does not work because I only know
how to access the validated property. But I need another property of the
Action object.
I know it would be solveable by the @FieldExpressionValidator where its
expression can be filled with a complex OGNL-Expression.
But if evaluating the expression internally throws an Exception, the
evaluation does not terminate right. (I'd be fine with a negative validation
and re-jecting to the input page, but if the OGNL is not evaluateable it
passes the validation)
Another way is to validate within the executed action method. I want a
Validator.
Yet, another is to implement a Validator which accesses Porperties via
Reflection and analyzing the Annotations.
But I'd like to have a Validator object handling the validation concern.
Big question?
Is there even a way to do this.
Is it possible to customize the parameters of an annotation?
What do I have to replace for @CustomizableS2Validator
Best wondering greetings from cologne
Dirk
--
softwareentwickler
denkwerk gmbh | vogelsanger straße 66 | d-50823 köln
telefon +49 221 2942 100 | telefax +49 221 2942 101
GF: Axel Schmiegelow, Marco Zingler, Jochen Schlaier, Frank Zimpel
HRB 32063 Amtsgericht Köln - www.denkwerk.com

Attachment:
user_184264.ezm (zipped)--- Dirk Schumacher wrote:
> 2 fields/properties to be set on my Action:
> startDate(String)
> endDate(String)
>
> When setting a value first of all the String must be parsed into a Date
> object.
FYI, that can be handled automatically by the framework via type conversion
[1] unless there's some compelling reason to explicitly convert from a
string.
> I'd like to annotate the properties-setters, so an implementing
> validator takes care of the validation.
>
> sth like this.:
> @CustomizableS2Validator ( message="Insuffient Start Date",
> when="before", otherDate="endDate" )
> public void setStartDate(String inDate) {
> date = inDate;
> }
IIRC using an annotation for a custom validator is a bit more complicated
than that because of how annotations work (they can't be subclassed) and
XWork sets things up with regards to validation annotations. You'd probably
have to use @CustomValidator [2].
> Is it possible to customize the parameters of an annotation?
@ValidationParameter [3] sets parameters for @CustomValidator. I find it
pretty unwieldy, but because of the way XWork looks for validation
annotations I'm not sure what the options are at this point. Perhaps somebody
else will have a better solution.
Dave
[1] http://struts.apache.org/2.x/docs/type-conversion.html
[2] http://struts.apache.org/2.x/docs/customvalidator-annotation.html
[3] http://struts.apache.org/2.x/docs/validationparameter-annotation.html

Attachment:
user_184283.ezm (zipped)Dirk Schumacher wrote:
> I know it would be solveable by the @FieldExpressionValidator where its
> expression can be filled with a complex OGNL-Expression.
> But if evaluating the expression internally throws an Exception, the
> evaluation does not terminate right. (I'd be fine with a negative
> validation
> and re-jecting to the input page, but if the OGNL is not evaluateable it
> passes the validation)
The expression shouldn't be so complicated; you're just comparing two
dates, after all. And why would the OGNL expression throw an exception?
The only issue I would expect is with one or both dates being null,
which you can avoid using a 'required' validator.
I would think working through any issues with this approach would be a
lot less pain than going for a custom validator in this case.
L.

Attachment:
user_184265.ezm (zipped)HI Vamsi,
by the time you get to the for loop I don't see the list initialized, unless you are doing this from your jsp I don't think it will work as how you have it, a better way would be with a normal for like this :
for (int index = 0; index < someLimit; index++) {
Person person = new Person();
persons.add(index, person);
_logger.error("Person ::::::::::::::::::::::::::" + person);
e.persist(person);
}
hope this helps.
Cesar
----- Original Message ----
From: Vamsi Gmail! <vamseemandava@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, March 13, 2008 11:14:53 PM
Subject: Problem assiging elements in to list
Hi all,
I have a requirement where I need to assign a Objects to a list.
I tried the example given in showcase there is working (in the site).
But It is not assigning to that list
I am also attaching code for your refernce.
---Vamsi
-----Inline Attachment Follows-----
/*
* $Id: PersonAction.java 471756 2006-11-06 15:01:43Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package test.actions;
import
java.util.ArrayList;
import
java.util.List;
import
javax.persistence.EntityManager;
import
javax.persistence.EntityTransaction;
import
javax.persistence.PersistenceUnit;
import
org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory;
import
org.hibernate.exception.ConstraintViolationException;
import test.examples.Person;
import
com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class PersonAction extends ActionSupport {
//private Person person;
private List persons = new ArrayList();
private Log _logger = LogFactory.getLog(PersonAction.class);
public List getPersons() {
return persons;
}
public void setPersons(List persons) {
this.persons = persons;
}
@SuppressWarnings("unchecked")
public String save() {
EntityManager e = SfmsEntityManagerFactory.getEntityManager();
EntityTransaction txn =e.getTransaction();
txn.begin();
try{
_logger.error("Person ::::::::::::::::::::::::::");
_logger.error("Person ::::::::::::::::::::::::::");
for (Object object :persons) {
Person person = (Person) object;
_logger.error("Person ::::::::::::::::::::::::::" + person);
e.persist(person);
}
_logger.error("Person ::::::::::::::::::::::::::");
_logger.error("Person ::::::::::::::::::::::::::");
txn.commit();
addActionMessage("Record Added");
read(e);
}catch(ConstraintViolationException e1) {
addActionError("Record Already There");
}catch(IllegalStateException e1){
}catch(Exception e1) {
addActionError("Error Inserting");
txn.rollback();
}
return SUCCESS;
}
private void read(EntityManager e) {
persons = e.createQuery("From Person").getResultList();
}
}
-----Inline Attachment Follows-----
package test.examples;
import static
javax.persistence.FetchType.LAZY;
import
javax.persistence.Basic;
import
javax.persistence.Entity;
import
javax.persistence.Id;
@Entity
public class Person implements Persister{
@Id
private String name;
@Basic(fetch=LAZY)
private int age;
public String getName() {
return name;
}
public int getAge() {
return age;
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return name + "::::" + age;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_184266.ezm (zipped)--- Cesar Arevalo <cesararevalo@(protected):
> by the time you get to the for loop I don't see the list initialized,
> unless you are doing this from your jsp I don't think it will work as how
> you have it, a better way would be with a normal for like this :
>
> for (int index = 0; index < someLimit; index++) {
> Person person = new Person();
> persons.add(index, person);
> _logger.error("Person ::::::::::::::::::::::::::" +
> person);
>
> e.persist(person);
> }
>
> hope this helps.
That would create a list of empty Person instances (then persist the last
empty Person, but I'm assuming that's a typo).
All of this is done automatically by the framework.
> From: Vamsi Gmail! <vamseemandava@(protected)>
>
> I have a requirement where I need to assign a Objects to a list.
> I tried the example given in showcase there is working (in the site).
> But It is not assigning to that list
>
> I am also attaching code for your reference.
>
> [code]
You never really state how you're expecting the list to be filled: is this
from a form with multiple Person form fields, or...?
Dave

Attachment:
user_184267.ezm (zipped)Just out of curiosity, when you say "All of this is done automatically by the framework" do you mean if you populate from a form? or how do you mean the framework does this automatically?
Cesar
----- Original Message ----
From: Dave Newton <newton.dave@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Friday, March 14, 2008 10:27:19 AM
Subject: Re: Problem assiging elements in to list
--- Cesar Arevalo <cesararevalo@(protected):
> by the time you get to the for loop I don't see the list initialized,
> unless you are doing this from your jsp I don't think it will work as how
> you have it, a better way would be with a normal for like this :
>
> for (int index = 0; index < someLimit; index++) {
> Person person = new Person();
> persons.add(index, person);
> _logger.error("Person ::::::::::::::::::::::::::" +
> person);
>
> e.persist(person);
> }
>
> hope this helps.
That would create a list of empty Person instances (then persist the last
empty Person, but I'm assuming that's a typo).
All of this is done automatically by the framework.
> From: Vamsi Gmail! <vamseemandava@(protected)>
>
> I have a requirement where I need to assign a Objects to a list.
> I tried the example given in showcase there is working (in the site).
> But It is not assigning to that list
>
> I am also attaching code for your reference.
>
> [code]
You never really state how you're expecting the list to be filled: is this
from a form with multiple Person form fields, or...?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_184268.ezm (zipped)--- Cesar Arevalo <cesararevalo@(protected):
> when you say "All of this is done automatically by the framework"
> do you mean if you populate from a form?
Yes.
Dave

Attachment:
user_184269.ezm (zipped)--- Cesar Arevalo <cesararevalo@(protected):
> when you say "All of this is done automatically by the framework"
> do you mean if you populate from a form?
Actually, let me re-answer that: yes, with caveats.
For example, in the source provided the list isn't genericized, so without a
type conversion properties file I don't think it would work.
It can also depend on what type conversion(s) are being attempted; simple
property types are supported out-of-the-box. Sometimes custom type converters
would have to be written.
Without knowing what the original poster was trying to do it's hard to say
what problem s/he is experiencing.
Dave

Attachment:
user_184271.ezm (zipped)Doug Pham wrote:
> Hi All,
> I took the current quickstart application and added sitemesh to the pom.xml and added all the necessary files for sitemesh, the dojo that listed the Persons broke. The decorator works but the ajax failed with "Error loading '/quickstart/list.action' (200 OK)" Is there any special settings I need to do to fix this problem?
It's rather hard to say without knowing what settings you added/changed
while integrating Sitemesh. Post more details of what you did and how it
is failing if you still need help.
L.

Attachment:
user_184272.ezm (zipped)I have created a template which utilizes parameters that are passed into
it to generate HTML conditionally based on those parameters. For
example:
<s:component theme="scaTheme" templateDir="template"
template="Header.jsp">
<s:param name="titleKey"
value="%{'title.appNpc'}" />
<s:param name="helpPage"
value="%{'Non_Premier_Contract_Home_Page.htm'}" />
</s:component>
However, I do not wish to require that all the parameters be required.
For example, it would be ok if the "helpPage" parameter was not
specified. At runtime, everything works fine if I do not specify the
"helpPage" parameter. However if I place my logging level at DEBUG, I
my log is cluttered with NPEs like the one below. I cannot seem to find
any kind of syntax to reference the parameter to even test if it is null
without generating this NPE in DEBUG. Does anyone know if it is
possible to avoid these NPEs? I make heavy use of templates with
optional parameters and it is really cluttering up the logs when trying
to debug. Am I doing something wrong? Should this maybe be readdressed
in the Struts code base? I understand why the DEBUG statement is
logged. Just not sure since it is a DEBUG statement, if the stack trace
is warranted.
Thanks in advance!
2008-03-14 14:30:14,364 DEBUG (http-127.0.0.1-8080-2:)
[com.opensymphony.xwork2.util.DefaultObjectTypeDeterminer] Error while
retrieving generic property class for property=parameters
java.lang.NullPointerException at
com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer.getClass(Gener
icsObjectTypeDeterminer.java:222)
at
com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer.getKeyClass(Ge
nericsObjectTypeDeterminer.java:44)
at
com.opensymphony.xwork2.util.XWorkMapPropertyAccessor.getKey(XWorkMapPro
pertyAccessor.java:136)
at
com.opensymphony.xwork2.util.XWorkMapPropertyAccessor.getProperty(XWorkM
apPropertyAccessor.java:68)
at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1643)
at ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.ASTChain.getValueBody(ASTChain.java:109)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.ASTNotEq.getValueBody(ASTNotEq.java:49)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.ASTAnd.getValueBody(ASTAnd.java:56)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at ognl.SimpleNode.getValue(SimpleNode.java:210)
at ognl.Ognl.getValue(Ognl.java:333)
at
com.opensymphony.xwork2.util.OgnlUtil.getValue(OgnlUtil.java:194)
at
com.opensymphony.xwork2.util.OgnlValueStack.findValue(OgnlValueStack.jav
a:238)
at
org.apache.struts2.components.Component.findValue (
Component.java:322)
at
org.apache.struts2.components.If.start (
If.java:85)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTag
Support.java:54)
at
org.apache.jsp.template.scaTheme.Header_jsp._jspx_meth_s_005fif_005f0(He
ader_jsp.java:273)
-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

Attachment:
user_184273.ezm (zipped)
Hi, forgive me if this has been asked before. I am just starting on struts
and wondering if I should first learn Struts 1 or just jump straight to
struts 2? Will spending time on struts 1 help me with struts 2 or will it
get in the way since everything in struts 2 is different from Struts 1? I
have all of the requisites for starting struts 1.
Thanks.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184274.ezm (zipped)2008/3/14, akoo <ogenium@(protected)>:
>
> Hi, forgive me if this has been asked before. I am just starting on struts
> and wondering if I should first learn Struts 1 or just jump straight to
> struts 2? Will spending time on struts 1 help me with struts 2 or will it
> get in the way since everything in struts 2 is different from Struts 1? I
> have all of the requisites for starting struts 1.
Struts 1 and 2 are so different that they deserve a different name :-)
Seriously, Struts 1 and 2 are not related, learn Struts 2 directly.
Antonio

Attachment:
user_184275.ezm (zipped)I am starting to doubt about that, I was denied a job because I didn't
have "enough" struts 1 experience, almost funny anyway :)
musachy
On Fri, Mar 14, 2008 at 2:53 PM, Antonio Petrelli
<antonio.petrelli@(protected):
> 2008/3/14, akoo <ogenium@(protected)>:
>
> >
> > Hi, forgive me if this has been asked before. I am just starting on struts
> > and wondering if I should first learn Struts 1 or just jump straight to
> > struts 2? Will spending time on struts 1 help me with struts 2 or will it
> > get in the way since everything in struts 2 is different from Struts 1? I
> > have all of the requisites for starting struts 1.
>
> Struts 1 and 2 are so different that they deserve a different name :-)
> Seriously, Struts 1 and 2 are not related, learn Struts 2 directly.
>
> Antonio
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_184276.ezm (zipped)
No, don't bother. Its not a chapter of book.
Skip some of the stuff you don't need to know any longer and roll up your
sleeves with struts 2.
akoo wrote:
>
> Hi, forgive me if this has been asked before. I am just starting on
> struts and wondering if I should first learn Struts 1 or just jump
> straight to struts 2? Will spending time on struts 1 help me with struts
> 2 or will it get in the way since everything in struts 2 is different from
> Struts 1? I have all of the requisites for starting struts 1.
> Thanks.
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_184279.ezm (zipped)2008/3/14, Musachy Barroso <musachy@(protected)>:
> I am starting to doubt about that, I was denied a job because I didn't
> have "enough" struts 1 experience, almost funny anyway :)
Then you had to learn Struts 1 instead of 2 :-D
Antonio

Attachment:
user_184280.ezm (zipped)
Also, include don't use Dojo or the Ajax theme unless you want to increase
your request size by 400KB.
Unfortunately for ajax, in the current form you need to roll your own if you
want to avoid the Dojo penality.
newton.dave wrote:
>
> --- Raghu varma bhupathiraju wrote:
>> give me the list of best practices to follow for reducing the
>> execution time in struts.
>
> http://struts.apache.org/2.x/docs/performance-tuning.html
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.