The Apache Software Foundation Receives Approval for Sale to Oracle Corporation

2010-05-19 Thread aum strut
Hi All,

i am not sure is this a good place to ask about such question but since many
here are involved with Apache from so long

while browsing Apache community site i came across this blog post,though
this has been posted on April 1st but still not sure whats the truth??
can any one have better idea about this post
https://blogs.apache.org/foundation/entry/the_apache_software_foundation_receives


ClassNotFoundException

2010-05-19 Thread Tasneem Yusuf

Hello all,
 I am using version struts1.3 , tomcat 6 and jdk 1.5.I am using the 
eclipse IDE to develop my web app.The problem I 'm facing is when my web app 
makes a call to any of the action classes , I get a classnot found error. My 
classes are in the webapp/WEB-INF/classes/src/java folder. The package 
structure for my java source files is WEB-INF/src/java/*.java. Below is the 
web.xml and the struts-config.xml. Please can anyone help me in figuring out 
what is the problem,  Thanks 

My app's web.xml

?xml version=1.0 encoding=ISO-8859-1?
!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the License); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
   
 http://www.apache.org/licenses/LICENSE-2.0
   
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--

  !DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;

web-app
  display-nameStruts Blank Application/display-name
  
  !-- Standard Action Servlet Configuration --
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
load-on-startup0/load-on-startup
 /servlet


  !-- Standard Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping


  !-- The Usual Welcome File List --
  welcome-file-list
welcome-fileindex.jsp/welcome-file
  /welcome-file-list

/web-app



MY APPS STRUT-CONFIG.XML

?xml version=1.0 encoding=ISO-8859-1 ?
!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the License); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
   
 http://www.apache.org/licenses/LICENSE-2.0
   
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.3//EN
  http://struts.apache.org/dtds/struts-config_1_3.dtd;



struts-config


!-- = Global Exception Definitions --

global-exceptions
!-- sample exception handler
exception
key=expired.password
type=app.ExpiredPasswordException
path=/changePassword.jsp/
end sample --
/global-exceptions


!-- === Global Forward Definitions --

global-forwards
!-- Default forward to Welcome action --
!-- Demonstrates using index.jsp to forward --
forward
name=welcome
path=/Welcome.do/
/global-forwards


!-- === Action Mapping Definitions --

action-mappings

action
path=/WelcomeAction
type=src.java.WelcomeAction
forward=/pages/Welcome.jsp
/
/action-mappings


!--  Message Resources Definitions --

message-resources parameter=MessageResources /



/struts-config



Re: Interceptor stack

2010-05-19 Thread Paweł Wielgus
Hi,
try to follow this example:

http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html

Best greetings,
Paweł Wielgus.


2010/5/18 RogerV roger.var...@googlemail.com:

 Ok - I'm having a bad start to the day and this is driving me nuts. I'm using
 the Convention plugin, and below I've attached a copy of my struts.xml. As
 you can see I've got two custom interceptors which I'm adding to a copy of
 the param-prepare-param stack.

 Through logging I can see that my two custome interceptors are being
 initialized (their constructors are being called) but thereafter neither of
 the interceptors intercept() method is being invoked.

 Using the config-browser plugin I see that my custom interceptors are *not*
 in the stack for the default, admin or diagnostic namespaces. Further none
 of the namespaces are using the param-prepare-param stack the first
 Parameter interceptor is missing as well. It looks like I'm using the
 bog-standard struts-default stack.

 What on arth have I missed?

 Regards

 struts
    constant name=struts.enable.DynamicMethodInvocation value=true /
    constant name=struts.devMode value=true /
    constant name=struts.objectFactory
 value=org.apache.struts2.spring.StrutsSpringObjectFactory /

        package name=default extends=struts-default
                interceptors
                    interceptor name=redirectMessage
 class=com.blackbox.genesis.interceptors.RedirectMessageInterceptor/
                        interceptor name=connectionStoreMonitor
 class=com.blackbox.genesis.interceptors.ConnectionStoreMonitorInterceptor/
          interceptor-stack name=secureStack
                interceptor-ref name=redirectMessage/
                interceptor-ref name=exception/
                interceptor-ref name=connectionStoreMonitor/
                interceptor-ref name=alias/
                interceptor-ref name=params/
                interceptor-ref name=servletConfig/
                interceptor-ref name=i18n/
                interceptor-ref name=prepare/
                interceptor-ref name=chain/
                interceptor-ref name=debugging/
                interceptor-ref name=scopedModelDriven/
                interceptor-ref name=modelDriven/
                interceptor-ref name=fileUpload/
                interceptor-ref name=checkbox/
                interceptor-ref name=multiselect/
                interceptor-ref name=staticParams/
                interceptor-ref name=actionMappingParams/
                interceptor-ref name=params
                  dojo\..*,^struts\..*
                /interceptor-ref
                interceptor-ref name=conversionError/
                interceptor-ref name=validation
                    input,back,cancel,browse
                /interceptor-ref
                interceptor-ref name=workflow
                    input,back,cancel,browse
                /interceptor-ref
            /interceptor-stack
            /interceptors


         default-interceptor-ref name=secureStack/


    /package

    !-- Add packages here --
        package name=admin namespace=/admin extends=default/
        package name=diagnostics  extends=default/
 /struts
 --
 View this message in context: 
 http://old.nabble.com/Interceptor-stack-tp28592300p28592300.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



Re: The Apache Software Foundation Receives Approval for Sale to Oracle Corporation

2010-05-19 Thread Manos Batsis

On 05/19/2010 09:31 AM, aum strut wrote:

Hi All,

i am not sure is this a good place to ask about such question but since many
here are involved with Apache from so long

while browsing Apache community site i came across this blog post,though
this has been posted on April 1st but still not sure whats the truth??
can any one have better idea about this post
https://blogs.apache.org/foundation/entry/the_apache_software_foundation_receives



The post has a date of April 1st. It's just an April fool's joke.

Cheers,

Manos

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



Re: The Apache Software Foundation Receives Approval for Sale to Oracle Corporation

2010-05-19 Thread aum strut
Manos i have alreay mentioed this in my post...
but since it was on community site so i prefer to confirm it...

On Wed, May 19, 2010 at 12:49 PM, Manos Batsis
manos_li...@geekologue.comwrote:

 On 05/19/2010 09:31 AM, aum strut wrote:

 Hi All,

 i am not sure is this a good place to ask about such question but since
 many
 here are involved with Apache from so long

 while browsing Apache community site i came across this blog post,though
 this has been posted on April 1st but still not sure whats the truth??
 can any one have better idea about this post

 https://blogs.apache.org/foundation/entry/the_apache_software_foundation_receives


 The post has a date of April 1st. It's just an April fool's joke.

 Cheers,

 Manos

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




Quartz and Struts

2010-05-19 Thread Søren Blidorf
Hi.

 

I am trying to implement Quartz to my exsiting Struts 1.x app

 

I am using the following as guide:
http://onjava.com/pub/a/onjava/2006/03/01/job-scheduling-in-web-application.
html

 

But I cannot get it to work.

 

I altered the struts-config:

  plug-in className=SchedulerPlugIn
 set-property property=startOnLoad value=false /
 set-property property=startupDelay value=0 /

  /plug-in

 

and altered the web-xml:

servlet
 
 servlet-nameQuartzInitializer/servlet-name
 display-nameQuartz Initializer Servlet/display-name
 
  servlet-class
org.quartz.ee.servlet.QuartzInitializerServlet
  /servlet-class
  load-on-startup1/load-on-startup
  init-param
param-nameshutdown-on-unload/param-name
param-valuetrue/param-value
  /init-param
 
  init-param
param-namestart-scheduler-on-load/param-name
param-valuefalse/param-value
/init-param
 

 /servlet

 

And now I am trying to get the HelloWorld to work. I get stopped at “extends
Job”

 

Can anybody help???

 

Soren

 



Re: Interceptor stack

2010-05-19 Thread RogerV



Paweł Wielgus wrote:
 
 Hi,
 try to follow this example:
 
 http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
 

I was using config-browser - that's how I knew the interceptor stack didn't
contain my custom interceptors. In the end, I've solved it - I needed the
@ParentPackage annotation on my actions and then my stack was the one that
was being used.

Regards
-- 
View this message in context: 
http://old.nabble.com/Interceptor-stack-tp28592300p28605946.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



Forms with Multiple Submit buttons (Bug or Expected?)

2010-05-19 Thread RogerV

For a long while I've been building forms along the lines of

s:form
..
s:submit id=submit type=button label=Continue action=processForm/
s:submit id=cancel type=button label=Cancel
action=goSomewhereElseWithoutSubmittingTheForm/

which has worked well. Until today. Today I needed to prevent a double
submit on a form so I chose the quick way by creating a javascript onsubmit
handler to cancel the button after the first click and referenced it in the
s:form onsubmit handler

script type=text/javascript
var formsubmitted=false;
function preventDoubleSubmit() {
if (formsubmitted) {
return false;
}
var submitButton = document.getElementById('submit');
submitButton.disabled=true;
formsubmitted=true;
return true;
}
/script

On clicking the submit button, the javascript disabled the button but the
performAction was never called and the form was redisplayed. So I tried
again, moving the javascript to the submit buttons onclick attribute. Same
thing. Looking at the POST through Firebug I see that without any javascript
handlers it looks like;

form dataaction%3performAction=Submit

and with the javascript handlers

form data i.e the Struts action information is not being attached.

Is this expected or a bug? Am I handling multiple submit buttons in the
wrong way?

Regards

-- 
View this message in context: 
http://old.nabble.com/Forms-with-Multiple-Submit-buttons-%28Bug-or-Expected-%29-tp28606047p28606047.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: Interator values not showed

2010-05-19 Thread Alex Rodriguez Lopez


Hi,
i'm trying the append tag and the list values of the appended lists are not
showed.
This is the main part of the jsp code:

s:append var=metalBands
s:param value=%{groups}/
s:param value=%{groups1}/
  /s:append
  Total Bands:br
  s:iterator id=band value=%{#metalBands}
Band:s:property value=#band.name/br
  /s:iterator


This is my Action class:

package struts2.action;

import java.util.ArrayList;

import com.opensymphony.xwork2.ActionSupport;

public class IteratorAction extends ActionSupport {
ArrayListBand  groups=new ArrayListBand();
ArrayListBand  groups1=new ArrayListBand();

public String greeting(){
return Hi, Every body;
}

@Override
public String execute() throws Exception {
this.groups.add(new Band(trash,Slayer));
this.groups.add(new Band(trash,kreator));
this.groups.add(new Band(death,Deicide));
this.groups.add(new Band(death,Obituary));
this.groups1.add(new Band(heavy,Judas Priest));
this.groups1.add(new Band(heavy,Primal Fear));
return SUCCESS;
}

public ArrayListBand  getGroups() {
return groups;
}

public void setGroups(ArrayListBand  groups) {
this.groups = groups;
}

public ArrayListBand  getGroups1() {
return groups1;
}

public void setGroups1(ArrayListBand  groups1) {
this.groups1 = groups1;
}   
}

This is my bean class:

package struts2.action;

public class Band {
private String style;
private String name;

public Band(String st,String n){
this.style=st;
this.name=n;
}

public String getStyle() {
return style;
}

public void setStyle(String style) {
this.style = style;
}

This is the ouput application:

Total Bands:
Band:
Band:
Band:
Band:
Band:
Band:

As you can see there is no values showed .
Please, can you help me with this?.

Thanks in advanced!!.


I think you need a public getter for band.name:

public String getName() {
return name;
}

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



Re: Interator values not showed

2010-05-19 Thread slayer666



slayer666 wrote:
 
 Hi,
 i'm trying the append tag and the list values of the appended lists are
 not showed.
 This is the main part of the jsp code:
 
 s:append var=metalBands
s:param value=%{groups}/
s:param value=%{groups1}/
  /s:append
  Total Bands:br
  s:iterator id=band value=%{#metalBands}
Band: s:property value=#band.name/br
  /s:iterator
 
 
 This is my Action class:
 
 package struts2.action;
 
 import java.util.ArrayList;
 
 import com.opensymphony.xwork2.ActionSupport;
 
 public class IteratorAction extends ActionSupport {
   ArrayListBand groups=new ArrayListBand();
   ArrayListBand groups1=new ArrayListBand();
   
   public String greeting(){
   return Hi, Every body;
   }
   
   @Override
   public String execute() throws Exception {
   this.groups.add(new Band(trash,Slayer));
   this.groups.add(new Band(trash,kreator));
   this.groups.add(new Band(death,Deicide));
   this.groups.add(new Band(death,Obituary));
   this.groups1.add(new Band(heavy,Judas Priest));
   this.groups1.add(new Band(heavy,Primal Fear));
   return SUCCESS;
   }
 
   public ArrayListBand getGroups() {
   return groups;
   }
 
   public void setGroups(ArrayListBand groups) {
   this.groups = groups;
   }
 
   public ArrayListBand getGroups1() {
   return groups1;
   }
 
   public void setGroups1(ArrayListBand groups1) {
   this.groups1 = groups1;
   }   
 }
 
 This is my bean class:
 
 package struts2.action;
 
 public class Band {
   private String style;
   private String name;
   
   public Band(String st,String n){
   this.style=st;
   this.name=n;
   }
 
   public String getStyle() {
   return style;
   }
 
   public void setStyle(String style) {
   this.style = style;
   }
 
 This is the ouput application:
 
 Total Bands:
 Band: 
 Band: 
 Band: 
 Band: 
 Band: 
 Band: 
 
 As you can see there is no values showed .
 Please, can you help me with this?.
 
 Thanks in advanced!!.
 

-- 
View this message in context: 
http://old.nabble.com/Interator-values-not-showed-tp28599699p28606214.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: Interator values not showed

2010-05-19 Thread slayer666

Thanks Alex,
but i've solved the problem. 
This is my Action class:

public class IteratorAction extends ActionSupport implements ModelDriven{
private ArrayListBand groups=new ArrayListBand();
private ArrayListBand groups1=new ArrayListBand();
private Band band=new Band(,);

public String greeting(){
return Hi, Every body;
}

@Override
public Object getModel() {
// TODO Auto-generated method stub
return null;
}


@Override
public String execute() throws Exception {
this.groups.add(new Band(trash,Slayer));
this.groups.add(new Band(trash,kreator));
this.groups.add(new Band(death,Deicide));
this.groups.add(new Band(death,Obituary));
this.groups1.add(new Band(heavy,Judas Priest));
this.groups1.add(new Band(heavy,Primal Fear));
return SUCCESS;
}

public ArrayListBand getGroups() {
return groups;
}

public void setGroups(ArrayListBand groups) {
this.groups = groups;
}

public ArrayListBand getGroups1() {
return groups1;
}

public void setGroups1(ArrayListBand groups1) {
this.groups1 = groups1;
}

public Band getBand() {
return band;
}

public void setBand(Band band) {
this.band = band;
}   
}

And this is my jsp code:

 s:append var=metalBands
   s:param value=%{groups}/
   s:param value=%{groups1}/
 /s:append
 Total Bands:br
 s:iterator id=band value=#metalBands
   Band: s:property value=name/br
 /s:iterator

Finally i used the ModelDriven interface to get the bean atributes in a
better way.

Thanks for replying.

Cheers!!.


Alex Rodriguez Lopez wrote:
 

 Hi,
 i'm trying the append tag and the list values of the appended lists are
 not
 showed.
 This is the main part of the jsp code:

 s:append var=metalBands
 s:param value=%{groups}/
 s:param value=%{groups1}/
   /s:append
   Total Bands:br
   s:iterator id=band value=%{#metalBands}
 Band:s:property value=#band.name/br
   /s:iterator


 This is my Action class:

 package struts2.action;

 import java.util.ArrayList;

 import com.opensymphony.xwork2.ActionSupport;

 public class IteratorAction extends ActionSupport {
  ArrayListBand  groups=new ArrayListBand();
  ArrayListBand  groups1=new ArrayListBand();
  
  public String greeting(){
  return Hi, Every body;
  }
  
  @Override
  public String execute() throws Exception {
  this.groups.add(new Band(trash,Slayer));
  this.groups.add(new Band(trash,kreator));
  this.groups.add(new Band(death,Deicide));
  this.groups.add(new Band(death,Obituary));
  this.groups1.add(new Band(heavy,Judas Priest));
  this.groups1.add(new Band(heavy,Primal Fear));
  return SUCCESS;
  }

  public ArrayListBand  getGroups() {
  return groups;
  }

  public void setGroups(ArrayListBand  groups) {
  this.groups = groups;
  }

  public ArrayListBand  getGroups1() {
  return groups1;
  }

  public void setGroups1(ArrayListBand  groups1) {
  this.groups1 = groups1;
  }   
 }

 This is my bean class:

 package struts2.action;

 public class Band {
  private String style;
  private String name;
  
  public Band(String st,String n){
  this.style=st;
  this.name=n;
  }

  public String getStyle() {
  return style;
  }

  public void setStyle(String style) {
  this.style = style;
  }

 This is the ouput application:

 Total Bands:
 Band:
 Band:
 Band:
 Band:
 Band:
 Band:

 As you can see there is no values showed .
 Please, can you help me with this?.

 Thanks in advanced!!.
 
 I think you need a public getter for band.name:
 
 public String getName() {
   return name;
 }
 
 -
 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://old.nabble.com/Interator-values-not-showed-tp28599699p28606255.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: Interceptor order

2010-05-19 Thread RogerV



Andy Law wrote:
 
 pFollowing on from my previous question
 (http://old.nabble.com/Some-Spring-Struts-questions-td28533505.html) about
 injecting objects orthogonal to actions into the environment where jsps
 can see them, I now have an interceptor that does what I want it do
 (Yay! - thanks guys).
 /pp
 However, I'm seeing some peculiar behaviour that I don't understand fully.
 /pp
 The pertinent code in the interceptor is reproduced below. It does what I
 expect it to do insofar as it sticks my Stuff object in a place that the
 JSP can retrieve it using the MAGIC_KEY string. However, if I configure my
 interceptor stack with this interceptor at the top, none of the other
 interceptors appear to fire. If I put this interceptor last in the stack,
 all of the others do seem to fire (well, the application works). Why
 should I need to put this after all the params-prepare-params stuff?
 /pp
 pre
 code
 public String intercept(ActionInvocation invocation) throws
 Exception {
 
 if (this.getStuff() != null) {
 ActionContext ic = invocation.getInvocationContext();
 if (ic != null) {
 ValueStack vs = ic.getValueStack();
 if (vs != null) {
 vs.set(MAGIC_KEY, this.getStuff());
 }
 }
 }
 return invocation.invoke();
 }
 /code
 /pre
 /p
 pAs always, any and all help/pointers gratefully accepted, particularly
 if I'm doing something stupid!/p
 pLater/p
 pAndy/p
 
 

First of all, I'd load the config-browser plugin and check that the
interceptor stack your action is using is actually the stack that you think
it is. (BTDTGTTS)

Secondly, I've never tried to poke the ValueStack directly, I've always used
Interceptors to load objects into my actions and then retrieved them from
there with the standard struts tags. What happens if you take all your
processing out leaving just return invocation.invoke() - does your stack
still fire?

Regards
-- 
View this message in context: 
http://old.nabble.com/Interceptor-order-tp28597967p28607337.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: Forms with Multiple Submit buttons (Bug or Expected?)

2010-05-19 Thread Denis Cabasson
Why not doing that on the server side, using the s:token approach? That 
would prevent double submit on the server side.
On the client side, I would say that your disabling the button before 
the form is submitted (the onsubmit technically happens before the 
submit, so that you can uypdate some value before the submit of the form 
actually happens) prevents the value of this button to be sent to the 
server (which makes sense, since it's disabled). I would recommend not 
disabling the button (as the formsubmitted var will be enough to prevent 
a re-submission). If you really want to disable your button, consider a 
timer that would do so 200ms after, leaving time for the form to be 
submitted *with* the value of this button.


Denis.

Le 2010-05-19 05:41, RogerV a écrit :

For a long while I've been building forms along the lines of

s:form
..
s:submit id=submit type=button label=Continue action=processForm/
s:submit id=cancel type=button label=Cancel
action=goSomewhereElseWithoutSubmittingTheForm/

which has worked well. Until today. Today I needed to prevent a double
submit on a form so I chose the quick way by creating a javascript onsubmit
handler to cancel the button after the first click and referenced it in the
s:form onsubmit handler

script type=text/javascript
var formsubmitted=false;
function preventDoubleSubmit() {
if (formsubmitted) {
return false;
}
var submitButton = document.getElementById('submit');
submitButton.disabled=true;
formsubmitted=true;
 return true;
}
/script

On clicking the submit button, the javascript disabled the button but the
performAction was never called and the form was redisplayed. So I tried
again, moving the javascript to the submit buttons onclick attribute. Same
thing. Looking at the POST through Firebug I see that without any javascript
handlers it looks like;

form dataaction%3performAction=Submit

and with the javascript handlers

form data  i.e the Struts action information is not being attached.

Is this expected or a bug? Am I handling multiple submit buttons in the
wrong way?

Regards

   



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



Re: Forms with Multiple Submit buttons (Bug or Expected?)

2010-05-19 Thread RogerV



dcabasson wrote:
 
 Why not doing that on the server side, using the s:token approach? That 
 would prevent double submit on the server side.
 

I thought about it. Googling for info showed support for both methods. I
took the javascript approach
because (a) it looked easier and (b) if using the TokenInterceptor is the
standard/recommended approach, I would've expected it to be in the default
stack.


dcabasson wrote:
 
 On the client side, I would say that your disabling the button before 
 the form is submitted (the onsubmit technically happens before the 
 submit, so that you can uypdate some value before the submit of the form 
 actually happens) prevents the value of this button to be sent to the 
 server (which makes sense, since it's disabled). 
 

Ahh .. yes that makes sense. Obvious now that you've explained it!

Thanks
-- 
View this message in context: 
http://old.nabble.com/Forms-with-Multiple-Submit-buttons-%28Bug-or-Expected-%29-tp28606047p28607804.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: Interceptor stack

2010-05-19 Thread Martin Gainty

this is good news roger

//assume i have this ParentPackage annotation declaration

package org.apache.struts2.convention.actions.parentpackage;
import org.apache.struts2.convention.annotation.ParentPackage;
/**
 * p
 * This is a parent package usage action.
 * /p
 */
@ParentPackage(class-level)
public class ClassLevelParentPackageAction {
public String execute() {
return null;
}
}
//and here is testResultPath method which tests class-level assignment
public void testResultPath() throws Exception {
ServletContext context = mockServletContext(/class-level);
// Test with a result path
PackageConfig packageConfig = createPackageConfigBuilder(/namespace); 

this.conventionsService = new ConventionsServiceImpl(/not-used);
DefaultResultMapBuilder builder = new DefaultResultMapBuilder(context, 
container, dispatcher,velocity,freemarker);
MapString, ResultConfig results = 
builder.build(ClassLevelResultPathAction.class, null, action, packageConfig);

//the association between annotation value 'class-level', package and namespace 
are clear
verify(context, /class-level, results, false);
}

//i notice this assignment in struts-plugin.xml for 
struts.convention.default.parent.package specifies convention-default
  constant name=struts.convention.default.parent.package 
value=convention-default/
//where convention-default is resolved as extending struts-default
  package name=convention-default extends=struts-default

//i also notice if i specify ParentPackage package-level value i could resolve 
to a specific package of org.apache.struts2.convention.actions.parentpackage
@org.apache.struts2.convention.annotation.ParentPackage(package-level)
package org.apache.struts2.convention.actions.parentpackage;

//the question is which namespace is assigned for any value for ParentPackage
//ParentPackage(class-level) namespace?
//ParentPackage(package-level) namespace?
//ParentPackage(convention-default) namespace?

Thanks!
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Wed, 19 May 2010 02:30:31 -0700
 From: roger.var...@googlemail.com
 To: user@struts.apache.org
 Subject: Re: Interceptor stack
 
 
 
 
 Paweł Wielgus wrote:
  
  Hi,
  try to follow this example:
  
  http://poulwiel.blogspot.com/2009/09/config-browser-plugin-in-struts2.html
  
 
 I was using config-browser - that's how I knew the interceptor stack didn't
 contain my custom interceptors. In the end, I've solved it - I needed the
 @ParentPackage annotation on my actions and then my stack was the one that
 was being used.
 
 Regards
 -- 
 View this message in context: 
 http://old.nabble.com/Interceptor-stack-tp28592300p28605946.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
 
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

Re: Session object null

2010-05-19 Thread Dale Newfield

On 5/18/10 6:55 PM, Ken wrote:

The problem has been resolved with what you said...


Glad to hear it.


However I'll fill you as I am new and looking for best practise.


I can offer my advice, but I don't have the hubris to claim that's 
necessarily what others would agree to as best practice. :-)



Most requests are DB queries, via Hibernate.  There is a Hibernate
configuration file that needs to be loaded that specifies connection
parameters and the tables to include.  In our system there are many
databases, one for each company (some are holding companies)...  So
there are a number of configuration files, depending on the log-on
credentials a different database is loaded (some users may be able to
select which one they are working with)... The processing is more less
consistent, the databases hold different accounting information for the
particular company. Anyways this configuration object and/or the
resulting SessionFactory (Hibernate connection sessions not Struts2)
aught to be in session scope.  Currently these objects are only stored
in memory and obtained with new in the request cycle.

So to think about it I'm currently creating a hibernate SessionFactory
EVERY request from credentials supplied by the log in form and then
throwing it away... well I'm going to change that.  So it isn't an
issue... but knowing what I'm doing any advice on how you'd do it?


Just to confirm--you have a single database that contains the login 
info, and based on info there other data will come from different 
databases?  I almost went a similar route on a project but decided the 
headaches weren't worth it, so I've got entirely separate deployments 
for each end application (and that's OK for me -- sounds like your 
requirements require another solution).


This sounds like it would best fit in an interceptor, probably before 
params (or if you use params prepare params between the first params 
and the prepare) so that by the time you get to prepare (and at least 
the last params) you've already got a connection to the correct DB so 
you can store incoming fields directly in the model object.  Depending 
on the tradeoff between the cost to construct this SessionFactory and 
the size/resources required to store it in the session between requests 
you can either have this interceptor create it anew each request or 
cache it in the session, only creating it if necessary.



There is nothing fancy, just the struts mapping file and actions with
the default stack.  And for view jsp's templated with tiles.  I've only
just started but I have to say everything has been far easier than
expected... So I'm really enjoying Struts2.


Glad to hear it!


Do you use Spring? I've heard great things about it.


For dependency injection, for example, it is quite nice.

I used appfuse to jump-start most struts2 apps I've built, so the 
configuration headaches are minimized...but you've already figured out 
the hard parts of your particular DB situation, so that shouldn't be too 
bad...


-Dale

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



Re: Online docs messed up

2010-05-19 Thread hernan gonzalez
Still broken.

On Mon, May 17, 2010 at 12:39 PM, Lukasz Lenart
lukasz.len...@googlemail.com wrote:
 2010/5/14 nuwan chandrasoma mymail...@gmail.com:
 I also noticed that, i think the wiki .css is messed up,

 It's because of new Confluence and auto export plugin :-(
 I can restore the previous version of the css file but it looks like
 everyday a new export is generated :P


 Regards
 --
 Łukasz
 http://www.lenart.org.pl/
 Kapituła Javarsovia 2010
 http://javarsovia.pl

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





-- 
Hernán J. González
http://hjg.com.ar/

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