Re: Strategy to consume JSON/REST SErver

2011-02-10 Thread Eduard Neuwirt

Hi,

I think the spring-web is better candidate for REST. I have not seen 
until now a well Struts2-REST prototype.


Eduard

Am 10.02.2011 20:31, schrieb Frans Thamura:

hi all

we know REST is getting popular, and we know Struts2 can produce REST/JSON

but..

any idea to consume REST/JSON in Struts2 approach

anyone working on this?

I want like hibernate way, but hibernate connectes to database.

F

-
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: how to access spring beans from inside a custom validator

2010-11-01 Thread Eduard Neuwirt

Jake,

does your struts.xml contain the both entries?




Eduard

Am 01.11.2010 10:50, schrieb Jake Vang:

Eduard,

I tried that. I thought spring would inject the field, but I keep
getting a NullPointer (after I get the field and try to use it). Are
there any other configurations that I need in web.xml? Right now,
among other things, I have the listener
org.springframework.web.context.ContextLoaderListener  defined in
web.xml.

Thanks,

On Mon, Nov 1, 2010 at 4:17 AM, Eduard Neuwirt
  wrote:

Hello Jake,

It is simple.
Use struts/spring plug in.
Declare your bean within your validator and let spring inject your
validator.

That's all

Regards
Eduard
P.S.: Do not forget to define the corresponding setter method for injection

Am 01.11.2010 08:37, schrieb Jake Vang:

i have a custom field validator that extends FieldValidatorSupport.
inside this class, i need to access some beans as defined in
applicationContext.xml by Spring. how do i access the spring managed
beans? any help is appreciated.

-
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



-
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: how to access spring beans from inside a custom validator

2010-11-01 Thread Eduard Neuwirt

Hello Jake,

It is simple.
Use struts/spring plug in.
Declare your bean within your validator and let spring inject your 
validator.


That's all

Regards
Eduard
P.S.: Do not forget to define the corresponding setter method for injection

Am 01.11.2010 08:37, schrieb Jake Vang:

i have a custom field validator that extends FieldValidatorSupport.
inside this class, i need to access some beans as defined in
applicationContext.xml by Spring. how do i access the spring managed
beans? any help is appreciated.

-
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: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-17 Thread Eduard Neuwirt
 Raymond,

I found a possible solution here:
http://blog.springsource.com/2007/01/23/dynamic-datasource-routing

TenantId is hold in the Struts UserSession and shall be shared with
spring layer. The described solution uses ThreadLocal for this purpose.

Is it possible to provide this tenantId to the spring layer using
ThreadLocal ?

Is the UserSession bound to the ThreadLocal ?

Questions, questions :)

Regards and a lot of thanks to all
Eduard

Am 16.10.2010 16:50, schrieb Raymond He:
> To Li Ying and Dave New ton, multiple datasources is a common
> requirement in large scale e-commerce  and telecom application.
> I used a data object to table
> mapping to do DB routing vertically, pk hashing to route horizontally.
>The routing operation should not be
> done by Struts, but by persistent layer.
>
> 2010/10/15, Eduard Neuwirt :
>> Hello,
>>
>> I am looking for an elegant solution for the following situation.
>>
>> I have a multitenant struts/spring/hibernate application. Every tenant is
>> stored in own database within the same RDBMS. All databases has the same
>> schema. At the spring layer every tenant is represented as a datasource.
>> Because I use the Hibernate I have to create multiple SessionFactories to
>>
>> How can I provide the correct Seesionfactory to the UserSession in struts.
>> Once I have is the tenantId stored in UserSession itself.
>>
>> Please help
>> Eduard
>>

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



Re: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Eduard Neuwirt
Hi Frans,

would you mind to explain it ? Different implementation of what ?

Regards
Eduard

2010/10/15 Frans Thamura 

> How about make different implementation
>
> So
>
> Tenant1 extends tenanta
>
> Tenant2 extends tenantb
>
>
> /m/
>
> -Original Message-
> From: Eduard Neuwirt 
> Date: Fri, 15 Oct 2010 16:16:35
> To: Struts Users Mailing List
> Reply-To: "Struts Users Mailing List" 
> Subject: Re: Struts, Spring, Hibernate and multiple Sessionfactories
>
> Hi Li,
>
> thanks for the answer. I didn't get how does it work within the
> struts-spring plugins ? In this case ist the the question is how to access
> to the application context directly from struts session. I could not find
> any information in the docu.
>
>
> Regards
> Eduard
>
>
>
> 2010/10/15 Li Ying 
>
> > If you want to use multi-DB for multi-tenant (let's say tenant01 and
> > tenant02)
> >
> > I think you can create config file should likes:
> >
> > 
> >  
> > 
> >
> > 
> >  
> > 
> >
> > and then, in your java code, you can get different bean instance for
> > different tenant via [ID],
> > code looks like:
> >  BeanFactory.getBean("sessionFactory_" + tenantID,SessionFactory.class);
> >
> >
> > You can read this document for more information:
> >
> >
> http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/BeanFactory.html#getBean%28java.lang.String,%20java.lang.Class%29
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>


Re: Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Eduard Neuwirt
Hi Li,

thanks for the answer. I didn't get how does it work within the
struts-spring plugins ? In this case ist the the question is how to access
to the application context directly from struts session. I could not find
any information in the docu.


Regards
Eduard



2010/10/15 Li Ying 

> If you want to use multi-DB for multi-tenant (let's say tenant01 and
> tenant02)
>
> I think you can create config file should likes:
>
> 
>  
> 
>
> 
>  
> 
>
> and then, in your java code, you can get different bean instance for
> different tenant via [ID],
> code looks like:
>  BeanFactory.getBean("sessionFactory_" + tenantID,SessionFactory.class);
>
>
> You can read this document for more information:
>
> http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/BeanFactory.html#getBean%28java.lang.String,%20java.lang.Class%29
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Struts, Spring, Hibernate and multiple Sessionfactories

2010-10-15 Thread Eduard Neuwirt
Hello,

I am looking for an elegant solution for the following situation.

I have a multitenant struts/spring/hibernate application. Every tenant is
stored in own database within the same RDBMS. All databases has the same
schema. At the spring layer every tenant is represented as a datasource.
Because I use the Hibernate I have to create multiple SessionFactories to

How can I provide the correct Seesionfactory to the UserSession in struts.
Once I have is the tenantId stored in UserSession itself.

Please help
Eduard


Re: Spring configuration error

2010-08-17 Thread Eduard Neuwirt

 Hello Rakesh,

are you using spring 3.x version ? If yes, please make sure, you have 
already included all spring 3.0 jars. The entire list of jars can be 
found here: 
http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/


Listener not cofigured means that one of  spring-web jars has not been 
included.


Regards
Eduard

Am 18.08.2010 06:18, schrieb Rakeshkumar Parmar:

Hi,

I am not using spring to configure Hello World sample application. But it 
still gives me listener not registered error for spring context. I am using 
struts 2.7.1 distribution.

Regards,
Rakesh



DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.



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



Re: [s2] number format s:textfield tag

2010-03-30 Thread Eduard Neuwirt
Hi,

This is very diffcult issue in struts. First you have to set your locale
correctly. Second you have to use in the jsp the correct calls for number
formatting. The struts docummenattion explains this point in FAQ (I hold in
mind so). Alternatively you can write your own converter for BigDecimal.
I would prefer the first way.

Regards
Eduard

2010/3/30 Juanjo C 

> Any idea?
>
> 2007/10/23 Pedro Herrera 
>
> >
> > Hi,
> >   I have a currency input field (BigDecimal). In my location the decimal
> > point is comma, eg, 10,00(==10.00) must be permitted.  Struts is throwing
> a
> > message error : Invalid field value for field "valor".
> >
> >
> > Thanks
> >
> > Herrera
> >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/-s2--number-format-s%3Atextfield-tag-tf4680318.html#a13373598
> > 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: Access to two diffrent beans in one form

2010-03-27 Thread Eduard Neuwirt

Hello Stephane,

I think this a small differ approach would be better. I would declare 
only once Action for example DisplayAction.
Within this class define two member variables clients and lists. Access 
to these beans via select in the *.jsp.


Something like that:
class DisplayAction ...
{
List clients;
List products;
//This will be set if you selects one from the list
Client client;
Product product;

public void prepare()
{
clients = someMethodsFillingClients();
products = someMethodFillingProducts();
}


}

Display.jsp







Am 27.03.2010 07:50, schrieb Stephane Cosmeur:

Hello
I'm very new on struts 2 and i'm facing a problem i can't resolv. I think it
will be a formality for real users of struts.
I have two actions class, ProductAction and CliendAction. And i want to have
in a jsp two s:select to print the list of my clients and the list of my
products.
To display this jsp i call an action whose associed class is ClientAction.
So my first s:select work well, but i can't see how provide the
ProductAction to my second s:select.
I tried to make an interceptor to "load" the ProductAction but it didn't
work. I tried to use s:bean but it didn t work either. I know my problem can
looks stupid but i really need help ! i'm facing this problem since two
days.

thank you and sorry for my english :)

   



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



Interesting behavior of struts 2.1

2010-03-24 Thread Eduard Neuwirt

Hello all,

I am facing a strange problem. If I redefine in web.xml the 
struts-filters (see following xml-snip), the struts works fine, but I 
loose my location settings after FORWARDING.


Any idea ? Please advice.

Regards
Eduard
P.S.: I haven't debugged  the struts code.


   openSessionInViewFilter
   /*
   REQUEST
   FORWARD
   
   
   struts-cleanup
   /*
   REQUEST
   FORWARD
   
   
   sitemesh
   /*
   REQUEST
   FORWARD
   
   
   struts
   /*
   REQUEST
   FORWARD
   


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



Re: Why did not show action message?

2009-12-11 Thread Eduard Neuwirt

Did you send your success message from the action ?
Emi Lu schrieb:

Good afternoon,

With struts2.1.81, in action class: addActionMessage("Success!");

in JSP, display .


But the success message never show up? Any clues?


Thanks a lot!
--
Lu Ying

-
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: excute method

2009-11-27 Thread Eduard Neuwirt

Hello,

try to find you message in the Servlet-Container log file. I am not sure 
abot the target of system.out in the jee context, i suppose it would be 
the log file.


Regards
Eduard

Nguyen Xuan Son schrieb:

dear all
in struts.xml i have

C0002_Home.jsp


however no matter how hard i tried
public String execute() throws Exception {
System.out.println("you're now in C0002_Home page");
return SUCCESS;
}
nothing is excuted

please tell me where should i correct?
thank you very much

  



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



Re: Struts2 / Hibernate Question

2009-10-23 Thread Eduard Neuwirt

Hm,

interesting. I checked against my configurations. I have in my 
WEB-INF/lib spring.jar, all necessary hibernate archives and the 
configuration of filters is done as described  in the link I already 
posted.


Best
Eduard

Dennis Atkinson schrieb:
OK, that's good.  So -- uh - how would I configure OpenSessionInView?  I attempted to do it, but even after I loaded the spring-hibernate3-2.0.8.jar file, I got a ClassNotFound error, so I couldn't even get past that. 


And you are absolutely correct about it being rather interesting.  But it seems 
so common, that there should be a common and standard way of dealing with it, 
but so far it seems not.

--Dennis






____
From: Eduard Neuwirt 
To: Struts Users Mailing List 
Sent: Fri, October 23, 2009 3:19:09 PM
Subject: Re: Struts2 / Hibernate Question

Hi Dennis,

sorry i don't know anything about FullHibernatePlugin. I am using only 
the OpenSessionInView-approach. The Google delivers several threads to 
this topic. It seems to be rather interesting problem.


Regards
Eduard

Dennis Atkinson schrieb:
  

Eduard,

I thought the FullHibernatePlugin implements this.

--Dennis





____
From: Eduard Neuwirt 
To: Struts Users Mailing List 
Sent: Fri, October 23, 2009 3:08:44 PM
Subject: Re: Struts2 / Hibernate Question

Hi,

please have a look to the https://www.hibernate.org/43.html

Regards
Eduard

Thomas Sattler schrieb:
 


So it sounds like both the FullHibernatePlugin and the
OpenSessionInViewFilter class work.  Thanks for the quick replies.

Do you remember how these are configured?

The FullHibernatePlugin wiki says only a few lines of configuration are
required, but it doesn't say what those lines are.

With OpenSessionInView, I add it to my web.xml file, but I get an error that
it can't find the class, even though I am fairly certain that the
"spring-hibernate3-2.0.8.jar" file contains it, and I triple-check to make
sure that jar is loaded.


--Dennis





On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt <
eduard.neuw...@googlemail.com> wrote:

 
   
  

Hi,

Obviously there is a gap between Hibernate and Web-Application.
OpenSessionInViewFilter working well, almost. I am using this filter and in
the most cases it is enough. Sometimes I have to load Collection with
size(). The another solution is to store only keys in the session and load
the objects for every request from the Database/second level cash. The Eager
Initialization does not work for two or more Lists in the class :(

Regards
Eduard


Dennis Atkinson schrieb:

 Hello all.
   
 


I am running into the infamous "closed session" issue, whereby I get a
LazyInitializationException on a lazy-initialized foreign key relationship.
 The issue, as I understand it, is that the session is closed before the
lazy-initialized objects need to be read from the database, so there is no
session when the read actually occurs, and the exception is thrown.  It
seems like any complex Struts / Hibernate system would eventually run into
this issue, as I have.  I could specify everything as "EAGER", but that
would (eventually) load my entire database and that's far from an optimal
solution.

As suggestions for fixing this, I have found references to the
FullHibernatePlugin, and also the OpenSessionInViewFilter class.  Both claim
that no code changes are required, and all that's needed are some
configuration changes.  The documentation on how to use these two solutions
is sparse, at best.
Has anyone used either of these two solutions?  Is there any documentation
floating around that I haven't found yet?  Or is there another, better
solution that someone has found?
I know this is a Hibernate issue and not a Struts issue, but I think
people here must have experience with this issue.

Thanks in advance,
Dennis




 
   
  

-
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


 
 




-
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: Struts2 / Hibernate Question

2009-10-23 Thread Eduard Neuwirt

Hi Dennis,

sorry i don't know anything about FullHibernatePlugin. I am using only 
the OpenSessionInView-approach. The Google delivers several threads to 
this topic. It seems to be rather interesting problem.


Regards
Eduard

Dennis Atkinson schrieb:

Eduard,

I thought the FullHibernatePlugin implements this.

--Dennis






From: Eduard Neuwirt 
To: Struts Users Mailing List 
Sent: Fri, October 23, 2009 3:08:44 PM
Subject: Re: Struts2 / Hibernate Question

Hi,

please have a look to the https://www.hibernate.org/43.html

Regards
Eduard

Thomas Sattler schrieb:
  

So it sounds like both the FullHibernatePlugin and the
OpenSessionInViewFilter class work.  Thanks for the quick replies.

Do you remember how these are configured?

The FullHibernatePlugin wiki says only a few lines of configuration are
required, but it doesn't say what those lines are.

With OpenSessionInView, I add it to my web.xml file, but I get an error that
it can't find the class, even though I am fairly certain that the
"spring-hibernate3-2.0.8.jar" file contains it, and I triple-check to make
sure that jar is loaded.


--Dennis





On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt <
eduard.neuw...@googlemail.com> wrote:

 


Hi,

Obviously there is a gap between Hibernate and Web-Application.
OpenSessionInViewFilter working well, almost. I am using this filter and in
the most cases it is enough. Sometimes I have to load Collection with
size(). The another solution is to store only keys in the session and load
the objects for every request from the Database/second level cash. The Eager
Initialization does not work for two or more Lists in the class :(

Regards
Eduard


Dennis Atkinson schrieb:

 Hello all.
   
  

I am running into the infamous "closed session" issue, whereby I get a
LazyInitializationException on a lazy-initialized foreign key relationship.
 The issue, as I understand it, is that the session is closed before the
lazy-initialized objects need to be read from the database, so there is no
session when the read actually occurs, and the exception is thrown.  It
seems like any complex Struts / Hibernate system would eventually run into
this issue, as I have.  I could specify everything as "EAGER", but that
would (eventually) load my entire database and that's far from an optimal
solution.

As suggestions for fixing this, I have found references to the
FullHibernatePlugin, and also the OpenSessionInViewFilter class.  Both claim
that no code changes are required, and all that's needed are some
configuration changes.  The documentation on how to use these two solutions
is sparse, at best.
Has anyone used either of these two solutions?  Is there any documentation
floating around that I haven't found yet?  Or is there another, better
solution that someone has found?
I know this is a Hibernate issue and not a Struts issue, but I think
people here must have experience with this issue.

Thanks in advance,
Dennis




 


-
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


  
  



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



Re: Struts2 / Hibernate Question

2009-10-23 Thread Eduard Neuwirt

Hi,

please have a look to the https://www.hibernate.org/43.html

Regards
Eduard

Thomas Sattler schrieb:

So it sounds like both the FullHibernatePlugin and the
OpenSessionInViewFilter class work.  Thanks for the quick replies.

Do you remember how these are configured?

The FullHibernatePlugin wiki says only a few lines of configuration are
required, but it doesn't say what those lines are.

With OpenSessionInView, I add it to my web.xml file, but I get an error that
it can't find the class, even though I am fairly certain that the
"spring-hibernate3-2.0.8.jar" file contains it, and I triple-check to make
sure that jar is loaded.


--Dennis





On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt <
eduard.neuw...@googlemail.com> wrote:

  

Hi,

Obviously there is a gap between Hibernate and Web-Application.
OpenSessionInViewFilter working well, almost. I am using this filter and in
the most cases it is enough. Sometimes I have to load Collection with
size(). The another solution is to store only keys in the session and load
the objects for every request from the Database/second level cash. The Eager
Initialization does not work for two or more Lists in the class :(

Regards
Eduard


Dennis Atkinson schrieb:

 Hello all.


I am running into the infamous "closed session" issue, whereby I get a
LazyInitializationException on a lazy-initialized foreign key relationship.
 The issue, as I understand it, is that the session is closed before the
lazy-initialized objects need to be read from the database, so there is no
session when the read actually occurs, and the exception is thrown.  It
seems like any complex Struts / Hibernate system would eventually run into
this issue, as I have.  I could specify everything as "EAGER", but that
would (eventually) load my entire database and that's far from an optimal
solution.

As suggestions for fixing this, I have found references to the
FullHibernatePlugin, and also the OpenSessionInViewFilter class.  Both claim
that no code changes are required, and all that's needed are some
configuration changes.  The documentation on how to use these two solutions
is sparse, at best.
Has anyone used either of these two solutions?  Is there any documentation
floating around that I haven't found yet?  Or is there another, better
solution that someone has found?
I know this is a Hibernate issue and not a Struts issue, but I think
people here must have experience with this issue.

Thanks in advance,
Dennis




  

-
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: Struts2 / Hibernate Question

2009-10-23 Thread Eduard Neuwirt

Hello Johannes,

I am a little bit confusing. I thougth that Spring + Hibernate do not 
solve the LazyInitializationException-issue because the hibernate 
session is attached to request scope, so it leads to the problem ? Do 
you store the session in the session scope ?


Regards
Eduard

Johannes Geppert schrieb:

I use the FullHibernatePlugin in some small Projects, this is working very
well for me.
In larger Projects today I prefer Hibernate in combination with Spring
Framework.

Best Regards

Johannes Geppert

--
http://www.jgeppert.com
http://twitter.com/jogep


Dennis Atkinson wrote:
  

Hello all.

I am running into the infamous "closed session" issue, whereby I get a
LazyInitializationException on a lazy-initialized foreign key
relationship.  The issue, as I understand it, is that the session is
closed before the lazy-initialized objects need to be read from the
database, so there is no session when the read actually occurs, and the
exception is thrown.  It seems like any complex Struts / Hibernate system
would eventually run into this issue, as I have.  I could specify
everything as "EAGER", but that would (eventually) load my entire database
and that's far from an optimal solution.

As suggestions for fixing this, I have found references to the
FullHibernatePlugin, and also the OpenSessionInViewFilter class.  Both
claim that no code changes are required, and all that's needed are some
configuration changes.  The documentation on how to use these two
solutions is sparse, at best.  


Has anyone used either of these two solutions?  Is there any documentation
floating around that I haven't found yet?  Or is there another, better
solution that someone has found? 


I know this is a Hibernate issue and not a Struts issue, but I think
people here must have experience with this issue.

Thanks in advance,
Dennis


  





-
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

  



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



Re: Struts2 / Hibernate Question

2009-10-23 Thread Eduard Neuwirt

Hi,

Obviously there is a gap between Hibernate and Web-Application. 
OpenSessionInViewFilter working well, almost. I am using this filter and in the 
most cases it is enough. Sometimes I have to load Collection with size(). The 
another solution is to store only keys in the session and load the objects for 
every request from the Database/second level cash. The Eager Initialization 
does not work for two or more Lists in the class :(

Regards
Eduard


Dennis Atkinson schrieb:

Hello all.

I am running into the infamous "closed session" issue, whereby I get a 
LazyInitializationException on a lazy-initialized foreign key relationship.  The issue, as I 
understand it, is that the session is closed before the lazy-initialized objects need to be read 
from the database, so there is no session when the read actually occurs, and the exception is 
thrown.  It seems like any complex Struts / Hibernate system would eventually run into this issue, 
as I have.  I could specify everything as "EAGER", but that would (eventually) load my 
entire database and that's far from an optimal solution.

As suggestions for fixing this, I have found references to the FullHibernatePlugin, and also the OpenSessionInViewFilter class.  Both claim that no code changes are required, and all that's needed are some configuration changes.  The documentation on how to use these two solutions is sparse, at best.  

Has anyone used either of these two solutions?  Is there any documentation floating around that I haven't found yet?  Or is there another, better solution that someone has found? 


I know this is a Hibernate issue and not a Struts issue, but I think people 
here must have experience with this issue.

Thanks in advance,
Dennis


  
  



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



Double conversion

2009-10-13 Thread Eduard Neuwirt

Hello all,

so I am still facing the problem with Double conversion ins Struts. So I 
am trying to describe the situation:
1. double will be converted without consideration of  localization, i.e. 
input and display form are using dot-notification.
2. Double will be convvrted with partial consideration of localization, 
the display form is done with dot-notification like 5.5 but input form 
is using comma-notification like 5,5. So it leads to the following 
mistake in fact input of displayed 5.5 leads to the value increasing to 
55. So you have to change the input from 5.5 to 5,5. There are several 
bug reports since 2007 but the bug still exists. Nevertheless  I  would 
get the problem solved.


So I tried the following workaround: I defined my own Double-Converter 
and declared it in xwork-conversion.properties for java.langDouble. The 
converter works fine, but the struts-default validator does not accept 
the comma-separted value so I get the "field invalid message".
What I doing wrong or how can I turn off the default Double conversion ? 
Please help.


Regards
Eduard

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



Re: Behaviour of Double conversion

2009-10-12 Thread Eduard Neuwirt

Hello Martin,

yes i did. The converter works partially. For displaying the 
dot-notification is used. For input the comma notification is used.


Any Idea ?

Martin Gainty schrieb:

did you use xwork DoubleConverter?
@Conversion()
public class ConversionAction implements Action {
  private String convertDouble;

  @TypeConversion(converter = 
"com.opensymphony.xwork2.util.XWorkBasicConverter")
  public void setConvertDouble( String convertDouble ) {
  this.convertDouble = convertDouble;
  }
}
?
http://www.opensymphony.com/xwork/api/com/opensymphony/xwork2/conversion/annotations/TypeConversion.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: Sun, 11 Oct 2009 21:24:57 +0200
From: eduard.neuw...@googlemail.com
To: user@struts.apache.org
Subject: Behaviour of Double conversion

Hi all,

I am facing the following interesting behavior of struts 2.1.8. I am 
using in action a list containing beans with setting of Double. 
Additionally I set German locale.


So the value of double will be displayed in the English-Locale for 
example 5.55, but the conversion of value is done in the German locale 
so struts2 expects 5,55. As a side effect the value 5.55 interprets 
struts like 555.


Any Idea ? I thought this issue was already fixed ?

Regards
Eduard



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


 		 	   		  
_

Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/171222985/direct/01/
  



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



Behaviour of Double conversion

2009-10-11 Thread Eduard Neuwirt

Hi all,

I am facing the following interesting behavior of struts 2.1.8. I am 
using in action a list containing beans with setting of Double. 
Additionally I set German locale.


So the value of double will be displayed in the English-Locale for 
example 5.55, but the conversion of value is done in the German locale 
so struts2 expects 5,55. As a side effect the value 5.55 interprets 
struts like 555.


Any Idea ? I thought this issue was already fixed ?

Regards
Eduard



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



Re: Struts 1 new bean in form.

2009-10-05 Thread Eduard Neuwirt

Hi,

perhaps a simple type :

omg.alocation

try with allocation (twin l)

Regards
Eduard

SanJ.SANJAY schrieb:


I am setting this new bena in form like this:

private NewBean omg= new NewBean ();

 public NewBean getOmg() {
   return omg;
}


public void setOmg(NewBean omg) {
this.omg= omg;
}

Now I have the instance of bean (omg) in my form.

So to call the properties inside omg, I call in jsp like this



for which i get server error saying no getter method for the bean 




Paweł Wielgus wrote:
  

Hi,
where are You setting this bean into form?
Try < bean:write name="myForm" property="omg" />
in jsp, it might be null.

Best greetings,
Paweł Wielgus.


2009/10/5 SanJ.SANJAY :


Hello,

  I am using Struts 1. I am having some issue with creating a new
bean
inside the form.

I have JSP with its form. Now I need to add a feature in my same JSP
page.
With this feature will come lots of new fields in JSP. So I thought
instead
of writing the fields and getter/setters in the same form, I will create
a
new bean where I will define all these new fields and getters/setters and
then I will instantiate that bean in my form and read those fields in
JSP.
But JSP is not able to read thos fields. The part of code is below.

JSP:



   OSP:
   

   



This si only one field, but similarly there are set of other fields which
I
have not mentioned.

I have a new bean with getters/setters for these new set of fields and I
instantiate that bean in my form like this:

 private NewBean omg= new NewBean ();

   public NewBean getOmg() {
   return omg;
   }


   public void setOmg(NewBean omg) {
   this.omg= omg;
   }

NewBean.java :

private String  alocation = "";
   public String getAlocation() {
   return alocationOSP;
   }

   public void setAlocation(String alocationOSP) {
   this.alocationOSP = alocationOSP;
   }
Any pointers what could be the issue here?

The error message I am getting is:
No getter method found for this bean omg.alocation
--
View this message in context:
http://www.nabble.com/Struts-1-new-bean-in-form.-tp25753281p25753281.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


  

-
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: Create new theme in struts Tutorial

2009-09-30 Thread Eduard Neuwirt

Hi Martin,

I have two kinds of forms. Table view and Entity View for different 
entities and tables. The look-and-feel shall be the same, only the 
content and columns differ.

I don't use any template library.
CSS is planned.

Eduard Neuwirt

Martin Gainty schrieb:

i would have to agree with patrick in saying its easier to wrap the simple 
theme than creating from scratch
http://struts.apache.org/2.0.14/docs/extending-themes.html

a few questions:
what is the purpose of this theme?
which Template Libraries would you be using?
will you be using CSS?

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: Wed, 30 Sep 2009 21:03:27 +0200
From: eduard.neuw...@googlemail.com
To: user@struts.apache.org
Subject: Create new theme in struts Tutorial

Hello,

I am trying to create my own Struts theme. The topic seems to be rather 
rarely. I am looking for an tutorial or how to guide describing this.

Does a tutorial exist ? Is it useful to create a won theme ?

Regards
Eduard



-
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_QuickAdd_062009
  



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



Create new theme in struts Tutorial

2009-09-30 Thread Eduard Neuwirt

Hello,

I am trying to create my own Struts theme. The topic seems to be rather 
rarely. I am looking for an tutorial or how to guide describing this.

Does a tutorial exist ? Is it useful to create a won theme ?

Regards
Eduard



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



Re: validation

2009-08-17 Thread Eduard Neuwirt

Hi all,

if you declare a field as int and pass a non int value, the described 
error occurs. Either use string or be sure to put the correct value.


Regards
Eduard

musom...@aol.com schrieb:

 That looks like a question -- it is meant to be an assertion but somehow 
question marks crept in.
C.


 



 


-Original Message-
From: musom...@aol.com
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 11:12 am
Subject: Re: validation











 For primitives and dates you don't need to do anything? -- the type conversion 
is automatic

Chris



 



 


-Original Message-
From: sandy.verfai...@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 10:43 am
Subject: RE: validation










Chris,

Your version doesn't work for me neither.. 
Maybe you can tell me the paths of each file you putted at pastie?


Anyway, I can not pass a double value from my jsp file to my
actionclass. Then I get the error 'no such method found for
'setPrice(java.lang.String)''.
So I make a setter with a string and convert it. Assuming the value
would be already parsed in the validation xml,so my conversion will
work.
Is this normal?

Regards,
Sandy 


-Oorspronkelijk bericht-
Van: musom...@aol.com [mailto:musom...@aol.com] 
Verzonden: maandag 17 augustus 2009 15:28

Aan: user@struts.apache.org
Onderwerp: Re: validation


 ok -- I used as much of your code as you have posted and put a working
version at

http://pastie.org/585837

Chris



 



 


-Original Message-
From: sandy.verfai...@roularta.be
To: user@struts.apache.org
Sent: Mon, Aug 17, 2009 2:09 pm
Subject: RE: validation










Requiredstring doesn't work neither.. 


-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@yahoo.com]
Verzonden: maandag 17 augustus 2009 14:16
Aan: Struts Users Mailing List
Onderwerp: Re: validation

how about change your field validator to requiredstring just to check
which part of your setting went wrong?




From: "sandy.verfai...@roularta.be" 
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:54:04 PM
Subject: RE: validation

Yes, this is my package declaration in struts.xml:


I changed the namespace of my formtag (on the jsp page) into 'shop',
according to the package name. 
But it doesn't help..



-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:42
Aan: Struts Users Mailing List
Onderwerp: Re: validation

do you extends="struts-default" in your package?

or may be just put this
 in your package to check




From: "sandy.verfai...@roularta.be" 
To: user@struts.apache.org
Sent: Monday, August 17, 2009 12:26:45 PM
Subject: RE: validation

Thx for the reply,
I have no interceptors declared in my struts.xml, so I assume i use
defaultstack interceptor, or not?
Jes, the validation xml is in the same dir as my class.

Any other thoughts? 


-Oorspronkelijk bericht-
Van: mailtolouis2020-str...@yahoo.com
[mailto:mailtolouis2020-str...@yahoo.com]
Verzonden: maandag 17 augustus 2009 13:12
Aan: Struts Users Mailing List
Onderwerp: Re: validation

Are u using defaultStack interceptor? If not u need to make sure
validate and workflow interceptor are in your interceptor stack.

Another check is are  u putting the
ProductActions-addProduct-validation.xml in the same directory as your
ProductActions.java ?




From: "sandy.verfai...@roularta.be" 
To: user@struts.apache.org
Sent: Monday, August 17, 2009 11:01:56 AM
Subject: validation

Hi,

I'm trying to add some validation to my fstruts 2 form but it won't
work.
If I enter for example value '6' in my weight textfield and press 'add',
the debugger comes in the method 'addProduct', finishes and returns to
products.jsp.
There is no message shown as defined in the validation xml.
Does someone see what goes wrong?


In products.jsp I have the following code:
...


...



weight: 

 ...

In struts.xml I have:


/products.jsp
/products.jsp
/products.jsp


In ProductActions.java i have:

public String addProduct(){
return SUCCESS;
}

In ProductActions-addProduct-validation.xml I have:

http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>



0
3
Weight has to be numeric and can't be less than 0.
   


thx!

Sandy

-
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

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



 



-

Re: struts 2.1.5 type conversion error

2009-08-17 Thread Eduard Neuwirt

Hi Sandy,

please use additionally to the conversion xml the of the declaration 
corresponding member attributes as double, int etc. I think there are 
several examples for the .properties files.


Regards
Eduard Neuwirt


sandy.verfai...@roularta.be schrieb:

Martin,

Then why are there validator xmls in which you can say what type your input 
should be?
Shall I give all my int variables in my class a String-setter?

Thx for the answer,
Sandy  



-Oorspronkelijk bericht-
Van: Martin Gainty [mailto:mgai...@hotmail.com] 
Verzonden: donderdag 13 augustus 2009 18:45

Aan: Struts Users Mailing List
Onderwerp: RE: struts 2.1.5 type conversion error


http transmits strings (not int,double,date or any other type of primitive)

Martin Gainty
je ne suis pas d'accord avec ce que vous dites.
mais je défendrai à ma mort votre droite de la dire. - Voltaire 
__
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.




  

Subject: RE: struts 2.1.5 type conversion error
Date: Thu, 13 Aug 2009 16:11:55 +0200
From: sandy.verfai...@roularta.be
To: user@struts.apache.org

Lukasz,

The type of 'price' is a double..

Thx for answering.

Regards,
sandy

-Oorspronkelijk bericht-
Van: Lukasz Lenart [mailto:lukasz.len...@googlemail.com]
Verzonden: woensdag 22 juli 2009 9:50
Aan: Struts Users Mailing List
Onderwerp: Re: struts 2.1.5 type conversion error

2009/7/17  :

 Name 
nl price
value=""/> 
  

What type has "price" in action class?


Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

Charles de Gaulle  - "The better I get to know men, the more I find 
myself loving dogs." - 
http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html


-
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




_
Get your vacation photos on your phone!
http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM

-
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: Configuring SiteMesh for specific action mappings in Struts 2?

2009-08-11 Thread Eduard Neuwirt

Hi Wong,

perhaps would the following entries from decorators.xml help you :


 
   /styles/*
   /scripts/*
   /images/*
   /index.html
 
...


Regards
Eduard Neuwirt

CS Wong schrieb:

Hi,
I'm trying to configure sitemesh to only take effect for a certain subset of
action mappings in my Struts 2 application.

Say for example, I have the following struts.xml snippet:


  
/view/form.jsp
  


  
/view/form.jsp
  


I would like the output of "/showForm.action" to be decorated by SiteMesh
but for "/widgets/showForm.action" to be returned empty instead. The
critical part here is that I want the JSP file to be reused by both action
mappings.

But try as I might, I can't seem to get SiteMesh's  tag to
recognize a mapping. I have to specify the file "/view/form.jsp" to be
excluded instead and that means I won't be able to reuse the JSP file.

Is there any way I can get around this?

I'm using Struts 2.0.14.

Thanks,
Wong

  



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



Re: JSP not loading

2009-08-10 Thread Eduard Neuwirt

Hi,
are you sure that the answer is sent to the correct JSP. Please check 
your struts.xml for the action and make sure that the correct result is 
chosen. In case of Chinese and if you are using the dynamic method 
invocation the result may be incorrect.


Regards
Eduard


Kavita Mehta schrieb:

Hi ,
I am facing a strange problem. I am using struts2.0 and my server side 
code executes well and sends the response ..but my ethereal shows empty 
response and hence my JSPs are not loading on the browser .
This happens when user has mentioned his details in lets say chinese 
language . i.e. any character other than english doesnt get interpreted by 
my JSP code. 


Can anyone pls help ?


Thanks,
Kavita




*DISCLAIMER*

This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers. 
Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is 
addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward, 
print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, 
please notify the sender immediately and delete the message.





  



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