RE: Generating Tiles tags and Struts tags from with in another Custom Tag

2004-03-23 Thread shirishchandra.sakhare
If you are writing a tag,The output generated by your tag should be valid html.

Because the life cycle is as follows.

1-->The ServletContainer gets a request for a particular page(In this case your .jsp 
page)
2-->The request being for a JSP page, the servlet container decides to pass it on to 
JspServlet/any helper class which knows how to interpret jsp code(Call methods on the 
Actions(Tags) if there are any tags included etc. ),I am also not very clear about 
this part, in the sense that if there is any restriction on ServletCOntainers about 
how to handle the interpretation of jsps.

3-->Any output that the tags generate will written to the HTTPServletResponse object. 
which means it has to be valid HTML if the browser has to display it properly.

In your case, as you can see, the tags you wrote are again generating jsp which will 
be directly going to the client Browser.

May be what you can do is to write a temporary jsp file and then redirect to that 
temporary jsp file.

But why you have to go this way?It looks too contrived/complicated to me.

Why not just spit out proper HTML from your tags?
And the only purpose is to reuse the existing struts/Tiles tags,why not extend them, 
overriding where ever appropriate?

HTH.

Regards,
Shirish

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 3:22 PM
To: Struts Users Mailing List
Subject: Generating Tiles tags and Struts tags from with in another
Custom Tag


All,

I wrote a custom tag that generates JSP code that includes struts tags and 
tiles tags.

They are not getting interpreted by the JSP Container. 

Can you please let me know if it is possible? If it is possible are there 
any examples that
help me understand the life cycle?

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.


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



RE: Using SSL Extension and Workflow Extension together

2004-03-23 Thread shirishchandra.sakhare
Hello Scott,
I have already replied to this message.But my replies to the list were bouncing since 
this morning.So reposting the reply.

As the SSL extension and Workflow extension modify different parts of the response 
cycle, they are not mutually exclusive.
Just that nobody came up with the requirement of using SSL+ Workflow + Tiles so far 
:-((

I have put together a class for you,which will allow you to use SSL+ Workflow + Tiles 
combination.
Put this java file in the Workflow source files you have and recompile it.Also change 
the configutration to make use of the new Request Processor.

I will make a note to include this class in next release of Workflow Extension/or make 
it available as patch ,which I am porting to sourceforge.net.


*

package com.livinglogic.struts.workflow;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.SecureTilesRequestProcessor;
import org.apache.struts.config.ForwardConfig;

/**
 * SecureTilesWorkflowRequestProcessor extends the request 
processor from
 * Struts SSL extension.This will allow using the Workflow extension along with the 
SSL extension
 * & Tiles.
 *
 * @author Shirish Sakhare
 */
public class SecureTilesWorkflowRequestProcessor
extends SecureTilesRequestProcessor implements 
WorkflowRequestProcessorLogicAdapter{

/**
 * The WorkflowRequestProcessingLogic instance we are using 
 */
WorkflowRequestProcessorLogic logic;

public void processForwardConfig(HttpServletRequest request, 
HttpServletResponse response, ForwardConfig forward)
throws IOException, ServletException
{
super.processForwardConfig(request, response, forward);
}


public HttpServletRequest processMultipart(HttpServletRequest request)
{
return super.processMultipart(request);
}

public String processPath(HttpServletRequest request, HttpServletResponse 
response)
throws IOException
{
return super.processPath(request, response);
}

public void processLocale(HttpServletRequest request, HttpServletResponse 
response)
{
super.processLocale(request, response);
}

public void processContent(HttpServletRequest request, HttpServletResponse 
response)
{
super.processContent(request, response);
}

public void processNoCache(HttpServletRequest request, HttpServletResponse 
response)
{
super.processNoCache(request, response);
}

public boolean processPreprocess(HttpServletRequest 
request,HttpServletResponse response)
{
return super.processPreprocess(request, response);
}

public ActionMapping processMapping(HttpServletRequest request, 
HttpServletResponse response, String path)
throws IOException
{
return super.processMapping(request, response, path);
}

public boolean processRoles(HttpServletRequest request, HttpServletResponse 
response,
ActionMapping mapping) 
throws IOException, ServletException
{
return super.processRoles(request, response, mapping);
}

public ActionForm processActionForm(HttpServletRequest request, 
HttpServletResponse response, ActionMapping mapping)
{
return super.processActionForm(request, response, mapping);
}

public void processPopulate(HttpServletRequest request, HttpServletResponse 
response,
ActionForm form, 
ActionMapping mapping) throws ServletException
{
super.processPopulate(request, response, form, mapping);
}

public boolean processValidate(HttpServletRequest request, HttpServletResponse 
response,
   ActionForm form, 
ActionMapping mapping) throws IOException, ServletException
{
return super.processValidate(request, response, form, mapping);
}

public boolean processForward(HttpServletRequest request, HttpServletResponse 
response, ActionMapping mapping)
throws IOException, ServletException
{
return super.processForward(request, response, mapping);
}

public boolean processInclude(HttpServletRequest request, HttpServletResponse 
response, ActionMapping mapping)
throws IOException, ServletException

RE: Using SSL Extension and Workflow Extension together

2004-03-23 Thread shirishchandra.sakhare
This should be doable.
I will add it to the next release of Struts Workflow extension on Source forge, as 
soon as it is available for download.

Till then use the hastily crafted code from me.
I have not tested it ,so please test it and let me know.

Add this to the source code you have for workflow extension and  recompile it.
Then also you need to change your config to make use of this new request processor.


But as both these extensions work on different parts of the processing life cycle, 
they should be easy to integrate.

Let me know if you face any problems.


***


/*
 * Created on Mar 23, 2004
 *
 * 
 */
package com.livinglogic.struts.workflow;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.SecureTilesRequestProcessor;
import org.apache.struts.config.ForwardConfig;

/**
 * SecureTilesWorkflowRequestProcessor extends the request 
processor from
 * Struts SSL extension.This will allow using the Workflow extension along with the 
SSL extension
 * & Tiles.
 *
 * @author Shirish Sakhare
 */
public class SecureTilesWorkflowRequestProcessor
extends SecureTilesRequestProcessor implements 
WorkflowRequestProcessorLogicAdapter{

/**
 * The WorkflowRequestProcessingLogic instance we are using 
 */
WorkflowRequestProcessorLogic logic;

public void processForwardConfig(HttpServletRequest request, 
HttpServletResponse response, ForwardConfig forward)
throws IOException, ServletException
{
super.processForwardConfig(request, response, forward);
}


public HttpServletRequest processMultipart(HttpServletRequest request)
{
return super.processMultipart(request);
}

public String processPath(HttpServletRequest request, HttpServletResponse 
response)
throws IOException
{
return super.processPath(request, response);
}

public void processLocale(HttpServletRequest request, HttpServletResponse 
response)
{
super.processLocale(request, response);
}

public void processContent(HttpServletRequest request, HttpServletResponse 
response)
{
super.processContent(request, response);
}

public void processNoCache(HttpServletRequest request, HttpServletResponse 
response)
{
super.processNoCache(request, response);
}

public boolean processPreprocess(HttpServletRequest 
request,HttpServletResponse response)
{
return super.processPreprocess(request, response);
}

public ActionMapping processMapping(HttpServletRequest request, 
HttpServletResponse response, String path)
throws IOException
{
return super.processMapping(request, response, path);
}

public boolean processRoles(HttpServletRequest request, HttpServletResponse 
response,
ActionMapping mapping) 
throws IOException, ServletException
{
return super.processRoles(request, response, mapping);
}

public ActionForm processActionForm(HttpServletRequest request, 
HttpServletResponse response, ActionMapping mapping)
{
return super.processActionForm(request, response, mapping);
}

public void processPopulate(HttpServletRequest request, HttpServletResponse 
response,
ActionForm form, 
ActionMapping mapping) throws ServletException
{
super.processPopulate(request, response, form, mapping);
}

public boolean processValidate(HttpServletRequest request, HttpServletResponse 
response,
   ActionForm form, 
ActionMapping mapping) throws IOException, ServletException
{
return super.processValidate(request, response, form, mapping);
}

public boolean processForward(HttpServletRequest request, HttpServletResponse 
response, ActionMapping mapping)
throws IOException, ServletException
{
return super.processForward(request, response, mapping);
}

public boolean processInclude(HttpServletRequest request, HttpServletResponse 
response, ActionMapping mapping)
throws IOException, ServletException
{
return super.processInclude(request, response, mapping);
}

public Action processActionCreate(HttpServle

RE: RE: Re: Performace Improvement :: Struts based applications

2004-03-18 Thread shirishchandra.sakhare
The initialization of most of resources(ResourceBundles etc) should take place when 
the webApplication is initialized.So I do not see that as a problem.
 
But anyhow, when you say slower or faster,what is the time difference we are talking 
about?
Are you sure no other process on the same computer may be was causing the delay?I know 
this is a  stupid question but have done those mistakes myself:-((
 
Anyhow there are profiling tools out there (Optimizeit,JProbe etc) which can help you 
to nail down the problem to the lowest level..And some of them are l not that costly 
..I will say a must have tool in every commercial grade project's armour.
 
There was a very nice article in java world ,giving a very nice comparison of 
different profilers.
 
http://www.javaworld.com/javaworld/jw-08-2003/jw-0822-profiler.html?
 
I have myself used  Optimizeit and found quite a few performance problems.Will 
certainly recommend it.
 
HTH:
 
Regards,
Shirish
-Original Message-
From: Satya Narayan Dash [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 9:24 PM
To: Sakhare, Shirishchandra
Cc: [EMAIL PROTECTED]
Subject: Re: RE: Re: Performace Improvement :: Struts based applications



I have precompiled JSPs. So I do not see any problem due to that. Rather I feel, the 
intialization of stuts resources are taking time.

On Thu, 18 Mar 2004 [EMAIL PROTECTED] wrote :
>The reason is jsps are not compiled when you hit the pages the first time.So the 
>first call will always be slow as it alos has to compile jsps.The subsequent calls 
>will use the compiled jsps and hence faster.
>
>Some server/ServletEngines have the option to precompile jsps.
>
>HTH.
>
>Regards,
>Shirish
>
>
>-Original Message-
> From: Satya Narayan Dash [mailto:[EMAIL PROTECTED]
>Sent: Thursday, March 18, 2004 2:13 PM
>To: Struts Users Mailing List
>Cc: Vic Cekvenich
>Subject: Re: Re: Performace Improvement :: Struts based applications
>
>
>Hi,
>
>I have done the testing of the view layer. And what is peculiar is when i am hitting 
>the ServletEngine for the first time, then it takes a lot of time, but subsequent 
>hits take less time.
>
>Is it because the ActionServlet is not initiliazed, though I have started the engine?
>
>I would like to know if any recommended technique is given to improve the performance.
>
>Regards,
>Satya.
>
>On Thu, 18 Mar 2004 Vic Cekvenich wrote :
> >Unit test the performance of the model layer.
> >.V
> >
> >Satya Narayan Dash wrote:
> >>Hi,
> >>
> >>I am in the process of improving a struts based application. I am using the cache 
> >>taglib (from apache) and have written some filters to improve the performace.
> >>I am using Apache2 as the web-sever and Tomcat4 as the servelt/jsp engine. I have 
> >>optimized them both.
> >>
> >>But the peformance improvement is not substantial. Can you please give me some 
> >>tips to improve the performance ?
> >>Need your help,
> >>Regards,
> >>Satya.
> >
> >
> >-
> >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: Re: Performace Improvement :: Struts based applications

2004-03-18 Thread shirishchandra.sakhare
The reason is jsps are not compiled when you hit the pages the first time.So the first 
call will always be slow as it alos has to compile jsps.The subsequent calls will use 
the compiled jsps and hence faster.

Some server/ServletEngines have the option to precompile jsps.

HTH.

Regards,
Shirish


-Original Message-
From: Satya Narayan Dash [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 2:13 PM
To: Struts Users Mailing List
Cc: Vic Cekvenich
Subject: Re: Re: Performace Improvement :: Struts based applications


Hi,

I have done the testing of the view layer. And what is peculiar is when i am hitting 
the ServletEngine for the first time, then it takes a lot of time, but subsequent hits 
take less time. 

Is it because the ActionServlet is not initiliazed, though I have started the engine?

I would like to know if any recommended technique is given to improve the performance.

Regards,
Satya.

On Thu, 18 Mar 2004 Vic Cekvenich wrote :
>Unit test the performance of the model layer.
>.V
>
>Satya Narayan Dash wrote:
>>Hi,
>>
>>I am in the process of improving a struts based application. I am using the cache 
>>taglib (from apache) and have written some filters to improve the performace. 
>>I am using Apache2 as the web-sever and Tomcat4 as the servelt/jsp engine. I have 
>>optimized them both.
>>
>>But the peformance improvement is not substantial. Can you please give me some tips 
>>to improve the performance ? 
>>Need your help,
>>Regards,
>>Satya.
>
>
>-
>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: Is there a way to have more than one controller servlets?

2004-03-17 Thread shirishchandra.sakhare
Hi,
I am not sure why you want to have a central controller and secondary controllers.

My experience is that if you have single controller,the application is more easy to 
maintain.

But if at all you want different controllers because you have different modules, then 
may be in struts 1.1 , you can use different request processors which are again 
controllers,but at a level lower than the ActionServlet.So in this case, the 
ActionServlet will be the main controller and the corresponding request processors can 
be sub controllers per module,one level down.

HTH.

Regards,
Shirish


-Original Message-
From: Amit Deokar [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 9:32 PM
To: Struts Users Mailing List
Subject: Is there a way to have more than one controller servlets?


Is there a way to have more than one controller servlets in Struts. My aim
is to have a "main" controller manager several other controllers. Any
suggestions or help?

Thanks in advance.
-amit


-
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: Handling multiple submits from a single form

2004-03-15 Thread shirishchandra.sakhare
use findForward action to dispatch the request to different actions depending upon the 
button pressed or use DispatcherAction
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Handling multiple submits from a single form


 
Hi
 
I have multiple actions possible from a single JSP page. How can I handle it using 
struts? I have single form with multiple buttons and I am using the html tag library. 
How can I handle it without using javascript?
 
Regards
Sajith

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



RE: My wizard workflow code.. doesnt work :S

2004-03-12 Thread shirishchandra.sakhare
Hello Edd,

I do not see any reason why the workflow extension should not work with STXX or any 
other extension..Apart from only one reason..STXX needs its own request processor 
which is not working
.But As I have not used STXX,i am not sure about it.

But from what you have posted to me ,I can tell you as follows.

Once the action does a forward, there is some step inSTXX extension, which will use 
the given forward(in your case 

 ) to perform the XML to html conversion using the defined XSLT 
..Most preferably in the  processForwardConfig(request, response, forward) method of 
the  request processor as this is the method that is called after the action returns a 
forward.

Please let me know if STXX uses a custom request processor and have a look in the 
method i have mentioned.

Else I can have a go at it.

HTH.

Regards,
Shirish.


-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 2:38 PM
To: Sakhare, Shirishchandra
Subject: RE: My wizard workflow code.. doesnt work :S


Hi Shirish

I am having another crack at getting the workflows working with stxx in
struts...

I am now basically trying converting the example application (the
addition of 2 numbers example) to work with stxx

if the struts-config.xml i have set the following section up :

  





   


  


The only change in their to the standard example is :

   




When i run the application when it trys to show the first page of the
wizard it displays a blank screen, i sent it in debug mode as well which
would show the raw xml being output by struts, and it displayed
absolutely nothing as well.

I am now thinking that the workflow extensions may not be able to work
with stxx at all.

What would your opinion be on this?

cheers
Edd

p.s I still cannot get on the struts-user list as my work havent taken
it off the spam list yet :(

>>> <[EMAIL PROTECTED]> 03/08/04 4:20 PM >>>
Hi,
You should find out what ever is the syntax for html hidden paramaters
and Using XSLT , create that string from the XML/or bean property what
ever approach you are using.

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 5:10 PM
To: Sakhare, Shirishchandra
Subject: RE: My wizard workflow code.. doesnt work :S


Hi Shirish

I tried this method, and it doesn't work as beans don't execute in an
xslt, so it just displays the text :   in plain text above the form!

oh well worth a try :S

Edd

>>> <[EMAIL PROTECTED]> 03/08/04 10:34 AM >>>
I am speaking about html hidden parameters.

In jsp world, After the login page, on the user_details.jsp page would
have something like

  which will in turn
create 2 hidden parameters of same name on the html for
user_details.jsp(for html details of same, see some HTML site..I am bad
with html syntax..Just know jsps.).So when the user enters all data ,
along with his data, the 2 hidden parameters will be again passed.And
hence available on the second action.SO you can apply similar technique
even with XSLT.


regards,
Shirish

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 11:30 AM
To: Sakhare, Shirishchandra
Subject: RE: My wizard workflow code.. doesnt work :S


How do the hidden paremeters work? do they get passed via the url?

i.e http://mysite.com/Mypage.do?parameter1=hello,parameter2=world

?

>>> <[EMAIL PROTECTED]> 03/08/04 10:26 AM >>>
Hi,
Also just an afterthought.

If this is just oneoff thing then there is a simpler solution to sharing
data.Use hidden parameters..But in this case as the data contains
username/password, I will not recommand it.

Regards,
Shirish.

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 11:24 AM
To: Sakhare, Shirishchandra
Subject: RE: My wizard workflow code.. doesnt work :S


thanks shirish

I will have a go with this and see what comes of it, i will have to
modify to try and use stxx, as i am not using jsp's for this project (i
am useless at jsp's) it has to be done using xslt's

>>> <[EMAIL PROTECTED]> 03/08/04 10:20 AM >>>
Ok.So now I know your workflow.
SO it seems that the only requirement you have is keeping data across
pages and then clear the data from session when user has completed the
workflow.So an ideal requirement to use workflow scope to stuff your
data.

stage1:RegisterSellerActionPage1.java.The action mapping conf will look
like this.

I have only entered workflow related elements of actionMapping.Rest you
can fill in.The struts action form should be in request scope.


 




  




 




   
  

 





  

I do not know about STXX..But the same you can use to achieve any
workflow.

HTH.

regards,
Shirish




-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent

RE: struts-workflow-extension and DynaValidatorForm

2004-03-12 Thread shirishchandra.sakhare
Hi Dean,
The struts workflow extension will just work as well with dynaValidatorForms or any 
other type of bean you use as form bean.The only point where it differs from standard 
struts is the ActionMapping.It uses a ActionMapping class of its own.But that also can 
be taken care of.

Just start with it and if you have any questions, there are people in this list(myself 
included) who will be glad to help.

HTH.
Regards,
Shirish.



-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 6:19 PM
To: [EMAIL PROTECTED]
Subject: struts-workflow-extension and DynaValidatorForm


I am interested in using the workflow extension but do
not want to give up using DynaValidatorForm. Is it
possible?

Dean Hoover


-
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: help me with using bean

2004-03-11 Thread shirishchandra.sakhare
Can you send the mail without the entrust cretificate?
I can not read the mail and hence help you :-((

> -Original Message-
> From: stu [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:04 PM
> To:   [EMAIL PROTECTED]
> Subject:  Re: help me with using bean
> 
>  << File: SMIME.txt >> 

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



RE: [OT]JSP Debugger

2004-03-10 Thread shirishchandra.sakhare
There is another age old method to debug jsps...

Just comment out entire code and uncomment the code incremently to see exactly which 
portion of jsp is causing problems.Has worked well for me many times..But this 
technique works well only if you have some part of jsp which is causing problem in the 
page display...

But if you really want to see how the jsp is being rendered(I dont see any such 
requirement???),then this will not work.But I have debugged even the tags well just by 
putting break points in the  tag source files when using tomcat/eclipse combination.



-Original Message-
From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 3:48 PM
To: Struts Users Mailing List
Subject: [OT]JSP Debugger


1.First my apology for post this question which I have asked it already.

2.This is question reg Debugging JSP,I do understand that debugging JSP is not really 
required if we are really follow MVC pattern as we are not putting too much of logic 
in it...BUT just wanted to know that is there any JSP debugger tool/plugin available 
for Eclipse? we know that myeclipse works well with Tomcat as a separate container but 
when it comes with JBoss Tomcat bundle I could not debug JSP using the same tool.

Tnx in advance,

-Ramadoss

-
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: Own Action-Subclass: How to configure using "set-property"-elements?

2004-03-08 Thread shirishchandra.sakhare
Hi,
Those setters will be called on the ActionMapping you specify.So the same will me 
available in all actions as attributes on your custom ActionMapping class(Subclass of 
ActionMapping.)

And you have to configure the struts to use your action mapping as follows.






HTH.
Regards,
Shirish





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 10:07 AM
To: [EMAIL PROTECTED]
Subject: Own Action-Subclass: How to configure using
"set-property"-elements?


Hey everbody!
 
I derived my own Action-subclass for doing multiple stuff in my webapp on
every request. Part of the "multiple-stuff" is a method that checks if the
session got lost, but only if needed at that certain point in the
application (like when a formbean is used over multiple request for creating
an order or stuff).
Now, my current pratice is to call that method manually in every custom
action I write, which is somehow unsatisfying. I'd rather like to be able to
configure this session-safety directly through the struts-config.xml. I saw
that there are  elements, which seem like they could give me
such an ability based on every action-mapping. That'd be nice.
But HOW can I access those properties in my action?! I can't seem to find
any methods for that.
 
Thx for any help!!
___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED] 
 

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



RE: Struts wizard workflows and stxx

2004-03-04 Thread shirishchandra.sakhare
Hello,
The demo application code is included with the downloaded source code.If you have 
downloaded the sourcecode, just look under the demo folder.

Also you have any doubts/questions, get back to me.

Regards,
Shirish.

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 8:31 PM
To: Sakhare, Shirishchandra
Subject: RE: Struts wizard workflows and stxx


Hi Shirish

Thanks for the info, i have downloaded struts-workflow-1-0-3-demo and
have it running..

I'd really like to know whether its possible to see the source code
behind the action classes in the demo just so i can really see 100% how
it all works?

thanks
Edd


>>> [EMAIL PROTECTED] 03/02/04 4:45 PM >>>
Hi ,
What you are looking for may be fits in workflow pattern.
We had some discussion about this on the list some time back.

the approach you have seen will work well, but the only problem that I
can see is the form will stay in session.

And being a web application, the user can jump any where.And hence no
way to clearly define the end point for workflow or force user to follow
the exact page flow.

So first decide what is your exact requirements it just one off
requirement or you may need to share data across pages in many
places.And mainly, putting form bean in session  is tolerable for your
web application(volume of traffic you are expecting etc .)

IF you need an out of box solution for those things, have a look at the
following extension.

http://www.livinglogic.de/Struts/index.html

I am porting the project to source forge and planning a new version as
well.But the current version is stable and supports all work flow
requirements.

If you have any doubts, I can help you with the same.

HTH.
Regards,
Shirish

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 5:26 PM
To: [EMAIL PROTECTED]
Subject: Struts wizard workflows and stxx


Hi

I am developing using struts and the stxx extensions that replace the
use of beans and jsp's with XML and XSLT. 

I am working on a site where as users register it asks them for a lot of
information..

So i want to split this over a few pages of forms..

page 1 will let  them choose a username and password

page 2 will let them enter their personal details
(forename,surname,email etc)

page 3 will let them enter their postal address

then i want my Action to pool all the details and create their account
and forward them to another page.


Now the question is what is the best way to go about this? I have found
the following on the jakarta website :

==

How can I create a wizard workflow? 
The basic idea is a series of actions with next, back, cancel and finish
actions with a common bean. Using a LookupDispatchAction is reccomended
as it fits the design pattern well and can be internationalized easily.
Since the bean is shared, each choice made will add data to the wizards
base of information. A sample of struts-config.xml follows: 






























The pieces of the wizard are as follows: 

forms.MyWizard.java - the form bean holding the information required 

actions.MyWizard.java - the actions of the wizard, note the use of
LookupDispatchAction allows for one action class with several methods.
All the real work will be done in the 'finish' method. 

mywizard[x].jsp - the data collection jsp's 

mywizarddone.jsp - the 'success' page 

mywizardcancel.jsp - the 'cancel' page 




Is it possible to do this when using stxx? and what would be the setup
of my struts-config.xml document for this?

Does anyone have any example code that acheives something similar to
what i am looking for?

Thanks for reading all this!

cheers
Edd :)

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


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


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



RE: Viewing .pdf files usign struts frames work..

2004-03-03 Thread shirishchandra.sakhare
return null from the action instead of returnign a forward.

-Original Message-
From: Vasudevrao Gupta [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 3:58 PM
To: 'Struts Users Mailing List'; 'Satya Narayan Dash'
Subject: Viewing .pdf files usign struts frames work..



Hi All,

I am trying to view a pdf file using struts frame work..
I am able to view the file ,but it throws an illegalStateException as struts
forward the request after I send the output stream.

Below is the action mapping:





below is the action class execute() method:
try {

MessageResources resource = this.getResources(request);
String scannedFileFolder = (String)
resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_LOCATN);
System.out.println("scannedFileFolder>>"+scannedFileFolder);
String scannedFileExtn = (String)
resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_EXTN);
System.out.println("scannedFileExtn>>"+scannedFileExtn);
String scannedFileLocation = scannedFileFolder +
request.getParameter("scannedFileReference") + scannedFileExtn;

System.out.println("scannedFileLocation>>"+scannedFileLocation);
String contentType = (String)
resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_CONTENT);
System.out.println("contentType>>"+contentType);
response.setContentType(contentType);
File pdfFile = new File(scannedFileLocation);
response.setContentLength((int) pdfFile.length());
FileInputStream in = new FileInputStream(pdfFile);
request.setAttribute("FILE",in);
OutputStream out = response.getOutputStream();

byte[] buf = new byte[4096];
int count = 0;
while ((count = in.read(buf)) >= 0) {
out.write(buf, 0, count);
}
out.flush();
in.close();
out.close();
} catch (Exception e) {

// Report the error using the appropriate name and ID.
System.out.println("Exception found while viewing>>"+e);
errors.add("name", new ActionError("id"));

}
return (mapping.findForward("SUCCESS"));
}

Please suggest me anyother alternative using the struts framework



Confidentiality Notice 

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 confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

-
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 Workflow - Questions ?

2004-03-03 Thread shirishchandra.sakhare
Also you need not use the session scope for the form.What ever data you want to share 
across pages, you can use workflow container to hold that data...

Have a look at the Demo application and Test Application(available with the  standard 
download ).The test application in fact demonstrates quite a few advanced concepts.It 
has examples of the loop back action as well.

HTH.
Regards,
Shirish




-Original Message-
From: Tommy Holm - TELMORE [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 9:10 AM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: SV: Struts Workflow - Questions ?


Hi 
I am not sure if I understand your question right, but the way I
understand it is.
You have some action that either can forward to itself (looping) 3 times
( 4 time it should be a workflow violation) or in case everything is ok
forward to another action ?
Well you have a couple of options. You could have a action mapping like
this
 











In your somePossibleLoopingAction you could have a session variable that
holds the count of unsuccessful logins, after the third it could foward
to /someActionThatViolates, this action should of course have some
states that would be violated and then the workflow engine would trigger
a workflow violation where your session forms would be cleaned and you
could eventually make sure that the user is banned or whatever you want.
This should happen in your workflow violation action class. Just make
sure you have a global forward like this !



And then of course the action mapping represented by the
/handleWorkflowLoginViolation.do.


-
makes sure that this workflow is ended 
mailto:[EMAIL PROTECTED] 
Sendt: 2. marts 2004 18:16
Til: [EMAIL PROTECTED]
Emne: Struts Workflow - Questions ?


Hi,

I'm trying to resolve a problem I have by making use of Struts Workflow
- Using this as I need something that will prevent "jump-out" within the
process

The login process of my app has a number of conditions which dictate
which page I send the user to next.

I understand the basic's of the Struts Workflow but am a little confused
when we get to the looping/forwarding aspects

Basically the section of the flow is as follows:

SecurityFilterAuthentication -> Is User Authenticated ?
 If  Y  -> StartWorkflow -> Retrieve User Settings -> Is
3fromN login required ?
   If Y -> Do 3FromN Else ->Record Successful Login ->
...Continue Workflow

The 3FromN section has to allow the user 3 attempts and then do a Lock
Out Action or if successful continue to the Record Successful Login
Action

How do I make those decisions within the workflow ? Do I have to have an
action for every decision node or can I set what the next action should
be in the active one using  return (new ActionForward());

Regards

Joanne Corless



-
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: ConcurrentModificationException

2004-03-02 Thread shirishchandra.sakhare
genarally you get this error with lists if you are iterating over list and remove 
element/add element to list..

-Original Message-
From: Sergei P. Volin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 7:08 PM
To: Struts Users Mailing List
Subject: Re: ConcurrentModificationException



The exception arised by doAfterBody method of IterateTag class, namely at
. It means that at least one time the body of iteration was
done. I can guarantee that inside itereator tags -
... I do not change nor iterator either
session attributes - just reading of session beans. So if smth of that
changes is that only due to some kind of requests interaction. I don't know
how it could be. This is really painful to me since I can't even think what
could it be and the issue persists from time to time. And again - the
application works smoothly when there is no collision of requests.

- Original Message - 
From: "Brad Balmer" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 8:49 PM
Subject: Re: ConcurrentModificationException


|
| Any chance that you were iterating through your HttpSession removing
| attributes?
|
| Sergei P. Volin wrote:
|
| >Greetings!
| >
| >Why did I get this message when sending two concurent requests to the
same page?
| >I'm using:
| >1) RH8.0, Linux 2.4.18 #2 SMP
| >2) java version "1.4.0"
| >Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
| >Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a (JIT
enabled: jitc))
| >3) Tomcat 5.0.19
| >4) Struts 1.1
| >
| >The same exception I've got on 4.1.24. I really have problems (with other
symptoms) with concurrent requests. Not often (because server is not highly
exploited) but persisted. And more often on Linux platform than on Windows.
Why so? Could it be a jvm issue? Or may be Tomcat? Or Struts? Or mine?
Without concurrent requests application works smoothly.
| >
| >Regards,
| >
| >Sergei Volin.
| >
| >HTTP Status 500 -
| >
|
>---
-
| >
| >type Exception report
| >
| >message
| >
| >description The server encountered an internal error () that prevented it
from fulfilling this request.
| >
| >exception
| >
| >org.apache.jasper.JasperException
| >
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
58)
| > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
| > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| >
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
| >
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
| >
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
| > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
| > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| > com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
| >
| >root cause
| >
| >java.util.ConcurrentModificationException
| > java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
| > java.util.AbstractList$Itr.next(AbstractList.java:417)
| >
org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:401)
| >
org.apache.jsp.admin.sidEditorSurveys_jsp._jspService(sidEditorSurveys_jsp.j
ava:1214)
| > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| >
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
| > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
| > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| >
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
69)
| >
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:455)
| >
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
| > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
| > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
| > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| > com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
| >
| >note The full stack trace of the root cause is available in the Tomcat
logs.
| >
| >
|
>---
-
| >
| >Apache Tomcat/5.0.19
| >
| >
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional comman

RE: Struts wizard workflows and stxx

2004-03-02 Thread shirishchandra.sakhare
Hi ,
What you are looking for may be fits in workflow pattern.
We had some discussion about this on the list some time back.

the approach you have seen will work well, but the only problem that I can see is the 
form will stay in session.

And being a web application, the user can jump any where.And hence no way to clearly 
define the end point for workflow or force user to follow the exact page flow.

So first decide what is your exact requirements it just one off requirement or you may 
need to share data across pages in many places.And mainly, putting form bean in 
session  is tolerable for your web application(volume of traffic you are expecting etc 
.)

IF you need an out of box solution for those things, have a look at the following 
extension.

http://www.livinglogic.de/Struts/index.html

I am porting the project to source forge and planning a new version as well.But the 
current version is stable and supports all work flow requirements.

If you have any doubts, I can help you with the same.

HTH.
Regards,
Shirish

-Original Message-
From: Edd Dawson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 5:26 PM
To: [EMAIL PROTECTED]
Subject: Struts wizard workflows and stxx


Hi

I am developing using struts and the stxx extensions that replace the
use of beans and jsp's with XML and XSLT. 

I am working on a site where as users register it asks them for a lot of
information..

So i want to split this over a few pages of forms..

page 1 will let  them choose a username and password

page 2 will let them enter their personal details
(forename,surname,email etc)

page 3 will let them enter their postal address

then i want my Action to pool all the details and create their account
and forward them to another page.


Now the question is what is the best way to go about this? I have found
the following on the jakarta website :

==

How can I create a wizard workflow? 
The basic idea is a series of actions with next, back, cancel and finish
actions with a common bean. Using a LookupDispatchAction is reccomended
as it fits the design pattern well and can be internationalized easily.
Since the bean is shared, each choice made will add data to the wizards
base of information. A sample of struts-config.xml follows: 






























The pieces of the wizard are as follows: 

forms.MyWizard.java - the form bean holding the information required 

actions.MyWizard.java - the actions of the wizard, note the use of
LookupDispatchAction allows for one action class with several methods.
All the real work will be done in the 'finish' method. 

mywizard[x].jsp - the data collection jsp's 

mywizarddone.jsp - the 'success' page 

mywizardcancel.jsp - the 'cancel' page 




Is it possible to do this when using stxx? and what would be the setup
of my struts-config.xml document for this?

Does anyone have any example code that acheives something similar to
what i am looking for?

Thanks for reading all this!

cheers
Edd :)

-
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: hiding jsp files under WEB-INF

2004-03-01 Thread shirishchandra.sakhare
Hi,
The taglibs will work, whether or not the page is being handled by struts 
controller,so long as they have the required objects(form bean , other beans)in the 
scopes mentioned in jsps.
:-))

-Original Message-
From: Mainguy, Mike [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 6:45 PM
To: 'Struts Users Mailing List'
Subject: RE: hiding jsp files under WEB-INF


Whoops, didn't see that.  Now I'm more inclined to think this will not work
as this page is not being handled by the struts controller.

<>

-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 12:35 PM
To: Struts Users Mailing List
Subject: Re: hiding jsp files under WEB-INF


Mainguy, Mike wrote:

>Also, are sure sure welcome is not supposed to be Welcome? (case 
>sensitive?)
>
The way I understand it, "welcome" is globally forwarded to 
"/Welcome.do", as
per the struts-config.xml.

>
>>
>
>-Original Message-
>From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 01, 2004 11:59 AM
>To: [EMAIL PROTECTED]
>Subject: hiding jsp files under WEB-INF
>
>
>I realized that the subject I filed this
>under (getting started) may not get
>attention. So I'm sending it out under
>this subject. Did some google searching
>but still don't see what the problem is.
>
>=
>I am experimenting with some code
>from "Struts in Action" but I am moving
>source code around abit. Specifically,
>I am moving all of the .jsp files into
>the WEB-INF directory except
>index.jsp. This is so that a user cannot
>hit a given .jsp directly. Anyway, I
>am getting an exception right from the
>get go and don't know what I am doing
>wrong. Here's the relevant pieces:
>
>== index.jsp ===
><%@ taglib uri="/tags/struts-logic" prefix="logic" %> name="welcome"/>
>
>== Welcome.jsp ===
>
>"DTD/xhtml1-trans
>itional.dtd">
><% taglib uri="/tags/struts-bean" prefix="bean" %>
><% taglib uri="/tags/struts-html" prefix="html" %>
><% taglib uri="/tags/struts-logic" prefix="logic" %>
>
> 
>   Welcome World!
>   
> 
> 
>   
> Welcome !
>   
>   
> Welcome World!
>   
>   
>   
> Sign in
> 
>   Sign out
> 
>   
> 
>
>
>=== struts-config.xml ===
>
>Struts Configuration 1.0//EN" 
>"http:/jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
>
> 
>   
> 
>   
> 
>   
>
> 
>  path="/Welcome"
>   type="org.apache.struts.actions.ForwardAction"
>   parameter="/WEB-INF/Welcome.jsp"/>
>
>  type="org.apache.struts.actions.ForwardAction"
>   parameter="/WEB-INF/Logon.jsp"/>
>
>  type="app.LogonAction"
>   name="logonForm"
>   scope="request"
>   validate="true"
>   input="/WEB-INF/Logon.jsp"/>
>
>  type="app.LogoffAction">
> 
>   
>
>  type="app.RegisterAction"
>   name="registerForm"
>   input="/WEB-INF/Register.jsp"
>   >
> 
> 
>   
>
> 
>
>
>
>Here's the exception:
>
>*exception*
>
>javax.servlet.ServletException: Exception forwarding for name welcome:
>javax.servlet.ServletException
> 
>org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCon
>textI
>mpl.java:867)
> 
>org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte
>xtImp
>l.java:800)
>org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
>ava:3
>11)
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>*root cause*
>
>javax.servlet.jsp.JspException: Exception forwarding for name welcome:
>javax.servlet.ServletException
>org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173)
>org.apache.jsp.index_jsp._jspx_meth_logic_forward_0(index_jsp.java:82)
>org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
>ava:3
>11)
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>
>
>What am I doing wrong?
>Dean Hoover
>
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>-
>This message and its contents (to include attachments) are the property 
>of Kmart Corporation (Kmart) and may contain confidential and 
>proprietary information. 

RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread shirishchandra.sakhare
I have not understood your problem completely.

But this looks like more a problem of resetting the list in form than anything else.

Firstly, if you are using request scoped form, then why going from page 1 to page 2 
will apend the beans to form?

Are you sure you are using request scoped forms?

If the form is session scoped, make sure you reset the list to empty properly.

HTH.
regards,
Shirish

-Original Message-
From: Martin Sturzenegger [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 3:28 PM
To: Struts Users Mailing List
Subject: RE: Problem in nested tags- Very Urgent - Please Help


hi,
i'm trying to use hubert's (and shirish's) approach on request-scope, and as long as 
the amount of rows are fixed it works well.
BUT now i have an additional feature on my page and that gives me headaches. 
actionOne gets the rows from the dto-bean and initializes the jsp. 
on the jsp-page with the form over the rows, i have an additional form where the user 
can toggle through different versions of my db.
this form submits to actionOne where the action is supposed to fetch another set of 
rows, according to the parameter given. 
let's say: choose february 12th there are 12 rows to display, choose february 15th 
there are 15 different rows, choose the next day there are 10 rows.
with this approach, starting with february 12th i get 12 rows. changing to february 
15th i get the old 12 rows and the new 15 rows added to, going back to feb 12th i get 
the old 27 rows and again the 12 rows from feb.12 added to and so on and on
is there a way to reinitialize the autopopulation method or even to temporarily 
disable autopopulation on lists with nested properties?
any adwise or code snippets are warmly welcomed
take care
martin



-- Urspruengliche Nachricht --
Von: Hubert Rabago <[EMAIL PROTECTED]>
Antworten an: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Datum:  Thu, 26 Feb 2004 07:01:54 -0800 (PST)

>IIRC, you also need it in reset():
>
>public class LazyListExampleForm extends ActionForm {
>private List actionList;
> 
>public LazyListExampleForm () {
>initLists();
>}
>
>public void reset(ActionMapping mapping, 
>  HttpServletRequest request) {
>super.reset(mapping, request);
>initLists();
>}
> 
>private void initLists() {
>Factory factory = new Factory() {
>public Object create() {
>return new ActionListBean();
>}
>};
>this.actionList = ListUtils.lazyList(new ArrayList(), factory);
>}
>
>// Getter/setters for list omitted
>}
>
>- Hubert
>
>--- "Paul, R. Chip" <[EMAIL PROTECTED]> wrote:
>> Note: I think this is likely different in current versions of the commons
>> collections lib, but this works for the version we are dependent on.
>> 
>> import java.util.ArrayList;
>> import java.util.List;
>> import org.apache.commons.collections.Factory;
>> import org.apache.commons.collections.ListUtils;
>> // Nonrelevant imports ommitted
>> 
>> public class LazyListExampleForm extends ActionForm {
>>  private List actionList;
>> 
>>  public LazyListExampleForm ()
>>  {
>>  Factory factory = new Factory() {
>>   public Object create() {
>>   return new ActionListBean();
>>   }
>>   };
>>   this.actionList = ListUtils.lazyList(new ArrayList(),
>> factory);
>>  }
>> 
>>  // Getter/setters for list omitted
>> }
>> 
>> -Original Message-
>> From: Mark Lowe [mailto:[EMAIL PROTECTED] 
>> Sent: Thursday, February 26, 2004 8:49 AM
>> To: Struts Users Mailing List
>> Subject: Re: Problem in nested tags- Very Urgent - Please Help
>> 
>> 
>> wouldn't mind an example of how to use lazy list if you have one.
>> 
>> 
>> On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:
>> 
>> > Or use the Commons Collections LazyList which handles this problem 
>> > automatically.
>> >
>> > -Original Message-
>> > From: Mark Lowe [mailto:[EMAIL PROTECTED]
>> > Sent: Thursday, February 26, 2004 8:09 AM
>> > To: Struts Users Mailing List
>> > Subject: Re: Problem in nested tags- Very Urgent - Please Help
>> >
>> >
>> > shirish posted this a few times.
>> >
>> > if you're scoping to request you'll need a while loop in your 
>> > getFoo(int index)  method
>> >
>> > public class OrgManagementForm extends ActionForm {
>> >
>> > private List addressList = new ArrayList();
>> >
>> > public Address getAddress(int index) {
>> >
>> >while(index >= addressList.size() ) {
>> >this.addressList.add( new Address() );
>> >}
>> >
>> >return (Address) addressList.get(index);
>> > }
>> >
>> > bla bla.
>> >
>> > }
>> >
>> > look like it could be your problem.
>> >
>> >
>> > On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:
>> >
>> >> I am having an OrganzationVO inside my form-bean.
>> >>
>> >> The OrganzationVO has a collection o

RE: Problem in nested tags- Very Urgent - Please Help

2004-02-27 Thread shirishchandra.sakhare
But using lazy initialization is simple...

See my earlier post...

I am resending my earlier mail to another user.Go through the sample code
and
ask me if u dont understand something.

The important portions are commented.Especially look at the jsps property
how
it is set and also the form bean.The property syntax i have used was for struts 1.0 
..But with struts 1.1 , you can have a better cleaner syntax using nested tags.But I 
have not used it...This works for 1.1 as well..



//Form Class

import java.util.ArrayList;

import java.util.List;

import org.apache.struts.action.ActionForm;

public class ExampleListForm extends ActionForm {

//A list of Emp beans

private List beanList = new ArrayList();

public List getBeanList(){

return beanList;

}

public void setBeanList(List list){

beanList = list;

}

//very imp.

//give indexed access to the beans

public Employee getEmployee(int index){

//very imp

//when a jsp is submited , then while auto populating the form,this will
ensure
that

// the  form is populated properly.

while(index >= beanList.size()){

beanList.add(new Employee());

}

return (Employee)beanList.get(index);

}

public void setEmployee(int index,Employee emp){

beanList.set(index,emp);

}

}

***

Bean class

public class Employee {

private String name;

private String salary;

/**

* Returns the name.

* @return String

*/

public String getName() {

return name;

}

/**

* Returns the salary.

* @return String

*/

public String getSalary() {

return salary;

}

/**

* Sets the name.

* @param name The name to set

*/

public void setName(String name) {

this.name = name;

}

/**

* Sets the salary.

* @param salary The salary to set

*/

public void setSalary(String salary) {

this.salary = salary;

}

}



JSP

<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>







">

">







Explanation:

See how the property is constructed.

">

So this will result in a parameter name employee[i].name in the http
request.So
when the jsp is rendered, this will be interpreted as

getEmployee[i].getName().And when the jsp is submitted , the same will be
interpreted as getEmployee[i].setName().And this will result in auto
population
of data in the form as u can see.

So check the indexed properties on the form as well.(Especially the
getEmployee(index i) proeprty with while loop.)

Hope this helps.



regards,

Shirish.

-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 1:21 PM
To: Struts Users Mailing List
Subject: RE: Problem in nested tags- Very Urgent - Please Help


>i'll try to use lazy list once i finish off my work

Eugh... We have all done it, but that is how botches get in to production code. People 
usually get too busy to apply the 'proper' code, or something more important that 
needs attention comes along. 

2 years later someone comes along and has to rewrite a major part of the application 
to compensate for the temporary fix :P

Welcome to the Software Industry.

btw that is not a personal slight on you :) just an observation of the industry as a 
whole.

-Original Message-
From: Parthasarathy Kesavaraj [mailto:[EMAIL PROTECTED]
Sent: 27 February 2004 09:45
To: 'Struts Users Mailing List'
Subject: RE: Problem in nested tags- Very Urgent - Please Help


Thanks mark , hubert and paul. i removed scope = request and it is working
fine now.

(Temporary fix :-)) i'll try to use lazy list once i finish off my work)


With Regards

Partha


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 8:35 PM
To: Struts Users Mailing List
Subject: Re: Problem in nested tags- Very Urgent - Please Help


Nice one..

For some reason i thought the Factory would involve more than it does,  
so i shied away from it.

Cheers Mark

On 26 Feb 2004, at 15:57, Paul, R. Chip wrote:

> Note: I think this is likely different in current versions of the  
> commons
> collections lib, but this works for the version we are dependent on.
>
> import java.util.ArrayList;
> import java.util.List;
> import org.apache.commons.collections.Factory;
> import org.apache.commons.collections.ListUtils;
> // Nonrelevant imports ommitted
>
> public class LazyListExampleForm extends ActionForm {
>   private List actionList;
>
>   public LazyListExampleForm ()
>   {
>   Factory factory = new Factory() {
>public Object create() {
>return new ActionListBean();
>}
>};
>this.actionList = ListUtils.lazyList(new ArrayList(),
> factory);
>   }
>
>   // Getter/setters for list omitted
> }
>
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 26, 2004 8:49 AM
> To: Struts

RE: Struts Workflow

2004-02-27 Thread shirishchandra.sakhare
Hi,
I don't think building a real workflow would be that simple.I mean the workflow must 
be built in the framework, the actions being just configured to use it.

And why reinvent the wheel when there is already a solution :-))

Have a look at http://www.livinglogic.de/Struts/

We used it in our project and found that it satisfies most of the requirements.
I am not sure what exactly is your requirement.But the above mentioned extension 
satisfies all workflow requirements.And I am in the process of refactoring it so that 
it provides more extension points for customization.

1.It provides workflow scope.So if you define a group of actions belonging to a 
workflow, they have their own workflow scope.The objects in this scope are available 
only for the duration of the workflow scope.If user jumps out of workflow,the workflow 
scope is cleared.
2.You can define modal dialogue box like screens, where user can be forced to complete 
a workflow/cancel it explicitly before he can jump workflow.

And the best part is,you do not need any code change.All of this is taken care by the 
workflow extension.You only have to configure your action mappings to use workflow.

Have a look at the demo application on the web site.
Also the test application is another replace where you can see how the extension can 
be used in a real world application.

I am in the process of transferring this application to sourceforge.Just transferred 
all source code to sourceforge cvs yesterday :-)).

Have  a look at the extension and let me know if you still have any questions.

HTH.
Regards,
Shirish.



-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 7:58 PM
To: Struts Users Mailing List
Subject: RE: Struts Workflow


No matter what, I would recommend turning off caching on the struts
controller, otherwise you will get anomalies with the back button and
workflows.  Do this early in your development and testing with QA.

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 26, 2004 12:42 PM
To: Struts Users Mailing List
Subject: Re: Struts Workflow

My suggestion is to build your own.  This is fairly simple stuff that must 
be wedded to your own way of coding your site or application that will fit 
your business requirements.  Make it general for use in other 
places.  Create, for example, you own do/undo/redo to work with but 
independent of the workflow.  Also create some token application or use the 
one that comes with struts.

At 10:08 AM 2/26/2004, you wrote:
>Does anyone have any great ideas on creating customizable workflows in
Struts?
>
>__
>Do you Yahoo!?
>Get better spam protection with Yahoo! Mail.
>http://antispam.yahoo.com/tools
>
>-
>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]


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



RE: Phase in Tiles?

2004-02-23 Thread shirishchandra.sakhare
You can very much do so.

We had a completed 50% of our application when we migrated to Tiles.

That is what we   did.
Instead of changing the existing working functionality,We just started using tiles for 
new development.As a result , we have tiles definitions as well as normal jsps.

BTW,there is an excellent chapter in Struts In Action (by Ted Husted) about converting 
an existing application to tiles.The part about namign conventions I found extremely 
useful.Espeially when you have tiles as well as non tiles jsps coexisting in an 
application,the naming convention becomes very important to avoid confusion. 

Hope this helps.

regards,
Shirish
-Original Message-
From: Marcella Turner [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 3:34 PM
To: [EMAIL PROTECTED]
Subject: Phase in Tiles?


I'm interesting in converting an existing Struts application with 
traditional JSP's and Actions into a Tiles application.  Can I take a phased 
in approach where some forwards point to the tiles-def.xml and some do not?  
Or is the tiles-def.xml approach "all or nothing"?

Thanks,
Marcella

_
Say "good-bye" to spam, viruses and pop-ups with MSN Premium -- free trial 
offer! http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/


-
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] visual XSLT or XSL-FO builder

2004-02-19 Thread shirishchandra.sakhare
XML Spy has a visual XSLT designer...I have never used the visual designing features ..

But any how, XML Spy suit is really good ..I have used it to design my xslts for 
XSL:FO transformations...I have found the the hierarchial(node like)view very 
conveninent.

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 7:47 PM
To: [EMAIL PROTECTED]
Subject: [OT] visual XSLT or XSL-FO builder


Hi
Has any one know of a tool which will help building
XSLT or XSL-FO visually, like VB where i can select
where i want to put the input field on page, and what
database field will be used to populate it

Ashish

__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

-
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: trubble with session

2004-02-17 Thread shirishchandra.sakhare
This is not entirely true:-((

Even if the user disables cookies, you can use still URL rewritting to maintain 
sessions...

I always thought that struts tags  take care of URL rewritting for you in case cookies 
are disabled.

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 12:06 PM
To: Struts Users Mailing List
Subject: RE: trubble with session


When the user doesn't accept cookies, session is of no use.
After login, you can fill the data in request object and *forward* the
request.

look into RequestDispatcher.forward()

HTH
Navjot Singh

>-Original Message-
>From: Claudia Woestheinrich [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, February 17, 2004 2:50 PM
>To: [EMAIL PROTECTED]
>Subject: trubble with session
>
>
>Hello,
>
>I am new. I have Problems with my first Struts Projekt.
>
>After a User is logged in, I show a List of datas. This list I put
>as Object in the session (session.put("list",datas))
>When another side is opend I cant`t read the Parameter from the
>Session, when the User don`t
>accept Cookis in his Browser. In a old the Servlet-Programm, I used
>the Method response.encode... to manage this
>Problem. But in Struts I use in the Action-Class
>actionMappping.findForwar("sucess") and der URL is definied in
>the Struts config. How can I give the SessionId with? Or how can I
>manage  this Problem?
>
>Sorry, My English perfect.
>
>Thanks
>Claudia
>
>
>-
>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: [OT] - Request against Session

2004-02-16 Thread shirishchandra.sakhare
very well said :-)) 
+1

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 5:26 PM
To: Struts Users Mailing List
Subject: Re: [OT] - Request against Session


Sorry if I'm regurgitating, but I haven't really been following this debate.
The only good argument I've heard for session=evil is the memory bloat one.

If every struts form was defined in session scope then a user running around
alot of forms can quickly consume alot - and it stays around unless you
specifically clean them out or they do nothing long enough for the session
to expire. Whether you have memory problems depends entirely on the amount
your stuffing into the session and the number of 'active' sessions at any
one time.

The good thing about doing everything in request scope is you never have to
worry about this - however big your system or the traffic volume gets. In
that sense its a no-brainer - tell everyone to do it in request and theres
no consequences. If the advice on the other hand was session or request -
you choose - alot of people would choose session because its easier to
develop - once they deploy the app though, then the s**t hits the
fan.

If you know the memory implications and the future traffic volumes of your
system and can guarantee its never going to be an issue, then go ahead. For
me though, even though it looks like I'm only going to have 20-40 users
initially, I do it the request way - because then I don't even have to
consider it as an issue, whatever the future.

Niall

- Original Message - 
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 16, 2004 3:41 PM
Subject: Re: [OT] - Request against Session


> Ah.. I'm having a bad hibernate day instead today so I'm a bit more
> distracted from this debate.
>
> Truth is I'm pretty stupid, my simplistic way of looking at the world
> tells me that if i need to temporally store data collected from some
> forms that storing in the session is a way to do this.
>
> The api says.
> "The session persists  for a specified time period, across more than
> one connection or  page request from the user."
>
> Seems to fit the bill to me. Each form is a request and i need a
> structure in the web tier to store the data. Until such a time when the
> user is ready to complete whatever s/he is doing and thus commit
> everything to the model.
>
> I even concede I'm out-gunned in terms of the folk advocating such
> things, but I just cant see why everyone's so against sessions. I'm in
> crisis attempting to resolve the incongruity between my and folk's, who
> know better than me, views, but I just don't get it.
>
> But when did sessions become the root of all evil? What are they there
> for? I even like the idea of dynamically generating hidden values as an
> alternative or an optimization but surely session is a valid tool to
> use.
>
> Perhaps my understanding of data-mining is erroneous but I fail to see
> how storing data collected via a view (in the web tier) for a short
> time has anything to do with it.
>
> "Data  mining is the process of discovering meaningful new
> correlations,  patterns and trends by sifting through large amounts of
> data stored  in repositories, using pattern recognition technologies as
> well as  statistical and mathematical techniques." (Gartner  Group).
>
> Another definition I found is
>
> "Data Mining follows an inductive strategy of analyzing data where
> users apply machine learning algorithms to gain non-obvious knowledge
> from the data."
> [http://www.jcp.org/en/jsr/detail?id=073]
>
> I'm not suggesting any such thing, I'm not forming any analysis on the
> data collected and stored in httpsession as that would be silly. Nor do
> i see that the proposed alternative as having anything to do with
> datamining.
>
> While I can see how a high traffic site need an alternative to
> httpsession the storing data collected from the view temporarily before
> its ready to be permanently stored (What i understand of what Andrew
> has been saying, and I think craig's recommendations). I cant see how
> the syllogism "all use of httpsession is bad" can be justified.
>
> Not on all fours but purring like a kitten :o)
>
> Mark
>
> On 16 Feb 2004, at 15:56, Michael McGrady wrote:
>
> >
> > >You [Mark Lowe] said:
> > >Perhaps HttpSession is a blunt instrument, and would need to be
> > substituted by another persistence >mechanism like say writing to a
> > temporary text file, but IMO this would be something that one >would
> > want to fix in the case that something were broken.
> >
> > Hi, Mark,
> >
> > Your reading "generating dynamic views" as somehow relating to
> > alternative forms of persistence is not correct.  The idea is to get
> > AWAY from this PERSISTENCE solution and to start using view LOGIC.
> >
> > Michael
> >
> > >And you [Mark Lowe] said:
> > >i know its a naive position but I thought part of the scope of the
> > java language

RE: Back to the originating screen...

2004-02-13 Thread shirishchandra.sakhare
Hi,
Had almost forgetten about your mail :-((

We have following action hierarchy.
 AbstractApplicationAction(As per struts best üractice guidelines...)
   |
 |--|
 |  |
AbstractOpenAction  AbstractSaveAction
(Any action that gets data   (Any action that performs update in DB.)
for some screen)

The important point is the Save actions will never perform a get.So in any action, 
when user updates something, then there will be generraly 2 actions involved.One 
action that does the update and another action that will get the data to be shown to 
the user after update screen.
Usecase:UserPreferencesUpdate screen.The user is shown HisDetails after login and he 
can update those by pressing update button.After update is successful, he will be 
shown same details.

a:UserDetailsOpenAction extends AbstractOpenAction.
This will get the user details for given user id and forward it to user details JSP.
which will show the user details to user.
b:UseDetailsUpdateAction extends AbstractSaveAction
This will update the user details passed and forward to success forward(which in this 
case wil point to UserDetailsOpenAction ).

The complete implementation will be as follows.
The login action will forward to UserDetailsOpenAction upon successful login .The user 
will see his details on screen aftter login.When he presses 
update,UseDetailsUpdateAction  will be called.It will update the details for user and 
forward to UserDetailsOpenAction  again, which will show the user his updated details.
As you can see, the atomic actions become realy reusable units.So tomorrow if after 
some other functionality(Placing an order for example),the suer needs to be shown his 
details page,then just make that other actions success forward to point to 
UserDetailsOpenAction .And if the actions are so atomic, changing teh screen flow is 
just like attaching together different actions is struts-config by using proper 
forwards(the assumption being all required parameters are being passed around) 

But I think the scenerio you have explained do not need 2 actions.It is the  case for 
just one OpenAction.(ProductListOpenAction).And the form for this action can keep 
record of teh search criteria entered(by having them as attributes) and the same can 
be  passed to jsp either as text fields or hidden parameters.

HTH.
regards,
Shirish.

-Original Message-
From: Villalba Arias, Fredy [BILBOMATICA] [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 6:59 PM
To: Sakhare, Shirishchandra
Subject: RE: Back to the originating screen...


Yes, indeed.

To be precise, I'm (more) interested in the OpenAction/SaveAction paradigm, and the 
general GET/POST philosophy you applied. The "Changing Language" functionality would 
be a good example, although I've thought about another one that I'm also interested in:

There is a login screen. The user logs into the system, gets "redirected" to the "List 
of Products" screen where the paginated list of products is shown. That screen allows 
the user to filter the list by specifying one or more filtering parameters (on that 
same screen) and submitting them (by clicking a "Search" - submit - button). 
Initially, there will appear all products. After clicking on "Search", that same 
screen is "reloaded"; however, this time the list contains only those products meeting 
the search criteria.
The last setting for all search parameters MUST be visible AFTER the search has 
returned (i.e. the screen has been reloaded).

I've already been thinking and working on this very same example and I've already 
managed to solve it by implementing everything in the same Action. However, if I 
understood you (and the thread you told me to give a look at), it should preferably be 
implemented in 2 different Actions.

Anyway, won't distract you any further. I look forward to hearing from you again.

Kind Regards,
Freddy.

-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Enviado el: lunes, 09 de febrero de 2004 15:57
Para: Villalba Arias, Fredy [BILBOMATICA]
Asunto: RE: Back to the originating screen...

Hi Freddy,
I will definately glad to share my experience.If i am not mistaken, you will like to 
know more about how we have implemented the Changing Language Functionality? including 
the concept of OpenAction/SaveAction?

I will send you a detail mail.But I will also urge you to read the post about 
chainning actions from struts archive.
http://marc.theaimsgroup.com/?l=struts-user&m=104427309720653&w=2

This thread might be of interest to you.Especially the defference between action 
chainning and Action relay...

A bit under pressure today.But definately send a detail mail by tomorrow.

regards,
Shirish

-Original Message-
From: Villalba Arias, Fredy [BILBOMATICA] [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 3:41 PM
To: Sakhare, Shirishchandra
Subject: RE: Back

RE: Where are the workflow extensions?

2004-02-13 Thread shirishchandra.sakhare
http://www.livinglogic.de/Struts/introduction.html

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 3:04 PM
To: Struts Users Mailing List
Subject: Where are the workflow extensions?



Hi I see all this chatter about Struts workflow extensions, but where can
I download it?

Thanks

Chris



-
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] - Request against Session

2004-02-13 Thread shirishchandra.sakhare
This is one of scenerios I was talking about.But I am not sure if this problem is 
specific to forms being in session.I mean even if the form is in request(but has al 
teh data necessery to perform the request), even in this case the user may have 2 
different windows open(One old and one latest)and submit the old one but actuall the 
current state being already updated by user in another window.And This is the exact 
scenerio where struts token mechanism comes into picture, but that is not the point we 
are discussing...

The other scenerio can be as follows.(The assumption is same form is being used for 
multiple related/Unrelated actions.And I think this is mainly the  case when forms are 
kept in session).

So in this case, the form may accumulate a number of properties which will be used by 
action to call service layer.But the same properties of the form may be set 
differently if the user has followed a different path(This being quite possible in a 
web application as the user may have performed any sequence of actions before actually 
caling a specific action.)So you do not have explicit control over the data being used 
by the action.
But if the same form is request scope, you have to  exactly know what properties are 
required in an action & you consiously have to pass those properties either as request 
parameters or as hidden parameters.And even after that if you need to take anything 
from session, that is also not implicit but very explicit design decision.And you have 
to code in action to get it from session.So the developer knows exactly what data he 
needs and what he is taking from the  global repository(Session).

I know this does not make it very clear(Soem use case scenerio would have been better 
.But in a fairly complex project, this becomes a very big problem,especialy when 
diferent developers maintain each others code.The data flow is not quite clear if the 
form is in session.


HTH.
regards,
Shirish


-Original Message-
From: Robert Nocera [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 5:41 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] - Request against Session


Mark,

My interpretation of that comment was that if a user has two windows open
and are going back and forth between the windows, the system may use
information from one window to update the information in the session that
actually relates to the old window.  This would be a pretty poor design, but
it's the only interpretation I can guess.

So the following could happen:
1. User chooses to edit order A.
2. Order A information is stored in the session and user is taken to an
order edit screen.
3. User chooses to edit order B in a new window.
4. Order B information is stored in the session and user is taken to an
order edit screen. 
5. User goes back to edit screen for order A and adds an item.
6. Because the session has Order B info in it, the info is either added to
Order B (instead of the intended Order A)

Seems to me a pretty easy thing to check if the info they are updating
relates to the info in the session, but that could be just me.

-Rob

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 13, 2004 11:22 AM
To: Struts Users Mailing List
Subject: Re: [OT] - Request against Session

Am i to assume that there's no issue then ? or am i being too stupid to 
warrant a response?





-
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] - Request against Session

2004-02-13 Thread shirishchandra.sakhare
Hi Mark,
Sorry for not responding to your mail.

Just got bogged down with work today.Having a lot of issues with the UAT right now.I 
had started the mail for you.But could not write a satisfactory 
(Understandable)explanation in short time.So the mail is incomplete till now :-((.
I will try to explain it now..(Hopefully there will be no more bugs to eb fixed till 
end of day...)

BTW, I am HE :-)) and not SHE

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 5:22 PM
To: Struts Users Mailing List
Subject: Re: [OT] - Request against Session


Am i to assume that there's no issue then ? or am i being too stupid to 
warrant a response?


On 13 Feb 2004, at 09:55, Mark Lowe wrote:

> hi shirish
>
> You said something yesterday about never being sure what data is being 
> displayed when using a session scoped action form, have you any 
> references or can you elaborate? Sounds interesting, and I think its 
> something I should know about.
>
> Cheers Mark
>
>
> On 13 Feb 2004, at 09:49, <[EMAIL PROTECTED]> wrote:
>
>> ???
>>
>> -Original Message-
>> From: Michael McGrady [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, February 12, 2004 11:56 PM
>> To: Struts Users Mailing List
>> Subject: RE: [OT] - Request against Session
>>
>>
>>
>> The work flow solution being talked about actually is the worst 
>> "bloat" for
>> the session.  It uses the work flow for all sessions.  Indeed, it is 
>> used
>> with every request processing.
>>
>>
>>
>> -
>> 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]
>


-
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: problem with indexed properties

2004-02-13 Thread shirishchandra.sakhare
can you get the html code generated by your jsp?(using view source on that perticular 
page).The parameter name generated may be of help...

But i can immediately see one problem.
The example you are refering to contains List Of beans...So when a parameter reference 
like emp[i].name is created , it will be resolved as getEmp(i).getName();
But in your case, getCandlist(index) wil return a string itself.So on string how will 
you cal setter.It is not a bean with a setter method.

I have not used indexed tags.But have a look at the parameter reference created in 
HTML.It will help you to understand whats goign on...

HTH.
regards,
Shirish

-Original Message-
From: Shyam A [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 4:04 PM
To: Struts Users Mailing List
Subject: problem with indexed properties


Hello,

I'm trying to use indexed propeties in my form bean
(ActionForm) to handle an array of text fields
generated dynamically. Initially, I used a String[] to
hold the text field values, and had a problem when
validation errors occured in my validate() method,
i.e, the values of the text fields were not retained.

To work around that, I'm trying indexed properties,
but it has not helped my cause, only added to my
woes:(

With indexed properties, I don't seem to get the
values of the textfields in the form bean(I get a
NullPointerException on form submission). Also, the
values in the textfields are not retained on
validation errors.
When my JSP is displayed initially, I seem to get some
null/junk entries in the text fields.

I used the sample code from
http://marc.theaimsgroup.com/?l=struts-user&m=104815589928698&w=2
for my form bean.

So, in my ActionForm, I have

#
private List candList = new ArrayList(); //previoulsy
was String[]

public List getCandList() 
   {
  return candList;
   }

public void setCandList(List aCandList) 
   {
  candList = aCandList;
   }


public String getCandList(int index) 
   {
  while(index >= candList.size()){

candList.add(new String(""));

}   
  return (String) candList.get(index);
   }


 public void setCandList(int index,String aCand) 
   {
  candList.set(index,aCand);
   }

-

I do not set candList=null in the reset() method.

In my Action class (DispatchAction), I have two
methods - get() and submit() corresponding to "get"
and "submit" requests on my JSP. In the get() method,
I tried populating the candList in my form bean with
dummy values, corresponding to the number of text
fields(obtained from database).

In my JSP, I use



within a  tag for a collection (of
business entities).


-
I guess there may be something wrong with the
getters/setters in my ActionForm, as my form bean
doesn't seem to get the user entered values in the
text fields.
Am I missing something in the reset() method?

Could somebody tell me what I'm doing wrong.

I'm not sure if the candList in my form bean should be
populated with dummy values in the get() method of my
Action class.

I tried in vain to find some good examples of form
beans with indexed properties..most of the examples
are for DynaActionForm, and I'm really strutting in
the dark:(

Any help/pointers will be greatly appreciated.


Thanks,
Shyam



__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.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]



RE: [OT] - Request against Session

2004-02-13 Thread shirishchandra.sakhare
???

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 11:56 PM
To: Struts Users Mailing List
Subject: RE: [OT] - Request against Session



The work flow solution being talked about actually is the worst "bloat" for 
the session.  It uses the work flow for all sessions.  Indeed, it is used 
with every request processing.



-
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] - Request against Session

2004-02-13 Thread shirishchandra.sakhare
True.
But as soon as the user exits the workflow, the workFlow object is cleared.So instead 
of having a session with n number of objects still in session you have the session and 
the workflow container which is empty(assuming the user has exited the workflow.).

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED]
Sent: Friday, February 13, 2004 4:56 AM
To: Struts Users Mailing List
Subject: RE: [OT] - Request against Session



>
>But the workflow solution is for situations when you dont want to use 
>session scope But still want to share data across screens And also manage 
>Modal dialogue boxes in a wizard liek flow.

This is not consistent with the workflow application in Struts.  Again, the 
WorkflowContainer is ALWAYS put into the session in that case.



-
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] - Request against Session

2004-02-13 Thread shirishchandra.sakhare
But what we are talking about is the concept & functionality.And what you are saying 
is the implementation.
Agreed the workflow container is in session scope .But for the user(The developer), it 
gives the choice of an additional scope definition.How it is implemented is not 
important.

Any how, when we are talking about any such implementation/Concept, we have to 
implement it in the context of available APIs. 

-Original Message-
From: Michael McGrady [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 11:53 PM
To: Struts Users Mailing List
Subject: RE: [OT] - Request against Session


At 07:50 AM 2/12/2004, you wrote:

>If user has different windows in different windows, then only the latest 
>windows workflow is honoured.SO all other window will have lost thier 
>workflow state if any...Which is desired behaviour in workflow like 
>situations...Where you dont want user to have multiple windows open and 
>accidently submit an old window with stale data thinking he was working 
>with the latest data...
>
>But you are right in the sense that all such stuff should go in framework...

This, I think, is a misunderstanding of what happens.  There STILL is a 
workflow container in session scope, and what is MORE, even where you don't 
need a workflow container, you still have one in session scope. 



-
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] - Request against Session

2004-02-12 Thread shirishchandra.sakhare
I think the use case you have is a very valid one .But you can always have more than 
workflows (But only one primary workflow..)But any how,
if the operator opens multiple windows(for different calls), and accidently changes 
data for user 3,thinking that he was working on window for user 2??
Because we implemented workflow mainly to avoid the multiple windw problem..


But you have a valid case..MAy be some applicatiosn need multiple workflows...

I am not sure if the current work flow allows that...



-Original Message-
From: Robert Nocera [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 4:58 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] - Request against Session


Shirish,

I'm not knocking the "workflow" concept, my only point earlier was that
someone shouldn't think it provides any real difference from session storage
except that it will attempt to automatically clear the session when they
leave that "workflow" and they won't have to put that logic in.

It's a good idea, but this latest message indicates that it limits its use
to applications that only allow a single "workflow" at a time.  I've worked
on many applications where there may be two or three valid workflows open
for a user at once, for example a help desk application where the operator
may be working on one issue and then need to open a new issue (in a new
window) for an incoming call in the middle of the current workflow, they are
both valid and neither contains "stale" data.

-Rob

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, February 12, 2004 10:50 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [OT] - Request against Session


If the user has multiple windows open all sharing a session and does
different things in different windows things get really fun.


If user has different windows in different windows, then only the latest
windows workflow is honoured.SO all other window will have lost thier
workflow state if any...Which is desired behaviour in workflow like
situations...Where you dont want user to have multiple windows open and
accidently submit an old window with stale data thinking he was working with
the latest data...

But you are right in the sense that all such stuff should go in framework...




-
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] - Request against Session

2004-02-12 Thread shirishchandra.sakhare
The performance is not the only issue with bloated sessions
Like in our current project, we are using WSAD4.0 and websphere does nto guareentee 
that session will be transferred across in a clustered environment if the session size 
is more than 4k..And we are having our depoyment in a clustered environment with 200% 
(??:-))) failsafety against downtime etc etc...


There are other  issues like you are never clear which data you are working with..And 
even for other sites with a fairly large amount of traffic, session size must be 
critical when it comes to performance eventhough i must admit that I have never worked 
on such web project.


But the workflow solution is for situations when you dont want to use session scope 
But still want to share data across screens And also manage Modal dialogue boxes in a 
wizard liek flow.So there is no point in discussing the pros and cons of it in 
situations where session size is not an issue..Even in that case i will refrain from 
using session scoped form beans...U are never sure which set of data you are working 
with...:-((

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 4:54 PM
To: Struts Users Mailing List
Subject: Re: [OT] - Request against Session




On 12 Feb 2004, at 15:44, Andrew Hill wrote:

> 
> Surely if performance is that much of an issue then java would be the
> last technology you'd use.
> 
>
> What would you suggest for a high performing web application?

I agree, java does the job nicely but if you're gonna get your knickers 
in a twist about using sessions and you've got time to burn then a c 
cgi would probably out perform a java solution (assuming you don't 
write shit that is).

>
> 
> If there are performance issue with
> this and you haven't abused the use of session then IMO this is a
> matter for the container developers.
> 
>
> Not much help when you have to fix a performance issue for a customer 
> within
> 24 hours or lose a huge contract.

Also agreed, but i've been working with java/jsp for about 5 years now 
and been lucky enough to work as a web tier person on for some high 
profile sites. And frankly all this session paranoia is disportionate 
to the actual problems that occur using httpsession. Perhaps your 
experiences have been different, but surely expecting web developers 
not to use session is just complete nonsense especially during the 
development stage rather than bug fixing stage.

You'd be more likely to loose the contract by not delivering the 
project in the first place, though irrational session avoidance.

>
> That said, if you havent abused the session your very unlikely to get 
> such
> performance issues unless it really is a container bug (time to switch
> containers). Of course what counts as abuse very much depends on your
> expected load (and things like whether you need to cluster). Whats 
> abuse for
> a public portal with 1000 hits per second is just fine for an intranet 
> app
> thats unlikely to have more than a dozen simultaneous hits...
>
>
>
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 12 February 2004 22:14
> To: Struts Users Mailing List
> Subject: Re: [OT] - Request against Session
>
>
> While I found your solution interesting. But whether the session is
> "bloated" or not is other folk's problem. The javadoc for HttpSession
> says what its for, the other way is to persist out-side of the web tier
> which is another subject. Sure you don't want to use session for
> everything that would be silly, but its also there to be used.
>
> Its simply a matter of mind-set, if you want to get down to the metal
> then I'm not sure java is an ideal technology. From a web developer's
> pov you read the docs you see that httpsession is for certain
> situations and thus you use it. If there are performance issue with
> this and you haven't abused the use of session then IMO this is a
> matter for the container developers.
>
> Surely if performance is that much of an issue then java would be the
> last technology you'd use.
>
> On 12 Feb 2004, at 14:49, <[EMAIL PROTECTED]> wrote:
>
>> The whole point is there is no concept of a Workflow scope in Servlet
>> API and if you want to share objects , you have to put them in
>> session.And then clearing them is not always easy, as you will never
>> be clear when user may leave the workflow scope.And you have to code
>> for it in every action.
>>
>> What this extension does is to leave all those details to framwrork,
>> and the programmer just has to COnfigure the actions ,saying that they
>> belong to a workflow.And then he has no more worries as to getting a
>> bloated session, as the session gets trimmed of workflow objects as
>> soon as user goes to any screen which is not part of work flow.
>>
>> HTH.
>> regards,
>> Shirish
>>
>> -Original Message-
>> From: Robert Nocera [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, February 12, 2004 2:36 PM
>> To: 'Stru

RE: [OT] - Request against Session

2004-02-12 Thread shirishchandra.sakhare

If the user has multiple windows open all sharing a session and does
different things in different windows things get really fun.


If user has different windows in different windows, then only the latest windows 
workflow is honoured.SO all other window will have lost thier workflow state if 
any...Which is desired behaviour in workflow like situations...Where you dont want 
user to have multiple windows open and accidently submit an old window with stale data 
thinking he was working with the latest data...

But you are right in the sense that all such stuff should go in framework...

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 3:37 PM
To: Struts Users Mailing List
Subject: RE: [OT] - Request against Session



And then he has no more worries as to getting a bloated session, as the
session gets trimmed of workflow objects as soon as user goes to any screen
which is not part of work flow.


Unless of course the user simply closes the window. :-(

If the user has multiple windows open all sharing a session and does
different things in different windows things get really fun.

Im not sure if the livinglogic workflow extension has anything to handle
this as I havent used it, but I have some familiarity with some of the
issues involved.

But in my app I had to essentially manage mini-sessions within sessions (I
call them Operation Contexts) and that involved using url rewriting to pass
around the id of the OperationContexts so that Actions could identify which
OperationContext a request was associated with. (The OperationContexts
themselves being essentially an object with Map and some other info. (Or in
fact a stack of Maps (to support some other requirements such as nav
stacks), but thats starting to get off topic...))

I had overridden the RequestProcessor to allow ActionForms to be scoped to
OperationContexts as well which was quite useful. Due to the nature of many
of the forms in the app (things like any number of file uploads to a single
field and slow access to persistence, and tab paney type stuff that had to
work in Netscrap6) we really needed to use session scoped forms, but we also
needed to support multiple windows open on html forms for different
instances of the same record type (and thus same action and form mapping).
Doing this in a frameworky way allows managing this to be abstracted away
and so the code in the Actions (& form) can concentrate on the task at hand
rather than on session management.

As for the session management for this ... what a nightmare (bucket loads of
javascript, popups submitting to the server to let it know a window closed,
some filters, vast amounts of url rewriting). There are so many edge
cases... (and its not actually possible to catch them all) - nasty stuff. If
you can find a framework to manage this chaos for you  then use it! Its not
something you want to do yourself unless you really have to...

btw: Ive posted about this Operation Context stuff before a few times so you
can search the archive if you want more info.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, 12 February 2004 21:49
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [OT] - Request against Session


The whole point is there is no concept of a Workflow scope in Servlet API
and if you want to share objects , you have to put them in session.And then
clearing them is not always easy, as you will never be clear when user may
leave the workflow scope.And you have to code for it in every action.

What this extension does is to leave all those details to framwrork, and the
programmer just has to COnfigure the actions ,saying that they belong to a
workflow.And then he has no more worries as to getting a bloated session, as
the session gets trimmed of workflow objects as soon as user goes to any
screen which is not part of work flow.

HTH.
regards,
Shirish

-Original Message-
From: Robert Nocera [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 2:36 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] - Request against Session



This is probably even more off topic, but I've seen this mentioned before.
>From what I can tell of their description of this "workflow" scope, it looks
like it may be helpful as far as ease of use goes, but it doesn't offer any
real technical benefit over the use of hidden form fields or sessions, in
fact, the underlying implementation has to be something passing parameters
of using the session, there just isn't any alternative in any compliant
application servers.

As far as the objects being cleared when the user leaves the workflow, how
is that any different the using the session correctly?  If the user goes on
to another page that is not part of your current "workflow" you can clear
those objects or you wait until the user's session times out -- those are
really the only two options.

-Rob

-Original Message-
From: [EMAIL PROTECTED] [

RE: [OT] - Request against Session

2004-02-12 Thread shirishchandra.sakhare
The whole point is there is no concept of a Workflow scope in Servlet API and if you 
want to share objects , you have to put them in session.And then clearing them is not 
always easy, as you will never be clear when user may leave the workflow scope.And you 
have to code for it in every action.

What this extension does is to leave all those details to framwrork, and the 
programmer just has to COnfigure the actions ,saying that they belong to a 
workflow.And then he has no more worries as to getting a bloated session, as the 
session gets trimmed of workflow objects as soon as user goes to any screen which is 
not part of work flow.

HTH.
regards,
Shirish

-Original Message-
From: Robert Nocera [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 2:36 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] - Request against Session



This is probably even more off topic, but I've seen this mentioned before.
>From what I can tell of their description of this "workflow" scope, it looks
like it may be helpful as far as ease of use goes, but it doesn't offer any
real technical benefit over the use of hidden form fields or sessions, in
fact, the underlying implementation has to be something passing parameters
of using the session, there just isn't any alternative in any compliant
application servers. 

As far as the objects being cleared when the user leaves the workflow, how
is that any different the using the session correctly?  If the user goes on
to another page that is not part of your current "workflow" you can clear
those objects or you wait until the user's session times out -- those are
really the only two options.

-Rob

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, February 12, 2004 4:21 AM
To: [EMAIL PROTECTED]
Subject: RE: [OT] - Request against Session

Hi Guys,
I think the issue over here is, in such cases we need a new scope(workflow
scope).The existing scopes(request/session) do not suffice in such cases.

...
The session scope can be used but it may not be cleared.So there has to be a
solution at architecture level.And the struts workflow extension
http://www.livinglogic.de/Struts/introduction.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]



RE: [OT] - Request against Session

2004-02-12 Thread shirishchandra.sakhare
Hi Guys,
I think the issue over here is, in such cases we need a new scope(workflow scope).The 
existing scopes(request/session) do not suffice in such cases.

The session scope can be used but it may not be cleared.So there has to be a solution 
at architecture level.And the struts workflow extension
http://www.livinglogic.de/Struts/introduction.html
  solves the issue.You can define all those aactions as part of a workflow.So any 
thing u put in workflow scope will be available for the duration of workflow and it 
will be cleared automaticaly as soon as user leaves the workflow.

I had eleborated this problem in one of my earlier mails to this list.
http://marc.theaimsgroup.com/?l=struts-user&m=107487218027622&w=2

And I am in the process of moving this project to SourceForge and also add some 
enhancements.I think if you can have a look at this extension, it should solve your 
problem.

regards,
Shirish



-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 10:03 AM
To: Struts Users Mailing List
Subject: Re: [OT] - Request against Session


An alternative is to have an action form then has a number of  nested 
forms or maps in there for example an order.

An order contains and addressForm, login/register form, and a payment 
card form. These are all hand reusable bit n pieces that can be reused.

if you nest this in an orderForm, scope the order form to session you 
can copy the properties from the component forms
to the order form. No dirty php hidden form value hacks, and that sort 
of jazz.

AddressForm address = (AddressForm) form;
OrderForm order = (OrderForm) session.getAttribute("order");
order.setAddress(address);

when the user reaches the end of the order process just.

session.setAttribute("order",null);

This way you can still rearrange things if/when required but also use 
the connivence of storing persistent stuff in session, (which I 
reiterate yet again is what sessions are for).



On 11 Feb 2004, at 23:13, Robert Nocera wrote:

> Using the session is certainly a possibility, I for the most part, 
> take the
> opposite approach.  Generally the only objects I store in the session 
> are
> objects that are going to be accessed throughout the entirety of the 
> user's
> access to the site, stuff like authentication information and role
> information.
>
> I usually will use hidden form fields to carry information from one 
> page to
> the next, but it's usually a small amount of information such as the 
> keys
> for objects that may be needed for a next page.
>
> I also find that if the entire application is architected so that all 
> the
> information an action needs is in the request as parameters, it becomes
> truly simplistic to rearrange the workflow or add links to existing 
> pages in
> places you might not have expected them originally because the call 
> requires
> nothing more than the correct request parameters.
>
> -Rob
>
>
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 4:45 PM
> To: Struts Users Mailing List
> Subject: Re: [OT] - Request against Session
>
> There was an interesting posting the other day on this, I tend to stick
> stuff in the session because I cant be arsed messing around. After
> things are working I then see whether i can move things out. There
> seems to be a lot on not storing stuff in the session i imagine because
> things can get kinda heavy but then this begs the question what are
> sessions for?
>
> I think people become a bit paranoid about sessions because java is
> kinda heavy in this respect, and garbage collection has remained an
> issue since its beginnings. But IMO thats for the folks you build the
> JVM's to worry about.
>
> If you want something to persist beyond the request then I suggest put
> it in the session. By the time you've messed around trying to avoid
> this you could have brought more hardware to deal with the problem.
>
> I'd say same as wendy, although look back if anything breaks.
>
> IMO storing values as hidden form values is ugly, I'd use it as a hack
> if using session breaks anything (which is doubtful) just set stuff to
> null when you're finished and hope the garbage collector comes along.
>
>
>
> On 11 Feb 2004, at 22:01, Pani R wrote:
>
>> Thanks for the advice Wendy.
>>
>> I may end up storing all the values in the Session. But, on the other
>> side, how would I store it in the hidden form variable. I think if I
>> store it in my hidden variable, then its available to me in the action
>> class via getParameter() which will return me a String object against
>> my User Defined Object. Is there any other way to do that?
>>
>> Pani
>>
>> --
>>
>> - Original Message -
>>
>> DATE: Wed, 11 Feb 2004 13:27:11
>> From: Wendy Smoak <[EMAIL PROTECTED]>
>> To: Struts Users Mailing List <[EMAIL PROTECTED]>
>> Cc:
>>
 From: Pani R [mailto:[EMAIL PROTECTED]
 Now, when the un-logged user tries to regi

RE: Struts Tag

2004-02-09 Thread shirishchandra.sakhare
Nest two  or  tags  one inside another :-))

-Original Message-
From: Oliver Thiel [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 6:07 PM
To: [EMAIL PROTECTED]
Subject: Struts Tag


Hi,


does anyone know a tag like  or 
beside that it should be able to handel more than one property!


thanks
Oliver

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++


-
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: Problems (re)populating nested bean

2004-02-09 Thread shirishchandra.sakhare
See this mail.MAy be this will help you..

http://marc.theaimsgroup.com/?l=struts-user&m=107458904510606&w=2

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 5:03 PM
To: Struts Users Mailing List
Subject: Re: Problems (re)populating nested bean


There are two ways of dealing with this (that i know of), as you've 
seen scope to session or you can use lazy list.

Usually complex forms have limited users anyhow so I scope to session. 
However folks on the list have used lazy list which apparently works 
although i've never seen it down without two days worth of postings (I 
guess some folks have time on their hands). For some reason storing 
forms in sessions isn't a very trendy thing to do.

Search the archived for lazy list if this takes your interest, although 
IMO session is fine and are there to be used.

Cheers Mark


On 9 Feb 2004, at 16:41, Linus Nikander wrote:

> I'm having trouble (re)populating a Form with nested beans when i 
> submit the
> values with the scope set to request. If i run the exact same code 
> using a
> session scope then it works fine. Has anyone run into similar problems 
> ? If
> so, what possible causes of the problem should i be looking at ?
>
> My actionform contains a list and a string:
>
> private String action = "";
> private ArrayList problematicOddsList = new ArrayList();
>
>
> The html code generated html looks like this:
>
>   action="/ManageUnknownSportsAction.do">
>  
>  value="0">
>  value="blahblah">
>
>  value="0">
>  value="blahblah2">
>
>
>
> Since the very same code works when I use a session scope I can't quite
> figure out what i'm doing wrong. It seems to me that somehow the 
> instance
> that Struts tries to populate using the request contains a List which 
> is
> initialized to too small a size to fit the submitted data, I don't
> understand why though and I'm quite sure I've used similar constructs 
> in the
> past without problems (albeit on a Weblogic server and not JBoss). Any 
> clues
> anyone ?
>
>  Actual errormsg form the log ---
> 2004-02-09 16:29:32,218 DEBUG 
> [org.apache.struts.action.RequestProcessor]
> Populating bean properties from this request
> 2004-02-09 16:29:32,218 ERROR [org.jboss.web.localhost.Engine]
> StandardWrapperValve[action]: Servlet.service() for servlet action 
> threw
> exception
> javax.servlet.ServletException: BeanUtils.populate
> ...
> ...
> ...
> 2004-02-09 16:29:32,421 ERROR [org.jboss.web.localhost.Engine] - 
> Root
> Cause -
> java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
>  Actual errormsg form the log ---
>
>
>
> //Linus Nikander - [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]


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



RE: Back to the originating screen...

2004-02-06 Thread shirishchandra.sakhare
Hi,
We have implemented similar concept.And you are right.You have to be careful not to 
redo the last posts.

Luckily for us, the desin we had solved the problem.We have a concept of 
OpenAction(Actions that prepare data for view) and Save action(Post actions,actions 
that update DB).So in AbstractOpenAction, the called URL is saved in session under a 
specific key(Open actions always use GET.So the saved URL can always recreate the 
request if you forward to it :-))) and when the user changes the language, we change 
the language in session and just forward to last action called.And as the last action 
called will be always be the OpenAction which created the last screen seen by user.So 
chance of a post being done again.

Some users have pointed out that having such Reusable small actions lends itself to 
action chaining(e.g. To complete a user Preference save request, you will first call 
SaveUserPrefrrenceAction which will then forward to UserdetaislOpenAction,assuming you 
are showing user details after he saves them) And qwe had a long discussion on this 
forum about action chainning.

So you may want to review all of this before you take this route.

HTH.
regards,
Shirish

-Original Message-
From: Villalba Arias, Fredy [BILBOMATICA] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 4:26 PM
To: Struts Users Mailing List
Subject: RE: Back to the originating screen...


Hi,

IMHO, this is a difficult problem to solve (100%, that is). Including the redo-URL on 
the language link is the most practical of those options, if you are able to generate 
"redo-URLs" that do not "redo" the last action itself but only "recompose" the current 
view (not that simple, I know). Remember to be careful with issues such as redo-ing 
posts that, for instance, involve persistency-related tasks. Say: "saveNewProduct".

Hth,
Freddy.

-Mensaje original-
De: Jesse Alexander (KAID 11) [mailto:[EMAIL PROTECTED] 
Enviado el: viernes, 06 de febrero de 2004 16:07
Para: 'Mailing List [EMAIL PROTECTED]'
Asunto: Back to the originating screen...

Hi
I need a hint on how to return always to the originating action preserving
all input-parameters to that originating action...

problem: From any screen in my application the user is allowed to
 change the language of the UI. He should be immediately presented
 the same screen again in the new UI-language.

So far I think I create an action (and a global forward) to change the
UI-language. That's the easy part. But what strategy to use in order
to be able to redo the last action before the change of language?

The possibilities I thought of are:
- on the language link, include always the "redo"-URL
- on each primary action (actions called from the UI, opposed to secondary
  actions called from primary actions...) I store the "redo"-URL in the
  session.

What do you do in such a case? 

thanks in advance
Alexander
  


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
 

-
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: Technical question about Struts Workflow Extension

2004-02-05 Thread shirishchandra.sakhare
Hi,
We have just created an account with source forge for the workflow extension project 
and will be transferring the source code etc. to that account  in the next couple of 
days.
So we are just in early stages of code transfer.
 
But regarding your question.
 
As you said,most of the workflow information can be made available for reading 
atleast.And I had came across similar problem and mr.Matthias bauer had replied that 
it was just overlooked.As this extension was developed/modified as and when the 
requirements arose, it does not have all required extension points and public API.
 
So that is the first task I am going to undertake.To see what parts of workflow can be 
made public and where all extension points are possible so that users can customise 
behaviour of the workflow.
 
And I am planning a next release very soon ,But have no definite schedule.But I am 
really looking forward to getting more such ideas /requests so that the next version 
can be designed keeping into view all of this.
And your requirement has just given me the idea for next immediate release.First thing 
I can do is to atleast make all Workflow state available in readOnly mode so that 
existing users can access use this  functionality without breaking any of the workflow 
logic.
 
Any ideas/suggestions are welcome.
 
I am forwarding this mail to struts user list so that others can also contribute to 
this discussion.
 
regards,
Shirish.
 
 
 
-Original Message-
From: Ignacio Cruzado Nuño [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 05, 2004 8:51 AM
To: Sakhare, Shirishchandra
Subject: Technical question about Struts Workflow Extension


Dear Struts Workflow Extension team:
 
I'm Ignacio Cruzado, from Spain, computer programmer who works on Tecsidel SA (a 
programming company) as a computer consultant.
 
Matthias Bauer gave me your email address in order to redirect this technical 
question... I hope to be writing to the right person (I'm sorry if you are not this 
one!).
 
We are using "struts workflow extension" (SWE) in our development, and we would like 
to access the mapping information that SWE clases manage (the dependencies modelled in 
the struts-config.xml file).
 
In your "Workflow scope" web page you only provide information about the Primary 
Workflow and it's state.
I would find very valuable to have methods to access also to the dependencies of the 
actual state: nextState, prevState, isEndWorkflow and so on...
I have been studying the source code of SWE and I have found out that this information 
is managed by the SWE, but not published (most methods and data structure that manage 
the mapping are on the private/protecthed/package scope, instead of the public scope 
(where I would love to found them!).
Why SWE API design doesn't publish that information? Is there a technical reason for 
that? I'm talking about just readding (get) not establishing or manipulating (set) 
that information.
 
I know that we can change the source code, in order to "open" that information, but 
before doing this I would like to ask you to put much more getter methods in order to 
ask the SWE about the workflow mapping that the developer has established, and get 
more information about the actual state of the workflow.
 
Are you working on that? Is a new release of the SWE scheduled? Is it going to have 
new functionallity in the way I'm asking for?
 
Best regards,
 
  Ignacio
 

Ignacio Cruzado Nuño
Tecsidel S.A.
Parque Tecnológico de Boecillo, Parcela 114
47151 Boecillo (Valladolid)


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



RE: log4j integration

2004-01-28 Thread shirishchandra.sakhare
Hi,
Also there is something called ReloadingPropertyConfigurator..May be this in 
combination with HierarchyEventListener will do the trick for you.

I mean the log4j API is so feature rich, you should not be required to write something 
for such a common task.

regards,
Shirish.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 4:02 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


*Yes*!!  The LogManager is the ticket - I didn't know about this class, so tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I inadvertently erased the
response to this question so am not sure of its author..)

Geeta


-
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: log4j integration

2004-01-28 Thread shirishchandra.sakhare
There is LogManagerclass with LoG4j.
It allows you to reset the configuration for entire LOG4J environment.And then as you 
said, you can reread the property file to initialise the log4j environment from the 
changed property file.

HTH:
regards,
Shirish




-Original Message-
From: shankarr [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 1:20 PM
To: Struts Users Mailing List
Subject: Re: log4j integration


Hi!

Yes, I figured that out.
But, that leaves the question open as to how do you make struts as a whole 
understand that changes have been
made to the log4j.properties file.
In fact, the question boils down to this:
Where do I get the handle to the log4j.properties file(let us say, using 
the File class)?
And once I do, will it be sufficient that I set the PropertyConfigurator 
method with the requisite parameters?
Actually, the whole point of the exercise is to use the dynamic reloading 
of changes made to the log4j.properties file facility provided by log4j.

Richie

At 07:01 AM 1/28/2004 -0500, you wrote:
>Please forgive this note if it seems too obvious and I have misunderstood your
>question/comments..
>
>If you think of both struts and log4j as just a bunch of Java 
>packages/classes,
>then you will see that "integrating struts with log4j" is really nothing
>unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
>(the name of this file is most probably hard-coded in the classes in log4j 
>jar,
>which is why you don't need to personally tie the file with log4j) and 
>this file
>should therefore be in the classpath and as you have found out yourself, 
>this is
>all that is required...If for some reason you need a handle to this file, I
>don't see why the usual File class in the java.io package won't do the 
>trick..?
>
>As for how to ensure that changes in your log4j.properties is made visible to
>struts, well, I guess you'll have to restart tomcat (or your app 
>server)..(:( I
>don't believe the admin/reload.do will work (that works for changes to the
>struts-config.xml and such a blessing *that* is during development!!) ..
>
>Hope this helps,
>Geeta
>
>shankarr wrote:
>
> > Hi!
> >
> > In fact, I got two responses for the question as I had sent the same
> > question twice.
> > My mailbox was acting funny yesterday, so I had to send it twice.
> >
> > Well, I do have the log4j.properties file under /classes
> > I had thought of using the PropertyConfigurator too.
> > But, when you integrate log4j with struts, we no where mention the
> > log4j.properties file specifically, ie, we
> > just create the file and put it under the mentioned location.
> > And when we use it, we do not mention the log4j.properties file anywhere in
> > the files too.
> > So, how to get a handle to the file?
> > Correct me if there are better approaches to the same.
> >
> > Steps by which I integrated are :
> >
> > a)Got the log4j.jar file
> > b)created the log4j.properties file
> > c)created commons-logging.properties file
> > d) used static logger = new logger(this) in the files where this is the
> > class name.
> >
> > TIA,
> >
> > Richie
> >
> > At 02:28 PM 1/27/2004 -0600, you wrote:
> > >Do you mean changes made after the initial configuration of 
> log4j?  You can
> > >use
> > >
> > > PropertyConfigurator.configureAndWatch( cfgFile, delay )
> > >
> > >This will load your log4j configuration file and create a thread that 
> looks
> > >for changes to the config file reloading when necessary.
> > >
> > >--Norm
> > >
> > >--
> > >Norm Deane
> > >MIS Consultant
> > >Vanderbilt University
> > >(615) 322-7855
> > >[EMAIL PROTECTED]
> > >
> > > > -Original Message-
> > > > From: shankarr [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, January 27, 2004 9:14 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: log4j integration
> > > >
> > > >
> > > > Hi!
> > > > I have integrated log4j with struts.
> > > > I need to know how to ensure that the changes done to
> > > > log4j.properties file
> > > > is taken into account at run time.
> > > > TIA,
> > > > Richie
> > > >
> > > > "To achieve all that is possible, one must attempt the impossible"
> > > >
> > > >
> > > >
> > > > -
> > > > 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 achieve all that is possible, one must attempt the impossible"
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

"To achieve all that is possible, one must attempt the impossible"



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo

RE: Problem with huge session memory and ActionForm

2004-01-28 Thread shirishchandra.sakhare
Why not change those forms to request scope instead?Where ever feasible I mean.If any 
data is not shared across pages in a wizard like flow, just put that form in 
request.This should be applicable to 90% of the cases.

But It may not be as simple as that.You may have to retest entire application because 
of that.

HTH.
regards,
Shirish

-Original Message-
From: Jose Ramon Diaz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 1:48 PM
To: 'Struts Users Mailing List'
Subject: Problem with huge session memory and ActionForm



Hi all,

We have detected a problem with the amount of memory we use in the session
when we use classes extending org.apache.struts.action.ActionForm and
DynaActionForm too.
We are using 9iAS 9.0.3.
We take a look to the memory using JPRobe profiler, and we see that the
forms stored in session (we define the scope to session in struts-config.xml
for an action) are using more than 20Mb(!!)
Those actionForms have a reference to ActionServlet in servlet attribute.

Of course, this is a lot of memory to have several hundreds of users. I
imagine this is not a Struts bug, and please help us to detect what´s
happening or which is the error in our code.

Thanks a lot.

Jose R.

E-mail: [EMAIL PROTECTED] 
Editorial Aranzadi: www.aranzadi.es 
Camino de Galar, 15
31190- Cizur Menor - SPAIN
Tlfno.: +34 948 297297  Fax: +34 948 297200
__
Este e-mail y cualquier documento anexo contienen información privada y
confidencial única y exclusivamente para el destinatario. Si usted no es el
destinatario, no tiene autorización para leer, copiar, usar o distribuir el
e-mail y el/los documento anexos. En caso de haber recibido esta
comunicación por error, le rogamos que lo remita al emisor y lo destruya
posteriormente.
This e-mail and any attachment contain information, which is private and
confidential and is intended for the addressee only. If you are not an
addressee, you are not authorized to read, copy, use or distribute this
communication. If you have received this e-mail in error, please notify the
sender by return e-mail.




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



Struts workflow problem.Request for enhancement to struts.

2004-01-23 Thread shirishchandra.sakhare
Hi Guys,
I am not sure if this is the proper place to ask this question or I should be asking 
this in struts developers mailing list.

I have used the workflow extension for struts 
(http://www.livinglogic.de/Struts/introduction.html) and found it very useful.

I think workflow is  a very very common problem we face in any reasonably sized web 
application and most of use end up implementing some application specific solution to 
it.I have been in touch with the Original author of the above mentioned extension(Mr. 
Matthias Bauer) and due to some other commitments,he can no longer devote sufficient 
time to maintain the extension but he has shown his willingness to hand over the 
extension to user community for further maintenance/enhancements .A true open source 
spirit :-))
My question is ..Is there any plan for something similar in next Struts release?Is 
anything similar to a workflow scope which will support wizard like flow, being 
implemented for latest release?I am asking this question because before I start 
working on this extension and think of any further enhancements,if something similar 
is there in standard struts release,I better be aware of that.



For those of you who want to know more about this problem, I have tried to explain the 
scenario.Others can skip this section.


The default scopes provided by Servlet API(Session, request,Page) are not sufficient 
many of the times,a common example being when implementing a wizard like flow.In such 
cases , we need to share data across a number of pages.The common solutions being 
adopted are keeping the data in session(most easy solution, but though very elegant 
for reasons I will explain later),passing around the data as hidden parameters or in 
extreme case, reading the data again.Each of these solutions has drawbacks.
1.Keeping data in session.
The data stays in session till the session expires.There is no guaranteed way of 
removing it from session.because in typical web application, the user has multiple 
exit points from any page, like clicking on any menu item or any other URL so it is 
very difficult to remove data using some generic approach.
2.Passing around data as hidden parameters is reasonable only when data to be passed 
is small.If you have complete tables of data to be passed this way, you unnecessary 
increase the traffic by passing around all this data.
3.Retrieving the data again.
Most crude solution.May not be feasible always & will involve unnecessary trips to 
database.

SO in such cases, if there is an additional scope(WorkflowScope) rpovided by struts, 
then in that case we can just use that without any additional coding.the framework 
will take care of any data cleanup when the user moves out of workflow.The developer 
should just be able to configure a group of actions saying that they are part of a 
Specific WorkFlow.
Also the same workflow processor should be able to take care of other features like 
Not alllowing the user to break the workflow or Warn him before he breaks the 
workflow.This should also be configurable.the current extension I mentioned does all 
this. But it may need to be refactored a bit to provide a bit more extension points 
for customization.




Any suggestions/comments welcome.

regards,
Shirish


Shirish Sakhare
Application Developer
(CEFS PROJECT)
(CEFS) Corporate Employee Financial Services

UBS AG
Stauffacherstrasse 41
P.O. Box, CH-8004 Zürich
Tel: +41-1-235 56 31
Fax: +41-1-235 54 21
Personal Mail Id:[EMAIL PROTECTED]
 

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



RE: Wishing I could use multiple ActionForms...

2004-01-22 Thread shirishchandra.sakhare
But why to take all the effort?I mean then the struts auto population will not 
work.Also as all the parameters will still be as hidden parameter(but just one), you 
do not even gain any performance benefit.You end up generating more traffic due to XML 
markup.So is there any other benefit of this XML approach? I may have missed it:-((
The advantage of hidden parameter is that the hidden parameters will be auto populated 
in the formBean.

And there is one openSource implementation for the workFlow situation as mentioned in 
my previous mail.




-Original Message-
From: Eric Bariaux [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 5:32 PM
To: 'Struts Users Mailing List'
Subject: RE: Wishing I could use multiple ActionForms...


Just one trick/hack I used in the past for such a situation.
Instead of having a bunch of hidden parameters to hold the values, I
marshall my form bean(s) or some other value object containing the
information I want to keep to an XML format. I then put that XML into
one hidden field.
I have a generic marshall/unmarshall mechanism in a parent action class
that simplifies coding a bit.
It is far from perfect though, as you need to think about this "storage"
hidden fields in all your actions/actionforms/html forms/... of the
given "workflow scope".
Anyway, not the most elegant way to do it but it can come in handy from
time to time.

If you want to avoid storing the whole XML in the page, then you need
some more "intelligent" mechanism where you store an id as the hidden
field and an in memory cache that you manages. But then you need to
clear the cache, ... so it becomes the whole "workflow scope" you're
referring to. And I don't know of any free implementation of this.

Eric.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 22, 2004 9:35 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Wishing I could use multiple ActionForms...
> 
> Hi,
> If the data on first 2 pages is not very large, I will go for using
hidden
> parameters to pass it to the third jsp.
> 
> I see a couple of problems with the session approach.First and
foremost,
> there is no guaranteed way of clearing the from session as the in a
> typical web application uyer can jump to any URL(any other link on the
> page or menu bar for example.).So if you are developing a fairly large
> application/an application with fairly high traffic, keeping session
to
> minimum can be a requirement.
> I think this is a generic problem we all face for a typical web
> application where in we need to preserve data for some scope other
than
> request or session(workflow scope ).And unfortunately struts does not
> provide any builtin mechanism for this.So may be we need to have a
> mechanism where in we can say that a group of actions belong to a
workflow
> and so any data(actionFOrms)are preserved for this scope only by the
> framwwork.If the user jumps to another URL,he leaves the workflow
scope
> and hence it should be automatically cleared.
> 
> We were using the workflow extension from livingLogic(an opensource
> implementation)for such problems,mainly implementing workflow
> situations.may be what you need is not exactly workflow but just the
> workflow scope part of it.
> You can have a look at it on the following URL.
> http://www.livinglogic.de/Struts/description.html
> 
> any ideas if anything like this is already being implemented or is
being
> planned in next struts version?
> 
> regards,
> Shirish
> 
> -Original Message-
> From: Wendy Smoak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 21, 2004 11:45 PM
> To: Struts Users Mailing List
> Subject: RE: Wishing I could use multiple ActionForms...
> 
> 
> > Finally, my question:  How do I retain the data entered on
> > the first two pages and contained in the first ActionForm?
> 
> Put it in session scope and take care not to reset the fields
> prematurely.
> 
> --
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management
> 
> -
> 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]


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



RE: Wishing I could use multiple ActionForms...

2004-01-22 Thread shirishchandra.sakhare
Hi,
If the data on first 2 pages is not very large, I will go for using hidden parameters 
to pass it to the third jsp.

I see a couple of problems with the session approach.First and foremost, there is no 
guaranteed way of clearing the from session as the in a typical web application uyer 
can jump to any URL(any other link on the page or menu bar for example.).So if you are 
developing a fairly large application/an application with fairly high traffic, keeping 
session to minimum can be a requirement.
I think this is a generic problem we all face for a typical web application where in 
we need to preserve data for some scope other than request or session(workflow scope 
).And unfortunately struts does not provide any builtin mechanism for this.So may be 
we need to have a mechanism where in we can say that a group of actions belong to a 
workflow and so any data(actionFOrms)are preserved for this scope only by the 
framwwork.If the user jumps to another URL,he leaves the workflow scope and hence it 
should be automatically cleared.

We were using the workflow extension from livingLogic(an opensource implementation)for 
such problems,mainly implementing workflow situations.may be what you need is not 
exactly workflow but just the workflow scope part of it.
You can have a look at it on the following URL.
http://www.livinglogic.de/Struts/description.html

any ideas if anything like this is already being implemented or is being planned in 
next struts version?

regards,
Shirish

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 11:45 PM
To: Struts Users Mailing List
Subject: RE: Wishing I could use multiple ActionForms...


> Finally, my question:  How do I retain the data entered on 
> the first two pages and contained in the first ActionForm?

Put it in session scope and take care not to reset the fields
prematurely.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

-
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: Designing for various Actions on JSP

2004-01-21 Thread shirishchandra.sakhare
Hi Parag,
there are many ways of doing this.

1:One action per function(Add,Delete,Edit will each be handled by separate action.)
2.Single action handling all operations(Create,Edit,Delete).on one page.

there are advantages and disadvantages or we can say they reflect different design 
approaches.

1:One action per function
Pro:You have atomic actions, each action just performing a single atomic unit of 
work.So the actions become highly reusable.
Con:Explosion of mappings in struts-config file.You have to define one action mapping 
for each such action and you need another action(FindForwardAction from struts or 
scaffold??) which will find out which button was pressed and which action the call 
should be delegated to.
But i am more familiar with this approach and i have found this works very well.

2.Single action handling all operations
Give corresponding methods on single action(edit,insert,delete).YOu don't even have to 
detect which button was pressed.The struts .LookupDispathAction  helps in this.
pro: less actions to define.So easy to maintain.
cons:never used it.But less reusable I will say.

Search the user archive.It must have some discussion on this question.

HTH.
regards,
Shirish

-Original Message-
From: Parag Marathe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 4:57 PM
To: Struts Users Mailing List
Subject: Designing for various Actions on JSP


Experts,

I have a doubt about mapping various actions (options presented) a user can
perform on a JSP and mapping them to Action classes.

In detail,

I have a JSP page which displays a set of records.
Add, Delete, Edit will be buttons displayed on JSP page for those records.

How to map these actions to Actions classes?
Do I have to create different Action classes to perform these ? if yes how?
how will this be written in struts-config.xml file?

OR should they be handled in one Action class? if yes how?

What will be preffered way?

All your comments are highly appreciated.

Cordially,
Parag

*
Disclaimer

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*
Visit us at http://www.mahindrabt.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: [OT?]Tomcat multiple users developing

2004-01-21 Thread shirishchandra.sakhare
Why don't you have separate tomcat installation for every developer?
Each developer can periodically synchronize with the repository to keep uptodate.But 
since the server installation is separate, he can restart it as many times he wants 
without affecting others..That is teh strategy we are using in our project(1 team of 7 
java developers).

HTH.
regards,
Shirish

-Original Message-
From: Leonardo Francalanci [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 10:12 AM
To: [EMAIL PROTECTED]
Subject: [OT?]Tomcat multiple users developing


Hello,
we are 3 developers currently developing a web site with struts.
The problem we are facing is that every time a user makes a change
to the code or to the struts.xml he has to reload the application:
this involve a great loss of time.
I'd like to know:

1) How do you share the same application developement? Do you use
a "strategy"? We are testing our business objects outside struts,
but the final test is always something that depends on tomcat, so
we need the last version of the code on tomcat very often...

2) Is there another way to tell Tomcat that a class has been changed
instead of reload the application or set the reload=true attribute
in the context?

-
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: getting data from form with nested beans

2004-01-20 Thread shirishchandra.sakhare
I did not get your question clearly.

When a new form(instance of ActionForm) is created, users input is not lost.The users 
input is still in the request Object.(Are you confusing the Form on screen with the 
ActionFOrm object on server side?).So after the instance of ActionForm is created, it 
is populated with the parameters from the request using the struts auto-population 
mechanism.And then you can use the same BeanList to pass to the Service layer(But 
after conversion may be as all the properties in String format.SO create DTO bean from 
correspondign stringbeans).

Hope this helps.
regards,
Shirish

-Original Message-
From: Martin Sturzenegger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 3:11 PM
To: [EMAIL PROTECTED]; Struts Users Mailing List
Subject: RE: getting data from form with nested beans


hi shirish,
great conceipt and many thanks for example and explanation, my fog seems to thin out 
slowly.
one question remains: as soon as a new form is created, then, i assume, the user's 
inputs are lost. so how do you get hold of the user's input? usually one feeds the 
input data back into a database. with simple beans i copy the formdata to a new 
instantiated dto-bean within my action class and pass the dto-bean to my 
business-layer. but dealing with nested beans, where and how?
sorry for pestering
and thanks a lot in advance
martin 


-- Urspruengliche Nachricht --
Von: <[EMAIL PROTECTED]>
Antworten an: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Datum:  Tue, 20 Jan 2004 13:54:30 +0100

>yes:-))
>And I am sure most of the people do have the same.I mean tieing the nested properties 
>to the session scope does take away a lot of flexibility.
>
>Anyhow just try my sample code...It should demonstrate the concept.
>
>regards,
>Shirish
>
>-Original Message-
>From: Mark Lowe [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, January 20, 2004 1:44 PM
>To: Struts Users Mailing List
>Subject: Re: getting data from form with nested beans
>
>
>So you've had forms, with indexed properties with dynamic sizes working  
>when scoping to request?
>
>
>On 20 Jan 2004, at 11:45, <[EMAIL PROTECTED]> wrote:
>
>> Hi,
>> Is it flaming or what?I thought we were trying to solve each others  
>> problems.Still a last try.
>> We have a complete application(3 modules/4000 classes/15 companies  
>> live as of date) which uses all form beans just in request scope.And  
>> all over the place we have used form beans in request scope.And the  
>> application is well and running.
>>
>> If you go t through my mail, you will understand why it will mail.SO  
>> please read the mail carefully.
>> I will try to explain it again.
>>
>> When the form is submitted(the user presses submit button on  
>> screen),the corresponding action will be called by struts.At the same  
>> time, it will look for a actionForm from the mapping.As the scope is  
>> specified as request, a new form will be created.And if you have  
>> looked at my example carefully, you will see that the nested bean list  
>> is created when the form is created.But this nested list is empty.Now  
>> when struts autopopulation tries to populate a nested bean, it should   
>> find that the nested bean list is empty.But the lazy initialization  
>> mechanism in the indexed getter will take care that the list has  
>> enough of beans.See the code below.
>> 33
>>  //give indexed access to the beans
>
> public Employee getEmployee(int index){
>
> //very imp
>
> //when a jsp is submited , then while auto populating the form,this
> will
> ensure
> that
>
> // the  form is populated properly.
>
> while(index >= beanList.size()){
>
> beanList.add(new Employee());
>
> }
>> ***
>>
>> And as explained in jsp part, as long as the property references are  
>> created properly, this will work.And with struts1.1 nested tags, you  
>> don't have to even use the script<%%> to create property is jsp.
>>
>> Hope this clarifies it.If not, try to run my example code.
>>
>> regards,
>> Shirish
>>
>> -Original Message-
>> From: Mark Lowe [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, January 20, 2004 12:28 PM
>> To: Struts Users Mailing List
>> Subject: Re: getting data from form with nested beans
>>
>>
>> Oh yeah .. by working i mean when you submit..
>>
>>
>> On 20 Jan 2004, at 11:25, Mark Lowe wrote:
>>
>>> .. Show us all an example of a form with a dynamic size for a form
>>> property thats scoped to the request then big shot..
>>>
>>> Come on lets see it!!!
>>>
>>>
>>> On 20 Jan 2004, at 10:45, <[EMAIL PROTECTED]> wrote:
>>>
 The scope of form has nothing to do with usage of nested beans.And
 using session scope shoudl be avaided as far as possible as teh form
 will stay in session  till it is explicitely removed from there..

 The <% %> business is for the scripts so that the nested prope

RE: getting data from form with nested beans

2004-01-20 Thread shirishchandra.sakhare
yes:-))
And I am sure most of the people do have the same.I mean tieing the nested properties 
to the session scope does take away a lot of flexibility.

Anyhow just try my sample code...It should demonstrate the concept.

regards,
Shirish

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 1:44 PM
To: Struts Users Mailing List
Subject: Re: getting data from form with nested beans


So you've had forms, with indexed properties with dynamic sizes working  
when scoping to request?


On 20 Jan 2004, at 11:45, <[EMAIL PROTECTED]> wrote:

> Hi,
> Is it flaming or what?I thought we were trying to solve each others  
> problems.Still a last try.
> We have a complete application(3 modules/4000 classes/15 companies  
> live as of date) which uses all form beans just in request scope.And  
> all over the place we have used form beans in request scope.And the  
> application is well and running.
>
> If you go t through my mail, you will understand why it will mail.SO  
> please read the mail carefully.
> I will try to explain it again.
>
> When the form is submitted(the user presses submit button on  
> screen),the corresponding action will be called by struts.At the same  
> time, it will look for a actionForm from the mapping.As the scope is  
> specified as request, a new form will be created.And if you have  
> looked at my example carefully, you will see that the nested bean list  
> is created when the form is created.But this nested list is empty.Now  
> when struts autopopulation tries to populate a nested bean, it should   
> find that the nested bean list is empty.But the lazy initialization  
> mechanism in the indexed getter will take care that the list has  
> enough of beans.See the code below.
> 33
>  //give indexed access to the beans

 public Employee getEmployee(int index){

 //very imp

 //when a jsp is submited , then while auto populating the form,this
 will
 ensure
 that

 // the  form is populated properly.

 while(index >= beanList.size()){

 beanList.add(new Employee());

 }
> ***
>
> And as explained in jsp part, as long as the property references are  
> created properly, this will work.And with struts1.1 nested tags, you  
> don't have to even use the script<%%> to create property is jsp.
>
> Hope this clarifies it.If not, try to run my example code.
>
> regards,
> Shirish
>
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 20, 2004 12:28 PM
> To: Struts Users Mailing List
> Subject: Re: getting data from form with nested beans
>
>
> Oh yeah .. by working i mean when you submit..
>
>
> On 20 Jan 2004, at 11:25, Mark Lowe wrote:
>
>> .. Show us all an example of a form with a dynamic size for a form
>> property thats scoped to the request then big shot..
>>
>> Come on lets see it!!!
>>
>>
>> On 20 Jan 2004, at 10:45, <[EMAIL PROTECTED]> wrote:
>>
>>> The scope of form has nothing to do with usage of nested beans.And
>>> using session scope shoudl be avaided as far as possible as teh form
>>> will stay in session  till it is explicitely removed from there..
>>>
>>> The <% %> business is for the scripts so that the nested property
>>> reference can be created.But with struts1.1 , with the usage of
>>> nested tags, oyu can get rid of that scriptlet code.See nested tags
>>> for how to do that.I have myself never used nested tags.
>>>
>>>
>>> -Original Message-
>>> From: Mark Lowe [mailto:[EMAIL PROTECTED]
>>> Sent: Tuesday, January 20, 2004 11:05 AM
>>> To: Struts Users Mailing List
>>> Subject: Re: getting data from form with nested beans
>>>
>>>
>>> What's with all the <% %> business? Things to watch out for, method
>>> names and the object cast to the jsp need to match names (e.g.
>>> foo.getEmployee() and ${foo.employee}). The form must be scoped to
>>> session if you are dynamically changing the size of the  indexed
>>> property.
>>>
>>> 
>>>
>>> A better example would be a form bean with a getEmployees() method  
>>> and
>>> a setEmployee rather than getBeanList or whatever it was.
>>>
>>>
>>> public Object[] getEmployees() {
>>> return emplyeeList.toArray();
>>> }
>>>
>>> public void setEmployees(ArrayList employeeList) {
>>> this.employeeList = employeeList;
>>> }
>>>
>>> public Employee getEmployee(int i) {
>>> return (Employee) employeeList.get(i);
>>> }
>>>
>>> public void setEmployee(int i,Employee employee) {
>>> this.employeeList.add(i,employee);
>>> }
>>>
>>>
>>> ..
>>>
>>> public class Employee {
>>> private String name;
>>>
>>> public String getName() {
>>> return name;
>>> }
>>> etc
>>> }
>>>
>>> ..
>>>
>>> >> property="employees">
>>>
>>> 
>>>
>>> 
>>>
>>> or
>>>
>>> 
>>> ..
>>>
>>>
>>>
>>> On 20 Jan 2004, at 08:56, <[EMAIL PROTECTED]> wrote:
>>>
 I am resending my earlier mail on this user list..G

RE: getting data from form with nested beans

2004-01-20 Thread shirishchandra.sakhare
Hi,
Is it flaming or what?I thought we were trying to solve each others problems.Still a 
last try.
We have a complete application(3 modules/4000 classes/15 companies live as of date) 
which uses all form beans just in request scope.And all over the place we have used 
form beans in request scope.And the application is well and running.

If you go t through my mail, you will understand why it will mail.SO please read the 
mail carefully.
I will try to explain it again.

When the form is submitted(the user presses submit button on screen),the corresponding 
action will be called by struts.At the same time, it will look for a actionForm from 
the mapping.As the scope is specified as request, a new form will be created.And if 
you have looked at my example carefully, you will see that the nested bean list is 
created when the form is created.But this nested list is empty.Now when struts 
autopopulation tries to populate a nested bean, it should  find that the nested bean 
list is empty.But the lazy initialization mechanism in the indexed getter will take 
care that the list has enough of beans.See the code below.
33
 //give indexed access to the beans
>>>
>>> public Employee getEmployee(int index){
>>>
>>> //very imp
>>>
>>> //when a jsp is submited , then while auto populating the form,this
>>> will
>>> ensure
>>> that
>>>
>>> // the  form is populated properly.
>>>
>>> while(index >= beanList.size()){
>>>
>>> beanList.add(new Employee());
>>>
>>> }
***

And as explained in jsp part, as long as the property references are created properly, 
this will work.And with struts1.1 nested tags, you don't have to even use the 
script<%%> to create property is jsp.

Hope this clarifies it.If not, try to run my example code.

regards,
Shirish

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 12:28 PM
To: Struts Users Mailing List
Subject: Re: getting data from form with nested beans


Oh yeah .. by working i mean when you submit..


On 20 Jan 2004, at 11:25, Mark Lowe wrote:

> .. Show us all an example of a form with a dynamic size for a form  
> property thats scoped to the request then big shot..
>
> Come on lets see it!!!
>
>
> On 20 Jan 2004, at 10:45, <[EMAIL PROTECTED]> wrote:
>
>> The scope of form has nothing to do with usage of nested beans.And  
>> using session scope shoudl be avaided as far as possible as teh form  
>> will stay in session  till it is explicitely removed from there..
>>
>> The <% %> business is for the scripts so that the nested property  
>> reference can be created.But with struts1.1 , with the usage of  
>> nested tags, oyu can get rid of that scriptlet code.See nested tags  
>> for how to do that.I have myself never used nested tags.
>>
>>
>> -Original Message-
>> From: Mark Lowe [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, January 20, 2004 11:05 AM
>> To: Struts Users Mailing List
>> Subject: Re: getting data from form with nested beans
>>
>>
>> What's with all the <% %> business? Things to watch out for, method
>> names and the object cast to the jsp need to match names (e.g.
>> foo.getEmployee() and ${foo.employee}). The form must be scoped to
>> session if you are dynamically changing the size of the  indexed
>> property.
>>
>> 
>>
>> A better example would be a form bean with a getEmployees() method and
>> a setEmployee rather than getBeanList or whatever it was.
>>
>>
>> public Object[] getEmployees() {
>>  return emplyeeList.toArray();
>> }
>>
>> public void setEmployees(ArrayList employeeList) {
>>  this.employeeList = employeeList;
>> }
>>
>> public Employee getEmployee(int i) {
>>  return (Employee) employeeList.get(i);
>> }
>>
>> public void setEmployee(int i,Employee employee) {
>>  this.employeeList.add(i,employee);
>> }
>>
>>
>> ..
>>
>> public class Employee {
>>  private String name;
>>
>>  public String getName() {
>>  return name;
>>  }
>>  etc
>> }
>>
>> ..
>>
>> 
>>
>>  
>>
>> 
>>
>> or
>>
>> 
>>  ..
>>
>>
>>
>> On 20 Jan 2004, at 08:56, <[EMAIL PROTECTED]> wrote:
>>
>>> I am resending my earlier mail on this user list..Go through the
>>> sample code
>>> and
>>> ask me if u don't understand something.
>>>
>>> The important portions are commented.Especially look at the jsps
>>> property
>>> how
>>> it is set and also the form bean.The property syntax I have used was
>>> for struts 1.0 ..But with struts 1.1 , you can have a better cleaner
>>> syntax using nested tags.But I have not used it...This works for 1.1
>>> as well..
>>>
>>> 
>>>
>>> //Form Class
>>>
>>> import java.util.ArrayList;
>>>
>>> import java.util.List;
>>>
>>> import org.apache.struts.action.ActionForm;
>>>
>>> public class ExampleListForm extends ActionForm {
>>>
>>> //A list of Emp beans
>>>
>>> private List beanList = new ArrayList();
>>>
>>> public List getBeanList(){
>>>
>>> return

RE: getting data from form with nested beans

2004-01-20 Thread shirishchandra.sakhare
The scope of form has nothing to do with usage of nested beans.And using session scope 
shoudl be avaided as far as possible as teh form will stay in session  till it is 
explicitely removed from there..

The <% %> business is for the scripts so that the nested property reference can be 
created.But with struts1.1 , with the usage of nested tags, oyu can get rid of that 
scriptlet code.See nested tags for how to do that.I have myself never used nested tags.


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 11:05 AM
To: Struts Users Mailing List
Subject: Re: getting data from form with nested beans


What's with all the <% %> business? Things to watch out for, method  
names and the object cast to the jsp need to match names (e.g.  
foo.getEmployee() and ${foo.employee}). The form must be scoped to  
session if you are dynamically changing the size of the  indexed  
property.



A better example would be a form bean with a getEmployees() method and  
a setEmployee rather than getBeanList or whatever it was.


public Object[] getEmployees() {
return emplyeeList.toArray();
}

public void setEmployees(ArrayList employeeList) {
this.employeeList = employeeList;
}

public Employee getEmployee(int i) {
return (Employee) employeeList.get(i);
}

public void setEmployee(int i,Employee employee) {
this.employeeList.add(i,employee);
}


..

public class Employee {
private String name;

public String getName() {
return name;
}
etc
}

..







or


..



On 20 Jan 2004, at 08:56, <[EMAIL PROTECTED]> wrote:

> I am resending my earlier mail on this user list..Go through the  
> sample code
> and
> ask me if u don't understand something.
>
> The important portions are commented.Especially look at the jsps  
> property
> how
> it is set and also the form bean.The property syntax I have used was  
> for struts 1.0 ..But with struts 1.1 , you can have a better cleaner  
> syntax using nested tags.But I have not used it...This works for 1.1  
> as well..
>
> 
>
> //Form Class
>
> import java.util.ArrayList;
>
> import java.util.List;
>
> import org.apache.struts.action.ActionForm;
>
> public class ExampleListForm extends ActionForm {
>
> //A list of Emp beans
>
> private List beanList = new ArrayList();
>
> public List getBeanList(){
>
> return beanList;
>
> }
>
> public void setBeanList(List list){
>
> beanList = list;
>
> }
>
> //very imp.
>
> //give indexed access to the beans
>
> public Employee getEmployee(int index){
>
> //very imp
>
> //when a jsp is submited , then while auto populating the form,this  
> will
> ensure
> that
>
> // the  form is populated properly.
>
> while(index >= beanList.size()){
>
> beanList.add(new Employee());
>
> }
>
> return (Employee)beanList.get(index);
>
> }
>
> public void setEmployee(int index,Employee emp){
>
> beanList.set(index,emp);
>
> }
>
> }
>
> ***
>
> Bean class
>
> public class Employee {
>
> private String name;
>
> private String salary;
>
> /**
>
> * Returns the name.
>
> * @return String
>
> */
>
> public String getName() {
>
> return name;
>
> }
>
> /**
>
> * Returns the salary.
>
> * @return String
>
> */
>
> public String getSalary() {
>
> return salary;
>
> }
>
> /**
>
> * Sets the name.
>
> * @param name The name to set
>
> */
>
> public void setName(String name) {
>
> this.name = name;
>
> }
>
> /**
>
> * Sets the salary.
>
> * @param salary The salary to set
>
> */
>
> public void setSalary(String salary) {
>
> this.salary = salary;
>
> }
>
> }
>
> 
>
> JSP
>
> <%@ page language="java"%>
>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> 
>
> 
>
>  indexId="i"/>
>
>  \"].name\"%>">
>
>  \"].salary\"%>">
>
> 
>
> 
>
> 
>
> Explanation:
>
> See how the property is constructed.
>
>  \"].name\"%>">
>
> So this will result in a parameter name employee[i].name in the http
> request.So
> when the jsp is rendered, this will be interpreted as
>
> getEmployee[i].getName().And when the jsp is submitted , the same will  
> be
> interpreted as getEmployee[i].setName().And this will result in auto
> population
> of data in the form as u can see.
>
> So check the indexed properties on the form as well.(Especially the
> getEmployee(index i) proeprty with while loop.)
>
> Hope this helps.
>
>
>
> regards,
>
> Shirish.
>
>
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 19, 2004 6:18 PM
> To: Struts Users Mailing List
> Subject: Re: getting data from form with nested beans
>
>
> Dunno what that thread on lazy lists was but nesting beans should work
> fine, but you will need to scope any property that you want a dynamic
> size to session.
>
> Shouldn't be anymore complicated than that.
>
>
> On 19 Jan 2004, at 16:01, Martin Sturzenegger 

RE: Write values from html-form to ArrayList in form bean

2004-01-20 Thread shirishchandra.sakhare
See my earlier reply to the question "getting data from form with nested beans" or 
search the user archive on the above key...

regards,
Shirish

-Original Message-
From: Matthias Winkler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 20, 2004 4:16 AM
To: [EMAIL PROTECTED]
Subject: Write values from html-form to ArrayList in form bean


HI,

I have a form bean that passes an ArrayList which
contains objects of type LineItem. 
With the iterate-tag I iterate through retrieve every
LineItem and I use  to access the 'id'
attribute and other values of each LineItem object to
setup a html form with several checkboxes. (For the
checkboxes I use some selfmade tags.)


 

...


Now I want the values of the attribute 'checked' of
each LineItem inside the ArrayList of the form bean to
be changed according to the users selection in the
html form.
As name for the checkboxes I use the value of the 'id'
attribute of each LineItem. Right now no value changes
inside the bean.

Is it possible to do that?

Thanks a lot for your help.
Matthias

__
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

-
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: getting data from form with nested beans

2004-01-20 Thread shirishchandra.sakhare
I am resending my earlier mail on this user list..Go through the sample code
and
ask me if u don't understand something.

The important portions are commented.Especially look at the jsps property
how
it is set and also the form bean.The property syntax I have used was for struts 1.0 
..But with struts 1.1 , you can have a better cleaner syntax using nested tags.But I 
have not used it...This works for 1.1 as well..



//Form Class

import java.util.ArrayList;

import java.util.List;

import org.apache.struts.action.ActionForm;

public class ExampleListForm extends ActionForm {

//A list of Emp beans

private List beanList = new ArrayList();

public List getBeanList(){

return beanList;

}

public void setBeanList(List list){

beanList = list;

}

//very imp.

//give indexed access to the beans

public Employee getEmployee(int index){

//very imp

//when a jsp is submited , then while auto populating the form,this will
ensure
that

// the  form is populated properly.

while(index >= beanList.size()){

beanList.add(new Employee());

}

return (Employee)beanList.get(index);

}

public void setEmployee(int index,Employee emp){

beanList.set(index,emp);

}

}

***

Bean class

public class Employee {

private String name;

private String salary;

/**

* Returns the name.

* @return String

*/

public String getName() {

return name;

}

/**

* Returns the salary.

* @return String

*/

public String getSalary() {

return salary;

}

/**

* Sets the name.

* @param name The name to set

*/

public void setName(String name) {

this.name = name;

}

/**

* Sets the salary.

* @param salary The salary to set

*/

public void setSalary(String salary) {

this.salary = salary;

}

}



JSP

<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>







">

">







Explanation:

See how the property is constructed.

">

So this will result in a parameter name employee[i].name in the http
request.So
when the jsp is rendered, this will be interpreted as

getEmployee[i].getName().And when the jsp is submitted , the same will be
interpreted as getEmployee[i].setName().And this will result in auto
population
of data in the form as u can see.

So check the indexed properties on the form as well.(Especially the
getEmployee(index i) proeprty with while loop.)

Hope this helps.



regards,

Shirish.


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Monday, January 19, 2004 6:18 PM
To: Struts Users Mailing List
Subject: Re: getting data from form with nested beans


Dunno what that thread on lazy lists was but nesting beans should work  
fine, but you will need to scope any property that you want a dynamic  
size to session.

Shouldn't be anymore complicated than that.


On 19 Jan 2004, at 16:01, Martin Sturzenegger wrote:

> hi,
> concerning nested properties, i found so many questions, hints etc. in  
> the archive but nothing that really helped all the way...i'm still  
> confused (or even more now...)
> i still don't understand how struts handles input from a form that  
> holds an iteration of nested beans.
> is the following correct?
> as soon as the user submits the form, the actionform-bean, holding the  
> nested beans with the user's changes, gets transmitted.
> is it so, that before the action-class is called, the form-bean's  
> reset() method is called, and all nested beans are set to null by  
> default?
> so do i have to override the reset() method?
> what do i iterate over in the reset() method to get the user's inputs?
> how do i limit the iteration?
> does the validate() method gets called before the reset method?.
>
> i've seen examples, where a dto-class is instanciated within the  
> reset() method.
> is this the way to do it?
> do i have to access these dto-beans in the action class?
>
> could somebody give me a little example of a reset()-method, just to  
> show how the user's input can be gathered and then stored away?
>
> and.. what are lazy lists? i wasn't able to find a definition
>
> sorry about it but
>
> regards from an utterly confused martin
>
>
>
>
> -- Urspruengliche Nachricht --
> Von: <[EMAIL PROTECTED]>
> Datum:  Mon, 19 Jan 2004 10:52:10 +0100
>
>> You ahve a fixed length or Empty list in the form.So when the auto  
>> population tries to populate the nested bean for the list which is  
>> empty/fixed size,you get this exception.
>> Try to use lazy list or search the archive for nested property  
>> usage...There are many examples which will demonatrate how to use it.
>>
>> HTH.
>> regards,
>> Shirish
>>
>> -Original Message-
>> From: Martin Sturzenegger [mailto:[EMAIL PROTECTED]
>> Sent: Monday, January 19, 2004 10:46 AM
>> To: Struts Users Mailing List; [EMAIL PROTECTED]; Struts  
>> Users
>> Mailing List
>> Subject: Re: Including one JSP in ano

RE: Including one JSP in another

2004-01-19 Thread shirishchandra.sakhare
You ahve a fixed length or Empty list in the form.So when the auto population tries to 
populate the nested bean for the list which is empty/fixed size,you get this 
exception. 
Try to use lazy list or search the archive for nested property usage...There are many 
examples which will demonatrate how to use it.

HTH.
regards,
Shirish

-Original Message-
From: Martin Sturzenegger [mailto:[EMAIL PROTECTED]
Sent: Monday, January 19, 2004 10:46 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]; Struts Users
Mailing List
Subject: Re: Including one JSP in another


i try to receive user-input from a form using a list of nested beans.
after hitting submit i get an ArrayIndexOutOfBoundsException
can somebody give me a hint?
many thanks
martin




stacktrace:

java.lang.ArrayIndexOutOfBoundsException
java.lang.reflect.Array.get(Native Method)

org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:525)

org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)

org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)




>> > >
>> > > Confidentiality Notice
>> > >
>> > > 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 confidential
>> > > or privileged information. If
>> > > you are not the intended recipient, please notify the sender at Wipro
>or
>> > > [EMAIL PROTECTED] immediately
>> > > and destroy all copies of this message and any attachments.
>> > >
>> > > -
>> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > > For additional commands, e-mail: [EMAIL PROTECTED]
>> > >
>> > >
>> > > Confidentiality Notice
>> > >
>> > > 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 confidential
>> or
>> > privileged information. If
>> > > you are not the intended recipient, please notify the sender at Wipro
>or
>> > [EMAIL PROTECTED] immediately
>> > > and destroy all copies of this message and any attachments.
>> > >
>> > > -
>> > > 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]
>>
>
>
>-
>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: Mandatory use of form rather than request object

2004-01-12 Thread shirishchandra.sakhare
Hi,
Its a good idea to use just form.getAttribute than use request.getparameter..I think 
that is major advantage with struts...You should no longer be using this syntax.The 
form should be a complete container as far as actions are concerned.The advantage is 
that just by looking at the form you should know what all data is required if the form 
is properly documents.That is one of the reasons I do not like using 
request.getParameter as it sort of smells of the magic key approach,there .

But I don't think you can remove parameters from the request as there is no such 
method there..Nor you can add parameters to a request.
the only thing I can think of is to do a code review and include it in the coding 
guidelines.


HTH.
regards,
Shirish

-Original Message-
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 4:19 PM
To: 'Struts Users Mailing List'
Subject: Mandatory use of form rather than request object


Hello All,

I did some code reviews recently for my project being done on struts.

I found that most people still do a request.getAttribute("NAME") kind of
code even when the name is a property of the form object and is available in
the form object.

My question is should the use of form be mandatory. If yes, how it can be
enforced. Is there quick way I can remove all the params/attributes from the
request object once the corresponding values have been set in the form
object?

Thanks in advance for your advise.

Regards,
Abhishek.

-
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: Storing uploaded files outside the root directory of a webapp

2004-01-12 Thread shirishchandra.sakhare
Hi,
We have applied following approach in the project.

A project level variable (system variable) is defined..e.g. MY_PROJECT_HOME 

And all file paths are resolved relative to this home.So all our configuration 
files(which are XML files) just give a path relative to the project home
and a FileUtils class provides the complete path by appending any path to this 
PROJECT_HOME.And it has worked quite well.
I think this is a very clean approach which separates your data files from the 
webapplication deployment directories.And it is reasonable to assume that any 
application will have its home directory set.


HTH.
regards,
Shirish

-Original Message-
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 1:43 PM
To: Struts Users List
Subject: Storing uploaded files outside the root directory of a webapp


Hi everybody,

A while ago i posted a question concerning file uploads. My initial idea was to 
save all uploaded files in a directory of the web application. Craig R. 
McClanahan replied to my post with the following very interesting comment 
(thanks Craig!):

Craig R. McClanahan wrote:
 > * You are not guaranteed that a particular servlet container
 >   even *has* a concept of a directory in which the web app
 >   is deployed -- for example, even Tomcat can execute a webapp
 >   directly from the WAR file.  When you do that, getRealPath()
 >   returns null instead of a pathname, and your calculations above
 >   will trigger a NullPointerException.
 >
 > * Even when you know that your apps are being deployed in unpacked
 >   directories, uploading things directly into that directory means
 >   you have to be careful about redeployment when you update the app
 >   -- the normal behavior of "delete the old directory and replace it
 >   with the new app" wipes out any uploaded files.
 >
 > I would recommend defining a directory somewhere in your server to hold the
 > uploaded files for a webapp, and then pass the pathname of this directory to
 > your app as a context init parameter or something like that.  This approach
 > deals with both of the problems identified above.

My question is, how can i specify such a directory outside my webapp root 
diretory so that my Action classes can still reference those files? Craig's idea 
  about using a context init parameter sounds good but do i have to retrieve 
this parameter manually every time i want to use it?

Ideally i would like to specify the upload directory in a properties file and 
then use the value of this property to create a constant that can be used 
throughout the application. is this doable? if yes, how?

I'm also looking into storing the files in the database along with the meta 
information for the files. What are the pros / cons for this approach? At the 
moment there are about 100 files that i have to deal with and there are not a 
lot of new ones added. The file size ranges from some KB up to ca. 5 MB...

Any suggestions, tips and comments would be higly appreciated.

Thanks a lot,
Patrick





-
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: One action per request, or chaining two?

2004-01-08 Thread shirishchandra.sakhare
We also have used the same approach where data retrieval and data update is taken care 
of by different actions...We call them open action and save actions..


And This has really served us well.I mean you may want to to show the same page after 
some other action..So in that case you just forward to the PageRetrival action form 
that action..They become really reusable this way...Making actions very granular has 
really helped us.But also to handle same request(or one logical part of request ..Like 
doing just the update) having 2 actions is not a good idea as at will have the logic 
split all over the place..

HTH.
regards,
Shirish


-Original Message-
From: Manfred Wolff [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 7:44 AM
To: Struts Users Mailing List
Subject: Re: One action per request, or chaining two?


John.

There are no rules. In the programming guide of my project it is 
described, that you have to make two actions. The both actions has two 
diffrent suffixes (pre and post), so that you can differ it. Than the 
responsibility of the action is clearly than in the other way.

Manfred

John Boyes wrote:

>I've read the archives on this subject (action chaining etc) carefully but
>am still slightly confused about the following:
> 
>If a typical situation for a page request is:
> 
>1) Data from a form submission is processed
> 
>2) Data is retrieved from the database to generate the next page view,
> 
>is it better practice to have just one action handle both 1) and 2), or is
>it better practice to relay two separate actions.
> 
>I have read posts which indicate that one action per request should be the
>norm for most situations, but equally I have read other posts which indicate
>that it is normal to have one action to handle the form submission and
>another to generate the next page view.
> 
>Thanks for any replies,
> 
>John
> 
> 
>
>  
>

-- 
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-27
phone : +49 421 534522
mobil : +49 178 49 18 434
eFax  : +49 1212 6 626 63 965 33
---

Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese 
Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



-
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: BeanUtils use in struts

2004-01-07 Thread shirishchandra.sakhare
Hi,

We had teh same question.But I have read that the performance issue with reflection 
has been resolved from jdk1.3 and jdk 1.4 so that it is almost undetectable.Check the 
release notes for those versions of jdk to get more details about the same.


HTH.
regards,
Shirish
-Original Message-
From: Marco Mistroni [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 11:27 AM
To: 'Struts Users Mailing List'
Subject: BeanUtils use in struts 


Hi all,
I have a  question about using BeanUtils in Struts.
For saving me from writing lot of code, I am using DynaActionForms in my
pages.
In the backend, I have some DTOs, so I decided in order to make
My app more 'extensible' without rewriting too much code, to use
BeanUtils to populate my DTOs with values from DynaActionForm, and to
Use the same mechanism to populate DynaActionForm from DTO.

Now, pls correct me if I am wrong, but BeanUtils uses reflection in
Order to populate properties..

I have read from some books ('Effective Java') that using reflection
Is much slower than invoking methods normally..
In my app, I will gain flexibility (I don't need to write methods for
Populating dtos from form and vice versa), but am I going to lose much
In tems of performance?

Anyone can give his comments?  I think BeanUtils is of great help,and it
would be a pity to give up the benefits that I get from it...

Best regards
marco


-
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: forwarding request to Another Action class from Action Class

2004-01-07 Thread shirishchandra.sakhare
The simplest way(And more struts way) would be to define a forward in action 1 which 
points to action 2.
And then return that forward from the execute method...

-Original Message-
From: Sudhakar G [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 6:21 AM
To: [EMAIL PROTECTED]
Subject: forwarding request to Another Action class from Action Class


Hi Everybody,
   Can any one tell me how do I forward the request to other Action class
from the current Action class..


Thanks in Advance

Sudhakar





DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. 
Before opening attachments please check them for viruses and defects. MindTree 
Consulting Private Limited (MindTree) will not be responsible for any viruses or 
defects or any forwarded attachments emanating either from within MindTree or outside. 
If you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or dissemination 
of this message in whole or in part is strictly prohibited.  Please note that e-mails 
are susceptible to change and MindTree shall not be liable for any improper, untimely 
or incomplete transmission.

-
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: Problem with action chaining

2003-12-31 Thread shirishchandra.sakhare
Hi ,
As pointed out by Mohan, Action chainning is not a good design practice...
You can forward from one action to another but they should eb performing completely 
independent units of work.If two actions are used to complete only bits of work to 
complete one logical response, then it is a bad design. There is a discussion thread 
about action chainning in mail archive.

Now about your question.

What do u mean by forwarding from action 1 tomaction 2?Because if AgencyAction  says 
mapping.findFOrward("create")
 then this should work as the forward will agin cause the form instance to be created 
or retrieved from session...


But if you are callign execute of the AgencyCreateAction from first action, then it 
will not work.


HTH.
regards,
Shirish



-Original Message-
From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 31, 2003 6:38 AM
To: 'Struts Users Mailing List'
Subject: RE: Problem with action chaining


We use base forms too but we use sub-forms in both action mappings. It works
for us if we use sub-forms with action chaining like this.

  Our action chains are very minimal though because it is not recommended
design practice.
Mohan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 31, 2003 10:26 AM
To: [EMAIL PROTECTED]
Subject: Problem with action chaining


Hi, 

 

I have a problem with action chaining. My action tag 











 

 

forwards control to the following:

 







 

Now AgencyCreateForm extends AgencyForm and AgencyCreateAction extends
AgencyAction. 

 

When the derived class AgencyCreateAction tries to type cast the
AgencyCreateForm in the execute() method, it throws a type cast
exception. This is because no instance of AgencyCreateForm is created
and it still persists the instance of AgencyForm. 

 

Can anyone guide me as to how I can resolve this problem. 

 

Regards,

Kavita C. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 31, 2003 10:19 AM
To: Kavita Cardoz
Subject: WELCOME to [EMAIL PROTECTED]

 

Hi! This is the ezmlm program. I'm managing the

[EMAIL PROTECTED] mailing list.

 

I'm working for my owner, who can be reached

at [EMAIL PROTECTED]

 

Acknowledgment: I have added the address

 

   [EMAIL PROTECTED]

 

to the struts-user mailing list.

 

Welcome to [EMAIL PROTECTED]

 

Please save this message so that you know the address you are

subscribed under, in case you later want to unsubscribe or change your

subscription address.

 

 

--- Administrative commands for the struts-user list ---

 

I can handle administrative requests automatically. Please

do not send them to the list address! Instead, send

your message to the correct command address:

 

To subscribe to the list, send a message to:

   <[EMAIL PROTECTED]>

 

To remove your address from the list, send a message to:

   <[EMAIL PROTECTED]>

 

Send mail to the following for info and FAQ for this list:

   <[EMAIL PROTECTED]>

   <[EMAIL PROTECTED]>

 

Similar addresses exist for the digest list:

   <[EMAIL PROTECTED]>

   <[EMAIL PROTECTED]>

 

To get messages 123 through 145 (a maximum of 100 per request), mail:

   <[EMAIL PROTECTED]>

 

To get an index with subject and author for messages 123-456 , mail:

   <[EMAIL PROTECTED]>

 

They are always returned as sets of 100, max 2000 per request,

so you'll actually get 100-499.

 

To receive all messages with the same subject as message 12345,

send an empty message to:

   <[EMAIL PROTECTED]>

 

The messages do not really need to be empty, but I will ignore

their content. Only the ADDRESS you send to is important.

 

You can start a subscription for an alternate address,

for example "[EMAIL PROTECTED]", just add a hyphen and your

address (with '=' instead of '@') after the command word:

<[EMAIL PROTECTED]>

 

To stop subscription for this address, mail:

<[EMAIL PROTECTED]>

 

In both cases, I'll send a confirmation message to that address. When

you receive it, simply reply to it to complete your subscription.

 

If despite following these instructions, you do not get the

desired results, please contact my owner at

[EMAIL PROTECTED] Please be patient, my owner is a

lot slower than I am ;-)

 

--- Enclosed is a copy of the request I received.

 

Return-Path: <[EMAIL PROTECTED]>

Received: (qmail 38403 invoked from network); 31 Dec 2003 04:49:08 -

Received: from unknown (HELO mumbai2.ezbroadnet.com) (203.124.136.26)

  by daedalus.apache.org with SMTP; 31 Dec 2003 04:49:08 -

Received: from ind-spz7gwy003.mastek.com (meghdoot.mastek.com
[203.124.144.12])

by mumbai2.ezbroadnet.com (8.11.7p1+Sun/8.11.7) with SMTP id
hBV4k7A06598

for
<[EMAIL PROTECTED]
ta.apache.org>; Wed, 31 Dec 2003 10:16:07 +0530 (IST)

Received: FROM ind-spz7gwy002.mastek.com BY ind-spz7gwy003.mastek.com ;
Wed Dec 31 10:16:36 2003 +0500

Received: from 

RE: PDF file in browser

2003-12-29 Thread shirishchandra.sakhare
Your first point of using xxx to make it open in 
a new browser is valid..

But the second point i did not get it.

Exactly for those situations where the user is prompted for save dialogue box,I have 
suggested to add the response.addHeader("Content-Disposition", "attachment; filename=" 
+ saveAsFileName );
This makes it to give the proper file name in save as dialogue box.

And it works with netscape as well...Thas what we are using here..

HTH.
regards,
Shirish.

-Original Message-
From: hernux [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 2:33 PM
To: Struts Users Mailing List
Subject: Re: PDF file in browser


You 're forgetting two things...

1- He wants to show a pdf  file in a new browser
to do that, you must set the apropiate target into de A tag...

xxx

target="_blank" will open the link in a new window.

2- This, will only work if the users uses Internet Explorer...cause it's an
activeX container, unless the
user changed it, by default pdf files and other documents, will be opened
inside explorer...but other
browsers such as netscape, mozilla and opera, are not activeX container, so,
pdf files will prompt the user
to download them, or open directly.

regards,
Hernux

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 24, 2003 7:17 AM
Subject: RE: PDF file in browser


Hi,
Also do not forget to set the header so that the save as dialogue box is
displayed in IE...For that you have to set the content-disposition header ..
following is the  code from our project..


Class  FileOpenAction{

protected final void returnBinaryFile(
HttpServletResponse response,
String filename
String saveAsName)
throws FileNotFoundException, IOException {
response.setContentType(mimeType);
String fileExt = WebUtil.getFileExtensionFromMIMEType("application/pdf");
setSaveAsHeader(response,saveAsName,fileExt);
File file = new File(filename);
response.setContentLength((int) file.length());

FileInputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] buf = new byte[4096];
int count = 0;

while ((count = in.read(buf)) >= 0) {
out.write(buf, 0, count);
}

in.close();
out.close();
}

public static void setSaveAsHeader(HttpServletResponse response,String
saveAsFileName,String fileExt){
if(saveAsFileName == null){
return;
}
//to get over a problem in browsers due to which the file name must have
proper extension
if((fileExt != null)|| (fileExt.length() !=0)){
int index1 = saveAsFileName.indexOf(fileExt.toUpperCase());
int index2 = saveAsFileName.indexOf(fileExt.toLowerCase());
if((index1 == -1) &&(index2 == -1)){
saveAsFileName = saveAsFileName + "." + fileExt;
}
}
response.addHeader("Content-Disposition", "attachment; filename=" +
saveAsFileName );
}
}

Also another thought..Why use another servlet..Just use another action like
we do..This way you can use all the existing framwroek..Like authorisation
etc

-Original Message-
From: Surachai Locharoen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 10:41 PM
To: Struts Users Mailing List
Subject: Re: PDF file in browser


Additionally, In struts framework you have to reset request header before by
call


request.reset();
request.setContentType("application/pdf");
request.setContentLength(byte.length);



- Original Message -
From: "Navjot Singh" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, December 23, 2003 9:53 PM
Subject: RE: PDF file in browser


> if you can reveal the location of the PDFs on your web server.
> Simply put your pdfs under a www/app.com/pdfs/*.pdf and give them links as
> you want.
>
> if you wish to maintain some security.
> 1. send a request to a servlet wit some pdf code or file name
> 2. open the given file from the file system whereever it is.
> 3. convert it into stream.
> 4. push the stream back to browser.
>
> note - must set the appropraite mime/type before you push the stream back.
> may be application/pdf or application/x-pdf
>
> HTH
> Navjot Singh
>
> >-Original Message-
> >From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, December 24, 2003 10:50 AM
> >To: 'Struts Users Mailing List'
> >Subject: PDF file in browser
> >
> >
> >
> >
> >Hi All,
> >
> > I am using Struts frame work for our application with Web sphere
> >app server.
> >We have a some PDF files on the app server .When the user clicks on a
> >particular link on
> >the JSP page, we have show a pdf  file to the user in a new browser
> >window.
> >Can any one pls tell me the easier procedure to do this??
> >
> >Regards
> >VasudevRaoGupta
> >
> >
> >Confidentiality Notice
> >
> >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
> >confidential or privileged information. If
> >you are not the intended recipient, please notify the

RE: Navigation Stack

2003-12-24 Thread shirishchandra.sakhare
Hi,
I found the idea interesting..

But I have a couple of questions...

the assumption you are making here is entire request parameters are captured in the 
form...How else can you call some action if it does not have access to all the request 
parameters..

Also it means that the action have very clean code and no forwarding of Objects as 
request attributes etc...


But if these  rules are followed,what you have done will definately work.


regards,
Shirish.

-Original Message-
From: Guillermo Meyer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 12:11 PM
To: Struts Users Mailing List
Subject: Navigation Stack


Hi:
I'm working with a Struts 1.0 application. I extended Action to create a
base action that handles backwards navigation in a stack fashion.
Each method calls a "saveStep" method to the stack. This step has form,
mapping and dispatch name. Base action has a method called "stepBack"
that can be called from the browser by clicking the "back" button (not
browser back button, but a submit button). This stepBack method executes
the last step in the stack and goes backwards. Another features exists
like checkPoint step, and an undoStep to return from a validation in
Validator Form.

public ActionForward stepBack(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws Exception {
NavigationStack ns =
this.retrieveNavigationStack(request);
synchronized(ns) {
//if not reloading
StackStep ss = null;
if(this.isTokenValid(request)) {
try {
  ns.pop(); //last step, ignore it.
ss = ns.pop();
} catch (Exception e){
   return this.handleEmptyStack(mapping, form, request,
response);
}
} else {
ss = ns.getLastPopped();
}
return ss.process(request, response);
}
}

public void saveStep(ActionMapping mapping, ActionForm form,
HttpServletRequest req, String dispatchName, boolean isCheckPoint) {
//si no se indicó invalidar el grabado...
if(this.isStepValid(req)) {
NavigationStack ns =
this.retrieveNavigationStack(req);
synchronized(ns) {
StackStep newStep = new
StackStep(dispatchName, mapping, form, isCheckPoint);
newStep.setServlet(this.getServlet());
//lo apila siempre y cuando sean
distintos (el último y el nuevo)
if(!newStep.equals(ns.getLast())) {
ns.push(newStep);
}
this.saveNavigationStack(req, ns);
}
}
}


I would like to know what you thing about this kind of navigation
management and know how are you dealing with this problem. With this
solution I can link 2 use case action (I designed one action for each
use case) and click back button to return wherever i was called.

Thanks in advance.

Guillermo Meyer
System Engineer.
EDS Argentina.

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



RE: PDF file in browser

2003-12-24 Thread shirishchandra.sakhare
Hi,
Also do not forget to set the header so that the save as dialogue box is displayed in 
IE...For that you have to set the content-disposition header ..
following is the  code from our project..


Class  FileOpenAction{

protected final void returnBinaryFile(
HttpServletResponse response,
String filename
String saveAsName)
throws FileNotFoundException, IOException {
response.setContentType(mimeType);
String fileExt = 
WebUtil.getFileExtensionFromMIMEType("application/pdf");
setSaveAsHeader(response,saveAsName,fileExt);
File file = new File(filename);
response.setContentLength((int) file.length());

FileInputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] buf = new byte[4096];
int count = 0;

while ((count = in.read(buf)) >= 0) {
out.write(buf, 0, count);
}

in.close();
out.close();
}

public static void setSaveAsHeader(HttpServletResponse response,String 
saveAsFileName,String fileExt){
if(saveAsFileName == null){
return;
}
//to get over a problem in browsers due to which the file name must 
have proper extension
if((fileExt != null)|| (fileExt.length() !=0)){
int index1 = saveAsFileName.indexOf(fileExt.toUpperCase());
int index2 = saveAsFileName.indexOf(fileExt.toLowerCase());
if((index1 == -1) &&(index2 == -1)){
saveAsFileName = saveAsFileName + "." + fileExt;
}
}
response.addHeader("Content-Disposition", "attachment; filename=" + 
saveAsFileName ); 
}   
}

Also another thought..Why use another servlet..Just use another action like we 
do..This way you can use all the existing framwroek..Like authorisation etc

-Original Message-
From: Surachai Locharoen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 24, 2003 10:41 PM
To: Struts Users Mailing List
Subject: Re: PDF file in browser


Additionally, In struts framework you have to reset request header before by
call


request.reset();
request.setContentType("application/pdf");
request.setContentLength(byte.length);



- Original Message -
From: "Navjot Singh" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, December 23, 2003 9:53 PM
Subject: RE: PDF file in browser


> if you can reveal the location of the PDFs on your web server.
> Simply put your pdfs under a www/app.com/pdfs/*.pdf and give them links as
> you want.
>
> if you wish to maintain some security.
> 1. send a request to a servlet wit some pdf code or file name
> 2. open the given file from the file system whereever it is.
> 3. convert it into stream.
> 4. push the stream back to browser.
>
> note - must set the appropraite mime/type before you push the stream back.
> may be application/pdf or application/x-pdf
>
> HTH
> Navjot Singh
>
> >-Original Message-
> >From: vasudevrao gupta [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, December 24, 2003 10:50 AM
> >To: 'Struts Users Mailing List'
> >Subject: PDF file in browser
> >
> >
> >
> >
> >Hi All,
> >
> > I am using Struts frame work for our application with Web sphere
> >app server.
> >We have a some PDF files on the app server .When the user clicks on a
> >particular link on
> >the JSP page, we have show a pdf  file to the user in a new browser
> >window.
> >Can any one pls tell me the easier procedure to do this??
> >
> >Regards
> >VasudevRaoGupta
> >
> >
> >Confidentiality Notice
> >
> >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
> >confidential or privileged information. If
> >you are not the intended recipient, please notify the sender at
> >Wipro or [EMAIL PROTECTED] immediately
> >and destroy all copies of this message and any attachments.
> >
> >-
> >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]


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

RE: Validations - 'format' vs 'business'

2003-12-23 Thread shirishchandra.sakhare
Hi,
I think many of us come across same problems ..And as you said, it is always not easy 
to come with an easy solution ..


But following  approach will avoid code duplication...And also keep seperation between 
business layer and Presentation layer(web layer)..


In the forms just do the frontend level validation(compulsory fields, date formats, 
invalid strings being entered for numeric text boxes etc etc...)
And then the business level validations should be done just in the service/model 
layer...That means no dao calls in the forms.And if there are any Business level 
validation failures in Service/Model layer, it should return with some specific 
Business Exception...Which can then be caught in Action and handled 
appropriately...You may even think about some ErrorContainer to the 
Serviclayer(Similar ActionMessages object in Struts layer) which can then be returned 
along with the businessException(Embedded in BusinessException .)So the ActionLayer 
can then just have a generic Utility method to extract the BusinessException from this 
container and populate the StrutsMessages container to show the same to user...


But the important point to consider is whether your Model/service layer is going to be 
called from some other API or not?Else doing the validation in FORM or Action looks 
just fine...


HTH.
regards,
Shirish

-Original Message-
From: Guido García Bernardo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 1:51 PM
To: Struts Users Mailing List
Subject: Re: Validations - 'format' vs 'business'


I really think that is a good aproach. At least one of the most simple 
and centralized.  BUT

...from a "pure struts" point of view someone can think that your 
solution is mixing the model with the view.
I think ActionForm should remains as part of the view, or just a 'box' 
between the view and the controller.
What do you think?

On the other hand, I _must_ expose business logic as a API for other 
projects.  With this fact in mind, business methods should be 
implemented doing validations again (defensive programming, you need to 
think about possible errors from your users and don't assume 
anything...). HOW without duplicated code?

Thank you again,
Guido García Bernardo

Vic Cekvenich wrote:

> {repost}
> I just override validate() method on formbean and do all there, 
> including super.validate() that reads validation.xml. In here I call 
> DAO's to do business validation also, ex: what is the available credit 
> for the client to place this order.
>
> Then in action I do this:
> errors = formbean.validate();
>
> hth,
> .V
>
> Guido García Bernardo wrote:
>
>> Hi,
>> I have a design doubt... I must validate data coming from a form. 
>> This consist typically of:
>>- 'format' validations (i.e. a field is not empty or it is 
>> numeric) that I do in the validate method of the ActionForm
>>- 'business' validations that usually require a DB access
>>
>> I actually do 2 steps (actions) per operation. One of them prepare 
>> the data and the second one does the operation itself. And here comes 
>> my first question: ¿¿is there any other better aproach??  Maybe 
>> something similar to a Tiles Controller to prepare the data...
>>
>>class PreOperationAction extends Action {
>>public ... execute ( ... ) {
>>   // Create JavaBeans to populate html selects and several 
>> inputs (requires DB access) and include them in the request
>>   // Forward to error/success jsp
>>}
>>}
>>
>>class PostOperationAction extends Action {
>>public ... execute ( ... ) {
>>   // Get data from ActionForm
>>   // Business validations (the selected values and inputs are 
>> valid from the business point of view)
>>   // Execute business logic (encapsulated in external 
>> business logic classes)
>>   // Forward to error/success jsp
>>}
>>}
>>
>> At this point I don't know what is better (from a MVC perspective).
>>1. Do it as actually, that is, doing business validation before 
>> business logic. This way I think I can't expose the business logic as 
>> an API or as a web service.
>>2. Include all the validations (business and format) into the 
>> business logic classes.  This way I must duplicate format validations
>>3. Doing a OperationValidations class (? only a vague idea)
>>4. Is there any pattern or any best practice related?  Does 
>> Validator Plugin allow complex business validations?
>>
>> Finally, I need your opinion about handling validation errors:
>>1. Throwing an Exception from the business logic classes and catch 
>> it in the Action (or declare the exception in struts-config.xml)
>>2. Returning null (or -1, or a no-sense value) from the business 
>> logic classes
>>3. Any other way...
>>
>> Thank you very much,
>> Guido García Bernardo.
>

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

RE: Getting values from jsp pages

2003-12-23 Thread shirishchandra.sakhare
Look at the struts documentation ..Especially the getting started guide...


But the simple rule is you should have matching attributes on your form...SO struts 
autopopulation will take care of transferring the parameters to the form..You can just 
you the getters on the form to access those values then...

-Original Message-
From: Kamal Gupta [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 10:33 AM
To: Struts Users Mailing List
Subject: Getting values from jsp pages


Hi,

Can some one please send me some example code of getting values from a jsp
page as I have to insert the values into the database.

what are the different steps which are required to be done in struts to make
this work

Regards

Kamal

-Original Message-
From: François Richard [mailto:[EMAIL PROTECTED]
Sent: 23 December 2003 09:03
To: Struts Users Mailing List
Subject: Re: Synchronise Collection with ActionForm


no one have an idea !!

my ActionForm :

public class SocieteForm extends ActionForm {

private ArrayList societes;

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
   return errors;
}

public ArrayList getSocietes()   {  return societes;   }
public void setSocietes(ArrayList liste){ societes = liste;  }
}

my struts-config.xml (only for submit) :





any advice would be appreciated. ;-)

François



François Richard wrote:

> Merry Christmas,
>
> I have got an ActionForm with a collection.
> The first synchronization (ActionForm object > form html) works great,
> on page load.
> but, on form submitting, the second synchronization (form html >
> ActionForm object)doesn't work. the old values are still present.
>
> The ActionForm (SocieteForm) object is stocked in the session.
>
> my jsp :
>
> 
>  scope="session" indexId="index">
> 
> 
> 
> 
>
> Thanks,
>
> François
>
>
>
> -
> 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]


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



RE: Nested Problem.

2003-12-23 Thread shirishchandra.sakhare
There is another way..I think struts has a lazy list implementation which takes of 
thsi problem...


Or see this post..This is reply to a similar question that was asked on the list 
earlier...And this is a lot cleaner implementation...
http://marc.theaimsgroup.com/?l=struts-user&m=106543028416768&w=2

If still in doubt , ask again.I will try to help you out...


HTH.
regards,
Shirish.




-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 8:50 AM
To: Struts Users Mailing List
Subject: RE: Nested Problem.


Why don't you design your bean like this:
If it's a one time set of the collection,then  

public class NestedParentBean extends ActionFormBase{

  private String parentName = null;
  private String parentId = null;
  private java.util.ArrayList childBeanCollection = null;

  public String getParentName() {
return parentName;
  }
  public void setParentName(String parentName) {
this.parentName = parentName;
  }
  public String getParentId() {
return parentId;
  }
  public void setParentId(String parentId) {
this.parentId = parentId;
  }
  public java.util.ArrayList getChildBeanCollection() {
return childBeanCollection;
  }
  public void setChildBeanCollection(java.util.ArrayList
childBeanCollection) {
if (childBeanCollection != null && childBeanCollection.size() >
0) {

  if ( this.childBeanCollection == null)  {
this.childBeanCollection = new
ArrayList(childBeanCollection.size());
  }

  for (int i = 0; i < childBeanCollection.size(); i++ ) {
this.childBeanCollection.add(childBeanCollection.get(i));   
  }
}

  }
}

Else just set the this.childBeanCollection = null before allocating
memory in setChildBeanCollection















-Original Message-
From: RAMYA BALA CHIVUKULA Padmanabha [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 23, 2003 1:09 AM
To: Struts-User (E-mail)
Subject: Nested Problem.

Hi ,
Can any one solve this problem for me.

I have a Parent Bean of the Structure.

public class NestedParentBean extends ActionFormBase{
  private String parentName;
  private String parentId;
  private java.util.ArrayList childBeanCollection;

  public NestedParentBean() {

for(int i=0;i<20;i++){
  NestedChildBean nesChldBean = new NestedChildBean();
  childBeanCollection.add(nesChldBean);
}
  }
  public String getParentName() {
return parentName;
  }
  public void setParentName(String parentName) {
this.parentName = parentName;
  }
  public String getParentId() {
return parentId;
  }
  public void setParentId(String parentId) {
this.parentId = parentId;
  }
  public java.util.ArrayList getChildBeanCollection() {
return childBeanCollection;
  }
  public void setChildBeanCollection(java.util.ArrayList
childBeanCollection) {
this.childBeanCollection = childBeanCollection;



And Child Bean of the Structure


public class NestedChildBean extends ActionFormBase{
  private String childId;
  private String childName;
  public NestedChildBean() {
  }
  public String getChildId() {
return childId;
  }
  public void setChildId(String childId) {
this.childId = childId;
  }
  public String getChildName() {
return childName;
  }
  public void setChildName(String childName) {
this.childName = childName;
  }
The problem for me now is .. I do not know the number of childBeans that
would be available and I do not want to hardcode as shown above, I'm
able to display in the Jsp.. 

ActionFormBase refers to one of our baseclasses


Can anyone help me out with how to create dynamic reference for the
childBean?


Regards,
Ramya 

-
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: Enhancement Request or Possible Alternative?

2003-12-19 Thread shirishchandra.sakhare
Hi,
If you download the workflow extension and see the etst app, you will get a better 
idea..
http://www.livinglogic.de/Struts/exampleApp.html

But as you said, the workflow solution works exactly the way you said...If there is no 
workflow configured, then the actions will work the normal way.
And only if the action mapping has workflow configured, then only workFLow 
restrictions apply.And also the workflow is highly configurable and you can even have 
subworkflows or decide where to go in case of workflow exception,like throw back the 
user to the start of the workflow with a message etc.It can also be used to solve the 
typical 2 window problem in a web application where user opens child  browser window 
from the main window and after finishing workflow from the parent window, tries to 
jump at the middle by using the child window.

And as i said, it just needs you to use thier requestProcessor and no change of code.

We had integrated it in our web application but have taken it out as we are too close 
to release and the workflow mappings have to carefully analysed.
Having said that, i will say that there are some shortcomings which we noticed.But I 
found it works for all the typical cases of workflow.


HTH.
regards,
Shirish.

-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 7:29 PM
To: Struts Users Mailing List
Subject: RE: Enhancement Request or Possible Alternative?


Vic,

I did notice that there is pattern matching now available on the CVS head,
but I was wondering if your solution was done with Struts as is, or if you
had to make modifications to the Struts Config DTD and/or RequestProcessor?

The solution of using a workflow to enforce pathways is not desired since we
want to leave that flexibility in most cases and have the business layer
resolved with changes of context (finishing/creating).

-Jake

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, December 18, 2003 4:30 AM
To: [EMAIL PROTECTED]
Subject: RE: Enhancement Request or Possible Alternative?

Hi,
Did you have a look at the workflow extention for struts?I wil advice you to
have alook at the demo application to see if this is what you are looking
for.
http://www.livinglogic.de/Struts/demoApp.html

And also the site has some introductory material...And best of all it is
Open Source as well...:-))

It has some similar concept.You can configure actions to make them part of a
workflow.And then you can catch when the user leaves the workflow.And then
there are various alternatives like you can force them to stay in a workflow
or allow them to branch to another workflow.
It is highly configurable and does need any code change, just twicking the
ActionMappings...


regards,
Shirish.



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Thursday, December 18, 2003 10:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Enhancement Request or Possible Alternative?


I have a commercial Struts product that includes an event that is 
generated when a new action is called.
I built it so that one can clean up any session stuff when going to 
another action for large projects.
We could work out something VERY reasonable.
.V

Hookom, Jacob wrote:
> We are doing a lot of module switching or multistep workflows (which we
> handle fine through session beans) but at the same time, users are allowed
> to jump to different pages and we would like to capture a "leave" event
when
> they aren't within a set of mapping(s).
> 
> I'm wondering if anyone has solved this problem because it would also
allow
> for constraints on workflows at the action level (if you leave pages X,Y,Z
> then fire Action 'CheckSession').
> 
> 
> Jacob Hookom
> Senior Programmer/Analyst
> McKesson Medical-Surgical
> Golden Valley, MN



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


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



RE: Enhancement Request or Possible Alternative?

2003-12-18 Thread shirishchandra.sakhare
Hi,
Did you have a look at the workflow extention for struts?I wil advice you to have 
alook at the demo application to see if this is what you are looking for.
http://www.livinglogic.de/Struts/demoApp.html

And also the site has some introductory material...And best of all it is Open Source 
as well...:-))

It has some similar concept.You can configure actions to make them part of a 
workflow.And then you can catch when the user leaves the workflow.And then there are 
various alternatives like you can force them to stay in a workflow or allow them to 
branch to another workflow.
It is highly configurable and does need any code change, just twicking the 
ActionMappings...


regards,
Shirish.



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
Sent: Thursday, December 18, 2003 10:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Enhancement Request or Possible Alternative?


I have a commercial Struts product that includes an event that is 
generated when a new action is called.
I built it so that one can clean up any session stuff when going to 
another action for large projects.
We could work out something VERY reasonable.
.V

Hookom, Jacob wrote:
> We are doing a lot of module switching or multistep workflows (which we
> handle fine through session beans) but at the same time, users are allowed
> to jump to different pages and we would like to capture a "leave" event when
> they aren't within a set of mapping(s).
> 
> I'm wondering if anyone has solved this problem because it would also allow
> for constraints on workflows at the action level (if you leave pages X,Y,Z
> then fire Action 'CheckSession').
> 
> 
> Jacob Hookom
> Senior Programmer/Analyst
> McKesson Medical-Surgical
> Golden Valley, MN



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

2003-11-21 Thread shirishchandra.sakhare
easy pizzy...We are already having the same scenario.
Don't use the default log4j initialization(which means just putting the 
log4j.properties file in the class path and forget about it.)This way you have no 
control over the initialization.
You write a class(e.g. LogEnvLoader) and in that class load the property file(Or XMl 
file if you want) and initialize the log4j environment.
And then you can call this initialization class form either the init method of servlet 
or from any model layer class.

HTH.
regards,
Shirish.

-Original Message-
From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 3:29 PM
To: Struts Users Mailing List
Subject: STRUTS LOG4J


Hi everybody... I know that one of the ways to use log4j with struts is 
to load a log4j.properties file at servlet container startup...
But what if I have a business layer that has no direct connection to a 
"servlet container" or I want to run some stand-alone tests and 
logging... Do I have to have two separate ways of loading the 
log4j.properties file or is there a way to do it so it works in servlet 
container and stand-alone environment?!

Thanks a lot,
Todor


-
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: best practice to avoid chaining actions

2003-11-21 Thread shirishchandra.sakhare
Hi,
There was a long discussion about action chainning some time ago.
http://marc.theaimsgroup.com/?l=struts-user&m=104427309720653&w=2
And as summarized in the above discussion, I think if you are using 2 actions to 
complete 1 logical function, then it is bad design.And that is what I think the 
approach suggested by you looks like.


To answer you specific question,like already suggested, I will put the validation 
logic in the form bean(SO that same validation can be used in some other action if it 
is using same form ) and then put the validation call in the action(Something like 
form.validate) and forward to error if the validation fails.

And if validation succeeds, go ahead with normal data processing(which is data 
retrieval in this case.)

HTH.
regards,
Shirish



-Original Message-
From: Krishnakumar N [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 10:56 AM
To: Struts Users Mailing List
Subject: RE: best practice to avoid chaining actions




> -Original Message-
> From: Nicolas De Loof [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 21, 2003 2:58 PM
> To: Struts Users Mailing List
> Subject: Re: best practice to avoid chaining actions
> 
> 
> 
> 
> > Hello,
> >
> > If action chaining is a design error, then the struts-example that
> > comes with struts distributions has a design error, saveSubscription
> > forwards to editRegistration.do!
> >
> > Anyway, what I do is keep validation off action classes, by moving
> > them off to action forms using validator and/or overridden 
> validate()
> > methods. (Business logic validations that need access to 
> the data model must
> > be in the model ofcourse, and not in action classes.)
> 
> You're right, my description was a little short about this :
> 
> In Action1, we use business model validation methods to 
> validate some form datas : to know if user is allowed to use
> some datas he entered for the business process he want's to begin.
>
If the logic itself is in the model and action1 only makes the call to
validate the user's inputs, I would guess it is ok to put it in the same
action that fetches and populates data for page2.
>
> >
> > Cheers,
> > Krishna
> >
> 
> 
> -
> 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: Combination of Struts, Tiles and JSF

2003-11-17 Thread shirishchandra.sakhare
Hi,
I think tilesCOntroller class concept is for the same purpose.Whenever the tiles is 
rendered, the controller class is called prior to that which should perform the 
business logic necessary to prepare business data..

But I would rather prefer the struts way.I mean prepare a struts action which will 
forward to a tile definition and then use this forward wherever i want to render the 
view:-))

HTH.
regards,
Shirish

-Original Message-
From: Dominik Stöttner [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Combination of Struts, Tiles and JSF


Hi,

is it possible to create a independent tile that includes all necessary
business logic and then put anywhere on a site? My aim is to have a number
of independent tiles that I can choose from a pool and put on the site
anywhere I want.
Btw.: Does anybody know where I can download the Struts-Faces integration
library?

kind regards,
Dominik


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



NullpointerException in getActionServlet of MockStrutsTestCase

2003-11-17 Thread shirishchandra.sakhare
Hi All,
I am using testclasses derived from MockStrutsTestCase to test me Action
classes. But on a call to ActionPerform I get following exception. I have
strutstest-2.0.0.jar and struts-config in my eclipse java build path and I
am running these tests from within Eclipse. I searched the web and couple of
books but couldn't find any help. Has anyone encountered this problem and
found the solution?

junit.framework.AssertionFailedError: java.lang.NullPointerException
at
servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.ja
va:185)
at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:
228)
at com.my.folder.MyActionTest.testFoo(MyActionTest.java:31)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)

Thanks very much

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



RE: [OT] generate HTML file from XML and XSLT

2003-11-14 Thread shirishchandra.sakhare
Why will u need to create a temp html file if all that u want is to show it in browser?
Just write it to the outputstream of response...Unless offcourse u need it for some 
other purpose as well.

-Original Message-
From: Jimmy Emmanual [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 10:58 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] generate HTML file from XML and XSLT


Try something similar to this:

import javax.xml.transform.*;

StringBuffer outHTML = new StringBuffer();
StringWriter ouput = new StringWriter();

java.net.URL xslUrl = this.getClass().getResource("test.xsl");
java.net.URL xmlUrl = this.getClass().getResource("test.xml");

String xslFile = xslUrl.toString();
String xmlFile = xmlUrl.toString();

try {
TransformerFactory tfactory = TransformerFactory.newInstance();

//get the XML Input file
Source xmlSource = new StreamSource(xslFile);

//get the stylesheet
Source xslSource = new StreamSource(xslFile);

//generate the transformer
Transformer transformer = tFactory.newTransformer(xslSource);

//Perform the transformation
transformer.transform(xmlSource, new StreamResult(output));
} catch ( TransformerException te) {
//
}

outHTML.append( output.toString() );

===

now you have a StringBuffer of the xsl transformation.


-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 9:42 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] generate HTML file from XML and XSLT


Hava a look at the sample servlets etc. that come with the Apache Xalan-J
package.

Paul

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
Sent: 13 November 2003 19:14
To: [EMAIL PROTECTED]
Subject: [OT] generate HTML file from XML and XSLT


Hi,
I have a XML file and a XSLT file, i need to create a
HTML file in a temp directory then read this file to
get a String so can email this String or print the
String as HTML
is it possible to do it?? and how 
I am using jdk1.4.1 
Ashish


=
A$HI$H

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and notify us
immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.


-
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: ResultSetDynaClass etc...

2003-11-11 Thread shirishchandra.sakhare
I think the dynaFormBean is there for exactly same purpose

-Original Message-
From: Sumit S. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 4:17 PM
To: [EMAIL PROTECTED]
Subject: ResultSetDynaClass etc...


The ResultSetDynaClass & ResultSetDynaBeans are a powerful way of encapsulating 
ResultSets in DynaClasses. However, when we need to transfer the data from such a 
DynaClass to a ValueObject (say a structs ActionForm), the 
PropertyUtils.copyProperties looks for a property name match.

So now my ActionForm attributes get tied to the DB Column namesand if at a later 
point in time, the column names are changed, it means a change in code.

One option is to store the mapping information in a simple configuration file and 
override the copyProperties to take this mapping info as an input parameter as well...

something like

copyProperties (Object dest, Object src, Map map)
{
for each property in src
read the value from source.
get the corresponding property name in dest from the map
set the property value in the dest
}

I have written a small class to do the above
Is there a more elegant way of doing it.The config might be XML or Text based 
which can be converted into Map objects & cached.

Thanks
Sumit



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



RE: dynamic indexed properties in Form bean

2003-11-10 Thread shirishchandra.sakhare
search the user archive..This has been answered many times before..

The solution is use lazyList implementation by struts or Dynamic arryList as 
implemented in my Solution..(See in the list archive)..I think that is what u have 
also said u tried..And it works..I have also answered thsi question a couple of times..

Still if u cant get it to work or have doubt, repost the question :-))

HTH.
regards,
Shirish

-Original Message-
From: Marc Dugger [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 4:56 PM
To: [EMAIL PROTECTED]
Subject: dynamic indexed properties in Form bean


I'm having trouble populating a Form bean that has an indexed (variable
size) nested bean.  I'm using an ArrayList inside the Form bean to collect
the nested properties and it's partially working.  The problem is that
because the index is variable, I don't know how to correctly size the
ArrayList.  As a result, the nested beans are being accessed by their index
inconsistently.I'm trying to dynamically grow it as getBean(int idx) is
called, but it's messy.  Does anyone have a good solution for this?  Thanks
in advance.

JSP:



























Bean fragment:

public class LiabilityForm extends ValidatorForm implements MonthlyDebts,
DispatchForm {

private ArrayList borrowerLiability = new ArrayList();
... more properties...

public BorrowerLiability[] getBorrowerLiability() {
return (BorrowerLiability[]) this.borrowerLiability.toArray(new
BorrowerLiability[0]);
}
public BorrowerLiabilityImpl getBorrowerLiability(int idx) {
BorrowerLiabilityImpl bl;
if (borrowerLiability.size() <= idx) {
borrowerLiability.ensureCapacity(idx+1);
bl = new BorrowerLiabilityImpl();
borrowerLiability.add(bl);
} else
bl = (BorrowerLiabilityImpl) borrowerLiability.get(idx);
return bl;
}
...more method ...
}


-
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: PDF File Display in JSP-Struts

2003-11-10 Thread shirishchandra.sakhare
The better approach would be to set the proper mime type in the action itself...So 
that u dont put any restrictions on jsps then...And any how, if you are writing the 
pdf to output stream, why you still want to forward to a jsp? Why not return a null 
forward in that case?

-Original Message-
From: Nail, Evan Burke [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 2:17 PM
To: Struts Users Mailing List
Subject: RE: PDF File Display in JSP-Struts



Also, You have to make sure that nothing is written out to the stream before you set 
your content type. 

Also I did this just playing around a while back, I noticed that we had to move our 
jsp imports to the bottom of the file. Having them at the top caused errors in the 
output.  I'm guessing for the above reason. 

If you have to use a jsp page, make sure all you do in the page is set the content 
type and output the content stream. 

bn

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 7:10 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: PDF File Display in JSP-Struts


Are you setting the mime type properly on the response object?

-Original Message-
From: Abhijeet Mahalkar [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 1:55 PM
To: Struts Users Mailing List
Cc: WebSphere User Group Tech Q & A Forum
Subject: PDF File Display in JSP-Struts



Hi All,
 I want to display one PDF file in my websphere struts framework. when i do
it without struts (only servlets ) it works but when i use JSP along with
struts it does not work. it does not read binary data properly... Is there
any body to help me out


regards & thankx in advace...
Abhijeet Mahalkar


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



**
This e-mail is the property of Enron Corp. and/or its relevant affiliate and may 
contain confidential and privileged material for the sole use of the intended 
recipient (s). Any review, use, distribution or disclosure by others is strictly 
prohibited. If you are not the intended recipient (or authorized to receive for the 
recipient), please contact the sender or reply to Enron Corp. at [EMAIL PROTECTED] and 
delete all copies of the message. This e-mail (and any attachments hereto) are not 
intended to be an offer (or an acceptance) and do not create or evidence a binding and 
enforceable contract between Enron Corp. (or any of its affiliates) and the intended 
recipient or any other party, and may not be relied on by anyone as the basis of a 
contract by estoppel or otherwise. Thank you. 
**


-
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: PDF File Display in JSP-Struts

2003-11-10 Thread shirishchandra.sakhare
Are you setting the mime type properly on the response object?

-Original Message-
From: Abhijeet Mahalkar [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 1:55 PM
To: Struts Users Mailing List
Cc: WebSphere User Group Tech Q & A Forum
Subject: PDF File Display in JSP-Struts



Hi All,
 I want to display one PDF file in my websphere struts framework. when i do
it without struts (only servlets ) it works but when i use JSP along with
struts it does not work. it does not read binary data properly... Is there
any body to help me out


regards & thankx in advace...
Abhijeet Mahalkar


-
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: Token and workflow

2003-11-07 Thread shirishchandra.sakhare
Hi,
You can handle the same problem in another way.Same thing we have handled this way.

In such cases, when user resubmits the saveAction, we detect that the form is 
resubmitted using struts tokens and then instead of notifying the user that he has 
resubmitted, we just forward him to success page.(But in your case if u r requirement 
says you have to warn , that can also be done)I mean to the jsp where he would have 
gone if this was his first submission.

And you can decide this case by case basis.We have a method in abstractAction which is 
called when double submission is detected.It just forwards to a forward named 
invalidTokenAction.So every Save action has to define this forward in their mapping 
.Most of them define this forward to be same as success forward.But it may point to 
any other page, depending on the case.Else it will go to a global page saying that 
some form was resubmitted.


Hope this helps.
regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 4:05 PM
To: [EMAIL PROTECTED]
Subject: Token and workflow


Hi everyone, 

I asked for some questions about token and double submissions a couple of weeks 
ago. Today, i'm back to that problem and more specifically on the workflow. The 
double submission detection is Ok. But i don't know how to retrieve the normal 
flow of the application. I explain myself :

In my Prepare Action, i use the saveToken() method.
Then, the JSP is shown and the user can fill the form.
In my Process Action, i use the isTokenValid() then resetToken() methods.

If there's just one submission, everything works fine.

If there's a double submission, my Process Action class detects it and returns 
to the JSP (via the Prepare Action class) with an error message on the screen. 
Everything's fine until this point.

But then, what happens ? The user can see the message but nothing can happen.. 
I can't retrieve the workflow of my application and the user remains on that 
page with this message whereas the first call of the Process Action class is 
already finished..

I spent a lot of time on the web searching for examples but unfortunatly, i 
couldn't find something that suits to my problem..

Thanks in advance, Frederic

-
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 - Design] Needing Fast Access to 300,000 Records

2003-11-06 Thread shirishchandra.sakhare
Hi,
But I think over here you are missing one important point.

Out of those 3 records, the client will want to browse over only a couple of (may 
be a couple of hundreds).
So as and when he requests, geting a few of them(stanadard pageful records at a 
time)wont be slow.Just retrieving all the records because just in case the client may 
need them does not look very efficient approach to me..I am assuming your 
functionality is something similar...

any ideas guys? 

-Original Message-
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 06, 2003 3:56 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT - Design] Needing Fast Access to 300,000 Records


Vic - 

This is still in the design stage, so I don't have a SQL statement to
provide.  I'm looking for the best approach to handling what is essentially
a table lookup where I need two keys (BILLING_ACCOUNT and ACCOUNT_CODE)

The scenario is this:  When one of my clients logs on to the webapp, the app
determines the BILLING_ACCOUNTs the client has assigned, then explodes the
BILLING_ACCOUNTs into the composite ACCOUNT_CODES.  As an example, I've got
one client with 54 BILLING_ACCOUNTs; these explode to over 30,000
ACCOUNT_CODES.  I am trying to eliminate 30,000 db calls to get the account
information - that's why I'm looking to pre-load the table(s) in a plug-in
and access everything in memory.

Make sense?

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


> -Original Message-
> From: Vic Cekvenich [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 06, 2003 8:46 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records
> 
> 
> 
> Jerry Jalenak wrote:
> > Hi All - 
> > 
> > I've been trying to figure out a good way of handling 
> something, and just
> > can't quite seem to get a grip on the best approach.  
> Here's what I've got:
> > 
> > Two database tables - Table 1 has a BILLING_CODE and an 
> ACCOUNT_CODE.  Table
> > 2 has the ACCOUNT_CODE and other account information (name, 
> address, etc.)
> > The tables are linked by ACCOUNT_CODE.
> > 
> > Table 1:
> > Table 2:
> > BILLING_CODEACCOUNT_CODE
> > ACCOUNT_CODENAMEADDRESS ...
> > 1234ABC1
> > ABC1blahblah
> > 1234ABC2
> > ABC2blahblah
> > 1234ABC3
> > ABC3blahblah
> > 5678DEF1
> > DEF1blahblah
> > 5678DEF2
> > DEF2blahblah
> > 
> > I need to be able to rapidly access the information in 
> table 2 either
> > through the BILLING_CODE, or directly through the 
> ACCOUNT_CODE.  I can
> > create a POJO containing the BILLING_CODE and a List object 
> to hold a second
> > POJO for the table 2 info.  Or I can use a Map.  Either way 
> doesn't give me
> > a good method of accessing the table 2 information based on 
> ACCOUNT_CODE.
> > 
> > Two other bits of info - the combined number of records 
> exceeds 300,000, so
> > I have a scaling issue.  Second, I'd like to load 
> everything in a plug-in
> > using iBatis dbLayer and store it in application scope (to 
> eliminate db
> > calls as the webapp is used.)  
> 
> That is ridiculous!!
> Why stop there, why not just write your own SQL engine in Java?
> Say 300,000 records times 500 bytes for each record in 
> memory... I can't 
> begin to ...
> 
> You can easily get sub second response scelable, that is a 
> very, very, 
> small database for a SQL engine. Post the the SQL command 
> that is giving 
> you performance problem. What DB are you using?
> iBatis is nicely going to cache duplicate requests and flush, that's 
> all, its a DAO.
> .V
> 
> > 
> > Does anyone have any experience in handling something like 
> this?  How did
> > you do it?
> > 
> > Thanks...
> > 
> > Jerry Jalenak
> > Development Manager, Web Publishing
> 
> 
> 
> 
> > LabOne, Inc.
> > 10101 Renner Blvd.
> > Lenexa, KS  66219
> > (913) 577-1496
> > 
> > [EMAIL PROTECTED]
> > 
> > 
> > This transmission (and any information attached to it) may 
> be confidential and
> > is intended solely for the use of the individual or entity 
> to which it is
> > addressed. If you are not the intended recipient or the 
> person responsible for
> > delivering the transmission to the intended recipient, be 
> advised that you
> > have received this transmission in error and that any use, 
> dissemination,
> > forwarding, printing, or copying of this information is 
> strictly prohibited.
> > If you have received this transmission in error, please 
> immediately notify
> > LabOne at the following email address: 
> [EMAIL PROTECTED]
> 
> -- 
> Victor Cekvenich,
> Struts Instructor
> (215) 321-9146
> 
> Advanced 

RE: Problem with html:select tag calling set method in form

2003-11-04 Thread shirishchandra.sakhare
what is it you are trying to do?I mean why the setter should be caled when nothing is 
selected?

Just curious :-))

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 4:41 PM
To: Struts Users Mailing List
Subject: RE: Problem with html:select tag calling set method in form






I was thinking that was the case, but was hoping otherwise, I'll have to
come up w/ a javascript solution.

thx for the help Shirish
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| | |
| ||
| |   11/04/2003 09:35 AM  |
| |   Please respond to|
| |   "Struts Users Mailing|
| |   List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |Subject: RE: Problem with html:select tag calling set method in form
  |
  
>--|




This looke like correct to me.Because if you do not select anything, that
also means that there wont be any value sent for that request parameter.And
so the setter will not be called.

You can runa  simple check.Check by calling request.getParameter if any
parameter with the name for the select box is being sent in request.I am
sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>

>--|

  |
|
  |To:  "Struts Users Mailing List"
<[EMAIL PROTECTED]>
|
  |cc:
|
  |Subject: Problem with html:select tag calling set method in form
|

>--|









I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


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

RE: Problem with html:select tag calling set method in form

2003-11-04 Thread shirishchandra.sakhare
This looke like correct to me.Because if you do not select anything, that also means 
that there wont be any value sent for that request parameter.And so the setter will 
not be called.

You can runa  simple check.Check by calling request.getParameter if any parameter with 
the name for the select box is being sent in request.I am sure you wont find any...

HTH.

regards,
Shirish

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Problem with html:select tag calling set method in form






Is this the correct functionallity of struts??

if you have a multiple selection list box, and everything is deselected,
the setter method in the form object is not getting called.

It only gets called if there are 1 or more entries in the list box selected
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Tel: (603) 471-4712
Email: [EMAIL PROTECTED]
Web Site: www.stchome.com
"Advancing Public Health Through Information Technology"
___


|-+>
| |   damian_bradicich@|
| |   stchome.com  |
| ||
| |   10/30/2003 10:44 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>--|
  |
  |
  |To:  "Struts Users Mailing List" <[EMAIL PROTECTED]>
 |
  |cc: 
  |
  |Subject: Problem with html:select tag calling set method in form
  |
  
>--|








I have a jsp that creates a select tag w/ size = 2 and multiple also true,
which gives me a list box w/ multi selection.

So, I open up the page, and I see all the data fine, I select a couple of
items in the list box and save, everything is great, my setter in the form
is getting called.  However, if i deselect all entries in the list box, and
save, the setter method in the form is not being called, has anyone else
noticed this?  If so, does anyone have a workaround?
___
Damian Bradicich
Software Developer
Scientific Technologies Corporation
Web Site: www.stchome.com
"Advancing Public Health Core Capacities While Leveraging the Resources of
a Community"
___


-
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 form submission using POST

2003-11-04 Thread shirishchandra.sakhare
Use struts tags for everything except for the form tag...The in the action attribute 
you can give the url to external site..

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 11:35 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Struts form submission using POST



I am submitting a form to external site (no form processing is involved
at the client side).  All parameters that need to be passed to external
site are hidden variables on the page.

I am not sure how to use 'action' attribute of the page.  In the past I
have attempted to use  with "action" but the problem remains
the same as URL is context/application relative (as specified in the
struts doc)and therefore external links are not valid URLs.

What I have tried is that "collate" all parameters and submit the page
using normal html form (and not using the struts framework) but I want
to stick to struts framework throughout my application.

Server side processing (option b in your reply) works only with GET as
you can append query string parameters and then using
request.sendRedirectTo("http://abc.com ?&selectedName="); but this
exposes security risk.

Any further suggestions.


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: 04 November 2003 09:48
To: Struts Users Mailing List
Subject: RE: Struts form submission using POST

What are you actually trying to do here?
a.) Have the browser directly submit the form somewhere else
 - or -
b.) have the browser submit to *your app* first and then and forward
outside
from the action?

if(a)
then your execute code is irrelevant as you wont be going through the
action
on submit - What you need is to have the 'action' attribute of the pages
form tag point at the external site. (Not quite sure how you would do
this
using the struts tags as Im not familiar enough with their syntax)

if(b)
You cant do this using a server side forward. It would require a client
side
forward (redirect). Ive never tried this with a POST rather than a GET,
but
Im assuming that since your asking about it it doesnt work?


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, 4 November 2003 17:35
To: [EMAIL PROTECTED]
Subject: Struts form submission using POST


How to submit a form to an external web link (not part of the current
web application)?



In struts action, all links are interpreted relative to web context and
therefore "forward" object specified in

struts-config does not work.



e.g.

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)

{



ActionForward forward =
mapping.findForward("constructionPage");

}



// Strtus-config:



http://www.externalformprocessor.com"/>



Web context:  myapplication



URL in  tag of the struts-config is evaluated as
"/myapplication/http://www.externalformprocessor.com"; which

obviously is not a valid URL.





One approach is to append all form parameters as query string in URL and
use response.sendRedirectTo(...) method of HTTPServeletRequest class

but this is not desirable for security reasons.



Does any one know any alternative approach to submit forms to external
sites using POST?



Any suggestion will be appreciated.



This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete
the
original.  Any other use of the email by you is prohibited.


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



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in error, 
please notify the sender immediately and delete the original.  Any other use of the 
email by you is prohibited.

-
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: Indexed Array List Properties (Repost)

2003-11-04 Thread shirishchandra.sakhare
getForumGroup will be right..Actually u can name the property whatEver you want..I 
mean you can call it even getXyz..The only important point is when you use the struts 
tags, the property attribute should be the name of the getter method minus the get..So 
in your case it will be forumGroup or xyz if you have followed my sugestion :-))

HTH.

regards,
Shirish

-Original Message-
From: David Erickson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 12:12 AM
To: Struts Mailing List
Subject: Indexed Array List Properties (Repost)


So I've been doing Indexed Arraylist Properties for awhile now but when I
tried to add some more to my form I'm a little miffed.  Here's the array
List code in my form:

private ArrayList forumGroups = new ArrayList();

now its a request scoped form, so I know I need a method that looks like
this:

public ForumGroupLine getForumGroup(int index) {

while (index >= this.forumGroups.size())

this.forumGroups.add(new ForumGroupLine());

return (ForumGroupLine) this.forumGroups.get(index);

}



However I can't figure out what to name it!  is the method supposed to be
named getForumGroup?  How does struts determine what to call to just get a
singular item from an array list?  On my other stuff my Arraylist was named
roles and my method for getting a single one was just getRole..

Thanks in advance,

David


-
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: tiles question

2003-10-30 Thread shirishchandra.sakhare
If you use Tiles Definitions, you can get rid of this second jsp(holder jsp) per 
page.So you end up writing just one jsp(te body part jsp)per page..

Following is what you do.

Write one jsp which include all the reusable jsps and have the common layout for your 
site.
I call this CLassicLayout_template.jsp

It will have includes like this.






with proper layout offcourse.

Then define a base definition for u r site like this in tiles-defs.xml..
 
  
  
  
  
  

Then per page you just extend this page and overridfe the body portion..



 


In fact, ted Husteds book(Struts In Action)has a very chapter about it.That should 
ehlp u.

Regards,
Shirish

-Original Message-
From: Ruth, Brice [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 3:48 PM
To: Struts Users Mailing List
Subject: Re: tiles question


There's a method of reducing this duplication in Ted Husted's "Struts in 
Action" book - the method, I believe, is called the "body wrap" method 
and it addresses a particular situation that is common, that allows you 
to eliminate this duplication. Also, you can define and extend tile 
definitions in XML, that also help mitigate and leverage the 
scaleability of Tiles.

I recommend you check out Ted's book or other Struts books that also 
address Tiles.

Kalra, Ashwani wrote:

>hi,
>I tiles you have to maintain two pages. One that includes all the sections
>like header, footer, variable content jsp, etc. and one jsp which contains
>your code(varible part).
>This doubles up the no of jsps ?  Is it ok. any work around ?
>
>TIA
>Ashwani Kalra
>http://www.geocities.com/ashwani_kalra
>
>
>
>
>
>
>
>
>
>This message contains information that may be privileged or confidential and
>is the property of the Cap Gemini Ernst & Young Group. It is intended only
>for the person to whom it is addressed. If you are not the intended
>recipient, you are not authorised to read, print, retain, copy, disseminate,
>distribute, or use this message or any part thereof. If you receive this
>message in error, please notify the sender immediately and delete all copies
>of this message.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, 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]



RE: Indexed Properties examples?

2003-10-21 Thread shirishchandra.sakhare
Search the user archive...
This question has been answered many times(Use of lazy lists is one of the ways to 
manange the list runtime..)

-Original Message-
From: hsc [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 9:29 AM
To: [EMAIL PROTECTED]
Subject: Re: Indexed Properties examples?


i have same question as you , do you have get right answer?
my resolve is like this :

form bean -
  private ArrayList awards = new ArrayList (5);
  public void reset(ActionMapping actionMapping, HttpServletRequest
httpServletRequest) {
awards .add(0,new AwardMasView ());
awards .add(1,new AwardMasView ());
awards .add(2,new AwardMasView ());
awards .add(3,new AwardMasView ());
awards .add(4,new AwardMasView ());
  }

the program can right work, but ArrayList's length is fixed .

if you have get right answer ,would you maind share whit me.




-
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 Workflow] Test application - why two actions for loop?

2003-10-20 Thread shirishchandra.sakhare
can you elaborate a little?
Too less info :-((



-Original Message-
From: Axel Gross [mailto:[EMAIL PROTECTED]
Sent: Monday, October 20, 2003 5:03 PM
To: [EMAIL PROTECTED]
Subject: [Struts Workflow] Test application - why two actions for loop?


Hello!

I had a close look to the test application of the Struts Workflow Extension
(v 1.0.3).
I still couldn't grasp though, why for loop in workflow "wf1" there is a
need for 2 actions.
Maybe you could help me finding out:
 Wouldn't it be enough to have
  prevState=2
  nextState=2
  nextState=3
  forward success -> inHome.jsp

thanks in advance,
Axel Gross

--  

 http://www.iaeste.at/~kamikaze/signature.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]



RE: ActionMessage and ActionMessages

2003-10-20 Thread shirishchandra.sakhare
You are 100% right..(In my opinion...)

Actually thats what we have done in our project..We have extended message tag and 
ActionMessage class (EqActionWarning,EqActionError,EqActionMessage)..And each of these 
has a static property (E.G. EqActionMesage.ACTION_MESSAGE) Wwhich is used by default 
to store that type of object.The extended mesasge tag looks for each specific type and 
renders them diffferently(Error:Red,Warning:Yellow warning symbol etc)

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, October 20, 2003 1:10 PM
To: Struts Users Mailing List
Subject: ActionMessage and ActionMessages




I've been programming some status messages into my action and something 
occurs to me about the property key with which we save an ActionMessage 
into an ActionMessages collection with

ActionMessages.add(key, msg)

and with which we retrieve specific groups of messages from the 
collection with

iterator = ActionMessages.get(key)

I think this property key should be a property of the ActionMessage. 
 From a purely theoretical point of view, this would be more OO, and 
from a practical point of view, that means we can pass an ActionMessage 
around without having to worry about the key we are going to add it with 
when we put it into the ActionMessages collection.

What do people think?

Adam

--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


-
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: ArrayIndexOutOfBoundsException after resubmitting form

2003-10-17 Thread shirishchandra.sakhare
May be in the reset you have emptied the list..

Have a look at ListUtils.lazyList..That may solve your problem...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 5:57 PM
To: [EMAIL PROTECTED]
Subject: ArrayIndexOutOfBoundsException after resubmitting form


Hi all,

I've searched the archive, but haven't found an occurrence of the exact
same problem I am encountering.

Here is a description of the problem:

My intention is to use transactional tokens to prevent duplicate posting of
a form where a user deletes a row in a list of search results. After the
delete is successful, I use the browser's back button to return to the list
of search results and attempt to submit the request to delete the same row
again. At this point, an ArrayIndexOutOfBoundsException is thrown (the
exception stack trace is provided below). After examining the debug log
statements, it appears that the logic to validate the transactional token
in the action has not yet been reached. The debug log statements indicate
that the form's reset method is invoked and the getter for the list is
called, but that is where it fails. The Struts logic is attempting to go
past the last valid index in the list and I have not found a way to catch
this nor prevent it.

If anyone has any ideas, it would be much appreciated.

Thanks in advance,

Christina



   
 
   Here is the Exception Stack Trace:  
 
   > 
com.ibm.servlet.engine.webapp.WebAppErrorReport

   
com.ibm.servlet.engine.webapp.WebAppErrorReport: BeanUtils.populate
  
at 
com.ibm.servlet.engine.webapp.WebApp.sendError(WebApp.java:597)
  
at 
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:188) 
  
at 
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239)  
  
at 
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)

at 
 
   
com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
 
at 
 
   
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:154)
   
at 
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315) 
  
at 
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60) 
  
at 
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)   
  
at 
com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
  
at 
com.ibm.ws.util.CachedThread.run(ThreadPool.java:137)  
  
   > javax.servlet.ServletException
 
   javax.servlet.ServletException: 
BeanUtils.populate   
at 
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)   
  
at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)   
  
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)   
  
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
  
at 
ca.toyota.core.controller.ControllerServlet.process(ControllerServlet.java:600)  

RE: Converting to Struts, where to put Servlet init() code?

2003-10-15 Thread shirishchandra.sakhare
You dont need to subclass the action servlet just for the init code...

Write u r own servlet(InitializationServlet)and put it in the init method of this 
servlet.

When configuring the servlets in web.xml have somethign like this.


InitializationServlet
InitializationServlet
com.urapp.InitializationServlet
1


And for all other servlets , the load-on-startupvalue should be greater than 
1.This ensures that when the servlets are initialized(Loaded), the initialization 
servlet is loaded first which means also the init method will be called before any 
requests are received.


Additionally u can have any startup code called from the init method of this servlet.

Hope this helps.
Regards,
Shirish

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 15, 2003 2:04 PM
To: Struts Users Mailing List
Subject: RE: Converting to Struts, where to put Servlet init() code?


subclass ActionServlet and put your inits there.

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 7:43 PM
To: [EMAIL PROTECTED]
Subject: Converting to Struts, where to put Servlet init() code?



I'm converting an existing webapp to Struts.  I have some code in a
Servlet init() method, and I don't immediately see where I should put
it.  This is an authentication/authorization webapp, and the code in
question sets up an authentication handler object to be used by every
subsequent request.

What's guaranteed to get executed before the Action code?  (I'm almost
thinking Filter, and to put the object in Application scope, but I'm not
sure yet.)

Any advice?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 

-
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: URGENT :: LOGIC:EQUAL works only with one constant Value ?? Not R epeat Iterations ????

2003-10-14 Thread shirishchandra.sakhare
Try a combination of logic:equal and logic:NotEqual...

Also try TRUE (In caps..)I had similar problems and i solved them using those 
techniques...

-Original Message-
From: Chawla, Yogesh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 10:25 AM
To: 'Struts Users Mailing List'
Subject: RE: URGENT :: LOGIC:EQUAL works only with one constant Value ??
Not R epeat Iterations 


I am specifying the complete values.  The e.g I had written was simplistic
for getitng some help!

The code is something like this..



 
  
Any ideas..

regards.

-Original Message-
From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 14, 2003 1:18 PM
To: Struts Users Mailing List
Subject: Re: URGENT :: LOGIC:EQUAL works only with one constant Value ??
Not R epeat Iterations 


Sure it works, but you don't specify the property of the variable, name 
of the variable to be compared to.
So that's why it doesn't evaulate to equal.
Here, take a peek :
http://jakarta.apache.org/struts/userGuide/struts-logic.html#equal

Chawla, Yogesh wrote:

>Hello,
>
>I have a repeat nested tag logic like this :
>
>The Struts Documentation on ligoc tags mentions this for the logic:equal
>tag. Why is it that it can only be checked against one contant value ? 
>
>equal - Evaluate the nested body content of this tag if the requested
>variable is equal to the specified value. 
>Compares the variable specified by one of the selector attributes against
>the specified constant value. The nested body content of this tag is
>evaluated if the variable and value are equal. 
>
>Can I use something like this :
>
> 
>   
>   the results">
>   property="value1Text">
>   
>   
>
>   
>This is not working even if conditions are not matching. It prints the
>html:text even if equal is not matching !!
>
>Any inputs would be appreciated..
>
>Cheers :)
>DISCLAIMER: The information in this message is confidential and may be
>legally privileged. It is intended solely for the addressee.  Access to
this
>message by anyone else is unauthorised.  If you are not the intended
>recipient, any disclosure, copying, or distribution of the message, or any
>action or omission taken by you in reliance on it, is prohibited and may be
>unlawful.  Please immediately contact the sender if you have received this
>message in error. Thank you.
>
>-
>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]
DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.

-
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: [RE-POST]: HOW TO Use Tiles parameters in Java

2003-10-13 Thread shirishchandra.sakhare
All parameters passsed are available in TilesCOntext..

Search the message archive for accessing TilesContext in java..

-Original Message-
From: Sudip Kumar Bhattacharya(HOTPOP) [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2003 2:11 PM
To: Struts Users Mailing List
Subject: [RE-POST]: HOW TO Use Tiles parameters in Java


Hi,

I sent the mail earlier but recieved no reply. So I am posting it again with
more code details.

My login.jsp given below assigns the parameter *pageid* a value of 1001. I
need to retrieve this pageid value in tile menu.jsp. How can I do that? I am
able to retrieve the pageid parameter in my pageLayout.jsp using
tiles:useAttribute, but it is not accessible in menu.jsp.
Can somebody guide me in this??

-login.jsp--
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

  
  
  
  
  
  




Thanks in advance,
Sudip

-Original Message-
From: Sudip Kumar Bhattacharya(HOTPOP) [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2003 12:21 PM
To: Struts Users Mailing List
Subject: Tiles and Java


Hi Everybody,

I just wanted to know if I can use the parameters passed to a tile in java
code? Can someone provide me some sample code which demonstrates this?

To elaborate, I am passing some parameters to a tile. The tile is a JSP page
and in that JSP page I have some java code as well. I would like to access
the value of the tile parameter in my Java code. That's it!!

Any type of help will be appreciated.

Sudip



-
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: Dynamic ActionForwarding

2003-10-13 Thread shirishchandra.sakhare
The forward definition should be just /go.do and then before doing forward add the 
param to the actionFOrward...

Something like

return new ActionFOrward(forward.getPath() + "?" + "page=" + "templateEdit")

-Original Message-
From: CuteProgrammer [mailto:[EMAIL PROTECTED]
Sent: Monday, October 13, 2003 3:27 PM
To: [EMAIL PROTECTED]
Subject: Dynamic ActionForwarding


Hi All...

 I'm not able to find the solution for this from last one month. Okay here goes my 
problem. Well i  in need to generate(dynamically) the ActionForwards based on data in 
the controller which has been extracted based on some user credentials. 

Eg  :

Lets assume we have a combo box  with some elements.  Based the the selection we need 
to take him to different pages. Lets say user selected some thing which has ID "101". 
Now what i did in cotroller is i extracted the data  from the database based on the 
selected id. then the url i need to forward will be  some thing like this  

  /go.do?page=templateEdit

where  the value "templateEdit" is extracted from database based on the user selected 
id.

for solving this problem what i did is this. declared an actionforward like this



and in controller used the following code


MessageFormat msgFormat = new 
MessageFormat(mapping.findForward("actionPage").getPath());
String path = msgFormat.format(new String[] {action});
forward = new ActionForward(path);



what happens is first time it woks fine.But from the second time its still going to 
the first selected page. Can any one guess what is the problem.. or any other 
alternative way to do this.  one thing is i dont want to user new 
ActionForward("/go.do?page=templateEdit");

Thanks
Abhi

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



RE: Dynamic Menus using tiles definition files

2003-10-09 Thread shirishchandra.sakhare
Hi,
I dont think you can have logic tags in definition files.But if your menu requirements 
are simple(Only a few roles for which you have different groups menu items), then you 
can easily do as follows.

Create different menu difinitions for each role.

And in the menu.jsp when inserting the definition use the logic tag to insert the 
appropriate definition.


HTH.
Regards,
Shirish

-Original Message-
From: Joe @ Team345 [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2003 1:15 PM
To: [EMAIL PROTECTED]
Subject: Dynamic Menus using tiles definition files


So is the above possible?  If so, how?  Basically, I'd like to have 
 (or notpresent) tags around certain parts of my menu 
definitions.  That is, I would like certain items to only appear under 
certain circumstances.   I can't figure out how to do this in a menu 
definition file.  Has anyone done something like this?  

My menus are _not_ overly complex; however, I know from my long ago 
Statistics class that it is completely impractical to define all the 
possible combinations.  Besides that solution is not only ugly, it is 
not very maintainable.

thanks for any thoughts!


-
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: html tag newbie question

2003-10-08 Thread shirishchandra.sakhare
have a look at html:link tag documentation ...And try to use the struts tags as much 
as possible...

-Original Message-
From: Peng, Meimin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 08, 2003 5:23 PM
To: 'Struts Users Mailing List'
Subject: html tag newbie question


Hi, 
I am very new in struts and facing a problem now. Please help. 
What I want to do is when user click a image, it will link to yahoo.com
which is defined as link.yahoo in the config property 
file. How can I approach this? 
After it generate the html source codes, it will be like
http://www.yahoo.com";>

Right now, I am doing a wrong way to combine struts and html even though
it's working fine. 
--in property file--
link.yahoo=http://www.yahoo.com"/>
image.yahoo=../images/yahoo.gif
image.yahoo.alt=Yahoo
--in jsp --
">

CONFIDENTIALITY NOTICE:  The information in this e-mail is privileged and
confidential.  Any use, copying or dissemination of any portion of this
e-mail by or to anyone other than the intended recipient(s) is unauthorized.
If you have received this e-mail in error, please reply to sender and delete
it from your system immediately.

-
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: insert html tags

2003-10-06 Thread shirishchandra.sakhare
which tags you are using to display the bean information?If you are using bean:write, 
then there is some option to turn of entity replacement.CHeck teh documentation for 
the tag...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 3:30 PM
To: [EMAIL PROTECTED]
Subject: insert html tags


Hallo,
I have bean filled form database, which contains formated text. But if I
display it on page, html tags are replaced by entities (for example, < by
< etc.).

How I can disable it?

And other question - this page contains images stored in database (in
oracle's blob). I need to display it on this page. What is the best way to
do it? I know, I need call some script as img.jsp which by out.println and
correct header print image into page. But I need to help, by what I can
read it from db, getString is not a best way I think... I do not do it in
java yet.

Thanks
Jiri

-
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: Help needed : cannot resend an indexed property to request

2003-10-06 Thread shirishchandra.sakhare
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>



Test Indexed property







B
C
   



"/>


"/>



Validate 





First of all, you need lazy initialisation in your form.//i have assumed the Beans as 
list here.

public TestBean  getBean(int index){
while(index >= this.getBeans().size() ){
this.getBeans().add(new TestBean());
}
return (TestBean)this.getBeans().getObject(index);
}

Now in your jsp, when you say "/> , it will be interpreted as 
testForm.getBean(i).setB(String )when the form is submitted.And this should work.


-Original Message-
From: Frederic Dernbach [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 05, 2003 4:46 PM
To: struts-layout; struts-user
Subject: Help needed : cannot resend an indexed property to request


Hello, 

I experience big difficulties resend an indexed property of a form as
part of a request. 

I build a super-simple code sample to share with you so you can help me
"find the trick". 

I have a form named TestForm; It has one property named 'beans' that is
an array of TestBean. TestBean is a bean that as two strings properties
: 'b' and 'c'. I put the class code below. 

I have two struts actions : '/Test' and '/Validate'. 
- '/Test' populates the form (especially the 'beans' property) and
forwards to the JSP 'test.jsp'. 
- 'test.jsp' displays basic a form property as well as a list (indexed
property).
- 'Validate' is the action called by the form included in 'test.jsp. It
does nothing but forward back to the JSP 'test.jsp'. 
I included the code of those two actions as well as the declarations in
struts-config.xml. 


HERE IS MY PROBLEM :

If I use the 'test.jsp' file below, I get an exception
InvokationTargetException when I hit the validate button (submit button
of the form). I aded the JSP an the exception from BeanUtils.populate()
below.

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>



Test Indexed property







B
C
   



"/>


"/>



Validate 






java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:493)
at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
at
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:770)
at
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)


QUESTION : how should I write my JSP in order to have the form populated
correctly by Struts before entering the 'Validate' action ? How can I
ensure than the indexed property is resend in the request ?


I tried a modified version of the JSP, with no success (I print here the
 tag only). The JSP displays OK, but when I hit the
submit button, Struts does not find any collection :



















java.lang.NullPointerException at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:515)



Thanks in advance for your help.

Fred

 TestForm.java ** 

package com.rubis.web.system; 
import javax.servlet.http.HttpServletRequest; 
import org.apache.struts.action.ActionMapping; 
import org.apache.struts.action.ActionForm; 
import com.rubis.web.system.TestBean; 

public class TestForm extends ActionForm implements java.io.Serializable
{ 
public String getA() { 
return a; 
} 
public void setA(String a) { 
this.a = a; 
} 
public TestBean[] getBeans() { 
return beans; 
} 
public void setBeans(TestBean[] beans) { 
this.beans = beans; 
} 
public TestBean getBean(int index) { 
return beans[index]; 
} 
public void setBean(int index, TestBean bean) { 
beans[index] = bean; 
} 
public void reset(ActionMapping mapping, HttpServletRequest request) { 
a = null; 
beans = null; 
} 

private String a; 
private TestBean[] beans

RE: Need for a sample with indexed properties

2003-10-03 Thread shirishchandra.sakhare
class MyForm{   
public BankInfoStringBean  getBankInfoBean(int index){
//lazy initialization
while(index >= this.getBankList().size() ){
this.getBankList().add(new BankInfoStringBean());
}
return (BankInfoStringBean)this.getBankList().getObject(index);
}

public void setBankInfoBean(int index,BankInfoStringBean bean){
this.getBankList().add(index,bean);
}

}//class myForm




"/>




Here myFormName is the name from ActionMapping.


HTH.
Regards,
Shirish

-Original Message-
From: Frederic Dernbach [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 9:59 AM
To: struts-layout; struts-user
Subject: Need for a sample with indexed properties


Following up on a previous post, I currently experience big difficulties
managing indexed properties in a Struts form.

Can somebody send me a complete sample with :

- a form with an indexed properties (I need to see the setter and getter
methods). The O'Reilly "Programming Jakarta Book" says that, when a
property like [] is defined, the following methods
should be present : get(int a) and set(int
a, ProperyElement b>

- the JSP reading this indexed property

- an action populating the indexed property before forwarding to the
JSP.

Thanks in advance.





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



  1   2   >