Re: return flow to calling servlet inside action

2006-11-06 Thread Antonio Petrelli

Sarry ha scritto:

I have a servlet which is the interface for the third party and its calling
the struts actions and jsps to do some processing, and it will go throuh the
actions and the flow should come to the calling servlet.

I am facing problems since third party is calling my flow as "include"
method of servlet and it acts as a subroutine.so I can forward the flow to
whichever actions I want but when it comes the time to return it expects
"action forward" which is not possible in this case and even I tried making
one more servlet and forward the call to that servlet and then return, it
just doesn't work.

if somebody has already integrated struts with servlets let me know how you
do it?
  


Did you try simply "return null" in your Action.execute method?

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



Re: struts tiles and validator framework

2006-11-06 Thread Antonio Petrelli

Madhav Bhargava ha scritto:
Since i am using struts tiles there is always going to be one form. 
How can

i then use these 2 together?


Wait a moment, what's the connection between Tiles and the use of only 
one form? That's not true.
Probably you wanted to say that you have one form and the fields of that 
form is spread across different JSP pages, right?
In this case probably you have to create a big big ActionForm that 
contains all fields, or create one ActionForm for each resulting page.
Anyway I don't know Validator very well, so maybe someone else can help 
you more than me.


Ciao
Antonio

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



struts tiles and validator framework

2006-11-06 Thread Madhav Bhargava

Hi All,

I am using struts tiles for laying out all the pages. I am wondering how i
can use struts client validator framework with struts tiles.
The validation.xml file requires form name and then within the form tag we
define the individual fields along with the respective validations.

Since i am using struts tiles there is always going to be one form. How can
i then use these 2 together?

Any help/guidence will be appreciated.

~madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do


[s2] Accessing HttpServletRequest from an Interceptor

2006-11-06 Thread Mark Menard
I need to access the HttpServletRequest from an Interceptor. I'm using:

HttpServletRequest request = ServletActionContext.getRequest ();

Is that the correct way to get it? It works, but I'm not sure that's how I
should be doing it.

Thanks,

Mark

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



[s2] Updating a List of objects

2006-11-06 Thread Mark Menard
I'd just like to be sure that I'm on the right path. I did my first update
action that is operating on a List of objects similar to the example from
the Showcase. Difference is I can't recreate them, like the Showcase does.

So, I got my List of objects from the database, then threw them into a Map
keyed on the id of the objects. I then exposed the Map with a getter on the
action.

In the JSP I iterate over the List, but use references to the Map using OGNL
notation:











Is this a reasonable approach to updating a list of items? Or is there
another recommended best practice for this?

Thanks,

Mark

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



Re: get webapp root directory from action constructor

2006-11-06 Thread Antonis Lebesis

Hello,
 I don't know if you still need it, but the "correct" way is to add a
ServletContextListener. To do this, you have to implement the
ServletContextListener interface:

public class FooContextListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
String homeDir = event.getServletContext().getRealPath("");
}

public void contextDestroyed(ServletContextEvent event) {
}
}

and declare it in the web.xml:







FooContextListener




...


The contextInitialized() method is called when your webapp starts. The
contextDestroyed() is called before the webapp stops and you can use
it to add any cleanup code you wish.

cheers,
Antonis


On 11/3/06, Patrice Le Cozler <[EMAIL PROTECTED]> wrote:

Hi,
I want to load a property file at webapp start. Since that property file is
located in my webapp's directory structure, I want to be able to determine
its absolute name at runtime.
I tried "this.getServlet().getServletContext().getRealPath(PROPS_FILE)" but
"getServlet()" returns null when called from an Action constructor.
Why ?
Is there another way to achieve the same result ? I can't use
MessageResources because it depends on the actual httpRequest instance.

Thanks in advance

Patrice




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



Re: Struts 2 formal release availability

2006-11-06 Thread Ted Husted

The Struts 2.0.1 distributed was upgraded to "BETA" recently, if that
qualifies as "formal". The web site is finally updated, and the usualy
announcement will follow tomorrow afternoon.

Right now, the major stumblingblock is a stable release of our major
dependency, XWork 2. There is a lot of crossover between XWork and
Struts, but they are separate projects. Until X2 receives a stable
grade, Struts 2 will be stuck at beta.

If I had a binding vote on X2, personally I would vote it stable,
since the few issues people mention are all non-functional. The bits
we use in our applications are fine, apparently, what's left are just
packaging issues.

-Ted.

On 11/4/06, a correspondant wrote:

Hi,

I was wondering when we could expect a formal release of Struts 2. It
looks to me that the current releases are just "snapshots" and not
really formal releases. The Struts Roadmap FAQ must be talking about
these snapshots, nothing on formal releases there. The Struts download
page also doesn't list any formal releases.

Is there a date (or general time frame) set for a formal release?


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



Re: Struts 2.0 Application Lifecycle

2006-11-06 Thread Adam Hardy

Ted Husted on 05/11/06 21:27, wrote:

On 11/5/06, Adam Hardy <[EMAIL PROTECTED]> wrote:

Imagine a common-place user story where the user sees a list of items, and
can choose one item, go to the 'edit item' page, submit changes, and be 
returned to the item list.


On the edit submit, my action processes the edit and does a save, and does
a Post-Redirect-Get back to the list.

Where do I put the logic fetching the list again? Obviously I don't want it
in the edit action. Do I put it in an action of its own, or do I put it in
an interceptor or even a PreResultListener?


Oh, in the normal course, I don't think anything so exotic would be needed.
:)

If we are fetching the list from a database, I'd put the actual logic in a
business facade. A good approach is to use Spring to instantiate the business
facade and then inject the business object into the Action. Struts 2 can
"autowire" Action properties from the Spring configuration. If you give the
Spring bean and the Action property the same name and type, the framework
will take care of the result.

* http://jroller.com/page/TedHusted?entry=struts_2_spring_love_fest

The list can be represented as a property on a base "support" Action that
other Action classes extend. All any Action needs to do is call the property,
and, behind the scenese, the property invokes the business facade. The
business facade itself can be autowired from Spring, so the Action just needs
to do is get the property name right!

If retrieving the list requires a key, a common approach is to create a
profile object that is stored in the session and can be retrieved as a
property on the base support Action.


You've made 75% of the code from my baseAction redundant! Come to think of it, I
suspect the remaining 25% can be farmed out into interceptors and that's the
whole lot.

The profile object / action interaction sounds interesting too. Can the
mechanism be mapped against tokens to identify the calling request in an app
allowing multiple windows?

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



Re: Action gets repeated every time i repeat the page.

2006-11-06 Thread Christopher Goldman
On Mon, 2006-11-06 at 13:52 -0800, Uday Karrothi wrote:
> Hi guys,
> 
> When i press a button for Exmaple. 'ADD',
> When i press the Button 'ADD' the values of the element 'X' are passed and
> the form is submitted.
> 
> One emlement 'X' of ArrayList A is added to ArrayList B.
> 
> When i Refresh teh page now, the operation is done  again.In ArrayList B i
> have two elements of 'X'.
> 
> I store the action to be performed and the elements value in the form bean.
> So in the action clas i access them and perform the operation. So when the
> user press "Refresh" from the browser, the same values exist in the form
> bean and the action class performs the same action again.
> 
> 
> Has anybody had this problem? I am not sure what i can do not to repeat the
> action.

Uday,

Take a look at this article.

http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost

Chris

-- 
Christopher D. Goldman
[EMAIL PROTECTED]



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



Action gets repeated every time i repeat the page.

2006-11-06 Thread Uday Karrothi

Hi guys,

When i press a button for Exmaple. 'ADD',
When i press the Button 'ADD' the values of the element 'X' are passed and
the form is submitted.

One emlement 'X' of ArrayList A is added to ArrayList B.

When i Refresh teh page now, the operation is done  again.In ArrayList B i
have two elements of 'X'.

I store the action to be performed and the elements value in the form bean.
So in the action clas i access them and perform the operation. So when the
user press "Refresh" from the browser, the same values exist in the form
bean and the action class performs the same action again.


Has anybody had this problem? I am not sure what i can do not to repeat the
action.

Thank you for your time.

Uday Chandra Karrothi


return flow to calling servlet inside action

2006-11-06 Thread Sarry

I have a servlet which is the interface for the third party and its calling
the struts actions and jsps to do some processing, and it will go throuh the
actions and the flow should come to the calling servlet.

I am facing problems since third party is calling my flow as "include"
method of servlet and it acts as a subroutine.so I can forward the flow to
whichever actions I want but when it comes the time to return it expects
"action forward" which is not possible in this case and even I tried making
one more servlet and forward the call to that servlet and then return, it
just doesn't work.

if somebody has already integrated struts with servlets let me know how you
do it?

Regards,

Saurabh
-- 
View this message in context: 
http://www.nabble.com/return-flow-to-calling-servlet-inside-action-tf2583789.html#a7203102
Sent from the Struts - User mailing list archive at Nabble.com.


Re: how recover a map of a bean in a "select list" of the jsp and to post the data ?

2006-11-06 Thread Ed Griebel

You need to use either  or  to iterate over your
beans.

This deals with arrays but is useful for how to use the iterator and how to
populate a select list: http://husted.com/struts/tips/006.html

HTH,
-ed

On 11/6/06, nalimoussa <[EMAIL PROTECTED]> wrote:


Hi everybody,

I have to create a map in a bean which recovers the data of a table, I
would like post(integrate) these data in a "select list" of a JSP?

Regards,

Nabil.


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




how recover a map of a bean in a "select list" of the jsp and to post the data ?

2006-11-06 Thread nalimoussa
Hi everybody, 

I have to create a map in a bean which recovers the data of a table, I
would like post(integrate) these data in a "select list" of a JSP? 

Regards,

Nabil.


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



RE: checkbox issue

2006-11-06 Thread fea jabi

con someone help me with this please? thanks.



From: "fea jabi" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" 
To: user@struts.apache.org
Subject: checkbox issue
Date: Fri, 03 Nov 2006 17:30:09 -0500

struts-config

The below form-bean is session scoped and hence using reset.


...







public class CustForm extends DynaValidatorForm {

   public CustForm() {
   }

 public void reset(ActionMapping 
mapping,	javax.servlet.http.HttpServletRequest  request) {


set("split", Boolean.FALSE);
   }

}


DispatchCustAction

public ActionForward save(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException, 
ServletException
{
DynaValidatorForm frm = (DynaValidatorForm)form;

..
...

return mapping.findForward("successSave");
}



JSP:

.


...


When this jsp is first loaded the checkbox above is unchecked.

When user checked the checkbox, and clicked a submit save button, in the 
save method of dispatch action I was expecting to see the split value as 
"true". But it was "false" when I debug.


why is this?

What am I missing here?

_
Add a Yahoo! contact to Windows Live Messenger for a chance to win a free 
trip! 
http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-us&hmtagline



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



_
Add a Yahoo! contact to Windows Live Messenger for a chance to win a free 
trip! 
http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-us&hmtagline



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



multi level indexed properties

2006-11-06 Thread Sébastien LABEY

Hi all,

I need to display and submit a form with 3 levels of indexed properties. The
3 indexed properties are not constant in size. I have a form with a
MyObject1[] array with getters and setters for indexed properties. MyObject1
object has a List of MyObject2 objects and MyObject2 has a List of MyObject3
objects.
I would like to display these recursives objects with input fields and
submit them. But I really don't know how to do it for the indexed properties
of level 2 and 3 and how to get the corresponding values. Does someone have
an idea?

Thanks

Sebastien


RE: How to make dropdown box editable.

2006-11-06 Thread kumar.vinodh


Thanks Lance for your help.




-Original Message-
From: Lance Semmens [mailto:[EMAIL PROTECTED]
Sent: Monday, November 06, 2006 2:53 PM
To: 'Struts Users Mailing List'
Subject: RE: How to make dropdown box editable.

Dojo has a control that sounds like what you're after.

http://dojotoolkit.org/

go to:
see it in action --> form widgets --> form tour and look at the "state"
field.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 26 October 2006 14:30
To: user@struts.apache.org
Subject: How to make dropdown box editable.


Hi all,


I have requirement where in I want drop down box to be editable. Is this
possible using struts html tag lib.
Please let me know how to go about making drop down box editable.


Regards,
Vinodh













The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain proprietary, confidential or privileged information. If
you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.


www.wipro.com



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



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com

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



RE: How to make dropdown box editable.

2006-11-06 Thread Lance Semmens
Dojo has a control that sounds like what you're after.

http://dojotoolkit.org/

go to:
see it in action --> form widgets --> form tour and look at the "state" field.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 26 October 2006 14:30
To: user@struts.apache.org
Subject: How to make dropdown box editable.


Hi all,


I have requirement where in I want drop down box to be editable. Is this
possible using struts html tag lib.
Please let me know how to go about making drop down box editable.


Regards,
Vinodh













The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.


www.wipro.com



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



[ANNOUNCE] Calyxo 0.9.0 final released

2006-11-06 Thread Christoph Beck
The Calyxo development team is pleased to announce the general
availability of Calyxo 0.9.0 final!

The Calyxo Web Application Framework encourages in MVC Model 2
based web application development. It offers support for true
modular applications, i18n, flexible view management, a powerful
validation engine and more.
Calyxo's Struts plugins may replace Struts' Tiles and Validator.

This is the first official production release, which comes with
Struts 1.3 support, improved PDF documentation as well as a
some minor enhancements and bug fixes.

Please visit the Calyxo web site http://calyxo.org for further
information.

Thank you,

-- The Calyxo Development Team


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