RE: Any issues using latest Dojo with Struts2?

2008-03-22 Thread Karr, David
After thinking about this some more, I guess the best answer is to avoid
it in the first place.  Keep complex JavaScript in ".js" files.  If the
JavaScript in your JSP is using a feature like this, it probably belongs
in a JS module.

> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 20, 2008 5:04 PM
> To: Struts Users Mailing List
> Subject: RE: Any issues using latest Dojo with Struts2?
> 
> Oh, the templates? Yeah, if you tried to use that notation on 
> a JSP page it would cause a problem. I'd imagine escaping the 
> $ would work, although I haven't tried it.
> 
> Dave
> 
> --- "Karr, David" <[EMAIL PROTECTED]> wrote:
> 
> > The following link into the "Dojo Book" has an example.  There are 
> > others throughout the book.  The "${...}" is substituted on 
> the CLIENT 
> > side.
> > 
> > http://dojotoolkit.org/node/3161
> > 
> > > -Original Message-
> > > From: Dave Newton [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, March 20, 2008 1:41 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: Any issues using latest Dojo with Struts2?
> > > 
> > > --- "Karr, David" <[EMAIL PROTECTED]> wrote:
> > > > Isn't it the case that Struts2 integrates Dojo, but a version 
> > > > older than the latest Dojo version?
> > > 
> > > Yes.
> > > 
> > > > Should I expect any difficulties if I try to use the latest
> > > Dojo in a
> > > > Struts2 application?
> > > 
> > > Not if you're not trying to combine the two versions; you can use 
> > > "naked"
> > > Dojo in an S2 app just like you would in any other framework.
> > > 
> > > > I also see that Dojo uses "${...}" references for variable
> > > substitution.
> > > > Will that cause problems if this code is in a JSP?
> > > 
> > > I'm not sure what you mean there; do you have a link to 
> what you're 
> > > referring to?
> > > 
> > > Dave
> > > 
> > > 
> > > 
> 
> > > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

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



Re: use continue in

2008-03-22 Thread Laurie Harper

Laurie Harper wrote:

Kibo wrote:

Hi conference

Can I use "continue" in struts tag  ?
--
from:

 for (Category cat : category){  
if (cat.getId() == 1)

continue;
   
System.out.println(cat.getName());
}
- 


to:

 
?
   
   


-


No, that's not supported. You'll need to filter the collection in advance.


... or invert the logic:








L.


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



Re: use continue in

2008-03-22 Thread Laurie Harper

Kibo wrote:

Hi conference

Can I use "continue" in struts tag  ?
--
from:

 for (Category cat : category){   
	

if (cat.getId() == 1)
continue;

	System.out.println(cat.getName());	
}

-
to:


?   
  
			  	 


-


No, that's not supported. You'll need to filter the collection in advance.

L.


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



Multiple Select

2008-03-22 Thread Thangalin

Hi,

I have a rather complex form with an  that uses dynamically
generated  values. The problem is that the destination array,
upon posting, returns an array with zero length. I am using a DynaActionForm
in Struts 1.2 (version cannot change).

The code ...

=File: allocate-manual-filter.jsp=
=SOURCE CODE: BEGIN=


// ... code to create "select_name" ... followed by ...



// ... code to get the PK value and populate the options array ...  followed
by ...

  <%= options[ INDEX_DISPLAY_VALUE ] %>



=SOURCE CODE: ENDED=

=File: struts-config.xml=
=SOURCE CODE: BEGIN=

  
  

=SOURCE CODE: ENDED=

=File: struts-config.xml=
=SOURCE CODE: BEGIN=


  


=SOURCE CODE: ENDED=

=File: ManualSelectAction.java=
=SOURCE CODE: BEGIN=
public boolean execute( ... ) {
DynaActionForm dynaForm = (DynaActionForm)form;
String values[] = (String[])dynaForm.get( "fiscal_year" );

if( values != null ) {
  System.out.println( "fiscal_year: " + values.length );
}
}
=SOURCE CODE: ENDED=

The log file shows the following:

fiscal_year: 0
display_fiscal_year: Fiscal Year

Everything is hooked up correctly, because display_fiscal_year is showing
the appropriate value. The former value is supposed to be an array of
strings with a size of 1 (for the one element I shuttle into it).

The ManualSelectAction class does not define a "fiscal_year" array of
Strings. This will be the next thing to try. (Although my impression was
that if I used a DynaActionForm, I wouldn't have to create a class that
contains variables ...?)

Aside from that, any other ideas?
-- 
View this message in context: 
http://www.nabble.com/Multiple-Select-tp16227737p16227737.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts 2 jsf plugin problem

2008-03-22 Thread Daniel
At first i have tried to make the portlet only with JSF. Unfortunately
Weblogic has some problems , many problems, it's the first time when i use
weblogic and it's not worthing it's money. After i failed making the portlet
with pure JSF i said to make a try with struts 2 and jsf plugin. Using this
method i have reached far than using pure JSF. I will try more to see if
there is any hope with this solution.

On Fri, Mar 21, 2008 at 5:55 PM, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]>
wrote:

> Sorry, no clue. As I said, I have no idea if this combination will
> work at all. Maybe someone with JSF experience can point out what's
> wrong. At least it looks like the portlet dispatcher has been able to
> execute the action, but it's failing with the JSF result.
>
> You might want to consider creating your portlet with either JSF or
> Struts 2 instead of combining them both.
>
> Nils-H
>
> On Fri, Mar 21, 2008 at 1:55 PM, Daniel <[EMAIL PROTECTED]> wrote:
> > I've done what you have said, unfortunately without results.  I still
> >  receive  index.jsp:16:26: No property editor found for the bean "
> >  javax.el.ValueExpression".
> >
> >  Any other ideas?
> >
> >
> >  On Thu, Mar 20, 2008 at 12:43 PM, Nils-Helge Garli Hegvik <
> [EMAIL PROTECTED]>
> >  wrote:
> >
> >
> >
> > > First of all, I'm not even sure if it's possible to use the portlet
> >  > and the jsf plugin at the same time. I have not tried, but there
> might
> >  > be issues with it if they try to do conflicting things in the
> >  > interceptors and the results.
> >  >
> >  > >  struts.xml
> >  > >
> >  > >   >  > namespace="/view">
> >  > >
> >  > > 
> >  > > 
> >  > > 
> >  > > 
> >  > > /WEB-INF/jsp/view/index.jsp
> >  > > 
> >  > > 
> >  > >
> >  >
> >  > A couple of things here. You're extending portlet-jsf-default, which
> >  > still has the jsfStack as the default interceptor ref. Since you have
> >  > defined a "jsf" package that extends "portlet-jsf-default", you
> should
> >  > probably extend the "jsf" package instead. However, it's probably
> just
> >  > as easy configuring the correct interceptor stack and default
> >  > interceptor ref right there in the "portlet-jsf-default" package. In
> >  > addition, you're overriding the default interceptor stack in your
> >  > action definition, so it's not really using the portletDefaultStack,
> >  > even if you had configured your default interceptor stack correctly.
> >  > Unless you need to use different interceptors in your action, there's
> >  > no need configuring those interceptor-refs there.
> >  >
> >  > You could also try swapping the order of the portletDefaultStack and
> >  > the jsfStack and see if that makes a difference.
> >  >
> >  > Nils-H
> >  >
> >
> >
> > > -
> >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > For additional commands, e-mail: [EMAIL PROTECTED]
> >  >
> >  >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Hey again

I'm posting via nabble, and it seems to strip out my wildcards, basically my
action looks like this now


  
 < param name= " id " > { 1 } 
/models/objectModel/update.jsp


Hopefully this is viewable. 


newton.dave wrote:
> 
> --- meeboo <[EMAIL PROTECTED]> wrote:
>> won't work with a wildcard parameter mapping Dave
>> 
>> > class="net.myapp.web.ModelObjectActions"
>> method="update">
> 
> Your first post didn't have a wildcard mapping.
> 
>> The parameter simply isn't parsed in the prepare method unless it's in
>> the
>> form of update/modelObject.action?id=22
> 
> Do you mean parsed by the parameter interceptor?
> 
>> this is what I'm currently doing
>> update/modelObject/22.action
>> 
>> The parameter is parsed in the update method, but not in the prepare
>> method
> 
> Are you using the standard action mapper? Any plugins?
> 
> The mapping you posted in your follow-up message did not come through
> properly; please make sure you're sending plain-text messages. This is
> what I
> saw:
> 
>> >  class="net.myapp.web.UserActions">
>>
>>  {1}
>>  /models/user/update.jsp
>> 
> 
> I don't really know what you're trying to do or how you're going about
> trying
> to do it.
> 
> Dave
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16227199.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread Dave Newton
--- meeboo <[EMAIL PROTECTED]> wrote:
> won't work with a wildcard parameter mapping Dave
> 
>  class="net.myapp.web.ModelObjectActions"
> method="update">

Your first post didn't have a wildcard mapping.

> The parameter simply isn't parsed in the prepare method unless it's in the
> form of update/modelObject.action?id=22

Do you mean parsed by the parameter interceptor?

> this is what I'm currently doing
> update/modelObject/22.action
> 
> The parameter is parsed in the update method, but not in the prepare method

Are you using the standard action mapper? Any plugins?

The mapping you posted in your follow-up message did not come through
properly; please make sure you're sending plain-text messages. This is what I
saw:

>class="net.myapp.web.UserActions">
> 
>  {1}
>  /models/user/update.jsp
> 

I don't really know what you're trying to do or how you're going about trying
to do it.

Dave



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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

won't work with a wildcard parameter mapping Dave



The parameter simply isn't parsed in the prepare method unless it's in the
form of update/modelObject.action?id=22

this is what I'm currently doing
update/modelObject/22.action

The parameter is parsed in the update method, but not in the prepare method
(i've tried using the 


newton.dave wrote:
> 
> --- meeboo <[EMAIL PROTECTED]> wrote:
>> I have a class for several actions and each action is mapped to a method,
>> like this:
>> 
>> >class="net.myapp.web.modelObjectActions"
>>method="update">
>> /index.jsp
>> 
>> 
>> The above action will fire when a form is submitted and the modelObject
>> properties are populated via the form fields. Now that I want is to
>> invoke
>> a
>> prepare method before the update method so that I first can read the
>> model
>> object from the database and then populate its fields. I did implement
>> preparable in modelObjectActions but then the prepare method will be
>> invoked
>> before all actions in that class, I want it to be invoked just for this
>> specific action. 
>> 
>> Any ideas?
> 
> prepareUpdate.
> 
> http://struts.apache.org/2.x/docs/prepare-interceptor.html
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16225398.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread Dave Newton
--- meeboo <[EMAIL PROTECTED]> wrote:
> I have a class for several actions and each action is mapped to a method,
> like this:
> 
> class="net.myapp.web.modelObjectActions"
>method="update">
> /index.jsp
> 
> 
> The above action will fire when a form is submitted and the modelObject
> properties are populated via the form fields. Now that I want is to invoke
> a
> prepare method before the update method so that I first can read the model
> object from the database and then populate its fields. I did implement
> preparable in modelObjectActions but then the prepare method will be
> invoked
> before all actions in that class, I want it to be invoked just for this
> specific action. 
> 
> Any ideas?

prepareUpdate.

http://struts.apache.org/2.x/docs/prepare-interceptor.html

Dave


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

It seems as if the preparable method can't parse parameters if they are in
the following format

update/modelObject/10.action (where 10.action is the primary key)

where as it works fine when using action urls like this
update/modelObject?10.action

Is this expected behavior? 


meeboo wrote:
> 
> Hi all
> 
> I have a class for several actions and each action is mapped to a method,
> like this:
> 
> class="net.myapp.web.modelObjectActions"
>method="update">
> /index.jsp
> 
> 
> The above action will fire when a form is submitted and the modelObject
> properties are populated via the form fields. Now that I want is to invoke
> a prepare method before the update method so that I first can read the
> model object from the database and then populate its fields. I did
> implement preparable in modelObjectActions but then the prepare method
> will be invoked before all actions in that class, I want it to be invoked
> just for this specific action. 
> 
> Any ideas?
> 
> Thanks
> 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16222867.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Ahh nevermind the first mail, I managed to work around it. 

I still have a problem of not being able to access parameters via my prepare
method though. Here's my action class:

public class UserActions extends StrutsSupport implements Preparable {

   public void prepare()
   {
if(id != null) //property is located in superclass StrutsSupport
user= appManager.readUser(Long.valueOf(id));
   }

}

and the struts mapping:

  
 {1}
 /models/user/update.jsp


The whole flow is that when you access the above action the user object is
read and its values populate the form in update.jsp. But the id property is
never set so the form is never populated. I even tried setting
paramsPrepareParamsStack as the default stack but with no luck. 


meeboo wrote:
> 
> Hi all
> 
> I have a class for several actions and each action is mapped to a method,
> like this:
> 
> class="net.myapp.web.modelObjectActions"
>method="update">
> /index.jsp
> 
> 
> The above action will fire when a form is submitted and the modelObject
> properties are populated via the form fields. Now that I want is to invoke
> a prepare method before the update method so that I first can read the
> model object from the database and then populate its fields. I did
> implement preparable in modelObjectActions but then the prepare method
> will be invoked before all actions in that class, I want it to be invoked
> just for this specific action. 
> 
> Any ideas?
> 
> Thanks
> 

-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16220742.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



use continue in

2008-03-22 Thread Kibo

Hi conference

Can I use "continue" in struts tag  ?
--
from:

 for (Category cat : category){   

if (cat.getId() == 1)
continue;

System.out.println(cat.getName());  
}
-
to:

  
?   

  

-
Thaks for help
Tomas Jurman 
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/use-continue-in-%3Cs%3Aiterator%3E-tp16219950p16219950.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Running a prepare method before the assigned action method

2008-03-22 Thread meeboo

Hi all

I have a class for several actions and each action is mapped to a method,
like this:


/index.jsp


The above action will fire when a form is submitted and the modelObject
properties are populated via the form fields. Now that I want is to invoke a
prepare method before the update method so that I first can read the model
object from the database and then populate its fields. I did implement
preparable in modelObjectActions but then the prepare method will be invoked
before all actions in that class, I want it to be invoked just for this
specific action. 

Any ideas?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Running-a-prepare-method-before-the-assigned-action-method-tp16219260p16219260.html
Sent from the Struts - User mailing list archive at Nabble.com.


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