Re: Struts and EJB 3

2009-04-11 Thread Stefano Tranquillini
Hi,
Have you got a list of the libraries or a blank-simply application
that contains struts2 tiles2 and ejb3 extension.

i usually use netbeans, do you put the library inside web-inf/lib and
put these libraries into the project? nothing else?

thanks.

2009/4/10 Ignacio de Córdoba icord...@skios.es:

 Hi there,
 I am using struts2 and tiles2 with JBoss 4 without any problems. I use no
 other frameworks or libraries. I got the EJB3 extension for struts2 (which
 does JNDI call internally as an interceptor) and even added a new
 functionality (it only locates EJBs in current class but coder forgot that
 there can be a parent class which also has de Annotation().
 Where are you putting those struts jars so that jboss webapps don't find
 them? I put them in WEB-INF/lib without any problems.

 Regards,
 Ignacio


 Stefano Tranquillini wrote:

 I'm not familiar with jsf and other stuff.
 first taken struts1 I'll try to use struts2 tiles2 jboss, struts2 has
 a plugin for the ejb3 (i think is an interceptor) but tiles2 and
 struts2 doesn't work with jboss (struts2 without tiles2 works, with
 tiles2 doesn't), jboss can't find the struts tags (it might be a bug,
 some one knows something about these stuff?).
 so i'm came back to the previous version 1.X (i don't remember exactly
 the number).

 so, in my case the simpler way is to use the jndi given the context
 and recall the remote object. is not so bad as solution but using
 ejb3.0 i loose something like the auto-jndi.

 well, i take a look about google guice anyway.

 thanks folks



 On Fri, Apr 10, 2009 at 17:14, Struts Two struts...@yahoo.ca wrote:

 @EJB annotation can be used only with container managed components like
 Servlet and JSF beans. Other than that either you have to use spring or
 right a customized EJB3 interceptor for struts 2 or modify request
 processing command chains for struts 1.3 to inject EJB 3 beans.

 Keep in mind you can also use Google Guice to do that as well [if you are
 not using any other spring goodies, Guice should very easy to set up]



 --- On Fri, 4/10/09, Stefano Tranquillini
 stefano.tranquill...@gmail.com wrote:

 From: Stefano Tranquillini stefano.tranquill...@gmail.com
 Subject: Re: Struts and EJB 3
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, April 10, 2009, 2:39 PM
 Yes, i'll try to use, but the ejb
 with annotation gives me a
 nullpointer exception.
 i've to call the ejb using the old style jndi call.

 On Fri, Apr 10, 2009 at 15:25, Lukasz Lenart
 lukasz.len...@googlemail.com
 wrote:
  2009/4/10 Stefano elste...@gmail.com:
  in struts1 what's the way to use EJB3.0?
 
  there's no possibility to use annotation?
  i need to use classical jndi? why?
 
  You can use annotations with Struts1, is not a problem
 with framework
  but with Java platform you're using. THe best solution
 is to use
  Spring to connect Struts1 Actions with EJB3 beans.
 
 
  Regards
  --
  Lukasz
  http://www.lenart.org.pl/
 
 
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Stefano

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




      __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.


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





 --
 Stefano

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




 --
 View this message in context: 
 http://www.nabble.com/Struts-and-EJB-3-tp22368697p22993709.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





-- 
Stefano

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



Struts upgrade notes?

2009-04-11 Thread Wendy Smoak
Is there a page on upgrading from 2.0 to 2.1, like we used to have
here http://wiki.apache.org/struts/StrutsUpgrade ?  I looked on the
new wiki and didn't find anything, nor does Google turn up anything
useful.

I tried just changing the version from 2.0.14 to 2.1.6 in the
Continuum build, and the app won't start.  It's a minor version change
so I don't expect it to be 100% backwards compatible.  What else needs
to change?

The Continuum log file looks fine, but Tomcat says
Apr 11, 2009 7:27:00 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Apr 11, 2009 7:27:00 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/continuum] startup failed due to previous errors

In Jetty I see
2009-04-11 07:42:53.314::WARN:  failed struts-cleanup
java.lang.NoClassDefFoundError:
com/opensymphony/xwork2/util/logging/LoggerFactory
at 
org.apache.struts2.dispatcher.ActionContextCleanUp.clinit(ActionContextCleanUp.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Thanks,
-- 
Wendy

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



Re: Struts upgrade notes?

2009-04-11 Thread Musachy Barroso
It seems like it is using an old version of xwork I would say.

musachy

On Sat, Apr 11, 2009 at 10:57 AM, Wendy Smoak wsm...@gmail.com wrote:
 Is there a page on upgrading from 2.0 to 2.1, like we used to have
 here http://wiki.apache.org/struts/StrutsUpgrade ?  I looked on the
 new wiki and didn't find anything, nor does Google turn up anything
 useful.

 I tried just changing the version from 2.0.14 to 2.1.6 in the
 Continuum build, and the app won't start.  It's a minor version change
 so I don't expect it to be 100% backwards compatible.  What else needs
 to change?

 The Continuum log file looks fine, but Tomcat says
 Apr 11, 2009 7:27:00 AM org.apache.catalina.core.StandardContext start
 SEVERE: Error filterStart
 Apr 11, 2009 7:27:00 AM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/continuum] startup failed due to previous errors

 In Jetty I see
 2009-04-11 07:42:53.314::WARN:  failed struts-cleanup
 java.lang.NoClassDefFoundError:
 com/opensymphony/xwork2/util/logging/LoggerFactory
        at 
 org.apache.struts2.dispatcher.ActionContextCleanUp.clinit(ActionContextCleanUp.java:74)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
 Method)

 Thanks,
 --
 Wendy

 -
 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: Struts upgrade notes?

2009-04-11 Thread Wendy Smoak
On Sat, Apr 11, 2009 at 8:12 AM, Musachy Barroso musa...@gmail.com wrote:
 It seems like it is using an old version of xwork I would say.

Looking in WEB-INF/lib, yes, it's using xwork-2.0.7.  Thanks!

I'm not sure why we have that declared separately in the pom... seems
like it should be a transitive dependency of struts-core.

-- 
Wendy

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



Re: Struts and EJB 3

2009-04-11 Thread Ignacio de Córdoba

Hi, I use JDeveloper but I just ad jars in the standard tiles and struts
distributions without any changes. Anyway, what is your exception when
trying to start the web-app? Maybe you should start there. Look at the
missing class and ensure it is in a jar inside WEB-INF/lib. Also, how do you
deploy EJBs? I use a different .ear file so to isolate layers (model -
view)


Stefano Tranquillini wrote:
 
 Hi,
 Have you got a list of the libraries or a blank-simply application
 that contains struts2 tiles2 and ejb3 extension.
 
 i usually use netbeans, do you put the library inside web-inf/lib and
 put these libraries into the project? nothing else?
 
 thanks.
 
 2009/4/10 Ignacio de Córdoba icord...@skios.es:

 Hi there,
 I am using struts2 and tiles2 with JBoss 4 without any problems. I use no
 other frameworks or libraries. I got the EJB3 extension for struts2
 (which
 does JNDI call internally as an interceptor) and even added a new
 functionality (it only locates EJBs in current class but coder forgot
 that
 there can be a parent class which also has de Annotation().
 Where are you putting those struts jars so that jboss webapps don't find
 them? I put them in WEB-INF/lib without any problems.

 Regards,
 Ignacio


 Stefano Tranquillini wrote:

 I'm not familiar with jsf and other stuff.
 first taken struts1 I'll try to use struts2 tiles2 jboss, struts2 has
 a plugin for the ejb3 (i think is an interceptor) but tiles2 and
 struts2 doesn't work with jboss (struts2 without tiles2 works, with
 tiles2 doesn't), jboss can't find the struts tags (it might be a bug,
 some one knows something about these stuff?).
 so i'm came back to the previous version 1.X (i don't remember exactly
 the number).

 so, in my case the simpler way is to use the jndi given the context
 and recall the remote object. is not so bad as solution but using
 ejb3.0 i loose something like the auto-jndi.

 well, i take a look about google guice anyway.

 thanks folks



 On Fri, Apr 10, 2009 at 17:14, Struts Two struts...@yahoo.ca wrote:

 @EJB annotation can be used only with container managed components like
 Servlet and JSF beans. Other than that either you have to use spring or
 right a customized EJB3 interceptor for struts 2 or modify request
 processing command chains for struts 1.3 to inject EJB 3 beans.

 Keep in mind you can also use Google Guice to do that as well [if you
 are
 not using any other spring goodies, Guice should very easy to set up]



 --- On Fri, 4/10/09, Stefano Tranquillini
 stefano.tranquill...@gmail.com wrote:

 From: Stefano Tranquillini stefano.tranquill...@gmail.com
 Subject: Re: Struts and EJB 3
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, April 10, 2009, 2:39 PM
 Yes, i'll try to use, but the ejb
 with annotation gives me a
 nullpointer exception.
 i've to call the ejb using the old style jndi call.

 On Fri, Apr 10, 2009 at 15:25, Lukasz Lenart
 lukasz.len...@googlemail.com
 wrote:
  2009/4/10 Stefano elste...@gmail.com:
  in struts1 what's the way to use EJB3.0?
 
  there's no possibility to use annotation?
  i need to use classical jndi? why?
 
  You can use annotations with Struts1, is not a problem
 with framework
  but with Java platform you're using. THe best solution
 is to use
  Spring to connect Struts1 Actions with EJB3 beans.
 
 
  Regards
  --
  Lukasz
  http://www.lenart.org.pl/
 
 
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Stefano

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




      __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark
 your
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.


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





 --
 Stefano

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




 --
 View this message in context:
 http://www.nabble.com/Struts-and-EJB-3-tp22368697p22993709.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


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

Re: Struts upgrade notes?

2009-04-11 Thread Musachy Barroso
 I was afraid to suggest you might have something wrong in the pom ;)

musachy

On Sat, Apr 11, 2009 at 11:23 AM, Wendy Smoak wsm...@gmail.com wrote:
 On Sat, Apr 11, 2009 at 8:12 AM, Musachy Barroso musa...@gmail.com wrote:
 It seems like it is using an old version of xwork I would say.

 Looking in WEB-INF/lib, yes, it's using xwork-2.0.7.  Thanks!

 I'm not sure why we have that declared separately in the pom... seems
 like it should be a transitive dependency of struts-core.

 --
 Wendy

 -
 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: Struts upgrade notes?

2009-04-11 Thread Wendy Smoak
On Sat, Apr 11, 2009 at 7:57 AM, Wendy Smoak wsm...@gmail.com wrote:
 Is there a page on upgrading from 2.0 to 2.1, like we used to have
 here http://wiki.apache.org/struts/StrutsUpgrade ?

In #struts I got a pointer to this page:
http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html

-- 
Wendy

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



Re: s:checkboxlist or s:checkbox

2009-04-11 Thread john lee

tks for both of u try to help me
 
s:iterator value=beds status=st 
  s:property value=bed_id/
/s:iterator
 
the above works, and print the value of bed_id
 
but, the following still not works
 
s:iterator value=beds status=st var=curBed
  s:checkbox name=%{'bed[' + (st.count-1) + ']'}  
alue=#curBed.bed_id/s:checkbox
/s:iterator
 
and running result complain the var tag
 
please advise, tks in advance
 
john

--- On Fri, 4/10/09, Dave Newton newton.d...@yahoo.com wrote:


From: Dave Newton newton.d...@yahoo.com
Subject: Re: s:checkboxlist or s:checkbox
To: Struts Users Mailing List user@struts.apache.org
Date: Friday, April 10, 2009, 6:28 PM


Wes Wannemacher wrote:
 Second, when you are using the iterator and creating single checkboxes, you 
 need to make the names unique. You are simply creating a new checkbox with 
 the name beds over and over again. 

Putting in an index only matters if order is important (and you don't trust the 
browser to submit in order); if a page has multiple variables of the same name 
their values will be put into an array or collection action property.

For a checkbox w/ a true/false value probably need either an index or to use a 
map-based property.

Dave


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




  

Re: s:checkboxlist or s:checkbox

2009-04-11 Thread john lee
tks very much, it works after change var to id. 
 
Also, have further question need to bother you similar to it
 
same bean class
 
public class Bed {
  private String bed_id;
  public String getBed_id() {return bed_id;}
  public void setBed_id(String bed_id) { this.bed_id=bed_id; }
}
 
same action class
...
private ArrayListBed beds;
    public String execute() throws Exception {
  
  beds=service.Beds();
  return SUCCESS;
    }
    public void setBeds(ArrayListBed beds){    this.beds = beds;    }
    public ArrayListBed getBeds() {    return beds;    }
 
almost same jsp file
    s:iterator value=beds status=st 
  s:property value=bed_id/
    /s:iterator
    s:select label=Bed ID name=bed_id headerKey=1 headerValue=Please 
Select Bed# list=beds/ /* the problem */
 
the output is 
  1 2 3 4
...@188d92e 
...@16a5bcb
    b...@1b08cf3
   @1f5d699    

my question is that why s:select list print object but value, is because i 
defined ArrayListBed ?
what is the correct way to fetch value out as s:iterators:property 
value=bed_id/ did
 
tks in advance again
 
 
 

--- On Sat, 4/11/09, Wes Wannemacher w...@wantii.com wrote:


From: Wes Wannemacher w...@wantii.com
Subject: Re: s:checkboxlist or s:checkbox
To: john lee sh_thorn_b...@yahoo.com
Date: Saturday, April 11, 2009, 11:53 AM


Try to use id attribute instead of var

-W

On 4/11/09, john lee sh_thorn_b...@yahoo.com wrote:

 tks for both of u try to help me

 s:iterator value=beds status=st 
   s:property value=bed_id/
 /s:iterator

 the above works, and print the value of bed_id

 but, the following still not works

 s:iterator value=beds status=st var=curBed
   s:checkbox name=%{'bed[' + (st.count-1) + ']'}
 alue=#curBed.bed_id/s:checkbox
 /s:iterator

 and running result complain the var tag

 please advise, tks in advance

 john

 --- On Fri, 4/10/09, Dave Newton newton.d...@yahoo.com wrote:


 From: Dave Newton newton.d...@yahoo.com
 Subject: Re: s:checkboxlist or s:checkbox
 To: Struts Users Mailing List user@struts.apache.org
 Date: Friday, April 10, 2009, 6:28 PM


 Wes Wannemacher wrote:
 Second, when you are using the iterator and creating single checkboxes,
 you need to make the names unique. You are simply creating a new checkbox
 with the name beds over and over again.

 Putting in an index only matters if order is important (and you don't trust
 the browser to submit in order); if a page has multiple variables of the
 same name their values will be put into an array or collection action
 property.

 For a checkbox w/ a true/false value probably need either an index or to use
 a map-based property.

 Dave


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






-- 
Sent from my mobile device

Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher



  

s:datetimepicker

2009-04-11 Thread john lee
 
is s:datetimepicker struts default tag?  if so, why it can not render the 
display?
 
does it need to load additional .jar to support it?
 
i tried the simple way
   s:datetimepicker lable=calendar value=2009-01-01  
but just display calendar only, nothing display on the right side
 
i tried the complex way, define action class
   public  class DateBean  extends ActionSupport {
  
    public String execute() throws Exception {
  setTodayDate(new Date());
  return SUCCESS;
  }
    private Date todayDate;
    public Date getTodayDate() {    return todayDate;    }
    public void setTodayDate(Date value) {    todayDate = value;   }
}

the jsp file is 
s:datetimepicker name=todayDate label=calendar displayFormat=-MM-dd/
 
but just display 'calendar', nothing display on the right side either
 
what happen? 
 
tks in advance
 
john




  

Re: Struts and EJB 3

2009-04-11 Thread Stefano Tranquillini
which jars did you put?
i've a only ear that contains both ejb and web (struts) application.
tomorrow i'll try to do something (if i've some time, is easter) and
put the exceptions.
thanks

2009/4/11 Ignacio de Córdoba icord...@skios.es:

 Hi, I use JDeveloper but I just ad jars in the standard tiles and struts
 distributions without any changes. Anyway, what is your exception when
 trying to start the web-app? Maybe you should start there. Look at the
 missing class and ensure it is in a jar inside WEB-INF/lib. Also, how do you
 deploy EJBs? I use a different .ear file so to isolate layers (model -
 view)


 Stefano Tranquillini wrote:

 Hi,
 Have you got a list of the libraries or a blank-simply application
 that contains struts2 tiles2 and ejb3 extension.

 i usually use netbeans, do you put the library inside web-inf/lib and
 put these libraries into the project? nothing else?

 thanks.

 2009/4/10 Ignacio de Córdoba icord...@skios.es:

 Hi there,
 I am using struts2 and tiles2 with JBoss 4 without any problems. I use no
 other frameworks or libraries. I got the EJB3 extension for struts2
 (which
 does JNDI call internally as an interceptor) and even added a new
 functionality (it only locates EJBs in current class but coder forgot
 that
 there can be a parent class which also has de Annotation().
 Where are you putting those struts jars so that jboss webapps don't find
 them? I put them in WEB-INF/lib without any problems.

 Regards,
 Ignacio


 Stefano Tranquillini wrote:

 I'm not familiar with jsf and other stuff.
 first taken struts1 I'll try to use struts2 tiles2 jboss, struts2 has
 a plugin for the ejb3 (i think is an interceptor) but tiles2 and
 struts2 doesn't work with jboss (struts2 without tiles2 works, with
 tiles2 doesn't), jboss can't find the struts tags (it might be a bug,
 some one knows something about these stuff?).
 so i'm came back to the previous version 1.X (i don't remember exactly
 the number).

 so, in my case the simpler way is to use the jndi given the context
 and recall the remote object. is not so bad as solution but using
 ejb3.0 i loose something like the auto-jndi.

 well, i take a look about google guice anyway.

 thanks folks



 On Fri, Apr 10, 2009 at 17:14, Struts Two struts...@yahoo.ca wrote:

 @EJB annotation can be used only with container managed components like
 Servlet and JSF beans. Other than that either you have to use spring or
 right a customized EJB3 interceptor for struts 2 or modify request
 processing command chains for struts 1.3 to inject EJB 3 beans.

 Keep in mind you can also use Google Guice to do that as well [if you
 are
 not using any other spring goodies, Guice should very easy to set up]



 --- On Fri, 4/10/09, Stefano Tranquillini
 stefano.tranquill...@gmail.com wrote:

 From: Stefano Tranquillini stefano.tranquill...@gmail.com
 Subject: Re: Struts and EJB 3
 To: Struts Users Mailing List user@struts.apache.org
 Received: Friday, April 10, 2009, 2:39 PM
 Yes, i'll try to use, but the ejb
 with annotation gives me a
 nullpointer exception.
 i've to call the ejb using the old style jndi call.

 On Fri, Apr 10, 2009 at 15:25, Lukasz Lenart
 lukasz.len...@googlemail.com
 wrote:
  2009/4/10 Stefano elste...@gmail.com:
  in struts1 what's the way to use EJB3.0?
 
  there's no possibility to use annotation?
  i need to use classical jndi? why?
 
  You can use annotations with Struts1, is not a problem
 with framework
  but with Java platform you're using. THe best solution
 is to use
  Spring to connect Struts1 Actions with EJB3 beans.
 
 
  Regards
  --
  Lukasz
  http://www.lenart.org.pl/
 
 
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Stefano

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




      __
 Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark
 your
 favourite sites. Download it now
 http://ca.toolbar.yahoo.com.


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





 --
 Stefano

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




 --
 View this message in context:
 http://www.nabble.com/Struts-and-EJB-3-tp22368697p22993709.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: 

Re: s:datetimepicker

2009-04-11 Thread Dave Newton

john lee wrote:

is s:datetimepicker struts default tag?  if so, why it can not render the 
display?


You're using  S2.1 I assume?

Are you using the s:head tag as mentioned in the s:datetimepicker 
docs [1]?


Dave

[1] http://struts.apache.org/2.0.11/docs/datetimepicker.html


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



Struts 2.1.6 conversion problem with java.util.Date

2009-04-11 Thread lewy87

Hello everybody,

i'm new here and I'm looking for help concerning my Struts2 conversion
problem.

Quick explanation:

I have LectureAction which implements ModelDrivenLecture interface and
has method to create particular lectures. in my bean Lecture I have fields
such like that: 

@Id
@GeneratedValue
private Integer id;
private String title;
private Date dateCreated; //created automatically in setter by assigning
new Date();
private Date dateAvailable; 
@Lob
private String content;
private File file;

The problem I have is related to field dateAvailable. I have
jquery.ui.datepicker on my JSP which show calendar and inserts into
s:textfield date in some format. 
Unfortunetely, Java says:

ognl.MethodFailedException: Method setDateAvailable failed for object
edu.pjwstk.struts2.models.lect...@1f920cf [java.lang.NoSuchMethodException:
edu.pjwstk.struts2.models.Lecture.setDateAvailable([Ljava.lang.String;)]

So I wrote converter which converts String to Date and created properties
file.

But even with that, my conversion fails.

I tries to place field Date dateAvailable in my Action straight forward
but it also didn't help me :(

I dunno what's wrong.

Maybe someone had this problem?
-- 
View this message in context: 
http://www.nabble.com/Struts-2.1.6-conversion-problem-with-java.util.Date-tp23004386p23004386.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: s:datetimepicker / display date content customrize

2009-04-11 Thread john lee
tks, it works after i put s:head
 
my new question:
 
is it possible to mark some of display/pop calendar cell with special color and 
clickable link?
 
In real word, any of display date could associate special event or customer 
order ...etc.
 
what is the approach could be? 
 
tks in advance
 


--- On Sat, 4/11/09, Dave Newton newton.d...@yahoo.com wrote:


From: Dave Newton newton.d...@yahoo.com
Subject: Re: s:datetimepicker
To: Struts Users Mailing List user@struts.apache.org
Date: Saturday, April 11, 2009, 1:50 PM


john lee wrote:
 is s:datetimepicker struts default tag?  if so, why it can not render the 
 display?

You're using  S2.1 I assume?

Are you using the s:head tag as mentioned in the s:datetimepicker docs [1]?

Dave

[1] http://struts.apache.org/2.0.11/docs/datetimepicker.html


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




  

Re: s:datetimepicker

2009-04-11 Thread satyanarayana katta
Which version of struts are you using?  If you using 2.1.6 and above, you
need to have the struts-dojo lib and there is a tag include with sx:
you need to use sx:datetimepicker  It is something like struts extensions.

You also need to include this..sx:head debug=true cache=false
compressed=false /


http://struts.apache.org/2.1.6/docs/datetimepicker.html

Rgds,

Satya

On Sat, Apr 11, 2009 at 11:34 AM, john lee sh_thorn_b...@yahoo.com wrote:


 is s:datetimepicker struts default tag?  if so, why it can not render the
 display?

 does it need to load additional .jar to support it?

 i tried the simple way
s:datetimepicker lable=calendar value=2009-01-01 
 but just display calendar only, nothing display on the right side

 i tried the complex way, define action class
public  class DateBean  extends ActionSupport {

 public String execute() throws Exception {
   setTodayDate(new Date());
   return SUCCESS;
   }
 private Date todayDate;
 public Date getTodayDate() {return todayDate;}
 public void setTodayDate(Date value) {todayDate = value;   }
 }

 the jsp file is
 s:datetimepicker name=todayDate label=calendar
 displayFormat=-MM-dd/

 but just display 'calendar', nothing display on the right side either

 what happen?

 tks in advance

 john







RE: s:datetimepicker

2009-04-11 Thread Martin Gainty


set the value with JS e.g.script type=text/javascript
  function setValue() {
 var picker = dojo.widget.byId(picker); 
 //string value//figure out where the value is then use 
dojo.widget.byId(DateID).setValue('new value') e.g.
 picker.setValue('2007-01-01'); //notice the tick marks for constants
 //Date value
 picker.setValue(new Date());
  }
  
  function showValue() {
 var picker = dojo.widget.byId(picker);
 //string value
 var stringValue = picker.getValue();
 alert(stringValue);
 //date value
 var dateValue = picker.getDate();
 alert(dateValue);
  }
/script

sx:datetimepicker id=picker 




Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
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, 11 Apr 2009 14:57:21 -0700
 Subject: Re: s:datetimepicker
 From: saty.pra...@gmail.com
 To: user@struts.apache.org
 
 Which version of struts are you using? If you using 2.1.6 and above, you
 need to have the struts-dojo lib and there is a tag include with sx:
 you need to use sx:datetimepicker It is something like struts extensions.
 
 You also need to include this..sx:head debug=true cache=false
 compressed=false /
 
 
 http://struts.apache.org/2.1.6/docs/datetimepicker.html
 
 Rgds,
 
 Satya
 
 On Sat, Apr 11, 2009 at 11:34 AM, john lee sh_thorn_b...@yahoo.com wrote:
 
 
  is s:datetimepicker struts default tag? if so, why it can not render the
  display?
 
  does it need to load additional .jar to support it?
 
  i tried the simple way
  s:datetimepicker lable=calendar value=2009-01-01 
  but just display calendar only, nothing display on the right side
 
  i tried the complex way, define action class
  public class DateBean extends ActionSupport {
 
  public String execute() throws Exception {
  setTodayDate(new Date());
  return SUCCESS;
  }
  private Date todayDate;
  public Date getTodayDate() { return todayDate; }
  public void setTodayDate(Date value) { todayDate = value; }
  }
 
  the jsp file is
  s:datetimepicker name=todayDate label=calendar
  displayFormat=-MM-dd/
 
  but just display 'calendar', nothing display on the right side either
 
  what happen?
 
  tks in advance
 
  john
 
 
 
 
 

_
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009

RE: s:datetimepicker

2009-04-11 Thread john lee
tks for ur reply,
 
but i expect when build calendar list in the action class, can assign the 
element of list(calendar) with clickable feature or highlight color, for 
example, the pop calendar display as following
 
 S M T W T F S
 1 2 3 4 5 6 7
  9 10   
 
but Tuesday (2) color need to be  different color, such as blue, which refer to 
special event..(map to the data from database).
 
tks in advance
 
john 
 
 
 

--- On Sat, 4/11/09, Martin Gainty mgai...@hotmail.com wrote:


From: Martin Gainty mgai...@hotmail.com
Subject: RE: s:datetimepicker
To: Struts Users Mailing List user@struts.apache.org
Date: Saturday, April 11, 2009, 5:20 PM




set the value with JS e.g.script type=text/javascript
  function setValue() {
     var picker = dojo.widget.byId(picker); 
     //string value//figure out where the value is then use 
dojo.widget.byId(DateID).setValue('new value') e.g.
     picker.setValue('2007-01-01'); //notice the tick marks for constants
     //Date value
     picker.setValue(new Date());
  }
  
  function showValue() {
     var picker = dojo.widget.byId(picker);
     //string value
     var stringValue = picker.getValue();
     alert(stringValue);
     //date value
     var dateValue = picker.getDate();
     alert(dateValue);
  }
/script

sx:datetimepicker id=picker 




Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
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, 11 Apr 2009 14:57:21 -0700
 Subject: Re: s:datetimepicker
 From: saty.pra...@gmail.com
 To: user@struts.apache.org
 
 Which version of struts are you using? If you using 2.1.6 and above, you
 need to have the struts-dojo lib and there is a tag include with sx:
 you need to use sx:datetimepicker It is something like struts extensions.
 
 You also need to include this..sx:head debug=true cache=false
 compressed=false /
 
 
 http://struts.apache.org/2.1.6/docs/datetimepicker.html
 
 Rgds,
 
 Satya
 
 On Sat, Apr 11, 2009 at 11:34 AM, john lee sh_thorn_b...@yahoo.com wrote:
 
 
  is s:datetimepicker struts default tag? if so, why it can not render the
  display?
 
  does it need to load additional .jar to support it?
 
  i tried the simple way
  s:datetimepicker lable=calendar value=2009-01-01 
  but just display calendar only, nothing display on the right side
 
  i tried the complex way, define action class
  public class DateBean extends ActionSupport {
 
  public String execute() throws Exception {
  setTodayDate(new Date());
  return SUCCESS;
  }
  private Date todayDate;
  public Date getTodayDate() { return todayDate; }
  public void setTodayDate(Date value) { todayDate = value; }
  }
 
  the jsp file is
  s:datetimepicker name=todayDate label=calendar
  displayFormat=-MM-dd/
 
  but just display 'calendar', nothing display on the right side either
 
  what happen?
 
  tks in advance
 
  john
 
 
 
 
 

_
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009


  

struts 2, implements Action / extend ActionSupport

2009-04-11 Thread john lee
 
 
i am aware that in struts 2, when define an action, it could be 
 
   public class XXX implement Action 
   or
   public class XXX extends ActionSupport
 
what is the difference b/w above two? in other words, in what kind of scenario, 
pick which one?
 
tks in advance
 
john 


  

struts 2, s:select postback problem

2009-04-11 Thread john lee
 
in struts 2, try to do following:
 
  a.    use s:select to display the selectable list (get value from db)
  b.    pickup the selection, 
  c.query the db
  d.    use s:select to display the selectable list still, and display 
the query result
 
2 Bean file
 
public class Bed {
  private String bed_id;
  public String getBed_id() {return bed_id;}
  public void setBed_id(String bed_id) { this.bed_id=bed_id; }
}
 
public class BedAnalysis {
  private String bed_id;
  private String status;
  public String getBed_id() {return bed_id;}
  public String getStatus() {return status;}
  public void setBed_id(String bed_id) { this.bed_id=bed_id; }
  public void setStatus(String status) { this.status=status; }
  }
 
Action 
 
public class Analysis_input implements Action {
private ArrayListBed beds;
private ArrayListBedAnalysis bedanalysis;
    private String bed_id;
   
    public String execute() throws Exception {
    /* db initial, get session etc */
  beds=service.Beds();  /* service is call db */
  String first_time=null;
  
first_time=ActionContext.getContext().getSession().get(FIRST_TIME);
  if (first_time==null)
  session.put(FIRST_TIME,1);
  else {
   bedanalysis=service.Analysis2(getBed_id());
   }

  return SUCCESS;
    }
 
    public void setBeds(ArrayListBed beds){ this.beds = beds; }
public void setBed_id(String bed_id){ this.bed_id = bed_id; } 
public void setBedanalysis(ArrayListBedAnalysis bedanalysis){ 
this.bedanalysis = bedanalysis; }
    public ArrayListBed getBeds() { return beds; }
    public String getBed_id(){ return bed_id; }
 public ArrayListBedAnalysis getBedanalysis() { return bedanalysis; }
   
struts.xml
    action name=Analysis_input class=matco.Analysis_input
    result name=error/Analysis_input.jsp/result
    result name=input/Analysis_input.jsp/result
    result name=success/Analysis_input.jsp/result
    /action
 
jsp file
    s:form id=analysis action=Analysis_input
 s:select label=beds name=beds headerKey=1 headerValue=Please 
Select Bed# list=beds listKey=bed_id listValue=bed_id  
value=%{#beds{bed_id}}/
s:submit value=Query/
/s:form
     s:iterator value=bedanlysis status=st 
   s:property value=bed_id/nspnbsps:property 
value=status/  /s:iterator
 
when i call Analysis_input.action, it works, the select box pop the value from 
db
   but after i select value of bed_id and submit, page render back, and show me 
the following
    



Invalid field value for field beds.

beds:
 Please Select Bed# 
 
i did select the value of bed_id, why this happen?
 
the weird thing even are:  the select list box' all value are gone.
 
pls help me
 
john


  

struts 2 s:iterator

2009-04-11 Thread john lee
 
in strut 1.X, 
   logic:present name=
 logic:iterator name=.
   /logic:present
   logic:notPresent name=
search result  not exist 
   /logic:present
 
but, in struts 2, 
   how can i use the same method to check s:iterator is not empty? in 
other words, i did not find equivalent s:present to achive the same effect as 
struts 1.x at above.
 
please advise
 
tks in advance
 
john