Re: NoClassDefFoundError Exception

2008-05-20 Thread Rushikesh Thakkar
You need to have xwork-2.0.*.jar file in your WEB-INF/lib folder.

-Rushikesh

On Tue, May 20, 2008 at 6:40 PM, Felipe Lorenz [EMAIL PROTECTED]
wrote:

 Hi folks.

 When i start the tomcat 5.5 this exception appear to me:
 20/05/2008 08:48:03 org.apache.catalina.core.StandardContext filterStart
 SEVERE: Exception starting filter struts2
 java.lang.NoClassDefFoundError:
 com/opensymphony/xwork2/config/ConfigurationProvider
at

 org.apache.struts2.dispatcher.FilterDispatcher.createDispatcher(FilterDispatcher.java:239)
at

 org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:200)
at

 org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at

 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at

 org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:78)
at

 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at

 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at

 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at

 org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at
 org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at
 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at

 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at
 org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at
 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
 org.apache.catalina.core.StandardService.start(StandardService.java:448)
at
 org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
 Caused by: java.lang.ClassNotFoundException:
 com.opensymphony.xwork2.config.ConfigurationProvider
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1363)
at

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 29 more

 But, everything work fine... i use Struts 2.0.11.1, Tomcat 5.5 and my
 WEB.XML:
 ?xml version=1.0 encoding=UTF-8?
 web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=
 http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
filter
filter-namestruts2/filter-name

 filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class
/filter
filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
/filter-mapping
 /web-app

 What can be?




-- 
-Rushikesh


Re: redirect after logging in

2008-05-13 Thread Rushikesh Thakkar
Hi,

Check out the login-interceptor in Mail-Reader application given on Planet
Struts. I found it useful. I think you are also looking for the same.
http://www.planetstruts.org/struts2-mailreader/Tour.do

(The application may be down sometimes, you can refer to cached pages in
Google search for the same.)

-Rushikesh

On Mon, May 12, 2008 at 1:35 PM, Laurie Harper [EMAIL PROTECTED] wrote:

 Acegi / Spring Security can certainly get this done, but may be overkill
 if the authentication and authorization requirements are simple. Container
 Managed Security is probably the quickest and easiest way to get the
 described behaviour, but that also doesn't always fit. For a home-brewed
 custom solution a Struts2 interceptor or simply a servlet filter will give
 more flexibility.

 So, the answer is yes, this can be achieved using interceptors. What
 specifically do you need help with?

 L.


 Jim Kiley wrote:

  I wouldn't implement it with interceptors so much as I'd look into
  something
  like Acegi Security (now Spring Security if I remember right).  I'm
  having a
  decent level of success on an Acegi / Sitemesh / Struts 2 / Spring /
  Hibernate project right now.
 
  jk
 
  On Fri, May 9, 2008 at 6:01 PM, Jaarthy [EMAIL PROTECTED] wrote:
 
   Hi,
  
   I'm trying to implement a scenario in which if the user who has not
   logged
   in clicks on a page for logged in users only  should be
   redirected to login page, and then after logging in he should be
   redirected to the page he originally requested for.
  
   I need to implement this in struts2.Can I achieve this using
   Interceptors?Kindly help.
  
   Thanks,
   Aarthy
  
   --
   View this message in context:
  
   http://www.nabble.com/redirect-after-logging-in-tp17157183p17157183.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]
  
  
  
 
 

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




Re: s:select problem

2008-05-07 Thread Rushikesh Thakkar
On Wed, May 7, 2008 at 6:10 PM, Arpan Debroy [EMAIL PROTECTED] wrote:


 But nothing is displaying in my drop down box when I put listkey and
 listvalue.

 If it's working without using listKey and listValue, then make sure you
have defined getters and setters for id and name attributes of *Result*
(I'm assuming it as the name of list is resultList) object.


Re: How to initialize business service objects?

2008-03-17 Thread Rushikesh Thakkar
Frank,

AFAIU, you want your Business Service Object to be injected in your Struts2
actions. To achieve that, I have done this:

- Using Spring ObjectFactory.
- Declare Business Service Object (BSO) in Spring's
applicationContext.xml(you've already done that)
- Define action that has setter method for your BSO.
- Declare this action as a bean in applicationContext.xml, with BSO
injected as dependency.

Sample Code:

Action:

public class SetEndPoint extends ActionSupport {
private DispatcherService dispatcherService;
public String execute () throws Exception {
//-your business logic-
return SUCCESS;
}

// DispatcherService object will be set (i.e. injected) by Spring (see
applicationContext.xml)
*public void setDispatcherService(DispatcherService dispatcherService)*{
this.dispatcherService = dispatcherService;
}
}

applicationContext.xml

 !-- . your existing bean declaration for DispatcherService
remains  -

!-- . Declare action here, injecting DispatcherService  -
bean id=setEndPoint class=example.client.web.action.SetEndPoint
*property name=dispatcherService*
ref bean=DispatcherService/
/property
/bean

struts.xml

struts
*constant name=struts.objectFactory value=spring /*
package name=no.bbs extends=struts-default
action name=setEndPoint method=execute *class=setEndPoint* 
result name=consumeA/view/consumeAcos.jsp/result
result name=consumeB/view/consumeMapp.jsp/result
result name=error/view/error.jsp/result
/action
/package
/struts

I have underlined important parts of each artifact..
I hope this helps..

-Rushikesh

On Mon, Mar 17, 2008 at 5:28 PM, Piero Sartini [EMAIL PROTECTED]
wrote:

 Am Donnerstag, 13. März 2008 22:32:34 schrieb Frank Fischer:
  Now i don't understand (1) where to create/initialize these business
 logic
  classes and (2) how to get access to them from the action classes.

 Just build your business logic without thinking about s2 too much. From
 your
 action classes you can access your business logic like everything else.
 Its
 really more of a java problem how to do this =)

 If you have to run initialization code at startup, maybe a normal Listener
 is
 what you are looking for...

Piero



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




Re: Question regarding OGNL

2008-03-14 Thread Rushikesh Thakkar
AFAIK you can use OGNL expression in any attribute of your struts2 tag.
Your problem could be 'what is the proper syntax for using OGNL
expression?'.
Can you post your relevant code? I might get an idea of what you are trying
to achieve.

-Rushikesh

On Fri, Mar 14, 2008 at 7:29 AM, Thomas Ramapuram 
[EMAIL PROTECTED] wrote:

 Hi,
 I have query regarding OGNL Expression.
 Can the #name kind of expression be used anywhere? Or are they
 applicable only in certain attributes of struts tags

 Till now I was using the %{name} expression and that too in the some
 attribute of a tag

 I tried using #name expression but it does not work.  Is there any
 settings to be set (for example in web.xml)
 Any pointers would be a great help.
 Thanks
 Thomas


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




Parameters: Invalid chunk ignored (parameters not passed)

2008-03-13 Thread Rushikesh Thakkar
Kindly help.. I have not been able to solve it yet.

-- Forwarded message --
From: Rushikesh Thakkar [EMAIL PROTECTED]
Date: Fri, Mar 7, 2008 at 3:40 PM
Subject: Parameters: Invalid chunk ignored (parameters not passed)
To: Struts Users Mailing List user@struts.apache.org


I am facing a strange problem. When I use s:submit *theme=ajax
targets=requestDiv* / I get the following error on the console:

07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters
WARNING: Parameters: Invalid chunk ignored.
and the parameters are not passed properly (So, my Action fails), but after
*removing* *theme=ajax targets=requestDiv*, it works fine.

If I change the jsp back to s:submit theme=ajax targets=requestDiv /,
then it starts working fine.
Please can anybody tell me what is wrong with my application? Please help
me, it is urgent.


Re: Parameters: Invalid chunk ignored (parameters not passed)

2008-03-13 Thread Rushikesh Thakkar
I tried it and Its Not Working !!

Thanks anyways, but can you tell me what does it do? I didn't find any
property as 'formFilter' in the documentation given for s:submit / in the
tag reference.

On Thu, Mar 13, 2008 at 3:32 PM, bierb [EMAIL PROTECTED] wrote:


 Add parameter formFilter=formFilter to your s:submit .../

 and create Javascript function in head

 function formFilter(element) {
  return true;
 }

 it's funny but works! :-)


 Rushikesh Thakkar wrote:
 
  Kindly help.. I have not been able to solve it yet.
 
  -- Forwarded message --
  From: Rushikesh Thakkar [EMAIL PROTECTED]
  Date: Fri, Mar 7, 2008 at 3:40 PM
  Subject: Parameters: Invalid chunk ignored (parameters not passed)
  To: Struts Users Mailing List user@struts.apache.org
 
 
  I am facing a strange problem. When I use s:submit *theme=ajax
  targets=requestDiv* / I get the following error on the console:
 
  07.mar.2008 15:30:46
  org.apache.tomcat.util.http.ParametersprocessParameters
  WARNING: Parameters: Invalid chunk ignored.
  and the parameters are not passed properly (So, my Action fails), but
  after
  *removing* *theme=ajax targets=requestDiv*, it works fine.
 
  If I change the jsp back to s:submit theme=ajax targets=requestDiv
  /,
  then it starts working fine.
  Please can anybody tell me what is wrong with my application? Please
 help
  me, it is urgent.
 
 

 --
 View this message in context:
 http://www.nabble.com/Parameters%3A-Invalid-chunk-ignored-%28parameters-not-passed%29-tp15898111p16026129.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: Parameters: Invalid chunk ignored (parameters not passed)

2008-03-13 Thread Rushikesh Thakkar
Thanks Dave. Thats the one I am using, but I was referring to
http://struts.apache.org/2.x/docs/submit.html

Bierb, can you tell me what does your code do? I might get an idea..

Does anybody have an Idea of when this error is thrown?
07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters
WARNING: Parameters: Invalid chunk ignored.


On Thu, Mar 13, 2008 at 4:19 PM, Dave Newton [EMAIL PROTECTED] wrote:

 --- Rushikesh Thakkar [EMAIL PROTECTED] wrote:
  Thanks anyways, but can you tell me what does it do? I didn't find any
  property as 'formFilter' in the documentation given for s:submit / in
 the
  tag reference.

 http://struts.apache.org/2.0.11.1/docs/dojo-submit.html

 Dave

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




Re: Setting disable attribute dynamically

2008-03-13 Thread Rushikesh Thakkar
I have done it.. It goes like this:

(1) The Action:
public class PrepareScreen extends ActionSupport {

private String yesOrNo;

public String execute() throws Exception {
yesOrNo = true;
return SUCCESS;
}

public String getYesOrNo() {
return yesOrNo;
}
public void setYesOrNo(String yesOrNo) {
this.yesOrNo = yesOrNo;
}
}

(2) The JSP:

Is Struts2 good?: s:textfield name=choice readonly=%{yesOrNo}
value=Yes, it is../s:textfield

regards,
Rushikesh

On Thu, Mar 13, 2008 at 3:24 PM, Richard Sayre [EMAIL PROTECTED]
wrote:

 I made a slight error

 readonly=%{fullAccess} with s:textfield does not work but

 input type=text name=description id=description   s:if
 test=!fullAccessreadonly=true/s:if /

 works.

 On Thu, Mar 13, 2008 at 10:48 AM, Richard Sayre [EMAIL PROTECTED]
 wrote:
  If the disable attribute is present in a HTML tag it will be disable,
   no matter what the value of the attribute is.
 
   So if I have a s:select and I say disabled=false  it will be
   disabled (renders disabled=disabled).
 
   But if we have a text, and we set readonly=false it will not be
 editable.
 
   On my page my action determines my users access level - fullAccess
   (user can edit anything) or partialAccess (user can edit certian
   fields but see the other fields)
 
   I have a text field set up like this s:textfield
   readonly=%{fullAccess}.  which works fine.
 
   But s:select disabled=%{fullAccess} does not work.
 
   I tried this s:select s:if test=!fullAccessdisabled=true/sif
   /  But the s:if tag is causing a syntax error.
 
   The only solution I came up with was
 
s:if test=!fullAccess
   s:select disabed=true ...
   /s:if
   s:else
 s:select  ...
   /s:else
 
   So I have 2 s:selects  and s:radios for every radio/select
 
   I would prefer to have it like the textfields so I dont have to have 2
   pieces of code for each select and radio.
 
   I figured i could do an if around a script block at the bottom of
   the page and disable them with javascript but that might be a little
   confusing for future coders who have to work on this.
 
   Can anyone think of a good way to achieve this?
 
   Thanks,
 
   Rich
 

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




Re: Clearing Action properties from ValueStack

2008-03-11 Thread Rushikesh Thakkar
Thanks a lot for giving me proper direction.
I solved it by changing the bean scope from default 'singleton' to
'prototype' as suggested in the struts2-spring-jpa-ajax tutorial at
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html

Thanks again..
-Rushikesh

On Mon, Mar 10, 2008 at 6:37 PM, Othon Reyes Sanchez [EMAIL PROTECTED]
wrote:

 * - In 2.0+ isn't the default scope singleton?*
 Yes, the deafault scope is singleton (Only one instance for the class ).
 You can change the scope fo your beans to request or session but also you
 nedd to add some configuration to your web.xml.

 Are you using ModelDriven interface?.



 On Mon, Mar 10, 2008 at 11:29 AM, Dave Newton [EMAIL PROTECTED]
 wrote:

  --- Rushikesh Thakkar [EMAIL PROTECTED] wrote:
   Not doing much in the applicationContext.xml file:
  
   beans default-autowire=autodetect
   bean id=putMappArchiveObject
  
  class=no.bbs.webservice.mapp.client.web.action.PutArchiveObject
   /bean
   /beans
 
  - Is that an action definition?
  - What version of Spring?
  - In 2.0+ isn't the default scope singleton?
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Clearing Action properties from ValueStack

2008-03-10 Thread Rushikesh Thakkar
Hi Group,

Can anyone tell me how long is the value of Action Property held on the
ValueStack. I am asking this b'coz I am facing a problem:

Background:
My action has 4 members (and getter,setter for them). One of them is a POJO
with many properties. So my JSP has different fields for supplying values to
these properties (none of them is mandatory). Finally, I am printing the
values of these properties when I submit the form to Action.

*Actual Problem*:
At the time of re-submitting the form with different set of propeties, the
older property-values are still present. They show up in the sysouts. I have
also made sure to declare the members of the Action class using new operator
and no-argument constructor, but that too didn't help for this POJO.

Kindly help me out with this.

!-- Gentle Reminder: Still waiting for somebody to look at my previous
post. --


Re: Clearing Action properties from ValueStack

2008-03-10 Thread Rushikesh Thakkar
Yes, I am using Spring ObjectFactory.

On Mon, Mar 10, 2008 at 5:13 PM, Dave Newton [EMAIL PROTECTED] wrote:

 --- Rushikesh Thakkar [EMAIL PROTECTED] wrote:
  Can anyone tell me how long is the value of Action Property held on the
  ValueStack. I am asking this b'coz I am facing a problem:

 Normally an action is created for each request and pushed onto the stack.

 Without knowing more about how your application is configured it will be
 hard
 to say much more.

 Are you using Spring?

  *Actual Problem*:
  I have also made sure to declare the members of the
  Action class using new operator

 What does that mean exactly?

 Dave


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




Re: Clearing Action properties from ValueStack

2008-03-10 Thread Rushikesh Thakkar
sorry, missed out the second question:

I mean, I have instantiated Action properties while declaring them.

public class PutArchiveObject extends ActionSupport implements SessionAware
{

private Map session;
private Head head = *new Head();*
private String parentObjectRef *= new String();*
private IndexDTO index *= new IndexDTO();*
 ...
}

On Mon, Mar 10, 2008 at 5:25 PM, Rushikesh Thakkar 
[EMAIL PROTECTED] wrote:

 Yes, I am using Spring ObjectFactory.


 On Mon, Mar 10, 2008 at 5:13 PM, Dave Newton [EMAIL PROTECTED]
 wrote:

  --- Rushikesh Thakkar [EMAIL PROTECTED] wrote:
   Can anyone tell me how long is the value of Action Property held on
  the
   ValueStack. I am asking this b'coz I am facing a problem:
 
  Normally an action is created for each request and pushed onto the
  stack.
 
  Without knowing more about how your application is configured it will be
  hard
  to say much more.
 
  Are you using Spring?
 
   *Actual Problem*:
   I have also made sure to declare the members of the
   Action class using new operator
 
  What does that mean exactly?
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Clearing Action properties from ValueStack

2008-03-10 Thread Rushikesh Thakkar
Not doing much in the applicationContext.xml file:

beans default-autowire=autodetect
 !--  similar declarations --

bean id=putMappArchiveObject class=
no.bbs.webservice.mapp.client.web.action.PutArchiveObject
/bean

 !--  similar declarations --
/beans


On Mon, Mar 10, 2008 at 5:50 PM, Dave Newton [EMAIL PROTECTED] wrote:

 --- Rushikesh Thakkar [EMAIL PROTECTED] wrote:
  Yes, I am using Spring ObjectFactory.

 Okay.

 Are you configuring your actions in the Spring config file? If so,
 *please*
 include how they're being configured.

 Dave


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




Parameters: Invalid chunk ignored (parameters not passed)

2008-03-07 Thread Rushikesh Thakkar
I am facing a strange problem. When I use s:submit *theme=ajax
targets=requestDiv* / I get the following error on the console:

07.mar.2008 15:30:46 org.apache.tomcat.util.http.ParametersprocessParameters
WARNING: Parameters: Invalid chunk ignored.

and the parameters are not passed properly, but after removing *theme=ajax
targets=requestDiv* it works fine.

Adding to its strange nature, w/o restarting the server if I change the jsp
back to s:submit theme=ajax targets=requestDiv /, then it starts
working fine. Now, if I make any changes in the source code of action
classes, and redeploy the application, I get the same error again (no
parameters are submitted).

Please can anybody tell me what is wrong with my application? Please help
me, it is urgent.


Javascript Form-submission problem

2008-02-27 Thread Rushikesh Thakkar
The UI of my application is divided in 3 parts, which looks almost similar
to the UI of Eclipse IDE. The user selects operation from 'div' sitting on
the left, then the *upper right div* shows a request *form* and the div
sitting below it shows the result.

I need to submit the form to two different actions: one using submit button,
and the other on 'onChange' event of html 'select' element (to refresh the
form, i.e. to disable some input elements).

I am able to submit the form using this javascript code:
s:select ..  onchange=this.form.action='prepareUpdateScreen.action';
this.form.submit(); /. But the problem is: 'The result of this action is
displayed on entire browser', (I mean, it doesn't work like s:submit
theme=ajax targets=requestDiv/ and display the result in a div w-o
changing the UI).

I tried using s:a / for manually refreshing the screen instead of
javascript onChange code, but I didn't get any success yet.

Kindly help me.!!

regards,
Rushikesh


Re: Struts2 WebApp context

2008-02-14 Thread Rushikesh Thakkar
Thanks Ian and Laurie for looking into this.
Excuse me Laurie, for missing out an imp. info. that web.xml also contains
spring ContextLoaderListener declaration.

I now feel that it is more a spring / tomcat issue and not a really a
struts2 issue.
I observed the tomcat's console logs while it was shutting down. I could see
the info messages indicating that the spring context was being destroyed.
But when I 'reload' the context of the same web-app using Tomcat Manager
application, I don't see those info messages.

So, I guess I need to
   either change the way tomcat reloads the context (only if it's possible)
   or find out a way to reload spring context when Tomcat reloads the
web-app context.

Correct me if I'm wrong. Direct me if I'm right.. :)

- Rushikesh

On Wed, Feb 13, 2008 at 9:29 PM, Laurie Harper [EMAIL PROTECTED] wrote:

   (3) web.xml doesn't contain anything but struts2 filter declaration.

 If that's the case, how is Spring getting initialized? Usually you would
 configure one of Spring's context listeners, which will take care of
 loading the Spring context on startup and destroying it when the
 application is shut down / undeployed.

 As Ian indicated, you'll need *some* sort of context listener to close
 the Spring context (i.e. reverse whatever Spring setup logic you have),
 whether it be one of the ones supplied by Spring or your own.

 L.

 Rushikesh Thakkar wrote:
  I want to release a database connection while reloading the context
 (using
  Tomcat Manager web app) of a Struts2 Web Application. I am also using
 Spring
  and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and
 Apache
  Commons-dbcp with HSql standalone-database)
 
  As I am using HSql 'standalone' database, even if the web application
  context gets reloaded, the database connection is not released while
  destroying the context. So I get 'Database is already in use by other
  process' error. I want to know whether there is any way to implement
  something like destroy() method of servlet in a Struts2 application.
 
  I am not sure whether I can do it with spring configuration. Any idea?
 If
  there are many ways of doing it, kindly also tell which way is the best
 for
  me.
 
  (1) struts.properties:
 
  struts.objectFactory =
 org.apache.struts2.spring.StrutsSpringObjectFactory
 
  (2) applicationContext.xml (my spring configuration file)
 
  beans default-autowire=autodetect
 
  bean id=myDataSource class=
 org.apache.commons.dbcp.BasicDataSource
  destroy-method=close
  property name=driverClassName value=org.hsqldb.jdbcDriver
 /
  property name=url
  value=jdbc:hsqldb:file:C:/Projects/db/hsqlTest /
  property name=username value=sa/
  property name=password value=/
  /bean
  bean id=mySessionFactory class=
  org.springframework.orm.hibernate3.LocalSessionFactoryBean
  property name=dataSource ref=myDataSource/
  property name=mappingResources
  list
 
 
  valueno/bbs/webservice/client/config/model/certificate.hbm.xml/value
  /property
  property name=hibernateProperties
  props
  prop key=hibernate.dialect
  org.hibernate.dialect.HSQLDialect/prop
  prop key=hibernate.show_sqltrue/prop
  /props
  /property
  /bean
 
  bean id=hibernateTemplate class=
  org.springframework.orm.hibernate3.HibernateTemplate
  property name=sessionFactory
  ref bean=mySessionFactory/
  /property
  /bean
  bean id=testClientDao class=
  webservice.client.dao.hibernate.TestClientDAO
  property name=hibernateTemplate
  ref bean=hibernateTemplate/
  /property
  /bean
  !-- Some Strus2-Actions follow --
  /beans
 
  (3) web.xml doesn't contain anything but struts2 filter declaration.
 


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




Re: Struts2 WebApp context

2008-02-14 Thread Rushikesh Thakkar
Yea, I will do that.
But its still unsolved, so if anybody has got some solution, please
feel free to guide me.
Thank you..

On Thu, Feb 14, 2008 at 4:18 PM, Ian Roughley [EMAIL PROTECTED] wrote:
 This question will probably result in an answer / better solution if
  asked on the Spring forums.


  /Ian

  --
  Ian Roughley
  From Down  Around, Inc.
  Consulting * Training / Mentoring * Agile Process * Open Source
  web: http://www.fdar.com - email: [EMAIL PROTECTED]



  Rushikesh Thakkar wrote:


  Thanks Ian and Laurie for looking into this.
   Excuse me Laurie, for missing out an imp. info. that web.xml also contains
   spring ContextLoaderListener declaration.
  
   I now feel that it is more a spring / tomcat issue and not a really a
   struts2 issue.
   I observed the tomcat's console logs while it was shutting down. I could 
 see
   the info messages indicating that the spring context was being destroyed.
   But when I 'reload' the context of the same web-app using Tomcat Manager
   application, I don't see those info messages.
  
   So, I guess I need to
  either change the way tomcat reloads the context (only if it's possible)
  or find out a way to reload spring context when Tomcat reloads the
   web-app context.
  
   Correct me if I'm wrong. Direct me if I'm right.. :)
  
   - Rushikesh
  
   On Wed, Feb 13, 2008 at 9:29 PM, Laurie Harper [EMAIL PROTECTED] wrote:
  
  
 (3) web.xml doesn't contain anything but struts2 filter declaration.
  
   If that's the case, how is Spring getting initialized? Usually you would
   configure one of Spring's context listeners, which will take care of
   loading the Spring context on startup and destroying it when the
   application is shut down / undeployed.
  
   As Ian indicated, you'll need *some* sort of context listener to close
   the Spring context (i.e. reverse whatever Spring setup logic you have),
   whether it be one of the ones supplied by Spring or your own.
  
   L.
  
   Rushikesh Thakkar wrote:
  
   I want to release a database connection while reloading the context
  
   (using
  
   Tomcat Manager web app) of a Struts2 Web Application. I am also using
  
   Spring
  
   and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and
  
   Apache
  
   Commons-dbcp with HSql standalone-database)
  
   As I am using HSql 'standalone' database, even if the web application
   context gets reloaded, the database connection is not released while
   destroying the context. So I get 'Database is already in use by other
   process' error. I want to know whether there is any way to implement
   something like destroy() method of servlet in a Struts2 application.
  
   I am not sure whether I can do it with spring configuration. Any idea?
  
   If
  
   there are many ways of doing it, kindly also tell which way is the best
  
   for
  
   me.
  
   (1) struts.properties:
  
   struts.objectFactory =
  
   org.apache.struts2.spring.StrutsSpringObjectFactory
  
   (2) applicationContext.xml (my spring configuration file)
  
   beans default-autowire=autodetect
  
   bean id=myDataSource class=
  
   org.apache.commons.dbcp.BasicDataSource
  
   destroy-method=close
   property name=driverClassName value=org.hsqldb.jdbcDriver
  
   /
  
   property name=url
   value=jdbc:hsqldb:file:C:/Projects/db/hsqlTest /
   property name=username value=sa/
   property name=password value=/
   /bean
   bean id=mySessionFactory class=
   org.springframework.orm.hibernate3.LocalSessionFactoryBean
   property name=dataSource ref=myDataSource/
   property name=mappingResources
   list
  
  
  
valueno/bbs/webservice/client/config/model/certificate.hbm.xml/value
  
   /property
   property name=hibernateProperties
   props
   prop key=hibernate.dialect
   org.hibernate.dialect.HSQLDialect/prop
   prop key=hibernate.show_sqltrue/prop
   /props
   /property
   /bean
  
   bean id=hibernateTemplate class=
   org.springframework.orm.hibernate3.HibernateTemplate
   property name=sessionFactory
   ref bean=mySessionFactory/
   /property
   /bean
   bean id=testClientDao class=
   webservice.client.dao.hibernate.TestClientDAO
   property name=hibernateTemplate
   ref bean=hibernateTemplate/
   /property
   /bean
   !-- Some Strus2-Actions follow --
   /beans
  
   (3) web.xml doesn't contain anything but struts2 filter declaration.
  
  
   -
   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]



Struts2 WebApp context

2008-02-13 Thread Rushikesh Thakkar
I want to release a database connection while reloading the context (using
Tomcat Manager web app) of a Struts2 Web Application. I am also using Spring
and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and Apache
Commons-dbcp with HSql standalone-database)

As I am using HSql 'standalone' database, even if the web application
context gets reloaded, the database connection is not released while
destroying the context. So I get 'Database is already in use by other
process' error. I want to know whether there is any way to implement
something like destroy() method of servlet in a Struts2 application.

I am not sure whether I can do it with spring configuration. Any idea? If
there are many ways of doing it, kindly also tell which way is the best for
me.

(1) struts.properties:

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory

(2) applicationContext.xml (my spring configuration file)

beans default-autowire=autodetect

bean id=myDataSource class=org.apache.commons.dbcp.BasicDataSource
destroy-method=close
property name=driverClassName value=org.hsqldb.jdbcDriver /
property name=url
value=jdbc:hsqldb:file:C:/Projects/db/hsqlTest /
property name=username value=sa/
property name=password value=/
/bean
bean id=mySessionFactory class=
org.springframework.orm.hibernate3.LocalSessionFactoryBean
property name=dataSource ref=myDataSource/
property name=mappingResources
list

 valueno/bbs/webservice/client/config/model/certificate.hbm.xml/value
/property
property name=hibernateProperties
props
prop key=hibernate.dialect
org.hibernate.dialect.HSQLDialect/prop
prop key=hibernate.show_sqltrue/prop
/props
/property
/bean

bean id=hibernateTemplate class=
org.springframework.orm.hibernate3.HibernateTemplate
property name=sessionFactory
ref bean=mySessionFactory/
/property
/bean
bean id=testClientDao class=
webservice.client.dao.hibernate.TestClientDAO
property name=hibernateTemplate
ref bean=hibernateTemplate/
/property
/bean
!-- Some Strus2-Actions follow --
/beans

(3) web.xml doesn't contain anything but struts2 filter declaration.


Re: Populating dropdown

2008-02-11 Thread Rushikesh Thakkar
Better option would be: using *autocompleter* instead of select.

On Feb 11, 2008 3:01 PM, Jayaveeran [EMAIL PROTECTED] wrote:


 Hi all,

 I am populating a dropdown in my jsp which has more than 10,000 elements
 in
 it. Since the record size is very huge the time taken for the JSP to load
 is
 very high. I am using the folowing snippet to populate the dropdown. I am
 using struts framework. Is there any other way that I can populate the
 dropdown to make it faster ? Please help.


  html:select property ='id' name=Form
 onchange='%=fnDoCheck(+rowIndex.intValue()+)%' style=width:300px
  bean:define id =List property='id' name= Object/
  html:options collection=List labelProperty=value property=name/
   /html:select
 --
 View this message in context:
 http://www.nabble.com/Populating-dropdown-tp15412021p15412021.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]




[SOLVED] Re: How to iterate session variable

2008-02-11 Thread Rushikesh Thakkar
This code is just fine. I made a mistake in selecting session variable for
iteration. Kindly excuse me..

On Feb 11, 2008 1:50 PM, Rushikesh Thakkar [EMAIL PROTECTED]
wrote:

 Hi all,

 I am trying to iterate the a session variable of type HashMapString,
 List using the following code:

s:iterator value=#session.physicalArchives
s:property value=key /
s:property value=value/
/s:iterator

 It is not producing any markup. I have made sure that the variable is
 present in the session and has valid values within.
 Kindly help me..



How to iterate session variable

2008-02-11 Thread Rushikesh Thakkar
Hi all,

I am trying to iterate the a session variable of type HashMapString, List
using the following code:

   s:iterator value=#session.physicalArchives
   s:property value=key /
   s:property value=value/
   /s:iterator

It is not producing any markup. I have made sure that the variable is
present in the session and has valid values within.
Kindly help me..