Re: [OT] Need suggestion about designing web application

2007-09-27 Thread Antonio Petrelli
2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> Hi
> We a to develop a web application which we want to be able to deploy on any
> J2EE compatiable application server.
> We would create a war file for deployment, but there is a issue with
> database connection,
> We do not know the JNDI name,
> So we thought we would put xml file under WEB-INF folder, and after
> deploying the application, modify the JNDI name in this XML and restart the
> application,
> Is this a good way of doing it, since BEA recommends not to modify any thing
> after deploying the application,
> We would be giving this war file to more then one deployment, and we do not
> want to maintain different war files one for each deployment, but just have
> one far which we can use for deployment in all servers.

IMHO, you have to decide (and not change) your data source JNDI name,
and then configure it in the container.

Antonio

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



Re: [OT] Need suggestion about designing web application

2007-09-27 Thread Nils-Helge Garli
As Antonio said, _you_ as the application developer/assembler decide
the local JNDI name of the data source. Then it's the task of the
deployer to link this local defined JNDI name to an actual JNDI
resource in the container.

Nils-H

On 9/27/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> 2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> > Hi
> > We a to develop a web application which we want to be able to deploy on any
> > J2EE compatiable application server.
> > We would create a war file for deployment, but there is a issue with
> > database connection,
> > We do not know the JNDI name,
> > So we thought we would put xml file under WEB-INF folder, and after
> > deploying the application, modify the JNDI name in this XML and restart the
> > application,
> > Is this a good way of doing it, since BEA recommends not to modify any thing
> > after deploying the application,
> > We would be giving this war file to more then one deployment, and we do not
> > want to maintain different war files one for each deployment, but just have
> > one far which we can use for deployment in all servers.
>
> IMHO, you have to decide (and not change) your data source JNDI name,
> and then configure it in the container.
>
> Antonio
>
> -
> 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 defaults to "struts.url.includeParams=get" why??...

2007-09-27 Thread Giovanni Azua

Hi all,

I don't understand why the parameter "struts.url.includeParams" would 
default to "get" rather than "none".


Its default value already gave me quite some headaches see:
http://code.google.com/p/tabletags/issues/detail?id=11
http://code.google.com/p/tabletags/issues/detail?id=12

regards,
Giovanni

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



[s2]struts-2-spring-2-jpa-ajax tutorial

2007-09-27 Thread Eugen Stoianovici
I've started learning struts based on this tutorial which (from my 
limited experience) is a good starting point.
There's on problem for me though. It gets frustrating implementing all 
my persistence related calls in a "service" class. Is there a way to 
instantiate my action classes with an EntityManager, so that i can 
perform simple persistence related jobs directly in my actions? ... Is 
this a "violation" of struts framework concepts?


Thanks

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



If Tag: testing for an enumerated value

2007-09-27 Thread setecastronomy

Somewhere I have the following enumeration
public enum Interval {
GENERIC,
MONTH,
YEAR;
}

The action has the following method:

public Interval getInterval() {return iInterval;}

I supposed I could test the enumerated value inside my jsp in the following
way:


 anno 


but it doesn't work.

The only solution I found was to to insert a 

boolean  isYear() 

method inside the action combined with a 



Can you suggest a better way?

Thanks 
Filippo
-- 
View this message in context: 
http://www.nabble.com/If-Tag%3A-testing-for-an-enumerated-value-tf4527832.html#a12919403
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: [S2] Iterator Tag and Status Count

2007-09-27 Thread Hoying, Ken
Thank you for clearing this up.  I had checked the JavaDoc before making
the post, as well, and as you report it is a bit thin.  Never occurred
to me that it was a 1 based index.  I have never seen that before.  I
guess someone thought it useful rather than just doing the math if
needed.

Thanks to all who responded!

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 26, 2007 4:37 PM
To: Struts Users Mailing List
Subject: Re: [S2] Iterator Tag and Status Count

I think count is a one based position in the iteration where as index is
zero based.  But there is almost no information in the documentation.
The tag library documentation simply says that a InteratorStatus is
pushed on the Value Stack.  And the JavaDocs for IteratorStatus has one
line of "useful" information:

"The iterator tag can export an IteratorStatus object so that one can
get information about the status of the iteration, such as the size,
current index, and whether any more items are available."

Which, since there is no size information in the IteratorStatus, could
be interpreted that the "count" represents the size.  It's too bad there
is no JavaDoc information on the methods, since that could easily clear
up the confusion.
  (*Chris*)

On 9/26/07, Hoying, Ken <[EMAIL PROTECTED]> wrote:
> I believe that I have come across a bug in the iterator tag.  It 
> appears that the count value for the status object is returning (index

> + 1) rather than the size of the collection being iterated over.
>
> Has anyone else seen this behavior?
> Is this the correct behavior and I am just not interepreting its usage

> correctly?
>
> Thank you!
> Ken
>
>
>
> -
> ***Note:The information contained in this message may be privileged 
> and confidential and protected from disclosure. If the reader of this 
> message is not the intended recipient, or an employee or agent 
> responsible for delivering this message to the intended recipient, you

> are hereby notified that any dissemination, distribution or copying of

> this communication is strictly prohibited. If you have received this 
> communication in error, please notify the Sender immediately by 
> replying to the message and deleting it from your computer. Thank you.

> Premier Inc.

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



listen/notify Topics doubt

2007-09-27 Thread Pablo Vázquez Blázquez

Hi all!

I have a simple question:

When a div tag contains the "listenTopics" attribute, the associated 
href is executed *Before and After* the action associated to the tag 
which invokes the notifyTopics??


  listenTopics="/refreshTree" executeScripts="true" 
loadingText=" "/>


   
   ...  
   
   targets="workspaceAjaxContent" executeScripts="true"
   loadingText=" " cssClass="submit">
   
   
   
   
   

When I submit the form it invokes the action form and i have 2 threads 
invoking "refreshTreeUrl"... I would like to first invoke the action 
form, and then, notifyTopics. Is it possible??


Thanks.


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



RE: If Tag: testing for an enumerated value

2007-09-27 Thread Wesley Wannemacher
Try - 

 
  anno 
 

> -Original Message-
> From: setecastronomy [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 27, 2007 7:35 AM
> To: user@struts.apache.org
> Subject: If Tag: testing for an enumerated value
> 
> 
> Somewhere I have the following enumeration public enum Interval {
> GENERIC,
> MONTH,
> YEAR;
> }
> 
> The action has the following method:
> 
> public Interval getInterval() {return iInterval;}
> 
> I supposed I could test the enumerated value inside my jsp in 
> the following
> way:
> 
> 
>  anno 
> 
> 
> but it doesn't work.
> 
> The only solution I found was to to insert a 
> 
> boolean  isYear() 
> 
> method inside the action combined with a 
> 
> 
> 
> Can you suggest a better way?
> 
> Thanks
> Filippo
> --
> View this message in context: 
> http://www.nabble.com/If-Tag%3A-testing-for-an-enumerated-valu
> e-tf4527832.html#a12919403
> 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: [S2] Iterator Tag and Status Count

2007-09-27 Thread Dave Newton
--- "Hoying, Ken" <[EMAIL PROTECTED]> wrote:
> Never occurred to me that it was a 1 based index.

It's not, although the difference is semantic.

"index" is the index. "count" is the number of
iteration you're currently on; you'll never be in the
zeroth iteration because the iteration starts
immediately after the  start tag.

I didn't see that anybody had opened an issue yet, so
I opened
https://issues.apache.org/struts/browse/WW-2216.

d.


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



RE: listen/notify Topics doubt

2007-09-27 Thread Manu Mahajan
Hi

If you want to handle the before and after topics separately you can do
something like this. Note I am publishing a separate topic for the form
(submitForm) and then handling it using some javascript code





...  








dojo.event.topic.subscribe("/submitForm", function(data, type, e){
   if (type=="before"){
//do something before the form is submitted
   }
   if (type=="load")
   {
//do something after the form is submitted
//you can publish the refreshTree topic here
dojo.event.topic.publish("/refreshTree");
   }
   });


Now your tree will only be refreshed once... 

Manu

-Original Message-
From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 27, 2007 5:38 PM
To: Struts Users Mailing List
Subject: listen/notify Topics doubt

Hi all!

I have a simple question:

When a div tag contains the "listenTopics" attribute, the associated 
href is executed *Before and After* the action associated to the tag 
which invokes the notifyTopics??




...  







When I submit the form it invokes the action form and i have 2 threads 
invoking "refreshTreeUrl"... I would like to first invoke the action 
form, and then, notifyTopics. Is it possible??

Thanks.


-
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: [OT] Need suggestion about designing web application

2007-09-27 Thread Ashish Kulkarni
Hi
But suppose i  have to install the same war file on same application server,
one installtion pointing towards database1, and
other installation pointing towards database 2.
And this is quite possible to happen, if database 1 is prodution database
for site1 and database 2 is production database for site 2.

So there cannot be one JNDI name, but 2 JNDI in web application server,
so what about this scenario

On 9/27/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
>
> 2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> > Hi
> > We a to develop a web application which we want to be able to deploy on
> any
> > J2EE compatiable application server.
> > We would create a war file for deployment, but there is a issue with
> > database connection,
> > We do not know the JNDI name,
> > So we thought we would put xml file under WEB-INF folder, and after
> > deploying the application, modify the JNDI name in this XML and restart
> the
> > application,
> > Is this a good way of doing it, since BEA recommends not to modify any
> thing
> > after deploying the application,
> > We would be giving this war file to more then one deployment, and we do
> not
> > want to maintain different war files one for each deployment, but just
> have
> > one far which we can use for deployment in all servers.
>
> IMHO, you have to decide (and not change) your data source JNDI name,
> and then configure it in the container.
>
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Struts - open windows without javascript

2007-09-27 Thread massimo . tagliaferri
how to open a new browser windows in Struts without to use javascript code
in jsp page?

thanks

Massimo

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



Re: [s2]struts-2-spring-2-jpa-ajax tutorial

2007-09-27 Thread Musachy Barroso
You can just inject your entity manager in your actions and do all the
persistence stuff in there. JPA/Hibernate are not related or tied to
struts in anyway. Just be advised that doing that will make your
actions harder to test/maintain/extend and your code won't be
reusable.

regards
musachy

On 9/27/07, Eugen Stoianovici <[EMAIL PROTECTED]> wrote:
> I've started learning struts based on this tutorial which (from my
> limited experience) is a good starting point.
> There's on problem for me though. It gets frustrating implementing all
> my persistence related calls in a "service" class. Is there a way to
> instantiate my action classes with an EntityManager, so that i can
> perform simple persistence related jobs directly in my actions? ... Is
> this a "violation" of struts framework concepts?
>
> Thanks
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



RE: Struts - open windows without javascript

2007-09-27 Thread Slattery, Tim - BLS
> how to open a new browser windows in Struts without to use 
> javascript code in jsp page?

Opening a new page is a client-side function. Since Struts is a
server-side system, there's no way to do this.

You could use the "target" attribute of the  tag, which
instructs the browser to open a new window for the result of the form.
That's as close as you're going to get.


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: Struts - open windows without javascript

2007-09-27 Thread Van Riper
On 9/27/07, Slattery, Tim - BLS <[EMAIL PROTECTED]> wrote:
> > how to open a new browser windows in Struts without to use
> > javascript code in jsp page?
>
> Opening a new page is a client-side function. Since Struts is a
> server-side system, there's no way to do this.
>
> You could use the "target" attribute of the  tag, which
> instructs the browser to open a new window for the result of the form.
> That's as close as you're going to get.

Same goes for the link  tag. The attribute you add to make your
form/link requests open a new browser window/tab is:

  target="_blank"

Technically, this will open a new window without javascript. It is
just adding an HTML attribute to your form or link tags in your
generated HTML response. No javascript required.

-Van

-- 
Mike "Van" Riper
[EMAIL PROTECTED]
http://weblogs.java.net/blog/van_riper/

Silicon Valley Web Developer JUG
https://sv-web-jug.dev.java.net

JUGs International MAP
http://tinyurl.com/ynktb2

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



[ot] help on generics...

2007-09-27 Thread nicolas de loof
Hello,

my question is fully off topic, but Struts2 is the only java5 project I know.

I'd like a method to return an instance of a class passed as parameter :

public Object getInstance( Class clazz )

I'd like to use generics to make the return type in sync with the
class type. Is this possible ???

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



Re: [ot] help on generics...

2007-09-27 Thread Giovanni Azua

how about:

public static  T
getInstance(Class aClass)
{
// TODO:
}

regards,
Giovanni

nicolas de loof wrote:

Hello,

my question is fully off topic, but Struts2 is the only java5 project I know.

I'd like a method to return an instance of a class passed as parameter :

public Object getInstance( Class clazz )

I'd like to use generics to make the return type in sync with the
class type. Is this possible ???

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



validating a url

2007-09-27 Thread Joe Yuen
What is the right way to validated a url?
 
In my validator.xml file, I have the following entry:
 




allowallschemes

true





allow2slashes 

true





 

If I enter a url i.e. http://www.apple.com, the validator complains that it is 
an invalid url.

What else should I be doing??

 

 



[S2] highlighting active link

2007-09-27 Thread TuomoS

Is there a better way of highlighting "active" link in struts 2

   






  


This one works but it shows ?active=home in the url which I don't like.


Regards,
Tuomo S.
-- 
View this message in context: 
http://www.nabble.com/-S2--highlighting-active-link-tf4529361.html#a12924511
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2]Actions with onLoad() and onSubmit() instead of execute()

2007-09-27 Thread Victor Neo

I wish to implement my S2 Action classes implementing ModelDriven with
onLoad() and onSubmit() methods that replaces the default execute() method.

When the user first views a page, onLoad() is called. If the user submits
the form, onSubmit() is called.
My idea is to create an Interface with these 2 methods, and implement them
in my action classes.

However, I have currently no idea how to call onLoad() or onSubmit() instead
of the default execute().

Should I call the onLoad() or onSubmit() method via an Interceptor(tried but
couldn't work)? Or are there interceptors that does the same thing?
-- 
View this message in context: 
http://www.nabble.com/-S2-Actions-with-onLoad%28%29-and-onSubmit%28%29-instead-of-execute%28%29-tf4529429.html#a12924800
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: Struts2+Spring2 Beans+Hibernate

2007-09-27 Thread Tom Holmes Jr.
You know ... we already have a Struts2+Spring2 beans+Hibernate project 
at work with maven2 for building ...
I could have asked for their framework and probably been a lot farther 
ahead ... but learning Struts2 the way I did was a learning experience.


Thanks for the information ... I will definitely look at this App 
example.  
I am sure there is a lot more I could be doing with Struts2, and I am 
sure I will in the near future.


Thanks again!
 tom

mraible wrote:

Here's a sample app that's ready to run if you have MySQL installed.

https://appfuse-light.dev.java.net/files/documents/6839/68407/appfuse-light-struts2-hibernate-1.8.zip

Matt


Vinicius Medeiros Peretti wrote:
  
I had problems with this combination using jdk 1.6, solved when I 
changed the tomcat's jdk to 1.5.


Vinicius

Tom Holmes Jr. wrote:

Yes ... this is one of the very first links that came up with my 
Google search and I looked at this example in detail.


Unfortunately, I'm not really using JPA (since in my opinion it's far 
from Hibernate and really not complete yet) ... and I'm not using Ajax 
at the moment.


It really wasn't clear to me in this example how to use Struts2 + 
Spring2 Beans and Hibernate ...  eventually I did find an example that 
more closely matches what I was looking for.


It was my fault that when I built my Maven2 pom.xml I included ALL the 
Struts2 plugins .. which in reality I just needed the Spring Plugin 
... and none of the rest.
Additionally my fault ... I typed "applicationContent.xml"  as opposed 
to "applicationContext.xml"      I hate when I do that.


I still have a few more errors, but that is because I'm working on the 
right jars to add.   I'm missing a few for Spring2 that I need.


Thanks very much for the help!
 Tom


Leena Borle wrote:
  
   
  

2) Can anyone point me to a sample Struts2 web-app
that uses Spring2 Beans with Hibernate.
  


Did you take a look at this example at,

  

http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html

It is complete with all possible combinations with Strus2

Leena

-
 


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



  
  



No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.488 / Virus Database: 
269.13.31/1031 - Release Date: 9/26/2007 12:12 PM
  


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



  

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






  



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



RE: Struts - open windows without javascript

2007-09-27 Thread Slattery, Tim - BLS
> > You could use the "target" attribute of the  tag, which 
> > instructs the browser to open a new window for the result 
> > of the form. That's as close as you're going to get.
> 
> Same goes for the link  tag. The attribute you add to 
> make your form/link requests open a new browser window/tab is:
> 
>   target="_blank"
> 
> Technically, this will open a new window without javascript. 
> It is just adding an HTML attribute to your form or link tags 
> in your generated HTML response. No javascript required.

One caveat on the "target" attribute: it doesn't exist in xhtml 1.1. 

--
Tim Slattery
[EMAIL PROTECTED]


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



RE: [ot] help on generics...

2007-09-27 Thread Engelking, Nicholas

Specifically, you could use

public  T getInstance(Class clazz)
throws InstantiationException, IllegalAccessException{
return clazz.newInstance();
}

The Class object has a method newInstance() that creates an instance of a 
class with the default constructor. The exceptions it throws represent cases 
where you don't have visibility permissions for the constructor, there is no 
default constructor, the class is abstract, or the constructor call throws an 
error (which is then wrapped and rethrown). The method outlined above is just a 
wrapper - if you already have the class object you can just instantiate it. If 
you need to not use the default constructor, try something like:

public  T getInstance(Class clazz)
throws IllegalArgumentException,
SecurityException,
InstantiationException,
IllegalAccessException,
InvocationTargetException,
NoSuchMethodException {
return clazz
.getConstructor(
Parameter1Type.class,
Parameter2Type.class)
.newInstance(
parameter1,
parameter2);
}

The getConstructor methods takes all they types for it's parameters in 
declaration order. This is to resolve the method signature. In this class your 
class would have a constructor:

MyClass(Parameter1Type parameter1, Parameter2Type parameter2){
// constructor stuff here
}

The newInstance method takes the actual parameters to pass to the constructor. 
In this example, they are parameter1 (which is a Parameter1Type) and parameter2 
(which is a Parameter2Type). The errors occur if the constructor doesn't exist, 
the arguments are the wrong type, the caller doesn't have visibility 
permissions, the class is abstract, or the constructor throws an error (which 
is then wrapped and rethrown).

You could also pass the parameters into the getInstance method and pick out the 
constructer dynamically like so:

public  T getInstance(Class clazz, Object... args)
throws InvocationTargetException {
T newObject = null;
for (java.lang.reflect.Constructor c :   
clazz.getConstructors()) {
// try creating objects with the passed
// args until one works.
try {
newObject = c.newInstance(args);
break;
} catch (IllegalArgumentException e) {
} catch (InstantiationException e) {
} catch (IllegalAccessException e) {
}
}
return newObject;
}

This method returns an instance of the class passed created with the 
constructor parameters passed. If the constructor throws an error it is wrapped 
in an InvocationTargetException and rethrown. If no constructor matches the 
method returns null.


-Original Message-
From: Giovanni Azua [mailto:[EMAIL PROTECTED]
Sent: September 27, 2007 11:56 AM
To: Struts Users Mailing List
Subject: Re: [ot] help on generics...

how about:

public static  T
getInstance(Class aClass)
{
 // TODO:
}

regards,
Giovanni

nicolas de loof wrote:
> Hello,
>
> my question is fully off topic, but Struts2 is the only java5 project I know.
>
> I'd like a method to return an instance of a class passed as parameter :
>
> public Object getInstance( Class clazz )
>
> I'd like to use generics to make the return type in sync with the
> class type. Is this possible ???
>
> -
> 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]



NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is 
intended only for the use of the addressees and is confidential. 
If you are not an intended recipient or responsible for delivering 
the message to an intended recipient, any review, disclosure, 
conversion to hard copy, dissemination, reproduction or other use 
of any part of this communication is strictly prohibited, as is the 
taking or omitting of any action in reliance upon this communication. 
If you receive this communication in error or without authorization 
please notify us immediately by return e-mail or otherwise and 
permanently delete the entire com

Re: Which values are passed to the action with a s:submit button?

2007-09-27 Thread wild_oscar

Putting it in another way...how can I send a value from the Action to the jsp
and use that value in another action in the next request?

Specifically, what struts2 tag should be used in the jsp? 


wild_oscar wrote:
> 
> I'm having doubts on a really basic question: which values are passed to
> the action (and can therefore be get/set) with a s:submit button?
> 
> I ask this because I have a form with two submit buttons:
> 
> Button 1 does some work and sets parameter par1 which is retrieved in the
> jsp with a  tag;
> 
> Button 2 should get par1 and do additional work. I thought that the action
> was able to get par1 here, but apparently not. Which tags are sent as
> parameters on a form?
> 

-- 
View this message in context: 
http://www.nabble.com/Which-values-are-passed-to-the-action-with-a-s%3Asubmit-button--tf4522862.html#a12925375
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: Which values are passed to the action with a s:submit button?

2007-09-27 Thread Dave Newton
--- wild_oscar <[EMAIL PROTECTED]> wrote:
>> Which tags are sent as parameters on a form?

All form tags, unless you have an interceptor
configured to specifically exclude specific
parameters.

> Putting it in another way...how can I send a value
> from the Action to the jsp and use that value in 
> another action in the next request?

On the *next* request? If there's no page between
requests you can chain your actions. If there is then
you'd have to include the parameter on the second form
using  or another mechanism.

I'm still not sure I understand the issue, though.

d.


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



Re: [OT] Need suggestion about designing web application

2007-09-27 Thread Nils-Helge Garli
The idea of the local JNDI reference (which exists for the application
instance only) is to decouple it from the actual, physical JNDI name
of the resource. The mapping of the datasource name is (usually) done
when the application is deployed. I am not familiar with how WebLogic
handle this, but maybe this website can help:
http://edocs.bea.com/wls/docs92/webapp/configureresources.html

Nils-H

On 9/27/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> But suppose i  have to install the same war file on same application server,
> one installtion pointing towards database1, and
> other installation pointing towards database 2.
> And this is quite possible to happen, if database 1 is prodution database
> for site1 and database 2 is production database for site 2.
>
> So there cannot be one JNDI name, but 2 JNDI in web application server,
> so what about this scenario
>
> On 9/27/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> >
> > 2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> > > Hi
> > > We a to develop a web application which we want to be able to deploy on
> > any
> > > J2EE compatiable application server.
> > > We would create a war file for deployment, but there is a issue with
> > > database connection,
> > > We do not know the JNDI name,
> > > So we thought we would put xml file under WEB-INF folder, and after
> > > deploying the application, modify the JNDI name in this XML and restart
> > the
> > > application,
> > > Is this a good way of doing it, since BEA recommends not to modify any
> > thing
> > > after deploying the application,
> > > We would be giving this war file to more then one deployment, and we do
> > not
> > > want to maintain different war files one for each deployment, but just
> > have
> > > one far which we can use for deployment in all servers.
> >
> > IMHO, you have to decide (and not change) your data source JNDI name,
> > and then configure it in the container.
> >
> > Antonio
> >
> > -
> > 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: Sharing resource bundles across web-apps

2007-09-27 Thread Sairam01

It appears that the way it finds the resource bundle ( looks for the bundle
to be available in current thread's class loader), we cannot locate the
bundle which is not visible to the current class loader. Am I right ?


Sairam01 wrote:
> 
> I have multiple web-apps in an ear file and want to share the resource
> bundle across web-apps. 
> Is this possible ?
> 



-- 
View this message in context: 
http://www.nabble.com/Sharing-resource-bundles-across-web-apps-tf4524302.html#a12925921
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: Which values are passed to the action with a s:submit button?

2007-09-27 Thread Slattery, Tim - BLS
 
> Putting it in another way...how can I send a value from the 
> Action to the jsp and use that value in another action in the 
> next request?

Put in into a  field in the form

> Specifically, what struts2 tag should be used in the jsp? 




--
Tim Slattery
[EMAIL PROTECTED]


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



RE: [S2]Actions with onLoad() and onSubmit() instead of execute()

2007-09-27 Thread Wesley Wannemacher

Check here - 
http://struts.apache.org/2.0.9/docs/action-configuration.html#ActionConf
iguration-WildcardMethod 

-Wes

> -Original Message-
> From: Victor Neo [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 27, 2007 12:15 PM
> To: user@struts.apache.org
> Subject: [S2]Actions with onLoad() and onSubmit() instead of execute()
> 
> 
> I wish to implement my S2 Action classes implementing ModelDriven with
> onLoad() and onSubmit() methods that replaces the default 
> execute() method.
> 
> When the user first views a page, onLoad() is called. If the 
> user submits the form, onSubmit() is called.
> My idea is to create an Interface with these 2 methods, and 
> implement them in my action classes.
> 
> However, I have currently no idea how to call onLoad() or 
> onSubmit() instead of the default execute().
> 
> Should I call the onLoad() or onSubmit() method via an 
> Interceptor(tried but couldn't work)? Or are there 
> interceptors that does the same thing?
> --
> View this message in context: 
> http://www.nabble.com/-S2-Actions-with-onLoad%28%29-and-onSubm
it%28%29-instead-of-execute%28%29-tf4529429.html#a12924800
> 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: Struts - open windows without javascript

2007-09-27 Thread Van Riper
On 9/27/07, Slattery, Tim - BLS <[EMAIL PROTECTED]> wrote:
> > > You could use the "target" attribute of the  tag, which
> > > instructs the browser to open a new window for the result
> > > of the form. That's as close as you're going to get.
> >
> > Same goes for the link  tag. The attribute you add to
> > make your form/link requests open a new browser window/tab is:
> >
> >   target="_blank"
> >
> > Technically, this will open a new window without javascript.
> > It is just adding an HTML attribute to your form or link tags
> > in your generated HTML response. No javascript required.
>
> One caveat on the "target" attribute: it doesn't exist in xhtml 1.1.

Wow! I did not know that. Google to the rescue. Found this related
information online:


JavaScript window object solution:

Javascript provides a partial solution to the problem by passing the
href attribute to the window object's open method, and returning a
value of false. The false return from the event handler prevents the
web browser from following the link specified in the href attribute.

http://www.TexaStar.com";
   onclick="window.open(this.href); return false;"
   onkeypress="window.open(this.href); return false;">TexaStar

This previous example provides an onclick event handler for those
using a pointing device, and an onkeypress event handler for those
using a keyboard. However, when JavaScript isn't enabled, the link is
processed as normal, providing a possibly adequate fallback mechanism,
but failing to produce the designer's desired result.


So, it does require a small amount of javascript to make it work in an
XHTML 1.1 compliant manner. This snippet above comes from the
following online source:

http://www.texastar.com/tips/2004/target_blank.shtml

- Van

-- 
Mike "Van" Riper
[EMAIL PROTECTED]
http://weblogs.java.net/blog/van_riper/

Silicon Valley Web Developer JUG
https://sv-web-jug.dev.java.net

JUGs International MAP
http://tinyurl.com/ynktb2

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



Re: [S2] TabbedPanel Events

2007-09-27 Thread Musachy Barroso
Try to listen to a topic with the name: widgetId + "-selectChild"
(hardcoded in dojo's code), let's say that your tab pannel is
something like:

 wrote:
> It looks like version 2.1 will contain the ability to capture events in
> the TabbedPanel.
>
> We are currently using v2.0.6 and need to be able to capture a change in
> tab.  Has anyone come across a solution for this?
>
> Thank you!
>
>
>
>
> -
> ***Note:The information contained in this message may be privileged
> and confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient,
> you are hereby notified that any dissemination, distribution or
> copying of this communication is strictly prohibited. If you have
> received this communication in error, please notify the Sender
> immediately by replying to the message and deleting it from your
> computer. Thank you. Premier Inc.


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



Re: [OT] Need suggestion about designing web application

2007-09-27 Thread Ashish Kulkarni
Hi
This sounds intresting
I am also working on an application which is suppose to get data from more
then one database and then merge and create one xml file and send it back.

So in this case, i will have to work with more then one JNDI,
Has anyone experience with working this kind of application, any
suggestions.
I am using ibatis for SQL mapping

Ashish

On 9/27/07, Nils-Helge Garli <[EMAIL PROTECTED]> wrote:
>
> The idea of the local JNDI reference (which exists for the application
> instance only) is to decouple it from the actual, physical JNDI name
> of the resource. The mapping of the datasource name is (usually) done
> when the application is deployed. I am not familiar with how WebLogic
> handle this, but maybe this website can help:
> http://edocs.bea.com/wls/docs92/webapp/configureresources.html
>
> Nils-H
>
> On 9/27/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > Hi
> > But suppose i  have to install the same war file on same application
> server,
> > one installtion pointing towards database1, and
> > other installation pointing towards database 2.
> > And this is quite possible to happen, if database 1 is prodution
> database
> > for site1 and database 2 is production database for site 2.
> >
> > So there cannot be one JNDI name, but 2 JNDI in web application server,
> > so what about this scenario
> >
> > On 9/27/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> > >
> > > 2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> > > > Hi
> > > > We a to develop a web application which we want to be able to deploy
> on
> > > any
> > > > J2EE compatiable application server.
> > > > We would create a war file for deployment, but there is a issue with
> > > > database connection,
> > > > We do not know the JNDI name,
> > > > So we thought we would put xml file under WEB-INF folder, and after
> > > > deploying the application, modify the JNDI name in this XML and
> restart
> > > the
> > > > application,
> > > > Is this a good way of doing it, since BEA recommends not to modify
> any
> > > thing
> > > > after deploying the application,
> > > > We would be giving this war file to more then one deployment, and we
> do
> > > not
> > > > want to maintain different war files one for each deployment, but
> just
> > > have
> > > > one far which we can use for deployment in all servers.
> > >
> > > IMHO, you have to decide (and not change) your data source JNDI name,
> > > and then configure it in the container.
> > >
> > > Antonio
> > >
> > > -
> > > 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]
>
>


[S2] TabbedPanel Events

2007-09-27 Thread Hoying, Ken
It looks like version 2.1 will contain the ability to capture events in
the TabbedPanel.

We are currently using v2.0.6 and need to be able to capture a change in
tab.  Has anyone come across a solution for this?

Thank you!




-
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.  

Re: Which values are passed to the action with a s:submit button?

2007-09-27 Thread wild_oscar

There is a page in between:

1) Page A - submit form 
2) Action sets parameter1 and sends to Page A
3) Page A shows parameter1
4) Page A has a submit for another action that needs parameter1


Curiously, I tried assigning it to a . It showed parameter1 ok ( 3)
), but the parameter was null in the action in 4).  with the
same "name" property was ok...


newton.dave wrote:
> 
> --- wild_oscar <[EMAIL PROTECTED]> wrote:
>>> Which tags are sent as parameters on a form?
> 
> All form tags, unless you have an interceptor
> configured to specifically exclude specific
> parameters.
> 
>> Putting it in another way...how can I send a value
>> from the Action to the jsp and use that value in 
>> another action in the next request?
> 
> On the *next* request? If there's no page between
> requests you can chain your actions. If there is then
> you'd have to include the parameter on the second form
> using  or another mechanism.
> 
> I'm still not sure I understand the issue, though.
> 
> d.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Which-values-are-passed-to-the-action-with-a-s%3Asubmit-button--tf4522862.html#a12928431
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: Which values are passed to the action with a s:submit button?

2007-09-27 Thread Dave Newton
--- wild_oscar <[EMAIL PROTECTED]> wrote:
> Curiously, I tried assigning it to a .

My fault; I assumed some familiarity with HTML forms.

All form *input* elements (including things like
 etc.)

> newton.dave wrote:
> > --- wild_oscar <[EMAIL PROTECTED]> wrote:
> >>> Which tags are sent as parameters on a form?
> > All form tags, unless you have an interceptor
> > configured to specifically exclude specific
> > parameters.

d.


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



RE: [S2] TabbedPanel Events

2007-09-27 Thread Hoying, Ken
Thank you!  That was exactly what I was looking for! 

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 27, 2007 2:58 PM
To: Struts Users Mailing List
Subject: Re: [S2] TabbedPanel Events

Try to listen to a topic with the name: widgetId + "-selectChild"
(hardcoded in dojo's code), let's say that your tab pannel is something
like:

 wrote:
> It looks like version 2.1 will contain the ability to capture events 
> in the TabbedPanel.
>
> We are currently using v2.0.6 and need to be able to capture a change 
> in tab.  Has anyone come across a solution for this?
>
> Thank you!
>
>
>
>
> -
> ***Note:The information contained in this message may be privileged 
> and confidential and protected from disclosure. If the reader of this 
> message is not the intended recipient, or an employee or agent 
> responsible for delivering this message to the intended recipient, you

> are hereby notified that any dissemination, distribution or copying of

> this communication is strictly prohibited. If you have received this 
> communication in error, please notify the Sender immediately by 
> replying to the message and deleting it from your computer. Thank you.

> Premier Inc.


--
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
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: Which values are passed to the action with a s:submit button?

2007-09-27 Thread wild_oscar

In the case you want to just display (and give no choice of editing) and at
the same time send in the next request, the best option is then to use a
label and repeat it in a hidden field?


newton.dave wrote:
> 
> --- wild_oscar <[EMAIL PROTECTED]> wrote:
>> Curiously, I tried assigning it to a .
> 
> My fault; I assumed some familiarity with HTML forms.
> 
> All form *input* elements (including things like
>  etc.)
> 
>> newton.dave wrote:
>> > --- wild_oscar <[EMAIL PROTECTED]> wrote:
>> >>> Which tags are sent as parameters on a form?
>> > All form tags, unless you have an interceptor
>> > configured to specifically exclude specific
>> > parameters.
> 
> d.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Which-values-are-passed-to-the-action-with-a-s%3Asubmit-button--tf4522862.html#a12929004
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: Which values are passed to the action with a s:submit button?

2007-09-27 Thread Dave Newton
--- wild_oscar <[EMAIL PROTECTED]> wrote:
> In the case you want to just display (and give no
> choice of editing) and at the same time send in the 
> next request, the best option is then to use a
> label and repeat it in a hidden field?

Well, personally I wouldn't use a label if it isn't a
label for a form field, because it's not labeling
anything -- this might just be obsessive-compulsive,
though. I'd just display it using 

If you want the value to be submitted then you
definitely need to include it in the form somehow,
either via an , through JavaScript, etc.

Dave


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



Re: [OT] Need suggestion about designing web application

2007-09-27 Thread Larry Meadors
With iBATIS, you can supply configuration properties at runtime - look
at the API for the constructors of the sqlmapclient - one of them
allows you to pass a properties object into it - those can be used to
configure the data source.

Larry


On 9/27/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> Hi
> This sounds intresting
> I am also working on an application which is suppose to get data from more
> then one database and then merge and create one xml file and send it back.
>
> So in this case, i will have to work with more then one JNDI,
> Has anyone experience with working this kind of application, any
> suggestions.
> I am using ibatis for SQL mapping
>
> Ashish
>
> On 9/27/07, Nils-Helge Garli <[EMAIL PROTECTED]> wrote:
> >
> > The idea of the local JNDI reference (which exists for the application
> > instance only) is to decouple it from the actual, physical JNDI name
> > of the resource. The mapping of the datasource name is (usually) done
> > when the application is deployed. I am not familiar with how WebLogic
> > handle this, but maybe this website can help:
> > http://edocs.bea.com/wls/docs92/webapp/configureresources.html
> >
> > Nils-H
> >
> > On 9/27/07, Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
> > > Hi
> > > But suppose i  have to install the same war file on same application
> > server,
> > > one installtion pointing towards database1, and
> > > other installation pointing towards database 2.
> > > And this is quite possible to happen, if database 1 is prodution
> > database
> > > for site1 and database 2 is production database for site 2.
> > >
> > > So there cannot be one JNDI name, but 2 JNDI in web application server,
> > > so what about this scenario
> > >
> > > On 9/27/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> > > >
> > > > 2007/9/27, Ashish Kulkarni <[EMAIL PROTECTED]>:
> > > > > Hi
> > > > > We a to develop a web application which we want to be able to deploy
> > on
> > > > any
> > > > > J2EE compatiable application server.
> > > > > We would create a war file for deployment, but there is a issue with
> > > > > database connection,
> > > > > We do not know the JNDI name,
> > > > > So we thought we would put xml file under WEB-INF folder, and after
> > > > > deploying the application, modify the JNDI name in this XML and
> > restart
> > > > the
> > > > > application,
> > > > > Is this a good way of doing it, since BEA recommends not to modify
> > any
> > > > thing
> > > > > after deploying the application,
> > > > > We would be giving this war file to more then one deployment, and we
> > do
> > > > not
> > > > > want to maintain different war files one for each deployment, but
> > just
> > > > have
> > > > > one far which we can use for deployment in all servers.
> > > >
> > > > IMHO, you have to decide (and not change) your data source JNDI name,
> > > > and then configure it in the container.
> > > >
> > > > Antonio
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

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



OT, ajax form submission

2007-09-27 Thread Henry Park


I could not get the packaged struts2 ajax implementation to work, so I am 
trying to go at it with plain javascript. A problem that I am having is that 
whenever I submit the form, all of my form fields keep getting appended over 
and over. If I click submit enough, it causes an overflow error. Can you take a 
look at my code? Thanks.
 

function retrieveURL(url, target, submitFormFlag, nameOfFormToPost) {
  var req = getXmlHttpRequest(); 
  var method = "GET";
  if (submitFormFlag) {
url = url + getFormAsString(nameOfFormToPost);
method = "POST";


  req.setRequestHeader("Content-Type", 
"application/x-www-form-urlencoded"); 
   }


  req.onreadystatechange = function() { 
  if (req.readyState == 4) {
if (req.status == 200) {
  if (req.responseText.length > 0) {
target.innerHTML = "";
target.innerHTML = req.responseText;
  }
} else {
  alert("Error encountered. Please contact support.");
}
  }
  req.open(method, url, true);
  req.send(null);
  return false;
}
 
function getFormAsString(formName){
  var x = document[formName];
  returnString = "?1=1";
  formElements = document[formName].elements;
  for(var i = formElements.length-1; i >= 0; --i) {
returnString = returnString + "&" + encodeURI(formElements[i].name) + "=" + 
encodeURI(formElements[i].value);
  }
  return returnString; 
}
 
function do_submit() {
  retrieveURL('NameOfAction!list.action', sometarget, true, 'aform');
}

 

   
   
   
   
   
  

 

 
 
_
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Validation and freemarker result ....

2007-09-27 Thread Mufaddal Khumri

Hello,

===
My web.xml:
===
Application 2.3//EN"

  "http://java.sun.com/dtd/web-app_2_3.dtd";>

  Glop

  
struts2
org.apache.struts2.dispatcher.FilterDispatcherfilter-class>

  

  
struts2
*.action
  


===
My struts.xml:
===
http://struts.apache.org/dtds/struts-2.0.dtd";>




  
/support/error.ftl
  
  


===
My Action class
===
@Validation
public class MyOrderAction extends ActionSupport
{
private String orderNumber;

public String execute()
{
// do some stuff here   
return NONE;
}

public void setOrderNumber(String orderNumber)
{
this.orderNumber = orderNumber;
}

@RequiredStringValidator(message = "Order number is required.")
public String getOrderNumber()
{
return this.orderNumber;
}
}

===
Problem:
===
http://mydomain/glop/workOnOrder.action?orderNumber=123456
Accessing the above url does what is intended.

On the other hand,
http://mydomain/glop/workOnOrder.action
Throws an error, but struts does not take the user to /support/ 
error.ftl page


Basically, I want to render the error.ftl page on validation failure.  
Is this possible?  What am I missing?


Thanks.

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



RE: OT, ajax form submission

2007-09-27 Thread Henry Park

By appended over and over, I mean in the querystring... so the request would 
look like this:
 
NameOfAction!list.action?1=1&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah&someField1=blah&someField2=blah&someField3=blah&someField4=blah&someField5=blah
 
etc...
> From: [EMAIL PROTECTED]> To: user@struts.apache.org> Subject: OT, ajax form 
> submission> Date: Thu, 27 Sep 2007 14:19:37 -0700> > > > I could not get the 
> packaged struts2 ajax implementation to work, so I am trying to go at it with 
> plain javascript. A problem that I am having is that whenever I submit the 
> form, all of my form fields keep getting appended over and over. If I click 
> submit enough, it causes an overflow error. Can you take a look at my code? 
> Thanks.> > > function retrieveURL(url, target, 
> submitFormFlag, nameOfFormToPost) {> var req = getXmlHttpRequest(); > var 
> method = "GET";> if (submitFormFlag) {> url = url + 
> getFormAsString(nameOfFormToPost);> method = "POST";> > > 
> req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); > 
> }> > > req.onreadystatechange = function() { > if (req.readyState == 4) {> if 
> (req.status == 200) {> if (req.responseText.length > 0) {> target.innerHTML = 
> "";> target.innerHTML = req.responseText;> }> } else {> alert("Error 
> encountered. Please contact support.");> }> }> req.open(method, url, true);> 
> req.send(null);> return false;> }> > function getFormAsString(formName){> var 
> x = document[formName];> returnString = "?1=1";> formElements = 
> document[formName].elements;> for(var i = formElements.length-1; i >= 0; --i) 
> {> returnString = returnString + "&" + encodeURI(formElements[i].name) + "=" 
> + encodeURI(formElements[i].value);> }> return returnString; > }> > function 
> do_submit() {> retrieveURL('NameOfAction!list.action', sometarget, true, 
> 'aform');> }> > > >  value="%{field1}" /> >  > 
>  >  value="%{field4}" /> >  > 
> > > >  id='sometarget'>> > > 
> _> Connect to 
> the next generation of MSN Messenger > 
> http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

Re: OT, ajax form submission

2007-09-27 Thread Dave Newton
The first thing I noticed was that your onclick
handler  attribute doesn't "return false;" after
executing your Ajax method; perhaps it's doing both
the Ajax submit and a regular one (easily verifiable)?

It might be less traumatic to just figure out what's
wrong with the built-in Ajax, though :/

d.

--- Henry Park <[EMAIL PROTECTED]> wrote:

> 
> 
> I could not get the packaged struts2 ajax
> implementation to work, so I am trying to go at it
> with plain javascript. A problem that I am having is
> that whenever I submit the form, all of my form
> fields keep getting appended over and over. If I
> click submit enough, it causes an overflow error.
> Can you take a look at my code? Thanks.
>  
> 
> function retrieveURL(url, target, submitFormFlag,
> nameOfFormToPost) {
>   var req = getXmlHttpRequest(); 
>   var method = "GET";
>   if (submitFormFlag) {
> url = url + getFormAsString(nameOfFormToPost);
> method = "POST";
> 
> 
>   req.setRequestHeader("Content-Type",
> "application/x-www-form-urlencoded"); 
>}
> 
> 
>   req.onreadystatechange = function() { 
>   if (req.readyState == 4) {
> if (req.status == 200) {
>   if (req.responseText.length > 0) {
> target.innerHTML = "";
> target.innerHTML = req.responseText;
>   }
> } else {
>   alert("Error encountered. Please contact
> support.");
> }
>   }
>   req.open(method, url, true);
>   req.send(null);
>   return false;
> }
>  
> function getFormAsString(formName){
>   var x = document[formName];
>   returnString = "?1=1";
>   formElements = document[formName].elements;
>   for(var i = formElements.length-1; i >= 0; --i) {
> returnString = returnString + "&" +
> encodeURI(formElements[i].name) + "=" +
> encodeURI(formElements[i].value);
>   }
>   return returnString; 
> }
>  
> function do_submit() {
>   retrieveURL('NameOfAction!list.action',
> sometarget, true, 'aform');
> }
> 
>  
> 
>
>
>
>
>
>onclick='do_submit()'/>
> 
>  
> 
>  
>  
>
_
> Connect to the next generation of MSN Messenger 
>
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline


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



Re: Validation and freemarker result ....

2007-09-27 Thread Dave Newton
--- Mufaddal Khumri <[EMAIL PROTECTED]>
wrote:
>  class="com.experiment.MyOrderAction">
>   
> /support/error.ftl
>   
> 
> On the other hand,
> http://mydomain/glop/workOnOrder.action
> Throws an error, but struts does not take the user
> to /support/error.ftl page
> 
> Basically, I want to render the error.ftl page on
> validation failure. Is this possible?  What am I 
> missing?

Validation normally returns you to the "input" result
(via the default workflow interceptor). Off the top of
my head I don't know of an immediately trivial way to
change that without doing the validation manually;
somebody else probably does though.

d.


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



Slow Web Page, Speed Up?

2007-09-27 Thread Brian Trzupek
We have a JSP that is the main navigation menu and it has a notion of  
RBAC so that the logged in user needs to be in a given role to see  
the different navigation items (the actions behind them respect the  
same roles as well, so we are not just hiding links).


The page loads extremely slowly, and I suspect it has something to do  
with the s:if tag.


Here is a code snippet example, we have about 12 if statements like  
the following:





Where the isAdmin var is being set via a single call for each role (7  
of them) at the top of the page with something like this:





Two main questions.

1) Is there something obvious I am doing 'wrong' (that would make it  
so slow). ?


2) Is there a way to optimize this any further?

Thanks,
Brian-

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



Struts 2 / codebehind / SiteMesh : how do I auto-wire static resources?

2007-09-27 Thread james_carbon5

I'm working on a project that is using struts 2, codebehind, and SiteMesh.
We're using Spring for injection. We've got it wired up so that each action
has a template that is "magically" discovered, such that if I request an
action "../foo!bar.action" the template "foo-bar.ftl" is used to render the
response. Sitemesh is also applying a decorator "main.ftl". 

I would like to add a static resource directory for javascript that uses the
same Action!Method naming convention. So my project looks something like:

templates /
foo-bar.ftl
javascript /
foo-bar.js

If it existed foo-bar.js or the path to foo-bar.js would automatically be
available to my template pages.

Any suggestions on where I should implement this would be appreciated.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Struts-2---codebehind---SiteMesh-%3A-how-do-I-auto-wire-static-resources--tf4531694.html#a12932357
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: Breadcrumbs

2007-09-27 Thread Brian Trzupek

Try this one out, we are using it very successfully.

Trail Taglin
http://www.osjava.org/trail-taglib/index.html

brian-


On Sep 25, 2007, at 5:53 AM, [EMAIL PROTECTED] wrote:


Can you tell me if Struts 2 has a facility for breadcrumbs?

On 9/25/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote:


2007/9/24, stanlick <[EMAIL PROTECTED]>:



I am writing a Breadcrumbs utility and have a question about how to

easily
get the current request in a format that could be wrapped in an  
URL.  Is

there a quick way to do this given a TilesRequestContext reference?




If it is a Tiles-related question, please post it at Tiles Users  
mailing

list:
http://tiles.apache.org/mail.html

Antonio





--
Scott
[EMAIL PROTECTED]



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



RE: specifying the location of struts.xml

2007-09-27 Thread Manu Mahajan
As far as I know the struts.xml has to be in the root of your classpath and
there is no way of changing this. The maximum you can do is add it to the
root of a jar in the WEB-INF/lib folder but not directly in the WEB-INF
folder.

Manu

-Original Message-
From: Pavel Sapozhnikov [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 27, 2007 3:22 AM
To: Struts Users Mailing List
Subject: specifying the location of struts.xml

Hi I have this issue where Struts only sees struts.xml in classes folder
this is an issue because if I want to add another jar or something else it
will delete struts.xml from my classes folder. Is there a way I could
specify so that application will look for struts.xml in /WEB-INF folder.
Thanks.

-- 
Pavel Sapozhnikov
xFact, Inc
[EMAIL PROTECTED]



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



Re: S2 Cannot get Submit button body to render as label...

2007-09-27 Thread Laurie Harper
Doh, my bad :-( I guess I was reading too fast (or with my eyes closed 
perhaps?...) Re-reading what you're doing, I'd say this is either a bug 
or a design limitation. It's probably worth a Jira ticket either way.


L.

billgloff wrote:

Laurie,

As you can see above in my sample code, I am already setting the
type="button" as you have suggested and I have also verified that the html
getting rendered is a  and not .

Can you try it for yourself as see if you can get it to work?

Maybe I will have to write up a bug report for this.

Thanks,
Bill



Laurie Harper wrote:

billgloff wrote:

Using the button element in normal HTML you can do the following:


     Save
 


which gives you an icon along with the label on the button itself.

When I attempt to try the same thing using S2 tags e.g.

 
  
     Save   



is gets rendered in the following way:

Save

Submit

I also have tried using the following inside the body with no luck.


    Save
 


How can I add an icon to my button?
I do not understand why any text in the tag body gets pushed out to the
front of the tag. 


Thanks for any help on this!
s:submit is rendering an the behaviour you're seeing is expected. If you want a button element, 
set 's 'type' attribute to 'button', as listed in the tag docs 
[1].


L.

[1] http://struts.apache.org/2.x/docs/submit.html


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