Re: Re : Disappearing Labels

2010-05-21 Thread Bhaarat Sharma
Were you in an environment where the Xworks.jar was shared by different
WARs?

can you share how your  tag looked like?

Thanks

On Fri, May 21, 2010 at 7:11 AM, François Rouxel  wrote:

> I had the same effect when pushing my model on the valueStack...
> I don't know why, but my labels disappeared too...
>
> if anybody had an idea...
>
> fr/
>  
> 
>
>
>
> ----- Message d'origine 
> De : Bhaarat Sharma 
> À : Struts Users Mailing List 
> Envoyé le : Jeu 20 mai 2010, 23h 31min 38s
> Objet : Re: Disappearing Labels
>
> Thanks for clarifying. I will try stuff and get back
>
> On Thu, May 20, 2010 at 11:24 PM, Cimballi  wrote:
>
> > I recommend you to try to deploy both applications on separate
> > servers, as the guy did in your link, and see if you still have the
> > problem.
> > For sure the s:text in Struts uses Xworks.
> >
> > Cimballi
> >
> >
> > On Thu, May 20, 2010 at 10:10 PM, Bhaarat Sharma 
> > wrote:
> > > Hi,
> > >
> > > Have not tried that yet.  We can not try that because of this error on
> > > glassfish.
> > http://www.mail-archive.com/user@struts.apache.org/msg76893.html
> > > having multiple wars in an ear.  this causes wars and ears to not get
> > > deployed.
> > >
> > > I fail to understand why this would happen couple hours after the
> restart
> > > when other ppl start doing their work on other war's.  what could be
> > causing
> > > the labels to just intermittently disappear?
> > >
> > > Can someone confirm that Xworks.jar is utilized when getting labels in
> > code
> > > like  ?
> > >
> > > On Thu, May 20, 2010 at 10:44 PM, Cimballi 
> > wrote:
> > >
> > >> Did you try putting the xworks jar in each project ? I am not sure but
> > >> I don't think you can share it.
> > >>
> > >> Cimballi
> > >>
> > >>
> > >> On Thu, May 20, 2010 at 9:18 PM, Bhaarat Sharma 
> > >> wrote:
> > >> > We have a weird problem with multiple Struts2 wars deployed on same
> > >> > GlassFish server.  These wars share the Xworks.jar file and have
> their
> > >> own
> > >> > copy of struts2-core jar files in WEB-INF/lib
> > >> >
> > >> > Problem we are experiencing is that once the server is restarted
> > >> everything
> > >> > is ok but after couple of hours of people going into their own
> > >> applications
> > >> > and doing regular work we notice that one application starts seeing
> > >> lables
> > >> > issues.
> > >> >
> > >> > In this applications struts.properties the following is defined:
> > >> > struts.custom.i18n.resources=labelsfile1,labelsfile2
> > >> >
> > >> > They use labels in their jsps like so:
> > >> > 
> > >> >
> > >> > When the error happens...instead of seeing the actual text
> > corresponding
> > >> to
> > >> > that value...we start seeing the label name. So in this case we see
> > >> > "somelabelin.labelsfile1" on the front end.
> > >> >
> > >> > This issue again goes away after the server is restarted.
> > >> >
> > >> > Anyone has any hint on what could be causing this?  could other
> war's
> > be
> > >> > overwriting this war's labels configuration? could devMode being
> true
> > in
> > >> > some war's struts.properties file be causing this issue?
> > >> >
> > >> > I'd appreciate any hints.
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Cimballi
> > >> JAVA J2EE Freelance
> > >> http://cimballi.elance.com/
> > >>
> > >> -
> > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > >> For additional commands, e-mail: user-h...@struts.apache.org
> > >>
> > >>
> > >
> >
> >
> >
> > --
> >  Cimballi
> > JAVA J2EE Freelance
> > http://cimballi.elance.com/
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Disappearing Labels

2010-05-20 Thread Bhaarat Sharma
Thanks for clarifying. I will try stuff and get back

On Thu, May 20, 2010 at 11:24 PM, Cimballi  wrote:

> I recommend you to try to deploy both applications on separate
> servers, as the guy did in your link, and see if you still have the
> problem.
> For sure the s:text in Struts uses Xworks.
>
> Cimballi
>
>
> On Thu, May 20, 2010 at 10:10 PM, Bhaarat Sharma 
> wrote:
> > Hi,
> >
> > Have not tried that yet.  We can not try that because of this error on
> > glassfish.
> http://www.mail-archive.com/user@struts.apache.org/msg76893.html
> > having multiple wars in an ear.  this causes wars and ears to not get
> > deployed.
> >
> > I fail to understand why this would happen couple hours after the restart
> > when other ppl start doing their work on other war's.  what could be
> causing
> > the labels to just intermittently disappear?
> >
> > Can someone confirm that Xworks.jar is utilized when getting labels in
> code
> > like  ?
> >
> > On Thu, May 20, 2010 at 10:44 PM, Cimballi 
> wrote:
> >
> >> Did you try putting the xworks jar in each project ? I am not sure but
> >> I don't think you can share it.
> >>
> >> Cimballi
> >>
> >>
> >> On Thu, May 20, 2010 at 9:18 PM, Bhaarat Sharma 
> >> wrote:
> >> > We have a weird problem with multiple Struts2 wars deployed on same
> >> > GlassFish server.  These wars share the Xworks.jar file and have their
> >> own
> >> > copy of struts2-core jar files in WEB-INF/lib
> >> >
> >> > Problem we are experiencing is that once the server is restarted
> >> everything
> >> > is ok but after couple of hours of people going into their own
> >> applications
> >> > and doing regular work we notice that one application starts seeing
> >> lables
> >> > issues.
> >> >
> >> > In this applications struts.properties the following is defined:
> >> > struts.custom.i18n.resources=labelsfile1,labelsfile2
> >> >
> >> > They use labels in their jsps like so:
> >> > 
> >> >
> >> > When the error happens...instead of seeing the actual text
> corresponding
> >> to
> >> > that value...we start seeing the label name. So in this case we see
> >> > "somelabelin.labelsfile1" on the front end.
> >> >
> >> > This issue again goes away after the server is restarted.
> >> >
> >> > Anyone has any hint on what could be causing this?  could other war's
> be
> >> > overwriting this war's labels configuration? could devMode being true
> in
> >> > some war's struts.properties file be causing this issue?
> >> >
> >> > I'd appreciate any hints.
> >> >
> >>
> >>
> >>
> >> --
> >> Cimballi
> >> JAVA J2EE Freelance
> >> http://cimballi.elance.com/
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>
>
>
> --
>  Cimballi
> JAVA J2EE Freelance
> http://cimballi.elance.com/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Disappearing Labels

2010-05-20 Thread Bhaarat Sharma
Hi,

Have not tried that yet.  We can not try that because of this error on
glassfish. http://www.mail-archive.com/user@struts.apache.org/msg76893.html
having multiple wars in an ear.  this causes wars and ears to not get
deployed.

I fail to understand why this would happen couple hours after the restart
when other ppl start doing their work on other war's.  what could be causing
the labels to just intermittently disappear?

Can someone confirm that Xworks.jar is utilized when getting labels in code
like  ?

On Thu, May 20, 2010 at 10:44 PM, Cimballi  wrote:

> Did you try putting the xworks jar in each project ? I am not sure but
> I don't think you can share it.
>
> Cimballi
>
>
> On Thu, May 20, 2010 at 9:18 PM, Bhaarat Sharma 
> wrote:
> > We have a weird problem with multiple Struts2 wars deployed on same
> > GlassFish server.  These wars share the Xworks.jar file and have their
> own
> > copy of struts2-core jar files in WEB-INF/lib
> >
> > Problem we are experiencing is that once the server is restarted
> everything
> > is ok but after couple of hours of people going into their own
> applications
> > and doing regular work we notice that one application starts seeing
> lables
> > issues.
> >
> > In this applications struts.properties the following is defined:
> > struts.custom.i18n.resources=labelsfile1,labelsfile2
> >
> > They use labels in their jsps like so:
> > 
> >
> > When the error happens...instead of seeing the actual text corresponding
> to
> > that value...we start seeing the label name. So in this case we see
> > "somelabelin.labelsfile1" on the front end.
> >
> > This issue again goes away after the server is restarted.
> >
> > Anyone has any hint on what could be causing this?  could other war's be
> > overwriting this war's labels configuration? could devMode being true in
> > some war's struts.properties file be causing this issue?
> >
> > I'd appreciate any hints.
> >
>
>
>
> --
> Cimballi
> JAVA J2EE Freelance
> http://cimballi.elance.com/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Disappearing Labels

2010-05-20 Thread Bhaarat Sharma
We have a weird problem with multiple Struts2 wars deployed on same
GlassFish server.  These wars share the Xworks.jar file and have their own
copy of struts2-core jar files in WEB-INF/lib

Problem we are experiencing is that once the server is restarted everything
is ok but after couple of hours of people going into their own applications
and doing regular work we notice that one application starts seeing lables
issues.

In this applications struts.properties the following is defined:
struts.custom.i18n.resources=labelsfile1,labelsfile2

They use labels in their jsps like so:


When the error happens...instead of seeing the actual text corresponding to
that value...we start seeing the label name. So in this case we see
"somelabelin.labelsfile1" on the front end.

This issue again goes away after the server is restarted.

Anyone has any hint on what could be causing this?  could other war's be
overwriting this war's labels configuration? could devMode being true in
some war's struts.properties file be causing this issue?

I'd appreciate any hints.


ConcurrentModificationException error.

2010-04-30 Thread Bhaarat Sharma
Hi

We are struggling with this error in our application.  We are on Struts
2.0.6 and Xworks version is 2.0.1.

This issue is very intermittent but the best way we've been able to
reproduce it is when we load the same page from two different browser
windows or on two different machines.

The stack trace looks like this:
java.util.ConcurrentModificationException
at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.findDefaultText(LocalizedTextUtil.java:174)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.getDefaultMessage(LocalizedTextUtil.java:571)
at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:449)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:224)
at
com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:99)
at org.apache.struts2.components.Text.end(Text.java:158)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)

I initially thought that it had something to do with  tag but we
are getting this error on pages where we are not even using an iterator.  We
are also getting it on somepages that DO use iterator.

Since LocalizedTextUtil is involved...I am thinking that it has something to
do with .  We use  to get the label name in our JSP.  Does
that go to LocalizedTextUtil?

On this page (one without iterator) I am not doing anything that involves
iterating over a list.  At most what I see is the following code:


Now LinkedHashMap is NOT synchronized...so if I load this at the same
time...is it possible that it would give ConcurrentModificationException? or
am i thinking along wrong lines since the log has no mention of this?

I am really out of ideas with this one and would appreciate any input from
you guys.

Thanks


Question on WW-2272 fixed by musachy

2010-04-29 Thread Bhaarat Sharma
I am referring to this JIRA ticket:
https://issues.apache.org/jira/browse/WW-2272

This code was fixed by musachy and the comment says:

 Fixed on xwork. rv1780

I am just trying to figure out what rv1780 means and how can I traslate that
to which xwork jar would have this issue fixed?

Currently I have the following xwork jar: xwork-2.0.1.jar

Can someone please help me find which xwork jar version corresponds to
rv1780?

Thanks
-bhaarat


Re: how to get runtime configuration

2010-04-22 Thread Bhaarat Sharma
nevermind...got it:
Dispatcher.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration();

On Thu, Apr 22, 2010 at 9:41 AM, Bhaarat Sharma  wrote:

> I was going through the API's and came across this 
> method<http://www.jarvana.com/jarvana/view/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8-javadoc.jar!/com/opensymphony/xwork2/config/impl/DefaultConfiguration.html#getRuntimeConfiguration()>
>
> It is getRuntimeConfiguration() in class DefaultConfiguration
>
> Does anyone know how I can access this method from my code??
>
> I know how to get hold of the configurationManager by doing:
> Dispatcher.getInstance().getConfigurationManager()
>
> but how do we gain access to the runtimeconfiguration?
>


how to get runtime configuration

2010-04-22 Thread Bhaarat Sharma
I was going through the API's and came across this
method

It is getRuntimeConfiguration() in class DefaultConfiguration

Does anyone know how I can access this method from my code??

I know how to get hold of the configurationManager by doing:
Dispatcher.getInstance().getConfigurationManager()

but how do we gain access to the runtimeconfiguration?


Re: no action mapped for namespace

2010-04-20 Thread Bhaarat Sharma
@Luis: I don't think I understand what you are trying to do from that
example...how  will that help? I am trying to find out that if
ActionContext.getInstance().getName() returns an action name say "test" and
that is infact the action we want to land on...can it be So if the above
line of code returns an action name...can it be guaranteed that we will not
get "No action mapped for namespace..."?

@Martin: I don't understand where component comes from in your example.
 which super.populateParams() is your method pointing to? I am lost


On Tue, Apr 20, 2010 at 7:49 PM, Martin Gainty  wrote:

>
> populated by the ActionTag populateParams()
>protected void populateParams() {
>super.populateParams();
>ActionComponent action = (ActionComponent) component;
>action.setName(name);
>action.setNamespace(namespace);
>
> so in the case of this declaration
>  namespace="/tags/non-ui/actionTag">
>
> ActionContext.getContext().get(ACTION_MAPPING).getNamespace()
> will yield
> /tags/non-ui/actionTag
>
> hth
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Tue, 20 Apr 2010 16:19:39 -0400
> > Subject: no action mapped for namespace
> > From: bhaara...@gmail.com
> > To: user@struts.apache.org
> >
> > in struts2 is there a way to detect when "No action mapped for namespace
> > ..." error will come up??
> >
> > What I mean is that can we write an if condition that checks whether or
> not
> > the the action name exists in struts.xml?
> >
> > we can get the action name by: ActionContext.getInstance().getName()
> >
> > So if the above line of code returns an action name...can it
> > be guaranteed that we will not get "No action mapped for namespace..."?
> >
> > Thanks
>
> _
> The New Busy is not the too busy. Combine all your e-mail accounts with
> Hotmail.
>
> http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
>


no action mapped for namespace

2010-04-20 Thread Bhaarat Sharma
in struts2 is there a way to detect when "No action mapped for namespace
..." error will come up??

What I mean is that can we write an if condition that checks whether or not
the the action name exists in struts.xml?

we can get the action name by: ActionContext.getInstance().getName()

So if the above line of code returns an action name...can it
be guaranteed that we will not get "No action mapped for namespace..."?

Thanks


Re: programatically add configuration

2010-04-20 Thread Bhaarat Sharma
Is this not possible to do ?

can we not programmaitcally add/load struts.xml into the instance?

On Mon, Apr 19, 2010 at 2:48 PM, Bhaarat Sharma  wrote:

> ConfigurationManager (
> http://struts.apache.org/2.0.11.1/struts2-core/apidocs/com/opensymphony/xwork2/config/ConfigurationManager.html)
> API provides a reload method that will reload the configuration settings.
>
> There is also a setConfiguration(Configuration configuration) method in
> there.  Can this method be used to explicitly load the struts.xml file??
>
> The implementing class for Configuration is DefaultConfiguration (
> http://struts.apache.org/2.0.11.1/struts2-core/apidocs/com/opensymphony/xwork2/config/impl/DefaultConfiguration.html
> )
>
> I can't figure out how to explicitly load all the configurations that are
> in struts.xml.
>
> I want to do this because sometimes intermittently we notice that we get
> action name not found errors.  At that point we'd like to explicitly load
> the struts.xml file.
>
> Can someone assist in this?
>


programatically add configuration

2010-04-19 Thread Bhaarat Sharma
ConfigurationManager (
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/com/opensymphony/xwork2/config/ConfigurationManager.html)
API provides a reload method that will reload the configuration settings.

There is also a setConfiguration(Configuration configuration) method in
there.  Can this method be used to explicitly load the struts.xml file??

The implementing class for Configuration is DefaultConfiguration (
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/com/opensymphony/xwork2/config/impl/DefaultConfiguration.html
)

I can't figure out how to explicitly load all the configurations that are in
struts.xml.

I want to do this because sometimes intermittently we notice that we get
action name not found errors.  At that point we'd like to explicitly load
the struts.xml file.

Can someone assist in this?


struts.xml vs struts.properties which takes a precedence?

2010-03-25 Thread Bhaarat Sharma
Hi,


If the same property is set in struts.xml and struts.properties which one
takes precedence?  also, is there any documentation where this is explained
/verified?


Way to forcefully reload struts.xml [struts2]

2010-02-25 Thread Bhaarat Sharma
We are seeing a situation where certain namespaces/actions are getting error
"There is no action mapped for namespace ... and action ..." on the server.
  However, on our local we do not get this error. Which leads us to believe
that struts.xml might be getting lost.

Is there a way to forcefully reload the struts.xml?

I tried:

import com.opensymphony.xwork2.config.ConfigurationManager;
ConfigurationManager config = new ConfigurationManager();
config.reload();


But that gives error: Could not open files of the name xwork.xml - [unknown
location]

By the way, we've noticed that when we get "There is no action mapped..."
error then the action name generally has a "!" in the URL because we are
directly going a specific method in the action.

I'd appreciate if someone can tell me how to forcefully reload struts.xml.
 (Besites the struts.reload property being true in struts.xml)

Thanks


Re: Any way to load resources in java.util.ResourceBundle

2010-01-29 Thread Bhaarat Sharma
no help on this one?

On Wed, Jan 27, 2010 at 12:43 PM, Bhaarat Sharma wrote:

> We have seen situations where sometimes the global resource bundles are
> lost intermittently for some sessions.  We are in a clustered/shared
> environment where multiple apps are deployed onto a GlassFishV2 server.
> Multiple apps share the struts2 core jars.
>
> We have some pages where we have written a custom Resource loader and
> everything looks fine on these pages. Problem is on pages that utilize
> . Our properties files reside globally in
> WEB-INF/lib
>
> Our custom resource loader works as follows in a JSP
>
> <%CustomMessageResrouce cusResource = new
> CustomMessageResource("Resource")%>
> <%= cusResource.getMessage("my.label.name")%>
>
> Java code for it looks like:
> import java.util.ResourceBundle;
> ResourceBundle resource = ResourceBundle.getBundle(baseName);
>
>
> So we know that loading properties into resourcebundles and using them as
> shown above works.
>
> My question is..can we do the same for struts2. Can we forcefully load the
> resourcebundles inside java.util.ResourceBundle and then have them be used
> in  tag?
>
>


Re: I18nInterceptor / request_locale not working as expected

2010-01-29 Thread Bhaarat Sharma
Hi stephan,

I see you solved your issue regarding resource bundle.

I am having a problem where intermittently the resource bundles get lost and
instead of seeing values on the browser...we start seeing actual properties
like: my.label.name.


using the execute method for your code below...is there any way to find out
whether a resource file named "MyResources" is loaded in the session?


On Thu, Jan 28, 2010 at 2:07 PM, Stephan R. Mueller <
stephanr.muel...@stud.leuphana.de> wrote:

> Hi list,
>
> I'm using struts 2.1.8 with JDK6
>
> I've Message.properties | Message_de_DE.properties
> and Message_en_US.properties.
>
> When switching the local via a browser plugin everything
> works fine and I can see that Session.WW_TRANS_I18N_LOCALE
> contains the expected locale (de_DE or en_US).
> Now I've added a languages.jsp that contains 2 links
> Constructed like this:
> 
>en_US
>
>English
>
>
>
>de_DE
>
>Deutsch
>
> When using one of these links I can see that
> Session.WW_TRANS_I18N_LOCALE changes it's value
> accordingly but the displayed language stays the same and
> doesn't change.
> languages.jsp uses an action like the following:
> --snip-
> public class LanguagesShowAction extends ActionSupport implements
> ServletRequestAware {
>
>HttpServletRequest request;
>private Map application;
>private Map session;
>
>public String execute() {
>
>application = ActionContext.getContext().getApplication();
>session = ActionContext.getContext().getSession();
>session.put("referer", "languages");
>
>String localeParam = request.getParameter("request_locale");
>
>System.out.println("localeParam = " + localeParam);
>
>if (localeParam != null && !localeParam.isEmpty()) {
>return "localeChngd"; //used to redirect to another
> jsp
>}
>System.out.println("loading languages page");
>return SUCCESS;
> ---snap---
>
> Any ideas on what I may have done wrong?
> Additional info needed?
>
> Regards,
> Stephan
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Any way to load resources in java.util.ResourceBundle

2010-01-27 Thread Bhaarat Sharma
We have seen situations where sometimes the global resource bundles are lost
intermittently for some sessions.  We are in a clustered/shared environment
where multiple apps are deployed onto a GlassFishV2 server. Multiple apps
share the struts2 core jars.

We have some pages where we have written a custom Resource loader and
everything looks fine on these pages. Problem is on pages that utilize
. Our properties files reside globally in
WEB-INF/lib

Our custom resource loader works as follows in a JSP

<%CustomMessageResrouce cusResource = new
CustomMessageResource("Resource")%>
<%= cusResource.getMessage("my.label.name")%>

Java code for it looks like:
import java.util.ResourceBundle;
ResourceBundle resource = ResourceBundle.getBundle(baseName);


So we know that loading properties into resourcebundles and using them as
shown above works.

My question is..can we do the same for struts2. Can we forcefully load the
resourcebundles inside java.util.ResourceBundle and then have them be used
in  tag?


Interceptor to load properties file

2010-01-20 Thread Bhaarat Sharma
I am using this approach to load properties

http://struts.apache.org/2.0.14/docs/how-do-i-set-a-global-resource-bundle.html

I want to load the properties on each request (without turning the devmode =
true).

How should I go about this?

Should I turn ActionGlobalMessagesListener into an interceptor?


Re: getText() from login.properties but not packages.properties

2010-01-20 Thread Bhaarat Sharma
login.properties has to be mentioned in you struts.properties file as

struts.custom.i18n.resources=login

Above means that login.properties resides in WEB-INF/classes

On Wed, Jan 20, 2010 at 1:47 PM, Emi Lu  wrote:

> Lukasz Lenart wrote:
>
>> Please read documentation, everything is explained there.
>>
>> http://struts.apache.org/2.1.8.1/docs/localization.html
>> http://struts.apache.org/2.1.8.1/docs/strutsproperties.html
>>
>>  This did not answer my question :(
>
> Using package.properties works fine for me. The problem is how to read
> value from login.properties file?
>
> How does struts2 recognize login.properties?
>
> Thanks
> --
> Lu Ying
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Resrouce bundles intermittently not getting loaded when in clustered environment

2010-01-20 Thread Bhaarat Sharma
I am not sure whether it is directly a Struts problem but I'm hoping someone
will be able to suggest a way around.

I have the following in my struts.properties file:
struts.custom.i18n.resources=MyResource

MyResource.properties resides in WEB-INF/classes of my application.

In my JSP I simply do the following:



Everything seems to work but sometimes we literally see 'my.text.label1' in
the browser instead of seeing the value. Once this happens...it stays for
the whole session. we close the browser...open new window (session) and then
most of the time it goes away. so it is really intermittent.

We are in a clustered environment where multiple Struts2 applications are
deployed on Glassfish server and all the WAR applications share the
struts2-core.jar.

We have noticed that this error goes away when following properties are
placed in struts.properties:
struts.devMode = true
struts.i18n.reload= true

the above properties will reload the resource bundles on each request.  We
do not want to do this in production.

So I finding out what are some other alternative ways of access properties
file in struts2? Will placing them in ActionClasses make a difference?

Thanks!
-bhaarat


custom properties file not loading in Glassfish V2

2009-12-16 Thread Bhaarat Sharma
Hello,

I have a Struts2 app in which my struts.properties resides in
WEB-INF/classes.  It contains the following line

struts.custom.i18n.resources=mypropertyfile

mypropertyfile also resides in WEB-INF/classes.  and inside the
properties file, for example I have the following:

pdf.test.title=PDF Test

then in my jsp I use it as follows



On the browser it shows "pdf.test.title" rather than "PDF Test"

With the same setup this problem was not there on Sun application
server 8.2.  Problem started happening after we moved to GlassFish.

I will ask the question to GlassFish users as well but before that I
wanted to know if there is any OTHER way in struts to use properties
file?  I do not have access to the App server so I want to try and
resolve the issue with code fix.

Please let me know if there is another way to use properties files in struts?

Thanks


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
however, this does not gurantee the order (because of the HashMap)...

something else can be used to preserve the order

On Thu, Oct 29, 2009 at 12:31 PM, Bhaarat Sharma wrote:

> got it.
>
> it should be list="#...@java.util.hashmap@{'1':'January',
> '2':'February','3':'March'}"
>
> source:
> http://www.nabble.com/JasperException-and-javax.el.ELException-when-running-under-Jetty-td13734373.html
>
>
> <http://www.nabble.com/JasperException-and-javax.el.ELException-when-running-under-Jetty-td13734373.html>mailing
> list archives FTW
>
>
> On Thu, Oct 29, 2009 at 12:12 PM, Bhaarat Sharma wrote:
>
>> how can I keep it from interpreting it as EL expression its OGNL..
>>
>> I am using Sun App Server 9.1
>>
>> could there be a setting on the server?
>>
>>
>> On Thu, Oct 29, 2009 at 12:10 PM, Bhaarat Sharma wrote:
>>
>>> :(
>>>
>>> still it gives this error:
>>>
>>> javax.el.ELException: Error Parsing: %{#{'ALL':'All  Programs', 'BU':'all
>>> BU programs'}}
>>>
>>>
>>> On Thu, Oct 29, 2009 at 12:02 PM, James Cook wrote:
>>>
>>>> Hi,
>>>>
>>>> I checked the javadoc for select and this is what is listed.
>>>>
>>>> >>>name="months"
>>>>headerKey="-1" headerValue="Select Month"
>>>>list="#{'01':'Jan', '02':'Feb', [...]}"
>>>>value="selectedMonth"
>>>>required="true"
>>>>  />
>>>>
>>>> This is what I used last night. So #{} worked for me.
>>>>
>>>> -Original Message-
>>>> From: Dale Newfield [mailto:d...@newfield.org]
>>>> Sent: 29 October 2009 15:54
>>>> To: Struts Users Mailing List
>>>> Subject: Re: javax.el.ELException Select Tag
>>>>
>>>> Bhaarat Sharma wrote:
>>>> > so it should be:
>>>> >
>>>> > >>> >  list="%{'ALL':'All Programs', 'BU':'BY Problems',
>>>> 'TS':'TS
>>>> > Programs'}"
>>>> >  value="selectedProgram" required="true"/>
>>>>
>>>> No: list='%{#{"All":"All Programs", "BU":"BY Problems"...}}'
>>>>
>>>> -Dale
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>>
>>>>
>>>
>>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
got it.

it should be list="#...@java.util.hashmap@{'1':'January',
'2':'February','3':'March'}"

source:
http://www.nabble.com/JasperException-and-javax.el.ELException-when-running-under-Jetty-td13734373.html

<http://www.nabble.com/JasperException-and-javax.el.ELException-when-running-under-Jetty-td13734373.html>mailing
list archives FTW

On Thu, Oct 29, 2009 at 12:12 PM, Bhaarat Sharma wrote:

> how can I keep it from interpreting it as EL expression its OGNL..
>
> I am using Sun App Server 9.1
>
> could there be a setting on the server?
>
>
> On Thu, Oct 29, 2009 at 12:10 PM, Bhaarat Sharma wrote:
>
>> :(
>>
>> still it gives this error:
>>
>> javax.el.ELException: Error Parsing: %{#{'ALL':'All  Programs', 'BU':'all
>> BU programs'}}
>>
>>
>> On Thu, Oct 29, 2009 at 12:02 PM, James Cook wrote:
>>
>>> Hi,
>>>
>>> I checked the javadoc for select and this is what is listed.
>>>
>>> >>name="months"
>>>headerKey="-1" headerValue="Select Month"
>>>list="#{'01':'Jan', '02':'Feb', [...]}"
>>>value="selectedMonth"
>>>required="true"
>>>  />
>>>
>>> This is what I used last night. So #{} worked for me.
>>>
>>> -Original Message-
>>> From: Dale Newfield [mailto:d...@newfield.org]
>>> Sent: 29 October 2009 15:54
>>> To: Struts Users Mailing List
>>> Subject: Re: javax.el.ELException Select Tag
>>>
>>> Bhaarat Sharma wrote:
>>> > so it should be:
>>> >
>>> > >> >  list="%{'ALL':'All Programs', 'BU':'BY Problems',
>>> 'TS':'TS
>>> > Programs'}"
>>> >  value="selectedProgram" required="true"/>
>>>
>>> No: list='%{#{"All":"All Programs", "BU":"BY Problems"...}}'
>>>
>>> -Dale
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
how can I keep it from interpreting it as EL expression its OGNL..

I am using Sun App Server 9.1

could there be a setting on the server?

On Thu, Oct 29, 2009 at 12:10 PM, Bhaarat Sharma wrote:

> :(
>
> still it gives this error:
>
> javax.el.ELException: Error Parsing: %{#{'ALL':'All  Programs', 'BU':'all
> BU programs'}}
>
>
> On Thu, Oct 29, 2009 at 12:02 PM, James Cook wrote:
>
>> Hi,
>>
>> I checked the javadoc for select and this is what is listed.
>>
>> >name="months"
>>headerKey="-1" headerValue="Select Month"
>>list="#{'01':'Jan', '02':'Feb', [...]}"
>>value="selectedMonth"
>>required="true"
>>  />
>>
>> This is what I used last night. So #{} worked for me.
>>
>> -Original Message-
>> From: Dale Newfield [mailto:d...@newfield.org]
>> Sent: 29 October 2009 15:54
>> To: Struts Users Mailing List
>> Subject: Re: javax.el.ELException Select Tag
>>
>> Bhaarat Sharma wrote:
>> > so it should be:
>> >
>> > > >  list="%{'ALL':'All Programs', 'BU':'BY Problems',
>> 'TS':'TS
>> > Programs'}"
>> >  value="selectedProgram" required="true"/>
>>
>> No: list='%{#{"All":"All Programs", "BU":"BY Problems"...}}'
>>
>> -Dale
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
:(

still it gives this error:

javax.el.ELException: Error Parsing: %{#{'ALL':'All  Programs', 'BU':'all BU
programs'}}

On Thu, Oct 29, 2009 at 12:02 PM, James Cook  wrote:

> Hi,
>
> I checked the javadoc for select and this is what is listed.
>
> name="months"
>headerKey="-1" headerValue="Select Month"
>list="#{'01':'Jan', '02':'Feb', [...]}"
>value="selectedMonth"
>required="true"
>  />
>
> This is what I used last night. So #{} worked for me.
>
> -Original Message-
> From: Dale Newfield [mailto:d...@newfield.org]
> Sent: 29 October 2009 15:54
> To: Struts Users Mailing List
> Subject: Re: javax.el.ELException Select Tag
>
> Bhaarat Sharma wrote:
> > so it should be:
> >
> >  >  list="%{'ALL':'All Programs', 'BU':'BY Problems',
> 'TS':'TS
> > Programs'}"
> >  value="selectedProgram" required="true"/>
>
> No: list='%{#{"All":"All Programs", "BU":"BY Problems"...}}'
>
> -Dale
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
you have the same code as my original code ...right?

On Thu, Oct 29, 2009 at 11:39 AM, James Cook  wrote:

> Should a #
>
> list="#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS
> Programs'}"
> value="selectedProgram" required="true"/>
>
> I made the same oversight last night
>
> Cookie
>
> -Original Message-
> From: Bhaarat Sharma [mailto:bhaara...@gmail.com]
> Sent: 29 October 2009 15:36
> To: Struts Users Mailing List
> Subject: Re: javax.el.ELException Select Tag
>
> so it should be:
>
> list="%{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS
> Programs'}"
> value="selectedProgram" required="true"/>
>
> ?
>
> On Thu, Oct 29, 2009 at 11:34 AM, Dale Newfield 
> wrote:
>
> > If you indicated that the attribute was OGNL by wrapping it in %{},
> the
> > container wouldn't try to parse it as JSTL-EL.
> >
> > -Dale
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
so it should be:



?

On Thu, Oct 29, 2009 at 11:34 AM, Dale Newfield  wrote:

> If you indicated that the attribute was OGNL by wrapping it in %{}, the
> container wouldn't try to parse it as JSTL-EL.
>
> -Dale
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
furthermore, I have struts-tags.tld in my WEB-INF folder.

Are there any other tld's that the select tag depends on

On Thu, Oct 29, 2009 at 11:30 AM, Bhaarat Sharma wrote:

> I have the following code:
>
>  name="programType"
>  list="#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS
> Programs'}"
>  value="selectedProgram" required="true"/>
>
>
> which is giving error:
>
> org.apache.jasper.JasperException:
> /reports/threshold/reportselection_struts2.jsp(102,12) PWC6038:
> "#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS Programs'}" contains
> invalid expression(s): javax.el.ELException: Error Parsing: #{'ALL':'All
> Programs', 'BU':'BY Problems', 'TS':'TS Programs'}
>
> at
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:62)
>


javax.el.ELException Select Tag

2009-10-29 Thread Bhaarat Sharma
I have the following code:




which is giving error:

org.apache.jasper.JasperException:
/reports/threshold/reportselection_struts2.jsp(102,12) PWC6038:
"#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS Programs'}" contains
invalid expression(s): javax.el.ELException: Error Parsing: #{'ALL':'All
Programs', 'BU':'BY Problems', 'TS':'TS Programs'}

at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:62)


Re: /struts-tags not found

2009-10-27 Thread Bhaarat Sharma
If I just extract it in /WEB-INF then I dont have to go back and change all
my jsp's

If I create a map in web.xml to point to tags on app server class path then
I will have to change all my jsp's

But just curious. what will the mapping look like?


/WEB-INF/struts-tags.tld
/WEB-INF/struts-tags.tld



what should I change the above taglib-location to...so that it points to
struts2core on app server class path?

On Tue, Oct 27, 2009 at 4:18 PM, Musachy Barroso  wrote:

> There are other ways to define a tag library, from jsp spec:
>
> "The container searches for all files with a .tld extension under /WEB-INF
> or a
> subdirectory, and inside JAR files that are in /WEB-INF/lib. When examining
> a
> JAR file, only resources under /META-INF or a subdirectory are considered.
> The order in which these files are searched for is implementation-specific
> and
> should not be relied on by web applications."
>
> so you can just extract the tld file in there. or map it in web.xml:
>
> " The web.xml file can include an explicit taglib map between URIs and TLD
> resource paths described using the taglib elements of the Web
> Application Deploy-
> ment descriptor in WEB-INF/web.xml. See Section JSP.3.2, “Taglib Map” for
> more
> details."
>
> musachy
>
> On Tue, Oct 27, 2009 at 1:07 PM, Bhaarat Sharma 
> wrote:
> > hello,
> >
> > on our app we are getting error: PWC6117: File "/struts-tags" not found
> >
> > App is running on Sun App Server 9.1
> >
> > struts2-core-2.0.6.jar is in class path of the application server.
> >
> > Code in the JSP:
> >
> > <%@ taglib prefix="s" uri="/struts-tags" %>
> >
> > What can we do to fix this error?
> >
> > I assume since the struts2 core jar is on the app server and not
> physically
> > in our WEB-INF/lib we maybe need to reference the struts-tags in a
> different
> > way. but how?
> >
> > We want to avoid putting struts2 core in our application web-inf/lib
> >
> > Thanks
> > -bhaarat
> >
>
>
>
> --
> Screw John Galt, who is Martin Gainty?
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


/struts-tags not found

2009-10-27 Thread Bhaarat Sharma
hello,

on our app we are getting error: PWC6117: File "/struts-tags" not found

App is running on Sun App Server 9.1

struts2-core-2.0.6.jar is in class path of the application server.

Code in the JSP:

<%@ taglib prefix="s" uri="/struts-tags" %>

What can we do to fix this error?

I assume since the struts2 core jar is on the app server and not physically
in our WEB-INF/lib we maybe need to reference the struts-tags in a different
way. but how?

We want to avoid putting struts2 core in our application web-inf/lib

Thanks
-bhaarat


Re: Unit Testing in Struts 2.1.6

2009-10-14 Thread Bhaarat Sharma
I have not read your post in detail but have a quick question about unit
testing with struts2.
lets say I have lot of DAO classes each with multiple methods each running a
stored procedure.

using your article information and Junit plugin if I write a unit case for
each of them (methods in DAO classes) how will it behave?

I mean Will I be able to just run the application (see index page) and
during that time all the unit cases will be ran?

I want to avoid going to each jsp page, clicking some link that triggers the
call to the DAO method.

On Wed, Oct 14, 2009 at 12:53 PM, Phillips, Bruce A wrote:

>
> see:
> http://www.brucephillips.name/blog/index.cfm/2009/9/5/Unit-Testing-A-Struts-2-Action-Class--Struts-2-JUnit-Plugin
>
> Bruce
>
> -Original Message-
> From: Dan R. Olsen III [mailto:danec...@gmail.com]
> Sent: Tue 10/13/2009 5:04 PM
> To: user@struts.apache.org
> Subject: Unit Testing in Struts 2.1.6
>
> I have gone to the page found at
> http://struts.apache.org/2.1.6/docs/how-can-we-test-actions.html.
> However, the code on that page is not possible with Struts 2.1.6
> although it is found in the docs for Struts 2.1.6. How can we get this
> page updated to show how to test actions in Struts 2.1.6 so I can have a
> better idea of how I would test my actions in my own apps?
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: urgent guys

2009-10-14 Thread Bhaarat Sharma
how about you give us code from VoyagerDispatchAction.java

around like 178.

On Wed, Oct 14, 2009 at 7:31 AM, swathi reddy wrote:

>  Hi  all guys
>
> can u tell me whare exactly this error is being raised in my project
>
> I am using struts 1.3.8
> errror log is like this below :
>
>
> java.lang.NullPointerException
>
> at
>
> com.xiusbcgi.ui.struts.action.VoyagerDispatchAction.preExecute(VoyagerDispatchAction.java:178)
>
> at
>
> com.xiusbcgi.ui.struts.action.VoyagerDispatchAction.execute(VoyagerDispatchAction.java:142)
>
> at
>
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
>
> at
>
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
>
> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
>
> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at com.xius.common.XIUSFilter.doFilter(XIUSFilter.java:53)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
>
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>
> at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> at
>
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
>
> at
>
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
> at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
> at
>
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>
> at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
>
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>
> at
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>
> at java.lang.Thread.run(Thread.java:595)
>
>
> --
> Thanks& Regards
>
> Swathi
>


Re: [OT] Re: AJAX issues in struts 2.1.6

2009-09-04 Thread Bhaarat Sharma
lol so mean

On Fri, Sep 4, 2009 at 10:20 AM, Greg Lindholm wrote:

> Martin Gainty wrote:
> >
> >> is struct2 a stealth apache project?
> >>
> >
> > Yes; it's a bot-detection/mailing-list removal system.
> >
> > Dave
> >
> >
> >
> LOL . and he's outta here
>


Re: [OT] Re: example of rich internet applications (RIAs) using struts 2

2009-08-26 Thread Bhaarat Sharma
this has been a long time coming.
Martin: I also appreciate your efforts as you try to answer questions but as
dave said..most of the time they make the poster more confused.

On Wed, Aug 26, 2009 at 10:35 AM, Dave Newton  wrote:

> Martin Gainty wrote:
>
>> mg>at least your attack took more than 5 seconds of thought
>> mg>whos next?
>>
>
> Me.
>
> We're not "attacking" you at random--we just don't think you make a lot of
> sense a lot of the time and often add more confusion than value.
>
> When you obfuscate issues under what's often essentially random (to us)
> source code it's really important to let the original poster *know* that
> it's completely unrelated to the question. It's not that we don't *want* you
> to contribute, we just want the contributions to be meaningful, accurate,
> helpful, etc. I mean, come on: you've posted XW 1.x code, Spring MVC code,
> told people there's a bug because some code didn't exist (when clearly it
> *must*)... there are a *lot* of examples.
>
> We've tried the polite route: we've asked you repeatedly to clarify why
> you've posted what you did or explain its relevance to the thread. The vast
> majority of the time we get no response. That's why people started joking
> about you being a bot.
>
> I'm *imploring* you to be more careful when responding to people's
> questions. Be a force of good, not confusion.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
questionId is just a string. so dont think its equals or hash problem.
wes, what you suggested I've put that in place and testing to see if error
comes again.

On Wed, Aug 5, 2009 at 1:35 PM,  wrote:

>
>  what type is questionId? You might have a problem with the
> equals() in it.
> Chris
>
>
>
>
>
>
>
> -Original Message-
> From: Wes Wannemacher 
> To: Struts Users Mailing List 
> Sent: Wed, Aug 5, 2009 1:09 pm
> Subject: Re: struts2 ognl confusion
>
>
>
>
>
>
>
>
>
>
> I would try to fiddle around with incorrectQs to see why .contains
> isn't working... I'm guessing that if you iterate both lists, although
> not efficient, you might get better results -
>
> 
> 
>  
>Print Something
>  
> 
> 
>
>
>
> On Wed, Aug 5, 2009 at 12:22 PM, Bhaarat Sharma
> wrote:
> > looks like it is not working only in contains.I tried the following:
> >
> > 
> > ? ? ? ?
> > ? ? ? ? ? ?Print
> > Something
> > ? ? ? ?
> > ? ? ? ?
> > ? ? ? ? ? ?  
> > ? ? ? ?
> > 
> >
> > Line 6 prints fine and prints questionId...:(
> >
> > On Wed, Aug 5, 2009 at 12:09 PM, Bhaarat Sharma 
> wrote:
> >
> >> thanks for the explanation chris. but using what you suggested is not
> >> making Print Something appear even once. so the test statement is never
> >> evaluated to true. ...leading me to suspect that ognl expression is not
> >> working.
> >> I am not sure whether the random error that is happening for us is being
> >> caused by using ${}. Now that you mentioned it is a security concern to
> use
> >> that expression under s: tags I am ready to change it to #...considering
> I
> >> find the syntax to do it..
> >>
> >>
> >> On Wed, Aug 5, 2009 at 11:54 AM, Chris Pratt  >wrote:
> >>
> >>> You must be using a fairly old version of Struts 2. ?The difference
> >>> between
> >>> the ${} and the # versions is that the ${} is a JSTL EL expression that
> is
> >>> no longer allowed inside struts (s:) tags for security reasons. ?The #
> >>> version is OGNL and references the variable that Wes tried to define.
> ?Try
> >>> using the id attribute instead of the var attribute. ?So something more
> >>> like
> >>> this:
> >>>
> >>> 
> >>> ? ?
> >>> ? ? ? ?Print
> Something
> >>> ? ?
> >>> 
> >>>
> >>> I like to make it obvious which attributes use OGNL by enclosing them
> in
> >>> %{}
> >>> ? (*Chris*)
> >>>
> >>> On Wed, Aug 5, 2009 at 8:43 AM, Bhaarat Sharma 
> >>> wrote:
> >>>
> >>> > oh and attribute 'var' seems to be invalid according to the TLD
> >>> >
> >>> > On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma  >
> >>> > wrote:
> >>> >
> >>> > > ok thanks Wes. yeah that is def. more readable.
> >>> > > could you please tell me what the difference is in doing
> >>> > > ? ? 
> >>> > > VS.
> >>> > > ? ? 
> >>> > >
> >>> > > beside the question.questionId part. I am more concerned about
> >>> difference
> >>> > > in '$' vs. '#'
> >>> > >
> >>> > >
> >>> > > On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher 
> >>> > wrote:
> >>> > >
> >>> > >> I think this would be more readable -
> >>> > >>
> >>> > >> 
> >>> > >> ? ?
> >>> > >> ? ? ? ? Print
> >>> > >> Something
> >>> > >> ? ? 
> >>> > >> 
> >>> > >>
> >>> > >> -Wes
> >>> > >>
> >>> > >> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma<
> bhaara...@gmail.com>
> >>> > >> wrote:
> >>> > >> > I have the following code in a jsp
> >>> > >> > Line1: 
> >>> > >> > Line2: ? ?
> >>> > >> > Line3: ? ? ? ?Print
> >>> > >> > Something
> >>> > >> > Line4: ? ?
> >>> > >> > Line5:
> >>> > >> >
> >>> > >> > On Line1 questions is a list. ?This list contains o

Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
but my version < 2.1.6

On Wed, Aug 5, 2009 at 12:53 PM,  wrote:

> but in this document
> http://struts.apache.org/2.1.6/docs/iterator.html
> id attribute is deprecated.
>
> Louis
>
>
> 
> From: Chris Pratt 
> To: Struts Users Mailing List 
> Sent: Wednesday, August 5, 2009 4:54:31 PM
> Subject: Re: struts2 ognl confusion
>
> You must be using a fairly old version of Struts 2.  The difference between
> the ${} and the # versions is that the ${} is a JSTL EL expression that is
> no longer allowed inside struts (s:) tags for security reasons.  The #
> version is OGNL and references the variable that Wes tried to define.  Try
> using the id attribute instead of the var attribute.  So something more
> like
> this:
>
> 
>   
>Print Something
>
> 
>
> I like to make it obvious which attributes use OGNL by enclosing them in
> %{}
>  (*Chris*)
>
> On Wed, Aug 5, 2009 at 8:43 AM, Bhaarat Sharma 
> wrote:
>
> > oh and attribute 'var' seems to be invalid according to the TLD
> >
> > On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma 
> > wrote:
> >
> > > ok thanks Wes. yeah that is def. more readable.
> > > could you please tell me what the difference is in doing
> > > 
> > > VS.
> > > 
> > >
> > > beside the question.questionId part. I am more concerned about
> difference
> > > in '$' vs. '#'
> > >
> > >
> > > On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher 
> > wrote:
> > >
> > >> I think this would be more readable -
> > >>
> > >> 
> > >>
> > >> Print
> > >> Something
> > >> 
> > >> 
> > >>
> > >> -Wes
> > >>
> > >> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma
> > >> wrote:
> > >> > I have the following code in a jsp
> > >> > Line1: 
> > >> > Line2:
> > >> > Line3:Print
> > >> > Something
> > >> > Line4:
> > >> > Line5:
> > >> >
> > >> > On Line1 questions is a list.  This list contains object of class
> > Exam.
> > >> > Class Exam has a getter/setter questionId
> > >> > On Line2 incorrectQs is a list.  This list contains strings.
> > >> >
> > >> > I am checking to see if list in Line2 contains a questionId that is
> in
> > >> > questions list on line1.
> > >> >
> > >> > Is this the best way to do this?
> > >> >
> > >> > the code seems to be working but 'randomly' sometimes Line2 never
> > seems
> > >> to
> > >> > be true ...when we know it IS true.
> > >> >
> > >> > I just want to make sure with some experienced people whether this
> is
> > >> the
> > >> > way to achieve this?
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Wes Wannemacher
> > >>
> > >> Head Engineer, WanTii, Inc.
> > >> Need Training? Struts, Spring, Maven, Tomcat...
> > >> Ask me for a quote!
> > >>
> > >> -
> > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > >> For additional commands, e-mail: user-h...@struts.apache.org
> > >>
> > >>
> > >
> >
>


Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
looks like it is not working only in contains.I tried the following:



Print
Something


  



Line 6 prints fine and prints questionId...:(

On Wed, Aug 5, 2009 at 12:09 PM, Bhaarat Sharma  wrote:

> thanks for the explanation chris. but using what you suggested is not
> making Print Something appear even once. so the test statement is never
> evaluated to true. ...leading me to suspect that ognl expression is not
> working.
> I am not sure whether the random error that is happening for us is being
> caused by using ${}. Now that you mentioned it is a security concern to use
> that expression under s: tags I am ready to change it to #...considering I
> find the syntax to do it..
>
>
> On Wed, Aug 5, 2009 at 11:54 AM, Chris Pratt wrote:
>
>> You must be using a fairly old version of Struts 2.  The difference
>> between
>> the ${} and the # versions is that the ${} is a JSTL EL expression that is
>> no longer allowed inside struts (s:) tags for security reasons.  The #
>> version is OGNL and references the variable that Wes tried to define.  Try
>> using the id attribute instead of the var attribute.  So something more
>> like
>> this:
>>
>> 
>>
>>Print Something
>>
>> 
>>
>> I like to make it obvious which attributes use OGNL by enclosing them in
>> %{}
>>   (*Chris*)
>>
>> On Wed, Aug 5, 2009 at 8:43 AM, Bhaarat Sharma 
>> wrote:
>>
>> > oh and attribute 'var' seems to be invalid according to the TLD
>> >
>> > On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma 
>> > wrote:
>> >
>> > > ok thanks Wes. yeah that is def. more readable.
>> > > could you please tell me what the difference is in doing
>> > > 
>> > > VS.
>> > > 
>> > >
>> > > beside the question.questionId part. I am more concerned about
>> difference
>> > > in '$' vs. '#'
>> > >
>> > >
>> > > On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher 
>> > wrote:
>> > >
>> > >> I think this would be more readable -
>> > >>
>> > >> 
>> > >>
>> > >> Print
>> > >> Something
>> > >> 
>> > >> 
>> > >>
>> > >> -Wes
>> > >>
>> > >> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma
>> > >> wrote:
>> > >> > I have the following code in a jsp
>> > >> > Line1: 
>> > >> > Line2:
>> > >> > Line3:Print
>> > >> > Something
>> > >> > Line4:
>> > >> > Line5:
>> > >> >
>> > >> > On Line1 questions is a list.  This list contains object of class
>> > Exam.
>> > >> > Class Exam has a getter/setter questionId
>> > >> > On Line2 incorrectQs is a list.  This list contains strings.
>> > >> >
>> > >> > I am checking to see if list in Line2 contains a questionId that is
>> in
>> > >> > questions list on line1.
>> > >> >
>> > >> > Is this the best way to do this?
>> > >> >
>> > >> > the code seems to be working but 'randomly' sometimes Line2 never
>> > seems
>> > >> to
>> > >> > be true ...when we know it IS true.
>> > >> >
>> > >> > I just want to make sure with some experienced people whether this
>> is
>> > >> the
>> > >> > way to achieve this?
>> > >> >
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> Wes Wannemacher
>> > >>
>> > >> Head Engineer, WanTii, Inc.
>> > >> Need Training? Struts, Spring, Maven, Tomcat...
>> > >> Ask me for a quote!
>> > >>
>> > >> -
>> > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > >> For additional commands, e-mail: user-h...@struts.apache.org
>> > >>
>> > >>
>> > >
>> >
>>
>
>


Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
thanks for the explanation chris. but using what you suggested is not making
Print Something appear even once. so the test statement is never evaluated
to true. ...leading me to suspect that ognl expression is not working.
I am not sure whether the random error that is happening for us is being
caused by using ${}. Now that you mentioned it is a security concern to use
that expression under s: tags I am ready to change it to #...considering I
find the syntax to do it..

On Wed, Aug 5, 2009 at 11:54 AM, Chris Pratt wrote:

> You must be using a fairly old version of Struts 2.  The difference between
> the ${} and the # versions is that the ${} is a JSTL EL expression that is
> no longer allowed inside struts (s:) tags for security reasons.  The #
> version is OGNL and references the variable that Wes tried to define.  Try
> using the id attribute instead of the var attribute.  So something more
> like
> this:
>
> 
>
>Print Something
>
> 
>
> I like to make it obvious which attributes use OGNL by enclosing them in
> %{}
>   (*Chris*)
>
> On Wed, Aug 5, 2009 at 8:43 AM, Bhaarat Sharma 
> wrote:
>
> > oh and attribute 'var' seems to be invalid according to the TLD
> >
> > On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma 
> > wrote:
> >
> > > ok thanks Wes. yeah that is def. more readable.
> > > could you please tell me what the difference is in doing
> > > 
> > > VS.
> > > 
> > >
> > > beside the question.questionId part. I am more concerned about
> difference
> > > in '$' vs. '#'
> > >
> > >
> > > On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher 
> > wrote:
> > >
> > >> I think this would be more readable -
> > >>
> > >> 
> > >>
> > >> Print
> > >> Something
> > >> 
> > >> 
> > >>
> > >> -Wes
> > >>
> > >> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma
> > >> wrote:
> > >> > I have the following code in a jsp
> > >> > Line1: 
> > >> > Line2:
> > >> > Line3:Print
> > >> > Something
> > >> > Line4:
> > >> > Line5:
> > >> >
> > >> > On Line1 questions is a list.  This list contains object of class
> > Exam.
> > >> > Class Exam has a getter/setter questionId
> > >> > On Line2 incorrectQs is a list.  This list contains strings.
> > >> >
> > >> > I am checking to see if list in Line2 contains a questionId that is
> in
> > >> > questions list on line1.
> > >> >
> > >> > Is this the best way to do this?
> > >> >
> > >> > the code seems to be working but 'randomly' sometimes Line2 never
> > seems
> > >> to
> > >> > be true ...when we know it IS true.
> > >> >
> > >> > I just want to make sure with some experienced people whether this
> is
> > >> the
> > >> > way to achieve this?
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Wes Wannemacher
> > >>
> > >> Head Engineer, WanTii, Inc.
> > >> Need Training? Struts, Spring, Maven, Tomcat...
> > >> Ask me for a quote!
> > >>
> > >> -
> > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > >> For additional commands, e-mail: user-h...@struts.apache.org
> > >>
> > >>
> > >
> >
>


Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
oh and attribute 'var' seems to be invalid according to the TLD

On Wed, Aug 5, 2009 at 11:42 AM, Bhaarat Sharma  wrote:

> ok thanks Wes. yeah that is def. more readable.
> could you please tell me what the difference is in doing
> 
> VS.
> 
>
> beside the question.questionId part. I am more concerned about difference
> in '$' vs. '#'
>
>
> On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher  wrote:
>
>> I think this would be more readable -
>>
>> 
>>
>>     Print
>> Something
>> 
>> 
>>
>> -Wes
>>
>> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma
>> wrote:
>> > I have the following code in a jsp
>> > Line1: 
>> > Line2:
>> > Line3:Print
>> > Something
>> > Line4:
>> > Line5:
>> >
>> > On Line1 questions is a list.  This list contains object of class Exam.
>> > Class Exam has a getter/setter questionId
>> > On Line2 incorrectQs is a list.  This list contains strings.
>> >
>> > I am checking to see if list in Line2 contains a questionId that is in
>> > questions list on line1.
>> >
>> > Is this the best way to do this?
>> >
>> > the code seems to be working but 'randomly' sometimes Line2 never seems
>> to
>> > be true ...when we know it IS true.
>> >
>> > I just want to make sure with some experienced people whether this is
>> the
>> > way to achieve this?
>> >
>>
>>
>>
>> --
>> Wes Wannemacher
>>
>> Head Engineer, WanTii, Inc.
>> Need Training? Struts, Spring, Maven, Tomcat...
>> Ask me for a quote!
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
ok thanks Wes. yeah that is def. more readable.
could you please tell me what the difference is in doing

VS.


beside the question.questionId part. I am more concerned about difference in
'$' vs. '#'

On Wed, Aug 5, 2009 at 11:39 AM, Wes Wannemacher  wrote:

> I think this would be more readable -
>
> 
>
> Print Something
> 
> 
>
> -Wes
>
> On Wed, Aug 5, 2009 at 11:35 AM, Bhaarat Sharma
> wrote:
> > I have the following code in a jsp
> > Line1: 
> > Line2:
> > Line3:Print
> > Something
> > Line4:
> > Line5:
> >
> > On Line1 questions is a list.  This list contains object of class Exam.
> > Class Exam has a getter/setter questionId
> > On Line2 incorrectQs is a list.  This list contains strings.
> >
> > I am checking to see if list in Line2 contains a questionId that is in
> > questions list on line1.
> >
> > Is this the best way to do this?
> >
> > the code seems to be working but 'randomly' sometimes Line2 never seems
> to
> > be true ...when we know it IS true.
> >
> > I just want to make sure with some experienced people whether this is the
> > way to achieve this?
> >
>
>
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


struts2 ognl confusion

2009-08-05 Thread Bhaarat Sharma
I have the following code in a jsp
Line1: 
Line2:
Line3:Print
Something
Line4:
Line5:

On Line1 questions is a list.  This list contains object of class Exam.
Class Exam has a getter/setter questionId
On Line2 incorrectQs is a list.  This list contains strings.

I am checking to see if list in Line2 contains a questionId that is in
questions list on line1.

Is this the best way to do this?

the code seems to be working but 'randomly' sometimes Line2 never seems to
be true ...when we know it IS true.

I just want to make sure with some experienced people whether this is the
way to achieve this?


Re: equivalent of request.getParameter();

2009-08-04 Thread Bhaarat Sharma
thanks wes. so when that url will be clicked the setter will be set.
...maybe pushing the envelope but is it possible to not click any url but
still set a setter. just like we call a getter.




On Tue, Aug 4, 2009 at 2:22 PM, Bhaarat Sharma  wrote:

> wow ..just explaining the problem i figured out I can just avoid doing what
> i was thinking and just check for request.getParamter() inside the action
> class.
> anyways...still curious if there is a way to set a setter w/out doing form
> submission..
>
>
> On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma wrote:
>
>> I know its not the best case scenario.  If i can do this then I will not
>> have to change major piece of the code.
>> I'll try to explain the scenario: basically one jsp page is used to show
>> results. this jsp page has pagination so each time 50 results are shown. But
>> the page has a printer friendly version.  when printer friendly link is
>> clicked this same jsp page is loaded again but this time around we want to
>> print everything not just 50 records. so in my action class there is a
>> method which returns sublist. but in this case i want it to return the whole
>> list.
>>
>> So in the jsp i know when printerfriendly is taking place because it is
>> being passed a parameter called ?print=true
>>
>> so i thought that in jsp i could check if print=true then set action class
>> Printer method to true. kind of confusing i bet it sounds..
>>
>>
>> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher  wrote:
>>
>>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma
>>> wrote:
>>> > Thanks.
>>> > I have another question, which might be a little off topic.
>>> >
>>> > if I have a method like this in my Action class
>>> >
>>> >public void setPrinter(String print)
>>> >{
>>> >this.printer = print;
>>> >}
>>> >
>>> > how can I call this setter with some value from my jsp page using
>>> struts2?
>>> >
>>> > I know this can be set if I submit a form with hidden value and stuff
>>> but I
>>> > dont want to submit a form. I just want to set the value from the jsp
>>> page.
>>> > ..
>>> >
>>>
>>> At which point will that value be used? If you need to know the value
>>> of the 'print' variable within the execute method of your action, then
>>> it should be part of the form submission... In fact, I am having
>>> trouble thinking of a scenario where you would want to call that sort
>>> of method from a JSP that doesn't involve form submission (except
>>> javascript, but still, just calling a setter alone doesn't really have
>>> any effect unless you are calling another action method afterwards
>>> that has an interest in that variable's value).
>>>
>>> -Wes
>>>
>>> --
>>> Wes Wannemacher
>>>
>>> Head Engineer, WanTii, Inc.
>>> Need Training? Struts, Spring, Maven, Tomcat...
>>> Ask me for a quote!
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>


Re: equivalent of request.getParameter();

2009-08-04 Thread Bhaarat Sharma
wow ..just explaining the problem i figured out I can just avoid doing what
i was thinking and just check for request.getParamter() inside the action
class.
anyways...still curious if there is a way to set a setter w/out doing form
submission..

On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma  wrote:

> I know its not the best case scenario.  If i can do this then I will not
> have to change major piece of the code.
> I'll try to explain the scenario: basically one jsp page is used to show
> results. this jsp page has pagination so each time 50 results are shown. But
> the page has a printer friendly version.  when printer friendly link is
> clicked this same jsp page is loaded again but this time around we want to
> print everything not just 50 records. so in my action class there is a
> method which returns sublist. but in this case i want it to return the whole
> list.
>
> So in the jsp i know when printerfriendly is taking place because it is
> being passed a parameter called ?print=true
>
> so i thought that in jsp i could check if print=true then set action class
> Printer method to true. kind of confusing i bet it sounds..
>
>
> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher  wrote:
>
>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma
>> wrote:
>> > Thanks.
>> > I have another question, which might be a little off topic.
>> >
>> > if I have a method like this in my Action class
>> >
>> >public void setPrinter(String print)
>> >{
>> >this.printer = print;
>> >}
>> >
>> > how can I call this setter with some value from my jsp page using
>> struts2?
>> >
>> > I know this can be set if I submit a form with hidden value and stuff
>> but I
>> > dont want to submit a form. I just want to set the value from the jsp
>> page.
>> > ..
>> >
>>
>> At which point will that value be used? If you need to know the value
>> of the 'print' variable within the execute method of your action, then
>> it should be part of the form submission... In fact, I am having
>> trouble thinking of a scenario where you would want to call that sort
>> of method from a JSP that doesn't involve form submission (except
>> javascript, but still, just calling a setter alone doesn't really have
>> any effect unless you are calling another action method afterwards
>> that has an interest in that variable's value).
>>
>> -Wes
>>
>> --
>> Wes Wannemacher
>>
>> Head Engineer, WanTii, Inc.
>> Need Training? Struts, Spring, Maven, Tomcat...
>> Ask me for a quote!
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: equivalent of request.getParameter();

2009-08-04 Thread Bhaarat Sharma
I know its not the best case scenario.  If i can do this then I will not
have to change major piece of the code.
I'll try to explain the scenario: basically one jsp page is used to show
results. this jsp page has pagination so each time 50 results are shown. But
the page has a printer friendly version.  when printer friendly link is
clicked this same jsp page is loaded again but this time around we want to
print everything not just 50 records. so in my action class there is a
method which returns sublist. but in this case i want it to return the whole
list.

So in the jsp i know when printerfriendly is taking place because it is
being passed a parameter called ?print=true

so i thought that in jsp i could check if print=true then set action class
Printer method to true. kind of confusing i bet it sounds..

On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher  wrote:

> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma wrote:
> > Thanks.
> > I have another question, which might be a little off topic.
> >
> > if I have a method like this in my Action class
> >
> >public void setPrinter(String print)
> >{
> >this.printer = print;
> >}
> >
> > how can I call this setter with some value from my jsp page using
> struts2?
> >
> > I know this can be set if I submit a form with hidden value and stuff but
> I
> > dont want to submit a form. I just want to set the value from the jsp
> page.
> > ..
> >
>
> At which point will that value be used? If you need to know the value
> of the 'print' variable within the execute method of your action, then
> it should be part of the form submission... In fact, I am having
> trouble thinking of a scenario where you would want to call that sort
> of method from a JSP that doesn't involve form submission (except
> javascript, but still, just calling a setter alone doesn't really have
> any effect unless you are calling another action method afterwards
> that has an interest in that variable's value).
>
> -Wes
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: equivalent of request.getParameter();

2009-08-04 Thread Bhaarat Sharma
Thanks.
I have another question, which might be a little off topic.

if I have a method like this in my Action class

public void setPrinter(String print)
{
this.printer = print;
}

how can I call this setter with some value from my jsp page using struts2?

I know this can be set if I submit a form with hidden value and stuff but I
dont want to submit a form. I just want to set the value from the jsp page.
..

On Tue, Aug 4, 2009 at 2:00 PM, Kawczynski, David <
david_kawczyn...@merck.com> wrote:

> Implement the requestAware interface to have access to a Map containing
> request parameters as name-value pairs.
> In terms of an html tag, use OGNL to get to the request parameters.
> Especially the #request object.  EG %{#request.someParam}
>
> > -Original Message-----
> > From: Bhaarat Sharma [mailto:bhaara...@gmail.com]
> > Sent: Tuesday, August 04, 2009 1:56 PM
> > To: Struts Users Mailing List
> > Subject: equivalent of request.getParameter();
> >
> > In servlets we can do request.getParameter("someParm"); to
> > gain access to
> > parameters passed to the jsp.
> > what is the equivalent of this in struts2?
> >
> > is there an html tag for this?
> >
> 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: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


equivalent of request.getParameter();

2009-08-04 Thread Bhaarat Sharma
In servlets we can do request.getParameter("someParm"); to gain access to
parameters passed to the jsp.
what is the equivalent of this in struts2?

is there an html tag for this?


Re: common error page in struts2 application

2009-07-31 Thread Bhaarat Sharma
ahhh i was not 'thrwoing' e after catching it >_<

thansk

On Fri, Jul 31, 2009 at 6:55 AM, Bhaarat Sharma  wrote:

> but if i am catching it, it is not showing my the common error page i
> made..
>
>
> On Fri, Jul 31, 2009 at 4:29 AM,  wrote:
>
>> I think you can catch it, then do log.error(e.getMessage(),e); and then
>> throw e;
>>
>>
>>
>> 
>> From: Bhaarat Sharma 
>> To: Struts Users Mailing List 
>> Sent: Friday, July 31, 2009 5:03:34 AM
>> Subject: Re: common error page in struts2 application
>>
>> Sorry I am a little confused.  Basically I need to be able to log the
>> message by doing log.error(e.getMessage(), e);  However, if i catch the
>> error and put it in the catch block then the global error page does not
>> come
>> up (I am assuming because the exception is caught?)
>>
>> If I do not catch the exception, then the error page shows up, however, I
>> have no way to do log.error(e.getMessage(), e);
>>
>> After reading,
>> http://struts.apache.org/2.0.6/docs/exception-configuration.html I though
>> I
>> can have a chainAction so something like.
>> 
>>
>>   
>>  ErrorPage
>> /error
>>   
>>
>>
>>
>>> result="Exception"/>
>>
>>
>>/reports/SelectionPage.jsp
>>
>>
>> 
>> 
>>
>>errorpage.jsp
>>
>> 
>> So finally, if i do not catch the error, the control will go to
>> com.myErrorClass.  Will I be able to do log.error(e.getMessage(), e); in
>> that class?? I dont think it will be available as originally the error was
>> thrown in reports.ReportSelection class.
>>
>> I'd appreciate any help to guide me in right direction.
>>
>> Thanks
>>
>> On Thu, Jul 30, 2009 at 11:40 PM, Bhaarat Sharma > >wrote:
>>
>> > will the global exception not recognize the exception if I am catching
>> it??
>> > I need to catch it because I want to put it in the logs.  However, in my
>> > example, if i am catching the exception then I am seeing that the error
>> page
>> > defined with global-results is not coming up.
>> > do the global exception mappings only work for 'non caught' exceptions?
>> >
>> >
>> > On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton > >wrote:
>> >
>> >> Bhaarat Sharma wrote:
>> >>
>> >>> Is there a way to just add [exception mapping] somewhere so that all
>> >>> 20 package mappings see it?
>> >>>
>> >>> most of the packing are using struts-default
>> >>>
>> >>
>> >> You could create your own base package and extend from that. Package
>> >> extension is also documented on the Struts 2 wiki (briefly):
>> >>
>> >> http://struts.apache.org/2.1.6/docs/package-configuration.html
>> >>
>> >>
>> >> Dave
>> >>
>> >> -
>> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> For additional commands, e-mail: user-h...@struts.apache.org
>> >>
>> >>
>> >
>>
>
>


Re: common error page in struts2 application

2009-07-31 Thread Bhaarat Sharma
but if i am catching it, it is not showing my the common error page i
made..

On Fri, Jul 31, 2009 at 4:29 AM,  wrote:

> I think you can catch it, then do log.error(e.getMessage(),e); and then
> throw e;
>
>
>
> ________
> From: Bhaarat Sharma 
> To: Struts Users Mailing List 
> Sent: Friday, July 31, 2009 5:03:34 AM
> Subject: Re: common error page in struts2 application
>
> Sorry I am a little confused.  Basically I need to be able to log the
> message by doing log.error(e.getMessage(), e);  However, if i catch the
> error and put it in the catch block then the global error page does not
> come
> up (I am assuming because the exception is caught?)
>
> If I do not catch the exception, then the error page shows up, however, I
> have no way to do log.error(e.getMessage(), e);
>
> After reading,
> http://struts.apache.org/2.0.6/docs/exception-configuration.html I though
> I
> can have a chainAction so something like.
> 
>
>   
>  ErrorPage
> /error
>   
>
>
>
> result="Exception"/>
>
>
>/reports/SelectionPage.jsp
>
>
> 
> 
>
>errorpage.jsp
>
> 
> So finally, if i do not catch the error, the control will go to
> com.myErrorClass.  Will I be able to do log.error(e.getMessage(), e); in
> that class?? I dont think it will be available as originally the error was
> thrown in reports.ReportSelection class.
>
> I'd appreciate any help to guide me in right direction.
>
> Thanks
>
> On Thu, Jul 30, 2009 at 11:40 PM, Bhaarat Sharma  >wrote:
>
> > will the global exception not recognize the exception if I am catching
> it??
> > I need to catch it because I want to put it in the logs.  However, in my
> > example, if i am catching the exception then I am seeing that the error
> page
> > defined with global-results is not coming up.
> > do the global exception mappings only work for 'non caught' exceptions?
> >
> >
> > On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton  >wrote:
> >
> >> Bhaarat Sharma wrote:
> >>
> >>> Is there a way to just add [exception mapping] somewhere so that all
> >>> 20 package mappings see it?
> >>>
> >>> most of the packing are using struts-default
> >>>
> >>
> >> You could create your own base package and extend from that. Package
> >> extension is also documented on the Struts 2 wiki (briefly):
> >>
> >> http://struts.apache.org/2.1.6/docs/package-configuration.html
> >>
> >>
> >> Dave
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>


Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
Sorry I am a little confused.  Basically I need to be able to log the
message by doing log.error(e.getMessage(), e);  However, if i catch the
error and put it in the catch block then the global error page does not come
up (I am assuming because the exception is caught?)

If I do not catch the exception, then the error page shows up, however, I
have no way to do log.error(e.getMessage(), e);

After reading,
http://struts.apache.org/2.0.6/docs/exception-configuration.html I though I
can have a chainAction so something like.


   
  ErrorPage
 /error
   






/reports/SelectionPage.jsp





errorpage.jsp


So finally, if i do not catch the error, the control will go to
com.myErrorClass.  Will I be able to do log.error(e.getMessage(), e); in
that class?? I dont think it will be available as originally the error was
thrown in reports.ReportSelection class.

I'd appreciate any help to guide me in right direction.

Thanks

On Thu, Jul 30, 2009 at 11:40 PM, Bhaarat Sharma wrote:

> will the global exception not recognize the exception if I am catching it??
> I need to catch it because I want to put it in the logs.  However, in my
> example, if i am catching the exception then I am seeing that the error page
> defined with global-results is not coming up.
> do the global exception mappings only work for 'non caught' exceptions?
>
>
> On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton wrote:
>
>> Bhaarat Sharma wrote:
>>
>>> Is there a way to just add [exception mapping] somewhere so that all
>>> 20 package mappings see it?
>>>
>>> most of the packing are using struts-default
>>>
>>
>> You could create your own base package and extend from that. Package
>> extension is also documented on the Struts 2 wiki (briefly):
>>
>> http://struts.apache.org/2.1.6/docs/package-configuration.html
>>
>>
>> Dave
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
will the global exception not recognize the exception if I am catching it??
I need to catch it because I want to put it in the logs.  However, in my
example, if i am catching the exception then I am seeing that the error page
defined with global-results is not coming up.
do the global exception mappings only work for 'non caught' exceptions?

On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> Is there a way to just add [exception mapping] somewhere so that all
>> 20 package mappings see it?
>>
>> most of the packing are using struts-default
>>
>
> You could create your own base package and extend from that. Package
> extension is also documented on the Struts 2 wiki (briefly):
>
> http://struts.apache.org/2.1.6/docs/package-configuration.html
>
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
one last question:
lets say my mapping comes out to be this


/chapterFour/Error.jsp






so will i add that in each package in my struts.xml.  I have over 20 right
now.

Is there a way to just add it somewhere so that all 20 package mappings see
it?

most of the packing are using struts-default

On Thu, Jul 30, 2009 at 3:26 PM, Bhaarat Sharma  wrote:

> thanks
>
>
> On Thu, Jul 30, 2009 at 3:21 PM, Dave Newton wrote:
>
>> Bhaarat Sharma wrote:
>>
>>> how do we map exceptions to a global result?
>>>
>>
>> You may not know about the Struts 2 documentation wiki that has a page
>> covering exception configuration:
>>
>> http://struts.apache.org/2.1.6/docs/exception-configuration.html
>>
>>
>> Dave
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
thanks

On Thu, Jul 30, 2009 at 3:21 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> how do we map exceptions to a global result?
>>
>
> You may not know about the Struts 2 documentation wiki that has a page
> covering exception configuration:
>
> http://struts.apache.org/2.1.6/docs/exception-configuration.html
>
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
how do we map exceptions to a global result?

On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> What is the way to provide a common error page in a struts2 application?
>> and
>> automatically redirect to the error page when errors occur?
>>
>
> Map exceptions to a global result.
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
Hi,
What is the way to provide a common error page in a struts2 application? and
automatically redirect to the error page when errors occur?

Thanks


getting listValue back to actionclass from s:select tag

2009-07-27 Thread Bhaarat Sharma
I have a s:select tag which is working fine.


html code made out of that is:

Reason1*
Reason2
Reason3*


when user selects stuff from this select box and submits what is sent back
is listKey.  Is there any way to get the listValue (content) back to the
action class?

I want to do this because as you can see some reasons have * behind them and
I want to have some logic for when users select reasons with *.  I can not
just go by value because it is dynamic.

Is there a way to get around this hurdle?


using 'method' in action mapping

2009-07-24 Thread Bhaarat Sharma
If I have a mapping like the following

/reports/moneyowed/selectionpage.jsp


the passBy method is doing nothing but returning SUCCESS

When the above action mapping is ran and the jsp page consists something
like  will the value show??

will providing attribute method in the actionmapping cause it to not have
access to public methods in the actionclass?


Re: s2 currency and internationalization

2009-07-23 Thread Bhaarat Sharma
Thanks!! this helps!

On Wed, Jul 22, 2009 at 10:08 PM, kaphilmore wrote:

> FIXED. If you're trying to sell a product in US dollars and you're selling
> internationally, use something similar to this in your resource file. I hope
> this helps someone, because it drove me crazy for a day!!
>
>  value="product.cost" />
> 
>
> format.money = $ {0,number,#.00}
>
>
> --- In str...@yahoogroups.com, "kaphilmore"  wrote:
> >
> > I'm using S2 for an eCommerce application (with resource files in
> different languages) and I'd like to display the currency in US only. The
> problem, when someone using the 'fr' locale comes to the site, the price is
> displayed as 89,99 instead of 89.99. Is there a way to force it to display
> as '89.99'? My setup is below.
> >
> > item.price={0,number,currency}
> >
> >  value="product.cost" />
> > 
> >
> > Thanks in advance for any help.
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@...
> > For additional commands, e-mail: user-h...@...
> >
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: preselect value for radio tag

2009-07-10 Thread Bhaarat Sharma
ah HAA
thats was my problem. the datatypes were different.

Thanks

On Fri, Jul 10, 2009 at 12:37 PM, Dale Newfield  wrote:

> Bhaarat Sharma wrote:
>
>> I have a very simple radio tag like following
>> > list=" #{'1':'1','2':'2','3':'3','4':'4'}"
>> value="questionVo.correctAnswer"/>
>>
>> questionVo.correctAnswer returns 2. So I want the second radio button to
>> be
>> preselected but it is not happening. I even tried:
>>
>> > list=" #{'1':'1','2':'2','3':'3','4':'4'}" value="%{1}"/>
>>
>> but that does not work either.
>>
>> what am I doing wrong?
>>
>
>
> http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
> Also, "%{1}" evaluates to a number, whereas "%{'1'}" evaluates to a char
> and '%{"1"}' evaluates to a string.
>
> -Dale
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


preselect value for radio tag

2009-07-10 Thread Bhaarat Sharma
I have a very simple radio tag like following


questionVo.correctAnswer returns 2. So I want the second radio button to be
preselected but it is not happening. I even tried:



but that does not work either.

what am I doing wrong?


Re: Commercial framework based on struts2.

2009-07-07 Thread Bhaarat Sharma
Struts 2 IS a framework

On Tue, Jul 7, 2009 at 12:20 PM, sharath karnati  wrote:

> Dear All,
>
>I'm looking for chimerical framework which is built on top of struts2,
> with having AJAX support tags. I know struts2 comes with DOJO but we need to
> write lot of coding which we'd like to avoid and we are planning to purchase
> chimerical product with support.
>
>Similar to Icefaces which is build on JSF technology.
>
>Can anyone please let me know. If you have price details then please
> include that also...
>
> Thanks,
> Sharath.
>
>
>
>
>


Re: how to add parameters to result type

2009-07-06 Thread Bhaarat Sharma
following the documentation on this page:
http://struts.apache.org/2.x/docs/result-configuration.html
<http://struts.apache.org/2.x/docs/result-configuration.html>I tried
something like this

/reports/identity/identitreport.jsp
${pageIndex}
${phaPageSize}
${goToTab}
${code}
${type}
${month}



but the parameters are still not getting passed to the page...


On Fri, Jul 3, 2009 at 10:53 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> I have a simple result type like the following
>>
>> 
>>/thirdpartyincome/pendingVerification.jsp
>>
>>
>> how can i add parameters to this resulttype? and have values of parameters
>> come from my action class?
>>
>> for example when result type is 'redirect-action' then we can do something
>> like this
>>
>>  
>>Information
>>${pageIndex}
>>50
>>${phaValue}
>>  
>>
>>
> According to the documentation you can:
>
> http://struts.apache.org/2.x/docs/result-configuration.html
> http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


how to add parameters to result type

2009-07-03 Thread Bhaarat Sharma
I have a simple result type like the following


/thirdpartyincome/pendingVerification.jsp


how can i add parameters to this resulttype? and have values of parameters
come from my action class?

for example when result type is 'redirect-action' then we can do something
like this

  
Information
${pageIndex}
50
${phaValue}
  


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Bhaarat Sharma
thanks for your advice.
"...optimizing out a for loop is not the best use of your time as a
developer."

I second that.  But in this case why would I write another for loop to do
something that can be done in the for loop that I already have?  Unless
there is an issue with doing this inside s:iterator tag, issues like code
readability or amount of time, I thought it would  be better to not write a
method in my action class just for this.

Furthermore, I got to learn something about ognl :)

On Wed, Jul 1, 2009 at 5:08 PM, Jim Kiley  wrote:

> I will bet one dollar that the amount of time it takes to calculate this
> value inside your Action class is less than or equal to the time it takes
> it
> to calculate the value inside the iterator in your JSP.  And it's a
> vanishingly small amount compared to network latency.  Unless you're
> writing
> code that's going to be hammered at the requests-per-second scale,
> optimizing out a for loop is not the best use of your time as a developer.
>
> When you're doing initial development, optimize in favor of readability and
> testability.  Once you're in or close to production, analyze to find
> bottlenecks.  Finding the sum of a bunch of values is not going to be your
> bottleneck.
>
> jk
>
> On Wed, Jul 1, 2009 at 5:03 PM, Bhaarat Sharma 
> wrote:
>
> > but if I do it in my action class then I am adding extra 'time'.
> > to begin with I anyways have to iterate over the list in my JSP.  Just to
> > calculate total if I iterate over the list again in java code then I am
> > doing two iterations through the list.  Just didnt seem very efficient
> for
> > my need.
> >
> > Thanks for your suggestion!! :)
> >
> >
> > On Wed, Jul 1, 2009 at 4:59 PM, Jim Kiley 
> wrote:
> >
> > > I don't know how Struts 2 tags work under the hood, but it's possible
> > that
> > > it's going out of scope because you declared it in the iterator, or
> it's
> > > silently throwing an error because it isn't initialized.  Before your
> > >  starts, do .
> > > This could be handled inside your action class with like two lines of
> > code,
> > > of course, and as a side benefit you could write meaningful unit tests
> to
> > > be
> > > sure you'd gotten it right.
> > >
> > > jk
> > >
> > > On Wed, Jul 1, 2009 at 4:55 PM, Bhaarat Sharma 
> > > wrote:
> > >
> > > > no :(
> > > > I tried the following
> > > > 
> > > >    > > "totalCount"/>
> > > >> > > value="%{calcTotalDebtAmt+totalCount}"/>
> > > > 
> > > >
> > > > and tried to print it
> > > > 
> > > >
> > > > but it shows nothing :(
> > > >
> > > > On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley 
> > > wrote:
> > > >
> > > > > Does it work if you replace the "+=" with a "+"?
> > > > > jk
> > > > >
> > > > > On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma <
> bhaara...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Does anyone know how to calculate the total value by making use
> of
> > > the
> > > > > >  tag?
> > > > > > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma <
> > bhaara...@gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > for our purpose i'd prefer doing it in the iterator tag.
> > > > > > > I tried something like this
> > > > > > >
> > > > > > >  > > > > > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > > > > > >
> > > > > > > but this does not seem to work.
> > > > > > >
> > > > > > > what can fix this?
> > > > > > >
> > > > > > >
> > > > > > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley <
> > > jhki...@summa-tech.com
> > > > > > >wrote:
> > > > > > >
> > > > > > >> You're far better off doing it inside the Action class.
> > > > > > >> That said, you can probably use s:set to get what you want.
> > > > > > >>
> > > > > > >> jk
> > > > > > >>
> > > > > > >> On M

Re: adding values to a variable inside iterator tag

2009-07-01 Thread Bhaarat Sharma
but if I do it in my action class then I am adding extra 'time'.
to begin with I anyways have to iterate over the list in my JSP.  Just to
calculate total if I iterate over the list again in java code then I am
doing two iterations through the list.  Just didnt seem very efficient for
my need.

Thanks for your suggestion!! :)


On Wed, Jul 1, 2009 at 4:59 PM, Jim Kiley  wrote:

> I don't know how Struts 2 tags work under the hood, but it's possible that
> it's going out of scope because you declared it in the iterator, or it's
> silently throwing an error because it isn't initialized.  Before your
>  starts, do .
> This could be handled inside your action class with like two lines of code,
> of course, and as a side benefit you could write meaningful unit tests to
> be
> sure you'd gotten it right.
>
> jk
>
> On Wed, Jul 1, 2009 at 4:55 PM, Bhaarat Sharma 
> wrote:
>
> > no :(
> > I tried the following
> > 
> >"totalCount"/>
> >> value="%{calcTotalDebtAmt+totalCount}"/>
> > 
> >
> > and tried to print it
> > 
> >
> > but it shows nothing :(
> >
> > On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley 
> wrote:
> >
> > > Does it work if you replace the "+=" with a "+"?
> > > jk
> > >
> > > On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma 
> > > wrote:
> > >
> > > > Does anyone know how to calculate the total value by making use of
> the
> > > >  tag?
> > > > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma  >
> > > > wrote:
> > > >
> > > > > for our purpose i'd prefer doing it in the iterator tag.
> > > > > I tried something like this
> > > > >
> > > > >  > > > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > > > >
> > > > > but this does not seem to work.
> > > > >
> > > > > what can fix this?
> > > > >
> > > > >
> > > > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley <
> jhki...@summa-tech.com
> > > > >wrote:
> > > > >
> > > > >> You're far better off doing it inside the Action class.
> > > > >> That said, you can probably use s:set to get what you want.
> > > > >>
> > > > >> jk
> > > > >>
> > > > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma <
> > bhaara...@gmail.com
> > > > >> >wrote:
> > > > >>
> > > > >> > Hi,
> > > > >> > I have a simple iterator tag like the following
> > > > >> >
> > > > >> > 
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > 
> > > > >> >
> > > > >> > is there a way to get the total of value1 at the end of this
> > > iterator
> > > > >> tag?
> > > > >> >
> > > > >> > basically in java we would do totalValue += value1; and then at
> > the
> > > > end
> > > > >> of
> > > > >> > the loop we would have total of value1.
> > > > >> >
> > > > >> > Is that possible to do with an iterator tag?
> > > > >> >
> > > > >>
> > > > >>
> > > > >>
> > > > >> --
> > > > >> Jim Kiley
> > > > >> Senior Technical Consultant | Summa
> > > > >> [p] 412.258.3346
> > > > >> http://www.summa-tech.com
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Jim Kiley
> > > Senior Technical Consultant | Summa
> > > [p] 412.258.3346
> > > http://www.summa-tech.com
> > >
> >
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Bhaarat Sharma
oh nevermind.
was experimenting and


works!

bless OGNL

On Wed, Jul 1, 2009 at 4:55 PM, Bhaarat Sharma  wrote:

> no :(
> I tried the following
> 
> "totalCount"/>
> value="%{calcTotalDebtAmt+totalCount}"/>
> 
>
> and tried to print it
> 
>
> but it shows nothing :(
>
> On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley  wrote:
>
>> Does it work if you replace the "+=" with a "+"?
>> jk
>>
>> On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma 
>> wrote:
>>
>> > Does anyone know how to calculate the total value by making use of the
>> >  tag?
>> > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma 
>> > wrote:
>> >
>> > > for our purpose i'd prefer doing it in the iterator tag.
>> > > I tried something like this
>> > >
>> > > > > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
>> > >
>> > > but this does not seem to work.
>> > >
>> > > what can fix this?
>> > >
>> > >
>> > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley > > >wrote:
>> > >
>> > >> You're far better off doing it inside the Action class.
>> > >> That said, you can probably use s:set to get what you want.
>> > >>
>> > >> jk
>> > >>
>> > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma <
>> bhaara...@gmail.com
>> > >> >wrote:
>> > >>
>> > >> > Hi,
>> > >> > I have a simple iterator tag like the following
>> > >> >
>> > >> > 
>> > >> >
>> > >> >
>> > >> >
>> > >> > 
>> > >> >
>> > >> > is there a way to get the total of value1 at the end of this
>> iterator
>> > >> tag?
>> > >> >
>> > >> > basically in java we would do totalValue += value1; and then at the
>> > end
>> > >> of
>> > >> > the loop we would have total of value1.
>> > >> >
>> > >> > Is that possible to do with an iterator tag?
>> > >> >
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> Jim Kiley
>> > >> Senior Technical Consultant | Summa
>> > >> [p] 412.258.3346
>> > >> http://www.summa-tech.com
>> > >>
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Jim Kiley
>> Senior Technical Consultant | Summa
>> [p] 412.258.3346
>> http://www.summa-tech.com
>>
>
>


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Bhaarat Sharma
no :(
I tried the following

   
   


and tried to print it


but it shows nothing :(

On Wed, Jul 1, 2009 at 4:41 PM, Jim Kiley  wrote:

> Does it work if you replace the "+=" with a "+"?
> jk
>
> On Wed, Jul 1, 2009 at 4:39 PM, Bhaarat Sharma 
> wrote:
>
> > Does anyone know how to calculate the total value by making use of the
> >  tag?
> > On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma 
> > wrote:
> >
> > > for our purpose i'd prefer doing it in the iterator tag.
> > > I tried something like this
> > >
> > >  > value="%{calcTotalDebtAmt+=totalDebtAmt}"/>
> > >
> > > but this does not seem to work.
> > >
> > > what can fix this?
> > >
> > >
> > > On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley  > >wrote:
> > >
> > >> You're far better off doing it inside the Action class.
> > >> That said, you can probably use s:set to get what you want.
> > >>
> > >> jk
> > >>
> > >> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma  > >> >wrote:
> > >>
> > >> > Hi,
> > >> > I have a simple iterator tag like the following
> > >> >
> > >> > 
> > >> >
> > >> >
> > >> >
> > >> > 
> > >> >
> > >> > is there a way to get the total of value1 at the end of this
> iterator
> > >> tag?
> > >> >
> > >> > basically in java we would do totalValue += value1; and then at the
> > end
> > >> of
> > >> > the loop we would have total of value1.
> > >> >
> > >> > Is that possible to do with an iterator tag?
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Jim Kiley
> > >> Senior Technical Consultant | Summa
> > >> [p] 412.258.3346
> > >> http://www.summa-tech.com
> > >>
> > >
> > >
> >
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>


Re: adding values to a variable inside iterator tag

2009-07-01 Thread Bhaarat Sharma
Does anyone know how to calculate the total value by making use of the
 tag?
On Mon, Jun 29, 2009 at 1:16 PM, Bhaarat Sharma  wrote:

> for our purpose i'd prefer doing it in the iterator tag.
> I tried something like this
>
> 
>
> but this does not seem to work.
>
> what can fix this?
>
>
> On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley wrote:
>
>> You're far better off doing it inside the Action class.
>> That said, you can probably use s:set to get what you want.
>>
>> jk
>>
>> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma > >wrote:
>>
>> > Hi,
>> > I have a simple iterator tag like the following
>> >
>> > 
>> >
>> >
>> >
>> > 
>> >
>> > is there a way to get the total of value1 at the end of this iterator
>> tag?
>> >
>> > basically in java we would do totalValue += value1; and then at the end
>> of
>> > the loop we would have total of value1.
>> >
>> > Is that possible to do with an iterator tag?
>> >
>>
>>
>>
>> --
>> Jim Kiley
>> Senior Technical Consultant | Summa
>> [p] 412.258.3346
>> http://www.summa-tech.com
>>
>
>


Re: adding values to a variable inside iterator tag

2009-06-29 Thread Bhaarat Sharma
for our purpose i'd prefer doing it in the iterator tag.
I tried something like this



but this does not seem to work.

what can fix this?

On Mon, Jun 29, 2009 at 12:08 PM, Jim Kiley  wrote:

> You're far better off doing it inside the Action class.
> That said, you can probably use s:set to get what you want.
>
> jk
>
> On Mon, Jun 29, 2009 at 12:03 PM, Bhaarat Sharma  >wrote:
>
> > Hi,
> > I have a simple iterator tag like the following
> >
> > 
> >
> >
> >
> > 
> >
> > is there a way to get the total of value1 at the end of this iterator
> tag?
> >
> > basically in java we would do totalValue += value1; and then at the end
> of
> > the loop we would have total of value1.
> >
> > Is that possible to do with an iterator tag?
> >
>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>


adding values to a variable inside iterator tag

2009-06-29 Thread Bhaarat Sharma
Hi,
I have a simple iterator tag like the following







is there a way to get the total of value1 at the end of this iterator tag?

basically in java we would do totalValue += value1; and then at the end of
the loop we would have total of value1.

Is that possible to do with an iterator tag?


Re: redirect action in s:submit

2009-06-22 Thread Bhaarat Sharma
my Struts version is 2.0.6
@Greg...I tried what you suggested..it works but not quite.

"redirect:MyAction.action?param1=value1¶m2=value2"

turns into the following url
MyAction.action?PageSize=50&pageIndex=3.action

problem is that it adds '.action' to the end...

On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty  wrote:

>
> attempt to decipher which version of struts the Op is using?
>
> thx,
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Mon, 22 Jun 2009 09:42:58 -0400
> > Subject: Re: redirect action in s:submit
> > From: greg.lindh...@gmail.com
> > To: user@struts.apache.org
> >
> > On Mon, Jun 22, 2009 at 1:19 AM, dusty  wrote:
> >
> > >
> > > That works?  What processes that redirect-action:PHAInformation
> parameter?
> > > Struts sees that and just redirects?  If I knew how that worked then I
> > > could
> > > figure out how to add parameters.
> > >
> > >
> > Yes it works and it's part of the DefaultActionMapper.  I don't think you
> > will be able to add parameters using the "redirect-action:" prefix. I
> > haven't try it but you should be able to use the "redirect:" prefix and
> > construct the url with parameters like this
> > "redirect:MyAction.action?param1=value1¶m2=value2".
>
> _
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
>
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
>


redirect action in s:submit

2009-06-21 Thread Bhaarat Sharma
I have a button value like this



but I want to add some parameters along with this...is that possible to do
in the code above or do I have to make additions to struts.xml for this?


Re: s:select with multiple

2009-06-21 Thread Bhaarat Sharma
My mistake.   Yeah, I knew it was against the convention so I have modified
the code to take care of this.
Thanks

On Sun, Jun 21, 2009 at 8:01 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> 
>>  Reason1*
>>  Reason2*
>>  Reason3*
>>  Reason4
>>
> > 
>
>>
>> When I submit this form I am getting the values like 1 2 3 4 back to my
>> action class just fine.   What if I want to get the content of the options
>> also? meaning what If I want to get back Reason1*, reason2* etc back to my
>> action class also?
>>
>
> *Also*?
>
> That's not really how select tags work. You'd have to build the value
> manually and pull it apart again on the server side. I can't think of any
> reasons why you'd want to do that, though--what, exactly, are you trying to
> accomplish?
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


s:select with multiple

2009-06-21 Thread Bhaarat Sharma
I have the following code for s:select tag




Reason1*
Reason2*
Reason3*
Reason4 

When I submit this form I am getting the values like 1 2 3 4 back to my
action class just fine.   What if I want to get the content of the options
also? meaning what If I want to get back Reason1*, reason2* etc back to my
action class also?


confusion about s:select with multiple true

2009-06-20 Thread Bhaarat Sharma
I have been playing around with this sample code:




This works as I want it to.  My question is, if I want values for 'list' and
'value' coming from the action class then should the method for list be
returning a hashMap? and value be returning a list? is that the only way?


Re: using multiple param in s:url tag

2009-06-20 Thread Bhaarat Sharma
nevermind..solved it.

had to used 'escape' in s:property tag.

like this: 

On Sat, Jun 20, 2009 at 7:25 PM, Bhaarat Sharma  wrote:

> according to documentation...if I try to use escapeAmp property in my s:url
> tag then I get the following error...
>
> Attribute escapeAmp invalid for tag url according to TLD
>
>
> On Sat, Jun 20, 2009 at 7:16 PM, Bhaarat Sharma wrote:
>
>> Hello,
>>
>> I am using param tag inside s:url tag like the following
>>
>> 
>>
>>
>>   
>>
>>">> name="tenant.edit"/>
>> 
>>
>> hshid is int
>> sSN is string
>>
>> However, in the final URL the two parameters are separated by &  This
>> should not be there.  Does anyone know how to avoid &?
>>
>
>


Re: using multiple param in s:url tag

2009-06-20 Thread Bhaarat Sharma
according to documentation...if I try to use escapeAmp property in my s:url
tag then I get the following error...

Attribute escapeAmp invalid for tag url according to TLD

On Sat, Jun 20, 2009 at 7:16 PM, Bhaarat Sharma  wrote:

> Hello,
>
> I am using param tag inside s:url tag like the following
>
> 
>
>
>   
>
>"> name="tenant.edit"/>
> 
>
> hshid is int
> sSN is string
>
> However, in the final URL the two parameters are separated by &  This
> should not be there.  Does anyone know how to avoid &?
>


using multiple param in s:url tag

2009-06-20 Thread Bhaarat Sharma
Hello,

I am using param tag inside s:url tag like the following


   
   
  
   
   ">


hshid is int
sSN is string

However, in the final URL the two parameters are separated by &  This
should not be there.  Does anyone know how to avoid &?


Re: checking which action on the jsp

2009-06-11 Thread Bhaarat Sharma
this should ideally be handled in your ActionClass.

set that 'something extra' in your Action class and use the  tag to
see if it is there. if its there then just display it.



/commonPage.jsp



/commonPage.jsp


import com.opensymphony.xwork2.ActionContext;
public class MyClass extends ActionSupport
{
  private String somethingExtra;

  public String execute()
  {
if
(ActionContext.getContext().getName().equalsIgnoreCase("specialAction"))
   this.somethingExtra = "I just set something extra dude!";
return SUCCESS;
   }


}

On Thu, Jun 11, 2009 at 8:25 PM, akoo  wrote:

>
> Hi,
> I have an jsp page which is used as a result by two actions.  However if
> the
> request comes from one of the actions something extra needs to be on the
> page.   Is there way I can access the action name on the jsp page.
>
> i.e
> 
> print something extra here
>
>  
>
>
> --
> View this message in context:
> http://www.nabble.com/checking-which-action-on-the-jsp-tp23991107p23991107.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Bhaarat Sharma
you just have to write the validate method

public void validate ()
{

  if (getModel().something()==null)
addFieldError("question", "Something went wrong");


}

On Thu, Jun 11, 2009 at 7:15 PM, Steven Hansen  wrote:

>
> Hi,
>
> I'm trying to test some basic validations on an action:
>
>
> public class CreateUserAction extends ActionSupport implements
> ModelDriven {
> private User user = new User();
>   private IUserDao userService = new UserDao();
> public String execute() {
>   if ( this.userService.save(this.user) ) {
>   return SUCCESS;
>   }
>   else {
>   return INPUT;
>   }
>   }
> @VisitorFieldValidator(message="", shortCircuit = false, appendPrefix =
> false)
>   public User getModel() {
>   return this.user;
>   }
> public void setModel(User user) {
>   this.user = user;
>   }
> }
>
>
> Is there anyway to manually check possible validation errors on this action
> as if it were called by the Validation interceptor?
>
> Thanks,
> Steven
>
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Bhaarat Sharma
I just implemented servletResponseAware as well.
Thanks!

On Thu, Jun 11, 2009 at 11:59 AM, Wes Wannemacher  wrote:

> On Thu, Jun 11, 2009 at 11:53 AM, Bhaarat Sharma
> wrote:
> > This might be too simple ...but how will i get the outputstream?
> > lets say I have something like this
> >
> > if (addNewQuestion () == 1)
> > {
> >String numQsAdded = " > id='message1'>"+getQuestion().substring(1,
> getQuestion().length())+"";
> >//I want to put numQsAdded into a outputstream
> >return NONE;
> >  }
> >
> >
> > my action is implementing ServletRequestAware so I have access to
> > the HttpServletRequest request
> >
>
>
> The OutputStream usually comes from the response (since you are
> responding). I think you might be able to pull the ServletResponse out
> of the ActionContext if you don't want to implement the interfaces.
>
> -Wes
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Bhaarat Sharma
This might be too simple ...but how will i get the outputstream?
lets say I have something like this

if (addNewQuestion () == 1)
{
String numQsAdded = ""+getQuestion().substring(1, getQuestion().length())+"";
//I want to put numQsAdded into a outputstream
return NONE;
 }


my action is implementing ServletRequestAware so I have access to
the HttpServletRequest request

On Thu, Jun 11, 2009 at 1:43 AM, Musachy Barroso  wrote:

> you can get a reference to the outputstream from the request and write
> to it, and then return null, or Action.NONE from your method.
>
> musachy
>
> On Thu, Jun 11, 2009 at 12:25 AM, Bhaarat Sharma
> wrote:
> > thanks for your been there done that insight.
> >
> > Struts 2 definitely is much more sane and enterprise level compared to
> > grails.  However, sometimes it is disappointing to know that in struts
> > out-of-the-box we cant even return a result type of a simple string that
> > does not go to a different page.  Say, I just want to stream out a string
> > and not go to a completly different page (this is helpfull for Ajax).  So
> I
> > end up making a whole new .jsp page that just has  > value="something"/> in it ...
> >
> > I will give grails a fair try.
> >
> > On Thu, Jun 11, 2009 at 12:10 AM, David C. Hicks 
> wrote:
> >
> >> I think Grails is a nice tool, as long as what you want to do is within
> the
> >> confines of what it is designed to give you for free.  After that,
> you'll be
> >> writing mounds of code.  The project I'm working on now was originally
> >> started on the Grails platform.  It was maybe 5 to 6 months down the
> road
> >> when we finally could not push Grails any further without essentially
> >> writing our own framework.  So, we re-wrote the entire thing using
> >> Struts/Hibernate/Spring.  We are all *MUCH* happier, now.
> >>
> >> Other frameworks of a similar nature:  Spring-MVC.  Very well done.
> >> Other languages?  too many to go into
> >>
> >> If you just want to be able to quickly throw together a very basic
> >> web-based application that does a very specific kind of data
> >> entry/edit/view, then Grails/Rails are great tools.  (I prefer Grails,
> >> personally.)  Anything more?  Struts or Spring-MVC would be my choices.
> >>
> >> Dave
> >>
> >>
> >>
> >> Bhaarat Sharma wrote:
> >>
> >>> Guys,
> >>>
> >>> I've been doing struts2 for about 2 years, although I dont know
> everything
> >>> about it but I have been able to get the stuff done.  Most of the stuff
> I
> >>> learned was from Struts2 in action book and this mailing list!
> >>>
> >>> Lately I've been intrigued by the XXX on Rails framework, be it Ruby or
> >>> Groovy.  So I am planning to sit down and teach myself Grails.
> >>>
> >>> I wanted some of your thoughts:
> >>>
> >>> What other Frameworks have you learned before/after Struts2?
> >>>
> >>> Apart from Java, What other languages have you been involved in?
> >>>
> >>> Hopefully, this isnt too Off topic :)
> >>>
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-10 Thread Bhaarat Sharma
thanks for your been there done that insight.

Struts 2 definitely is much more sane and enterprise level compared to
grails.  However, sometimes it is disappointing to know that in struts
out-of-the-box we cant even return a result type of a simple string that
does not go to a different page.  Say, I just want to stream out a string
and not go to a completly different page (this is helpfull for Ajax).  So I
end up making a whole new .jsp page that just has  in it ...

I will give grails a fair try.

On Thu, Jun 11, 2009 at 12:10 AM, David C. Hicks  wrote:

> I think Grails is a nice tool, as long as what you want to do is within the
> confines of what it is designed to give you for free.  After that, you'll be
> writing mounds of code.  The project I'm working on now was originally
> started on the Grails platform.  It was maybe 5 to 6 months down the road
> when we finally could not push Grails any further without essentially
> writing our own framework.  So, we re-wrote the entire thing using
> Struts/Hibernate/Spring.  We are all *MUCH* happier, now.
>
> Other frameworks of a similar nature:  Spring-MVC.  Very well done.
> Other languages?  too many to go into
>
> If you just want to be able to quickly throw together a very basic
> web-based application that does a very specific kind of data
> entry/edit/view, then Grails/Rails are great tools.  (I prefer Grails,
> personally.)  Anything more?  Struts or Spring-MVC would be my choices.
>
> Dave
>
>
>
> Bhaarat Sharma wrote:
>
>> Guys,
>>
>> I've been doing struts2 for about 2 years, although I dont know everything
>> about it but I have been able to get the stuff done.  Most of the stuff I
>> learned was from Struts2 in action book and this mailing list!
>>
>> Lately I've been intrigued by the XXX on Rails framework, be it Ruby or
>> Groovy.  So I am planning to sit down and teach myself Grails.
>>
>> I wanted some of your thoughts:
>>
>> What other Frameworks have you learned before/after Struts2?
>>
>> Apart from Java, What other languages have you been involved in?
>>
>> Hopefully, this isnt too Off topic :)
>>
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


[OT]Moving from Struts2 to grails, your thoughts

2009-06-10 Thread Bhaarat Sharma
Guys,

I've been doing struts2 for about 2 years, although I dont know everything
about it but I have been able to get the stuff done.  Most of the stuff I
learned was from Struts2 in action book and this mailing list!

Lately I've been intrigued by the XXX on Rails framework, be it Ruby or
Groovy.  So I am planning to sit down and teach myself Grails.

I wanted some of your thoughts:

What other Frameworks have you learned before/after Struts2?

Apart from Java, What other languages have you been involved in?

Hopefully, this isnt too Off topic :)


Re: how to return xml from struts2 action class

2009-06-10 Thread Bhaarat Sharma
I am trying to avoid plugin or another library (dont want to add another jar
file to our lib)

So I think xsl result type will do...
http://struts.apache.org/2.0.6/docs/xsl-result.html

@Martin It will just be a very simple xml like  1





On Wed, Jun 10, 2009 at 9:49 PM, Martin Gainty  wrote:

>
> do you have the Schema or DTD?
>
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > From: w...@wantii.com
> > To: user@struts.apache.org
> > Subject: Re: how to return xml from struts2 action class
> > Date: Wed, 10 Jun 2009 20:40:07 -0400
> >
> > On Wednesday 10 June 2009 08:34:41 pm Bhaarat Sharma wrote:
> > > Hello,
> > > Is there some built in functionality in struts2 that would let me
> return
> > > xml data from my action class?  If not, I will have to create the xml
> data
> > > myself (which I dont mind).  But what will the result-type be for this
> > > action in my struts.xml?
> >
> > There is a capable xsl result type built in. It's also quite easy to
> stream
> > xml using the xstream library. Whichever suites your needs.
> >
> > -Wes
> >
> > --
> >
> > Wes Wannemacher
> > Author - Struts 2 In Practice
> > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> > http://www.manning.com/wannemacher
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
>
> _
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290


how to return xml from struts2 action class

2009-06-10 Thread Bhaarat Sharma
Hello,
Is there some built in functionality in struts2 that would let me return xml
data from my action class?  If not, I will have to create the xml data
myself (which I dont mind).  But what will the result-type be for this
action in my struts.xml?


Problem with displayTag

2009-06-08 Thread Bhaarat Sharma
Hi guys,
I'm starting displaytag for the first time.

I have a simple Struts2 action that is returning a list.  The list contains
elements of Class Apple.

Following is the code I have:





   
   

This works ok, however, when I click 'next page' the page says 'Nothing
found to display.'

Does anyone know how to fix this?


Re: [friday] training for Struts 2

2009-06-05 Thread Bhaarat Sharma
I also second the online training course.
Adding to what scott said, I think you can start with screen casts as well.
 You can provide basic free screen casts for free and then charge money for
advanced topics.

You should look at Rail Casts by Ryan Bates: http://railscasts.com/

-bhaarat



On Fri, Jun 5, 2009 at 10:31 AM, Martin Gainty  wrote:

>
> good idea scott
>
> one option is to use Backboard
> http://www.blackboard.com/Teaching-Learning/Overview.aspx
> (University of Cincinatti uses this for the online courses)
> I taught a course way back 00-01 using their WebCT product
> this is an excellent and more cost-effective alternative for busy
> professionals
>
> the problem i see are folks who get busy schedules and miss a few classes
> so they're playing catchup (while those who attend all classes stay right
> on track)
>
> the other scenario is getting paid..you need a strict policy of paying
> upfront
>
> feel free to ping me offline for setting this up!
> Martin Gainty
> __
> Note de déni et de confidentialité
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Fri, 5 Jun 2009 08:11:19 -0500
> > Subject: Re: [friday] training for Struts 2
> > From: stanl...@gmail.com
> > To: user@struts.apache.org
> >
> > Hey Wes --
> >
> > Travel and paper is so 80's bro.  Have you considered an online format?
>  I
> > think a five day session where 2-3 are basics and the remaining 2-3 are
> > advanced topics would be flexible.  This way you could price the two
> > separately and allow clients one or both enrollments.  As far as course
> > materials goes, I think S2iA and your S2iP would be great resources, and
> > hey, they are already written and have labs!  The marketing piece is
> outside
> > my area of expertise.  I was a corporate trainer for several years and
> would
> > be interested in pair-teaching with you if this pans out.
> >
> > Peace,
> > Scott
> >
> >
> >
> > On Fri, Jun 5, 2009 at 7:54 AM, Wes Wannemacher  wrote:
> >
> > > Hello fellow-struts-ers,
> > >
> > > I have been toying with the notion of hosting a struts training, but
> > > I'm not convinced that it is a good business move for me. I am
> > > wondering about a few things and figured who better to ask than the
> > > community... Questions / Discussion Topics -
> > >
> > > 1.) I'm in Ohio, US, so naturally this is where I would want to host
> > > it, but I'm not sure if there would be enough interest to get people
> > > to actually fly here. I have been working out of Dayton which has a
> > > large airport and plenty of hotels (that I could probably work out a
> > > deal on a discount), is that enough or is there another area (SF, NY)
> > > where I might be better off traveling myself to host something.
> > >
> > > 2.) What topics would you guys pay to learn? I think there are a few
> > > what I would call basic struts2 trainings available I've seen... If I
> > > (as one of the committers) were to host a training, would basic be
> > > okay, or would you guys want something more advanced? If so, what sort
> > > of topics would you guys want to see?
> > >
> > > 3.) How should I advertise something like this? Obviously there are
> > > google keywords and an announce list (I think there is an announce
> > > list), but I think there are more than a few large-ish companies using
> > > Struts 2 or WebWork and I would want to reach into there and I don't
> > > think a lot of those users don't participate in the mailing lists,
> > > etc.
> > >
> > > 4.) Training format... I've been to training in classrooms where all I
> > > had was a notebook (actual paper, not laptop/notebook) and other
> > > trainings in classrooms with PCs. For a Struts training, which would
> > > people prefer?
> > >
> > > Anyhow, I'm invoking the lazy friday and hopefully no one gets too
> > > angry about my off-topic spam.
> > >
> > > -Wes
> > >
> > > --
> > > Wes Wannemacher
> > > Author - Struts 2 In Practice
> > > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> > > http://www.manning.com/wannemacher
> > >
> > > -
> > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > For additional commands, e-mail: user-h...@struts.apache.org
> > >
> > >
>
> _
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
>
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Sto

Re: struts2 locale question

2009-06-03 Thread Bhaarat Sharma
I am doing this but not working
imi.welcome = Hello {0}



On Wed, Jun 3, 2009 at 7:16 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> is there a way in struts2 to create a locale in the properties file and
>> then
>> substitue values to it?
>> For example:
>> in properties file:
>> myApp.Welcome = "Hello ?"
>>
>> then when we call this locale we can pass in some value for '?'
>>
>> 
>> 
>> 
>>
>> This would print:
>> Hello World
>> Hello John
>>
>
> You can do it using positional parameters like regular Java, or use OGNL
> expressions in the message.
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


struts2 locale question

2009-06-03 Thread Bhaarat Sharma
is there a way in struts2 to create a locale in the properties file and then
substitue values to it?
For example:
in properties file:
myApp.Welcome = "Hello ?"

then when we call this locale we can pass in some value for '?'





This would print:
Hello World
Hello John

Thanks
-bhaarat


Re: why doesnt iterator tag provide 'next'

2009-06-01 Thread Bhaarat Sharma
i see that musachy added support for this
http://svn.apache.org/viewvc?view=rev&revision=741179
Mushacy, is this ready to be used?

On Tue, Jun 2, 2009 at 2:10 AM, Bhaarat Sharma  wrote:

> currently, I am not using jstl tags at all inmy application.
> Isnt there anyway to achive this using strictly struts2 tags?
>
>
> On Tue, Jun 2, 2009 at 1:50 AM, Chris Pratt wrote:
>
>> You can use the  tag for that type of iteration.
>>   (*Chris*)
>>
>> On Mon, Jun 1, 2009 at 10:36 PM, Bhaarat Sharma 
>> wrote:
>>
>> > 
>> > 
>> >
>> >
>> > the above properties dont seem to be there for iterator tag.
>> >
>> > I am doing something like this:
>> >
>> > 
>> >
>> >   
>> >   
>> >   
>> > 
>> >
>> > But this way, In first iteration I am getting elements 0, 1 and 2 but in
>> > second iteration I Am again getting elements 1, 2 and 3 instead in first
>> > iteration I want to get elements 0, 1, 2 and in second iteration get 3,
>> 4,
>> > 5
>> > and so on
>> >
>> > begin, end, step seems like would work but I get compilation errors when
>> > using those since the TLD does not support them
>> > On Tue, Jun 2, 2009 at 1:21 AM, Bhaarat Sharma 
>> > wrote:
>> >
>> > > thanks dale.
>> > > Your solutions seems to be very good.
>> > >
>> > > Could you or someone else please explain what exactly this line means?
>> > >
>> > > 
>> > > 
>> > >
>> > > On Sun, May 31, 2009 at 10:58 AM, Dale Newfield 
>> > wrote:
>> > >
>> > >> Bhaarat Sharma wrote:
>> > >>
>> > >>> So I'll have something like this to create my iteratorList
>> > >>>
>> > >>> int sizeList = dataList.size();
>> > >>> List iterList = new ArrayList();
>> > >>>
>> > >>> for (i = 0; i <= sizeList; i=i+2)
>> > >>> {
>> > >>>   iterList.add(i);
>> > >>> }
>> > >>>
>> > >>>
>> > >>>So now I have a iterList. I can iterate over it in my struts2
>> code
>> > >>>
>> > >>> 
>> > >>>> value="((myClass)dataList.get(stat)).someClassMethod"/>
>> > >>> > > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > >> For additional commands, e-mail: user-h...@struts.apache.org
>> > >>
>> > >>
>> > >
>> >
>>
>
>


Re: why doesnt iterator tag provide 'next'

2009-06-01 Thread Bhaarat Sharma
currently, I am not using jstl tags at all inmy application.
Isnt there anyway to achive this using strictly struts2 tags?

On Tue, Jun 2, 2009 at 1:50 AM, Chris Pratt  wrote:

> You can use the  tag for that type of iteration.
>   (*Chris*)
>
> On Mon, Jun 1, 2009 at 10:36 PM, Bhaarat Sharma 
> wrote:
>
> > 
> > 
> >
> >
> > the above properties dont seem to be there for iterator tag.
> >
> > I am doing something like this:
> >
> > 
> >
> >   
> >   
> >   
> > 
> >
> > But this way, In first iteration I am getting elements 0, 1 and 2 but in
> > second iteration I Am again getting elements 1, 2 and 3 instead in first
> > iteration I want to get elements 0, 1, 2 and in second iteration get 3,
> 4,
> > 5
> > and so on
> >
> > begin, end, step seems like would work but I get compilation errors when
> > using those since the TLD does not support them
> > On Tue, Jun 2, 2009 at 1:21 AM, Bhaarat Sharma 
> > wrote:
> >
> > > thanks dale.
> > > Your solutions seems to be very good.
> > >
> > > Could you or someone else please explain what exactly this line means?
> > >
> > > 
> > > 
> > >
> > > On Sun, May 31, 2009 at 10:58 AM, Dale Newfield 
> > wrote:
> > >
> > >> Bhaarat Sharma wrote:
> > >>
> > >>> So I'll have something like this to create my iteratorList
> > >>>
> > >>> int sizeList = dataList.size();
> > >>> List iterList = new ArrayList();
> > >>>
> > >>> for (i = 0; i <= sizeList; i=i+2)
> > >>> {
> > >>>   iterList.add(i);
> > >>> }
> > >>>
> > >>>
> > >>>So now I have a iterList. I can iterate over it in my struts2 code
> > >>>
> > >>> 
> > >>> value="((myClass)dataList.get(stat)).someClassMethod"/>
> > >>>  > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > >> For additional commands, e-mail: user-h...@struts.apache.org
> > >>
> > >>
> > >
> >
>


Re: why doesnt iterator tag provide 'next'

2009-06-01 Thread Bhaarat Sharma




the above properties dont seem to be there for iterator tag.

I am doing something like this:



   
   
   


But this way, In first iteration I am getting elements 0, 1 and 2 but in
second iteration I Am again getting elements 1, 2 and 3 instead in first
iteration I want to get elements 0, 1, 2 and in second iteration get 3, 4, 5
and so on

begin, end, step seems like would work but I get compilation errors when
using those since the TLD does not support them
On Tue, Jun 2, 2009 at 1:21 AM, Bhaarat Sharma  wrote:

> thanks dale.
> Your solutions seems to be very good.
>
> Could you or someone else please explain what exactly this line means?
>
> 
> 
>
> On Sun, May 31, 2009 at 10:58 AM, Dale Newfield  wrote:
>
>> Bhaarat Sharma wrote:
>>
>>> So I'll have something like this to create my iteratorList
>>>
>>> int sizeList = dataList.size();
>>> List iterList = new ArrayList();
>>>
>>> for (i = 0; i <= sizeList; i=i+2)
>>> {
>>>   iterList.add(i);
>>> }
>>>
>>>
>>>So now I have a iterList. I can iterate over it in my struts2 code
>>>
>>> 
>>>
>>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: why doesnt iterator tag provide 'next'

2009-06-01 Thread Bhaarat Sharma
thanks dale.
Your solutions seems to be very good.

Could you or someone else please explain what exactly this line means?




On Sun, May 31, 2009 at 10:58 AM, Dale Newfield  wrote:

> Bhaarat Sharma wrote:
>
>> So I'll have something like this to create my iteratorList
>>
>> int sizeList = dataList.size();
>> List iterList = new ArrayList();
>>
>> for (i = 0; i <= sizeList; i=i+2)
>> {
>>   iterList.add(i);
>> }
>>
>>
>>So now I have a iterList. I can iterate over it in my struts2 code
>>
>> 
>>
>>  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: why doesnt iterator tag provide 'next'

2009-05-31 Thread Bhaarat Sharma
cool, Jim, thats a better solution!!

So I'll have something like this to create my iteratorList

int sizeList = dataList.size();
List iterList = new ArrayList();

for (i = 0; i <= sizeList; i=i+2)
{
   iterList.add(i);
}


So now I have a iterList. I can iterate over it in my struts2 code



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


Re: why doesnt iterator tag provide 'next'

2009-05-31 Thread Bhaarat Sharma
sadly in my case i need to :(

But this takes us back, the pseudocode you are suggesting is not possible
using s:iterate, I dont think we have the ability to move the cursor (or
current value in top stack) withtin the iterator tag.  Neither does jstl
provide this.  So sadly, will my code have to sit back in time and use
scriptlets.

On Sun, May 31, 2009 at 9:49 AM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> how would 'if' help with 'next'.  can you please give an example?
>>
>
> Pseudocode Java; this is something people should be able to figure out for
> themselves. In JSP I might just use the index.
>
> for (Foo curr : foos) {
>if (alt) {
>...
>} else prev = curr;
>alt = !alt;
> }
>
> OTOH, I'd probably never *need* to do this.
>
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: why doesnt iterator tag provide 'next'

2009-05-31 Thread Bhaarat Sharma
how would 'if' help with 'next'.  can you please give an example?

On Sun, May 31, 2009 at 12:58 AM, Musachy Barroso  wrote:

> duh..I sometimes read the whole email, believe me :). I have had a
> couple of scenarios where break would be nice, but I always go around
> it using "if", same thing for "next", just more often.
>
> musachy
>
> On Sat, May 30, 2009 at 8:10 PM, Bhaarat Sharma 
> wrote:
> > Musachy,
> >
> > I think you have the wrong impression.
> >
> > This is not a 'break' tag...this would work same as in iterator tag BUT
> > would also have a functionality where the user can go to the next element
> > within the iteration.
> >
> > Thanks
> >
> > On Sat, May 30, 2009 at 11:46 AM, Musachy Barroso 
> wrote:
> >
> >> I will take a look at it when I have a chance, this would be very easy
> >> to implement.
> >>
> >> musachy
> >>
> >> On Sat, May 30, 2009 at 11:45 AM, Musachy Barroso 
> >> wrote:
> >> > I would suggest you to write a new tag, as a patch to struts core
> >> > (look at the other tags, all you need is 2 classes and a couple of
> >> > annotations). What this "break" tag would need to do is find the
> >> > parent "iterator" tag, and somehow let it know that the iteration is
> >> > over.
> >> >
> >> > musachy
> >> >
> >> > On Sat, May 30, 2009 at 10:51 AM, Martin Gainty 
> >> wrote:
> >> >>
> >> >> Bharaat
> >> >>
> >> >> did you get a change to read musachy's tag developer guide
> >> >> http://struts.apache.org/2.0.14/docs/tag-developers-guide.html
> >> >>
> >> >> ?
> >> >> Martin Gainty
> >> >> __
> >> >> Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
> >> >>
> >> >> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> >> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte
> >> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
> Nachricht
> >> dient lediglich dem Austausch von Informationen und entfaltet keine
> >> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> >> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >> >> Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> pas
> >> le destinataire prévu, nous te demandons avec bonté que pour satisfaire
> >> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie
> >> de ceci est interdite. Ce message sert à l'information seulement et
> n'aura
> >> pas n'importe quel effet légalement obligatoire. Étant donné que les
> email
> >> peuvent facilement être sujets à la manipulation, nous ne pouvons
> accepter
> >> aucune responsabilité pour le contenu fourni.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>> Date: Sat, 30 May 2009 08:51:17 -0400
> >> >>> Subject: Re: why doesnt iterator tag provide 'next'
> >> >>> From: bhaara...@gmail.com
> >> >>> To: user@struts.apache.org
> >> >>>
> >> >>> I actually would like to make a custom tag out of this as I think it
> >> might
> >> >>> be helpful to others as well.  However, I cant find any good
> >> documentation
> >> >>> on how to create one.  I have 'Struts2 web 2.0 projects' book by Ian
> >> Roughly
> >> >>> and it does not show how to create your own custom tags.
> >> >>>
> >> >>> I believe If I were to create a custom tag for this I will take most
> of
> >> the
> >> >>> code from the iterator tag and just add a few bits to it?
> >> >>>
> >> >>> Can someone please just exaplain some steps that are involved in
> making
> >> a
> >> >>> custom tag?
> >> >>>
> >> >>> Thanks
> >> >>> -bhaarat
> >> >>>
> >> >>> On Sat, May 30, 2009 at 8:00 AM, Martin Gainty  >
> >> wrote:
> >> >>>
> >> >>> >
> >> >>> > Good Morning Bharaat
> >> >>> >
> >&

Re: why doesnt iterator tag provide 'next'

2009-05-30 Thread Bhaarat Sharma
I have not started on it yet.  Dave, how would you do it with OGNL? can we
write our own?

I have something like this in mind










...how would you do it?

On Sat, May 30, 2009 at 8:34 PM, Dave Newton  wrote:

> Bhaarat Sharma wrote:
>
>> This is not a 'break' tag...this would work same as in iterator tag BUT
>> would also have a functionality where the user can go to the next element
>> within the iteration.
>>
>
> IMO depending on ordering within a collection is an accident waiting to
> happen, but the functionality itself shouldn't be much more difficult.
>
> FWIW, this functionality could most likely be achieved via OGNL and a
> couple of collection operations or, less cleanly, via subset/decider.
>
> A break tag would be nice, though.
>
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: why doesnt iterator tag provide 'next'

2009-05-30 Thread Bhaarat Sharma
Musachy,

I think you have the wrong impression.

This is not a 'break' tag...this would work same as in iterator tag BUT
would also have a functionality where the user can go to the next element
within the iteration.

Thanks

On Sat, May 30, 2009 at 11:46 AM, Musachy Barroso  wrote:

> I will take a look at it when I have a chance, this would be very easy
> to implement.
>
> musachy
>
> On Sat, May 30, 2009 at 11:45 AM, Musachy Barroso 
> wrote:
> > I would suggest you to write a new tag, as a patch to struts core
> > (look at the other tags, all you need is 2 classes and a couple of
> > annotations). What this "break" tag would need to do is find the
> > parent "iterator" tag, and somehow let it know that the iteration is
> > over.
> >
> > musachy
> >
> > On Sat, May 30, 2009 at 10:51 AM, Martin Gainty 
> wrote:
> >>
> >> Bharaat
> >>
> >> did you get a change to read musachy's tag developer guide
> >> http://struts.apache.org/2.0.14/docs/tag-developers-guide.html
> >>
> >> ?
> >> Martin Gainty
> >> __
> >> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >>
> >> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
> le destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
> >>
> >>
> >>
> >>
> >>> Date: Sat, 30 May 2009 08:51:17 -0400
> >>> Subject: Re: why doesnt iterator tag provide 'next'
> >>> From: bhaara...@gmail.com
> >>> To: user@struts.apache.org
> >>>
> >>> I actually would like to make a custom tag out of this as I think it
> might
> >>> be helpful to others as well.  However, I cant find any good
> documentation
> >>> on how to create one.  I have 'Struts2 web 2.0 projects' book by Ian
> Roughly
> >>> and it does not show how to create your own custom tags.
> >>>
> >>> I believe If I were to create a custom tag for this I will take most of
> the
> >>> code from the iterator tag and just add a few bits to it?
> >>>
> >>> Can someone please just exaplain some steps that are involved in making
> a
> >>> custom tag?
> >>>
> >>> Thanks
> >>> -bhaarat
> >>>
> >>> On Sat, May 30, 2009 at 8:00 AM, Martin Gainty 
> wrote:
> >>>
> >>> >
> >>> > Good Morning Bharaat
> >>> >
> >>> > struts tags have an extensible design which can be expanded for
> future
> >>> > requirements
> >>> > can you suggest a testcase to implement this functionality?
> >>> >
> >>> > thanks,
> >>> > Martin Gainty
> >>> > __
> >>> > Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
> >>> >
> >>> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> >>> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte
> >>> > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
> Nachricht
> >>> > dient lediglich dem Austausch von Informationen und entfaltet keine
> >>> > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit
> von
> >>> > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >>> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> pas le
> >>> > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> >>> > informez l'expédite

Re: why doesnt iterator tag provide 'next'

2009-05-30 Thread Bhaarat Sharma
I actually would like to make a custom tag out of this as I think it might
be helpful to others as well.  However, I cant find any good documentation
on how to create one.  I have 'Struts2 web 2.0 projects' book by Ian Roughly
and it does not show how to create your own custom tags.

I believe If I were to create a custom tag for this I will take most of the
code from the iterator tag and just add a few bits to it?

Can someone please just exaplain some steps that are involved in making a
custom tag?

Thanks
-bhaarat

On Sat, May 30, 2009 at 8:00 AM, Martin Gainty  wrote:

>
> Good Morning Bharaat
>
> struts tags have an extensible design which can be expanded for future
> requirements
> can you suggest a testcase to implement this functionality?
>
> thanks,
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Sat, 30 May 2009 00:25:16 -0400
> > From: newton.d...@yahoo.com
> > To: user@struts.apache.org
> > Subject: Re: why doesnt iterator tag provide 'next'
> >
> > Bhaarat Sharma wrote:
> > > Iterator it = myList.iterator()
> > > while (it.hasNext()) {
> > > SomeClass ob1 = (SomeClass) it.next();
> > > SomeClass ob2 = (SomeClass) it.next();
> > > //do something
> > > }
> > >
> > > why can we not achieve the same with s:iterator tag.
> > > What was the reasoning behind not providing a 'next' or something
> similar?
> >
> > Because it's a simple iterator, just like Java's for (Type var :
> > collection) construct or JSTL's forEach tag.
> >
> > Dave
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
>
> _
> Insert movie times and more without leaving Hotmail®.
>
> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
>


  1   2   >