RE: HELP: Dispaly Date in a JSP that used Tiles

2003-04-01 Thread Heligon Sandra
First, thanks a lot for your help.

I think indeed that this manner of making is better 
but I have a problem to set up it.
Because I must define a tag form. 




As I explained in my previous message I use Tiles all the
pages are composed of several modules header, menu, body and footer.
It is in the header module that I want to display the date,
for the moment the header.jsp page is the following:

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



  

 


   
 

  



When I run the application I have an error no instance of MyForm
has been created.
I thus defined a DynaValidatorForm in struts-config.xml,and use the Struts
tag
. But when I compile the application I have the
following
message "action is mandatory for tag form".
But I don't want to associate an action to this page.
How can I do ?

Thanks a lot in advance
Sandra




As of February 12th, 2003 Thomson unifies its email addresses on a worldwide
basis. 
Please note my new email address: [EMAIL PROTECTED] 

http://www.thomson.net/ 

Original Message-
From: Gareth Andrew [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 00:49
To: [EMAIL PROTECTED]
Subject: RE: HELP: Dispaly Date in a JSP that used Tiles


I think your problem has nothing to do with tiles or jsp.  You just need 
to write the output to a control instead of trying to write to the page.
If the browser were to allow your code to work as you have written it 
you would actually get a list of times.
The following code should work - it renders to a named textBox.

BEGINNING OF CODE SAMPLE --


   function aff_heure() {
var d=new Date()
var weekdays=new 
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
)
var monthname=new 
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec
")

 var weekday=weekdays[d.getDay()]
 var date = d.getDate()
 var month = monthname[d.getMonth()]
var year = d.getFullYear()
var hour = d.getHours()
var minute = d.getMinutes()
var second = d.getSeconds()
 
 var time = new String(weekday + " " + date
  + "." + month + " " + year
  + ", " + hour + ":" + minute
  + ":" + second)
 document.myForm.dateControl.value=time;

   
setTimeout("aff_heure()",100);
   }
  






END OF CODE SAMPLE --

Hope this helps,

Gareth


PS.  You can also render to put your answer in other html objects such 
as spans and divs but if you're trying to make it work on as many 
browsers as possible that might be a bit of a headache.
PPS.  Why not use d.toGMTString() or d.toLocaleString() instead of 
trying to format the string yourself?


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


RE: [RePosted] localize messages in JSP without session

2003-04-01 Thread Andrew Hill
You could probably override the processLocale() method in RequestProcessor
to store it in the request scope, but Im not sure what would be involved
over on the rendering side to get the tags to look for current locale there.

If using locales does indeed require use of the session, than an enhancement
for an option to allow this to be done using only the request is a good
idea. This could be quite useful for higher throughput websites that dont
need to track sessions - though it may involve a bit more effort from the
garbage collector to clean up throwaway locale objects.

-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 15:13
To: Struts Users Mailing List
Subject: [RePosted] localize messages in JSP without session



 On logon.jsp I would like messages to be localized. AFAIK to do this with
Struts I have to put this tags :

 
   
 ...


 This tags use a Locale objet stored in session scope. My boss doesn't want
this logon JSP to create a new session to
limit memory usage. Is they're a way to use Struts i18n with a REQUEST
scoped Locale or something like this ?

Do you thing it could be an interseting enhancement for future versions ?

 Nico.


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



[RePosted] localize messages in JSP without session

2003-04-01 Thread Nicolas De Loof

 On logon.jsp I would like messages to be localized. AFAIK to do this with Struts I 
have to put this tags :
 
 
   
 ...

 
 This tags use a Locale objet stored in session scope. My boss doesn't want this logon 
JSP to create a new session to
limit memory usage. Is they're a way to use Struts i18n with a REQUEST scoped Locale 
or something like this ?
 
Do you thing it could be an interseting enhancement for future versions ?
 
 Nico.
 

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



Re: bean message as button label

2003-04-01 Thread Affan Qureshi
Use


You can't use a tag as an attribute's value.

HTH
Affan


> I want to use a value in my ApplicationResources.properties as a label on
a button in my jsp, so that I can switch the text on the button, depending
on the Locale used.  I used the following code :
> 
>
> This gives the text: bean:message key on my button, and not the wanted
text in my .properties file. Can anyone help me ?
>
> Thanks
>
> Koen Boutsen
>


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



Re: RE: JBoss-3.0.4 and Tomcat-4.1.12,Problem with Deployment and ApplicationREsources

2003-04-01 Thread Thilko Richter
Sorry, that was a spelling mistake in my e-mail ;-)
The path was /WEB-INF/classes/de/picasso.client/PicassoProperties.properties

I should sleep longer... 

Thilko


"Struts Users Mailing List" <[EMAIL PROTECTED]> schrieb am 02.04.03 09:07:33:
> 
> You have ;
> 
> de.picasso.client.PicassoProperties
>   INF/classes/de/picassoclient/PicassoProperties.properties
> 
> So the XML should read;
> de.picassoclient.PicassoProperties
> 
> -Original Message-
> From: Thilko Richter [mailto:[EMAIL PROTECTED]
> Sent: 02 April 2003 07:54
> To: [EMAIL PROTECTED]
> Subject: JBoss-3.0.4 and Tomcat-4.1.12,Problem with Deployment and
> ApplicationREsources
> 
> 
> 
> Hi!
> 
> I have some serious problem with the deployment of my struts application. At first 
> I´ve got an error when I try to access my ApplicationResources. This is my 
> configuration:
> 
> In the web.xml:
> 
> action
>   
> org.apache.struts.action.ActionServlet
>   
>   
> application
> de.picasso.client.PicassoProperties
>   
> ...
> 
> In the jsp page:
> 
> 
> In the PicassoProperties.properties:
> 
> page.status.title=Picasso Application - Status Page
> page.status.form.description=Beschreibung
> page.status.form.name=Name
> page.status.form.select=Auswahl
> page.status.submit.insert=Status einfügen
> page.status.submit.delete=Status löschen
> page.status.submit.update=Status ändern
> page.status.submit.search=Status suchen
> page.index.title=Picasso Application - Main Page
> page.navigation.link.config=Administration
> page.navigation.link.home=Home
> page.navigation.link.status=Status
> 
> The PicassoProperties.properties is under 
> /WEB-INF/classes/de/picassoclient/PicassoProperties.properties
> 
> When I try to call the Page I get the error:
> 
> org.apache.jasper.JasperException: Missing message for key page.index.title
>   at 
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
> 
> 
> What I am doing wrong??? I am totally confused, because few days ago it works!!! 
> Could be there a bug? I am using an .ear file for my application.
> When I deploy my application and the struts-example.war, I get this error:
> 
> 08:26:44,949 ERROR [Engine] action: Error creating Action instance for
>  path '/editRegistration', class name 'org.apache.struts.webapp.exampl
> e.EditRegistrationAction'
> java.lang.LinkageError: loader constraints violated when linking org/a
> pache/struts/action/ActionMapping class
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:140)
> at org.apache.struts.action.ActionServlet.processActionCreate(
> ActionServlet.java:1631)
> at org.apache.struts.action.ActionServlet.process(ActionServle
> t.java:1577)
> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.
> java:492)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740
> )
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853
> )
> at org.apache.catalina.core.ApplicationFilterChain.internalDoF
> ilter(ApplicationFilterChain.java:247)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ap
> plicationFilterChain.java:193)
> at org.apache.catalina.core.StandardWrapperValve.invoke(Standa
> rdWrapperValve.java:260)
> at org.apache.catalina.core.StandardPipeline$StandardPipelineV
> alveContext.invokeNext(StandardPipeline.java:643)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
> peline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
> .java:995)
> at org.apache.catalina.core.StandardContextValve.invoke(Standa
> rdContextValve.java:191)
> at org.apache.catalina.core.StandardPipeline$StandardPipelineV
> alveContext.invokeNext(StandardPipeline.java:643)
> at org.apache.catalina.valves.CertificatesValve.invoke(Certifi
> catesValve.java:246)
> at org.apache.catalina.core.StandardPipeline$StandardPipelineV
> alveContext.invokeNext(StandardPipeline.java:641)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
> peline.java:480)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
> .java:995)
> at org.apache.catalina.core.StandardContext.invoke(StandardCon
> text.java:2396)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardH
> ostValve.java:180)
> at org.apache.catalina.core.StandardPipeline$StandardPipelineV
> alveContext.invokeNext(StandardPipeline.java:643)
> at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Erro
> rDispatcherValve.java:170)
> at org.apache.catalina.core.StandardPipeline$StandardPipelineV
> alveContext.invokeNext(StandardPipeline.java:641)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRep
> ortValve.java:172)
> at org.apache.catalina.core.Stan

FIND AN ERROR: ApplicationRessources doesn´t work with write protection!!!!!!!

2003-04-01 Thread Thilko Richter

HI!

I´ve find out the problem:  I checked out the scource files with WinCVS. When I 
checked out the files, they are write protected. Now I buil the ear file with ant and 
deploy it to the JBoss deploy directory. But the ApplicationProperties.properties IS 
WRITE PROTECTED. Then I I ´ve got the error:

... can´t find messag for key... Although everything was correct. But when I remove 
the write protection from the ApplicationProperties.properties IT WORKS! Could be this 
a bug? I thought that Struts only reads the properties file...

Thilko
__
E-Mails sehen immer gleich aus? Aber nicht bei WEB.DE FreeMail!
http://freemail.web.de/features?mc=021138


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



RE: JBoss-3.0.4 and Tomcat-4.1.12,Problem with Deployment and ApplicationREsources

2003-04-01 Thread Anthony . Leon
You have ;

de.picasso.client.PicassoProperties
INF/classes/de/picassoclient/PicassoProperties.properties

So the XML should read;
de.picassoclient.PicassoProperties

-Original Message-
From: Thilko Richter [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 07:54
To: [EMAIL PROTECTED]
Subject: JBoss-3.0.4 and Tomcat-4.1.12,Problem with Deployment and
ApplicationREsources



Hi!

I have some serious problem with the deployment of my struts application. At first 
I´ve got an error when I try to access my ApplicationResources. This is my 
configuration:

In the web.xml:

action
  
org.apache.struts.action.ActionServlet
  
  
application
de.picasso.client.PicassoProperties
  
...

In the jsp page:


In the PicassoProperties.properties:

page.status.title=Picasso Application - Status Page
page.status.form.description=Beschreibung
page.status.form.name=Name
page.status.form.select=Auswahl
page.status.submit.insert=Status einfügen
page.status.submit.delete=Status löschen
page.status.submit.update=Status ändern
page.status.submit.search=Status suchen
page.index.title=Picasso Application - Main Page
page.navigation.link.config=Administration
page.navigation.link.home=Home
page.navigation.link.status=Status

The PicassoProperties.properties is under 
/WEB-INF/classes/de/picassoclient/PicassoProperties.properties

When I try to call the Page I get the error:

org.apache.jasper.JasperException: Missing message for key page.index.title
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)


What I am doing wrong??? I am totally confused, because few days ago it works!!! Could 
be there a bug? I am using an .ear file for my application.
When I deploy my application and the struts-example.war, I get this error:

08:26:44,949 ERROR [Engine] action: Error creating Action instance for
 path '/editRegistration', class name 'org.apache.struts.webapp.exampl
e.EditRegistrationAction'
java.lang.LinkageError: loader constraints violated when linking org/a
pache/struts/action/ActionMapping class
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.struts.action.ActionServlet.processActionCreate(
ActionServlet.java:1631)
at org.apache.struts.action.ActionServlet.process(ActionServle
t.java:1577)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.
java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740
)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoF
ilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ap
plicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(Standa
rdWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(Standa
rdContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(Certifi
catesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardCon
text.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardH
ostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Erro
rDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRep
ortValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogV
alve.java:469)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catal

Re: bean message as button label

2003-04-01 Thread Gemes Tibor
koen boutsen írta:



 



Btw why do you call your key buttons.english.push? 

It shouldn't contain the english word, as it is for internationalization 
purposes, so the 
will return the message in any Locale you set up.

Hth,

Tib



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


JBoss-3.0.4 and Tomcat-4.1.12,Problem with Deployment and ApplicationREsources

2003-04-01 Thread Thilko Richter

Hi!

I have some serious problem with the deployment of my struts application. At first 
I´ve got an error when I try to access my ApplicationResources. This is my 
configuration:

In the web.xml:

action
  
org.apache.struts.action.ActionServlet
  
  
application
de.picasso.client.PicassoProperties
  
...

In the jsp page:


In the PicassoProperties.properties:

page.status.title=Picasso Application - Status Page
page.status.form.description=Beschreibung
page.status.form.name=Name
page.status.form.select=Auswahl
page.status.submit.insert=Status einfügen
page.status.submit.delete=Status löschen
page.status.submit.update=Status ändern
page.status.submit.search=Status suchen
page.index.title=Picasso Application - Main Page
page.navigation.link.config=Administration
page.navigation.link.home=Home
page.navigation.link.status=Status

The PicassoProperties.properties is under 
/WEB-INF/classes/de/picassoclient/PicassoProperties.properties

When I try to call the Page I get the error:

org.apache.jasper.JasperException: Missing message for key page.index.title
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)


What I am doing wrong??? I am totally confused, because few days ago it works!!! Could 
be there a bug? I am using an .ear file for my application.
When I deploy my application and the struts-example.war, I get this error:

08:26:44,949 ERROR [Engine] action: Error creating Action instance for
 path '/editRegistration', class name 'org.apache.struts.webapp.exampl
e.EditRegistrationAction'
java.lang.LinkageError: loader constraints violated when linking org/a
pache/struts/action/ActionMapping class
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.struts.action.ActionServlet.processActionCreate(
ActionServlet.java:1631)
at org.apache.struts.action.ActionServlet.process(ActionServle
t.java:1577)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.
java:492)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740
)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoF
ilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ap
plicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(Standa
rdWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(Standa
rdContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(Certifi
catesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardCon
text.java:2396)
at org.apache.catalina.core.StandardHostValve.invoke(StandardH
ostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Erro
rDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRep
ortValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogV
alve.java:469)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(Standar
dEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineV
alveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPi
peline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase
.java:995)
at org.apache.catalina.connec

Re: bean message as button label

2003-04-01 Thread Steve_Akins

Not sure if it makes a difference but we do this:



And it works fine.

Give it a try.


Regards,
Steve Akins
Team Leader, Frameworks, J2EE Engineering
Development Centre
Financial Services Australia Technology


( +61 3 8641 2846 2 +61 3 8641 4152 : [EMAIL PROTECTED]


National Australia Bank Limited
4th Floor/ 500 Bourke St
Melbourne, Victoria 3000


|-+>
| |   "koen boutsen"   |
| |   <[EMAIL PROTECTED]|
| |   s.com>   |
| ||
| |   02/04/2003 16:48 |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>--|
  |
  |
  |   To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
 |
  |   cc:  
  |
  |   Subject:  bean message as button label   
  |
  
>--|




I want to use a value in my ApplicationResources.properties as a label on a
button in my jsp, so that I can switch the text on the button, depending on
the Locale used.  I used the following code :


This gives the text: bean:message key on my button, and not the wanted text
in my .properties file. Can anyone help me ?

Thanks

Koen Boutsen



_
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

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



bean message as button label

2003-04-01 Thread koen boutsen
I want to use a value in my ApplicationResources.properties as a label on a button in 
my jsp, so that I can switch the text on the button, depending on the Locale used.  I 
used the following code :


This gives the text: bean:message key on my button, and not the wanted text in my 
.properties file. Can anyone help me ?

Thanks

Koen Boutsen



_
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

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



[Struts FAQ] Update #3

2003-04-01 Thread John Yu
Struts FAQ - Update #3

 http://www.scioworks.net/servlets/ShowPage?pid=54&dp=3

This update covers:

Q1: Is it possible to make the data from the resource bundles accessible as 
JSP page scripting variables?

Q2: What does  do?

Q3: What are "indexed" struts-html tags and how to use them?

Q4: What are "map-backed" form beans and how to use them?

Q5: I have an "index.jsp" in a "module1" module. However, when I access 
this from the browser, Struts doesn't seem to access the module 
struts-config.xml of the "module1". Why?

Q6: How do I make  to check if a bean is null before comparing 
the value?

Q7: The Taglib standard does not allow nesting custom tag inside the 
attribute of another custom tag. How can I achieve something like 
"/>?

Q8: How to apply container-managed security to Struts Actions?

Q9: When I have literal string in scriplet used inside a Struts custom tag, 
e.g. "/>, the scriplet is not 
evaluated properly. Why?

Q10: How do I use a Struts Action as a welcome file specified as 
 in web.xml ?

Q11: Why does my JSP gives me "Illegal target of jump or branch", 
ClassFormatError or VerifyError?

Q12: Can I detect if the user presses STOP on the browser?

Q13: How to dynamically populate values in a form (e.g. options in a select 
box) without submitting or refreshing the entire page?

--
John Yu  

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


RE: [Struts FAQ] Update #3

2003-04-01 Thread Andrew Hill
Glad to see your still updating the Q & A. Keep up the good work. :-)


How to dynamically populate values in a form (e.g. options in a select box)
without submitting or refreshing the entire page?

As well as applets (which require the user's browser to have a Java VM or
plugin), a similar effect can be achieved using only javascript and a hidden
IFRAME or FRAME. Theres quite a good article on this technique at
http://developer.apple.com/internet/javascript/iframe.html

btw: I noticed a typo:

 the problem encountered by the container when flushing will be 'swollen' by
the container

I presume that should be 'swallowed by the container'?


-Original Message-
From: Struts Q&A Info [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 12:19
To: [EMAIL PROTECTED]
Subject: [Struts FAQ] Update #3



Struts FAQ - Update #3

  http://www.scioworks.net/servlets/ShowPage?pid=54&dp=3


This update covers:

Q1: Is it possible to make the data from the resource bundles accessible as
JSP page scripting variables?

Q2: What does  do?

Q3: What are "indexed" struts-html tags and how to use them?

Q4: What are "map-backed" form beans and how to use them?

Q5: I have an "index.jsp" in a "module1" module. However, when I access
this from the browser, Struts doesn't seem to access the module
struts-config.xml of the "module1". Why?

Q6: How do I make  to check if a bean is null before comparing
the value?

Q7: The Taglib standard does not allow nesting custom tag inside the
attribute of another custom tag. How can I achieve something like
"/>?

Q8: How to apply container-managed security to Struts Actions?

Q9: When I have literal string in scriplet used inside a Struts custom tag,
e.g. "/>, the scriplet is not
evaluated properly. Why?

Q10: How do I use a Struts Action as a welcome file specified as
 in web.xml ?

Q11: Why does my JSP gives me "Illegal target of jump or branch",
ClassFormatError or VerifyError?

Q12: Can I detect if the user presses STOP on the browser?

Q13: How to dynamically populate values in a form (e.g. options in a select
box) without submitting or refreshing the entire page?

===
You receive this message because you are subscribed to
Struts FAQ at scioworks.net.
To unsuscribe, please send a request to <[EMAIL PROTECTED]>



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



Re: message resouce bundle in validator

2003-04-01 Thread Navjot Singh
 hi mahesh,

i am aware of this problem but we can't call it a bug. May be a shortcoming
that might be solved in the coming release.

if you wish to change on your own. You need to look into
commons-validator.jar.

HTH
-navjot

- Original Message -
From: "Bhagia, Mahesh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 8:28 PM
Subject: message resouce bundle in validator


|
| Hello Navjot,
|
| This message(from struts-user-forum) is regarding specifying message
| resource bundle in validator.xml
|
| Struts 1.1-b2
|
| I have multiple resource files for my application defined in
| struts-config.xml:
| 
| 
|
| Then in my JSPs I reference:
| 
| 
|
| This all works fine.
|
| I am now trying to add in validation on the form. Here is my
validation.xml:
| 
| 
| 
| 
| 
| 
|
| The "partNumber" arg0 is in the "default" ApplicationResources.properties
| file and displays correctly. However the "faultDescription" error message
is
| not correct it returns:
| ???en.faultDescription.title??? is required.
|
| By looking at the validation_1_1.dtd I can see that the arg0 attribute
takes
| only three parameters:
| name
| key
| resource
|
| none of which is bundle. Can the validator handle multiple resources? Is
| this a bug?
|
|
| Do you know how / where,  we need to change framework for this to work?,
|
| Thanks
| Mahesh Bhagia
|
|
|


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



Re: [OT] Re: A question

2003-04-01 Thread David Graham
> The reason to avoid scriplets is to allow seperation of page designers 
and
> developers dependancies but the poor page designer won't make much sense 
out
> of either of them in this case i think and its better to give him one 
line
> of confusion than 5.
Ah, the mysterious "page designer".  They're rarely spotted in the Canadian 
woods...or is that the Yetti?

I believe most developers don't have the luxury of dedicated page designers. 
 IMO, the main reason to use tags over scriptlets is that it's more 
productive and much less error prone.  I've always been confused by people 
who ask things like, "Does IDE X support JSP debugging?".  Well, if you need 
to debug your JSP, you've got way too much logic in there and no IDE will 
save you.

David

_
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus

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


Re: [OT] Zip Codes [WAS: RE: Bug in JSF Car Demo]

2003-04-01 Thread Neil Erdwien
Zone Improvement Plan -- if memory serves.

Andrew Hill wrote:
What is a ZIP code?
Yes I know its a postcode - but what does zip stand for?
(Does the US Postal service compress your mail to save space?)
-Original Message-
From: James Turner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 11:20
To: 'Struts Users Mailing List'
Subject: FYI: Bug in JSF Car Demo
For those of us who live in the east, we have zip codes that start with
zero.  Since you're using a numeric field for zip code (bad boy, bad bad
boy!), it doesn't work.
James



-
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]
--
Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
Computing and Network Services, Kansas State University
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Re: A question

2003-04-01 Thread James Mitchell
On Tue, 2003-04-01 at 22:36, Affan Qureshi wrote:
> Isn't the scriplet free version more confusing/cryptic than the scriplet
> one? I know we should avoid scriplets 110% in JSPs but what about cases
> where it can save some confusion of five tags to do a simple thing?

Well, first of all, referencing a key from the bundle like this is poor
design IMHO.  Something like that should have been done in the action,
and placed on the formbean.  I was just trying to help with syntax.

> 
> The reason to avoid scriplets is to allow seperation of page designers and
> developers dependancies but the poor page designer won't make much sense out
> of either of them in this case i think and its better to give him one line
> of confusion than 5.

I agree.

> 
> Intersted to know your comments.
> 
> Regards,
> Affan
> 
> - Original Message -
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, April 02, 2003 12:21 AM
> Subject: Re: A  question
> 
> 
> > or using the scriptlet-free version
> >
> > 
> >
> > 
> >  .name
> > 
> >
> > 
> >  
> > 
> >
> >   <-- remove this unless you just want to
> print
> > it out on the page
> >
> >
> >
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.open-tools.org
> >
> >
> >
> > - Original Message -
> > From: "Karr, David" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, April 01, 2003 11:14 AM
> > Subject: RE: A  question
> >
> >
> > > This might work:
> > >
> > > 
> > > 
> > > 
> > >
> > > > -Original Message-
> > > > From: Binaghi Mauro [mailto:[EMAIL PROTECTED]
> > > >
> > > > Hi
> > > > I have the "user.name" property in my "ApplicationResource.properties"
> > > > file.
> > > > Can I take its value with the following instrucition in my JSP page?
> > > >
> > > > 
> > > >  > > > %>.name"/>
> > > > 
> > > >
> > > > Of course, I call my JSP with this URI
> > > "/myPage.jsp?httpParameter=user"
> > >
> > > -
> > > 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]
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




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



No posts in last couple of days?

2003-04-01 Thread K.Viswanathan
Test...


Re: [OT] Zip Codes [WAS: RE: Bug in JSF Car Demo]

2003-04-01 Thread Kris Schneider
Only the fragile stuff...;-)

Andrew Hill wrote:
What is a ZIP code?
Yes I know its a postcode - but what does zip stand for?
(Does the US Postal service compress your mail to save space?)
-Original Message-
From: James Turner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 11:20
To: 'Struts Users Mailing List'
Subject: FYI: Bug in JSF Car Demo
For those of us who live in the east, we have zip codes that start with
zero.  Since you're using a numeric field for zip code (bad boy, bad bad
boy!), it doesn't work.
James
--
Kris Schneider 
D.O.Tech   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] April Fools?

2003-04-01 Thread Andrew Hill
I thought April Fools day was 1st of April - not the second.
-or is that the prank?

;->

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 01:30
To: struts
Subject: [OT] April Fools?





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



[OT] Zip Codes [WAS: RE: Bug in JSF Car Demo]

2003-04-01 Thread Andrew Hill
What is a ZIP code?
Yes I know its a postcode - but what does zip stand for?
(Does the US Postal service compress your mail to save space?)

-Original Message-
From: James Turner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 11:20
To: 'Struts Users Mailing List'
Subject: FYI: Bug in JSF Car Demo


For those of us who live in the east, we have zip codes that start with
zero.  Since you're using a numeric field for zip code (bad boy, bad bad
boy!), it doesn't work.

James



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

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



[OT] Re: A question

2003-04-01 Thread Affan Qureshi
Isn't the scriplet free version more confusing/cryptic than the scriplet
one? I know we should avoid scriplets 110% in JSPs but what about cases
where it can save some confusion of five tags to do a simple thing?

The reason to avoid scriplets is to allow seperation of page designers and
developers dependancies but the poor page designer won't make much sense out
of either of them in this case i think and its better to give him one line
of confusion than 5.

Intersted to know your comments.

Regards,
Affan

- Original Message -
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 12:21 AM
Subject: Re: A  question


> or using the scriptlet-free version
>
> 
>
> 
>  .name
> 
>
> 
>  
> 
>
>   <-- remove this unless you just want to
print
> it out on the page
>
>
>
> --
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
>
>
>
> - Original Message -
> From: "Karr, David" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, April 01, 2003 11:14 AM
> Subject: RE: A  question
>
>
> > This might work:
> >
> > 
> > 
> > 
> >
> > > -Original Message-
> > > From: Binaghi Mauro [mailto:[EMAIL PROTECTED]
> > >
> > > Hi
> > > I have the "user.name" property in my "ApplicationResource.properties"
> > > file.
> > > Can I take its value with the following instrucition in my JSP page?
> > >
> > > 
> > >  > > %>.name"/>
> > > 
> > >
> > > Of course, I call my JSP with this URI
> > "/myPage.jsp?httpParameter=user"
> >
> > -
> > 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]



FYI: Bug in JSF Car Demo

2003-04-01 Thread James Turner
For those of us who live in the east, we have zip codes that start with
zero.  Since you're using a numeric field for zip code (bad boy, bad bad
boy!), it doesn't work.

James



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



RE: Struts London Square Mile Java Developers

2003-04-01 Thread Marco Tedone
I live in Leyton, when the central line will work again, is not that far
from the SM.

Regards,

Marco 

> -Original Message-
> From: PILGRIM, Peter, FM [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 01, 2003 3:56 PM
> To: 'Struts Users Mailing List'
> Subject: Struts London Square Mile Java Developers 
> 
> 
> > On 26/03/2003 10:26 Chris May wrote:
> > > Maybe, if it was south Manchester (I'm based in the 
> Midlands). Any 
> > > takers?
> > > 
> > Chris
> >
> > I'm in the Midlands too - just north of Brum.
> 
> Anyone in the square mile!
> 
> --
> Peter Pilgrim,
> Struts/J2EE Consultant, RBoS FM, Risk IT
> Tel: +44 (0)207-375-4923
>  
> 
> 
> **
> *
>   Visit our Internet site at http://www.rbsmarkets.com
> 
> This e-mail is intended only for the addressee named above.
> As this e-mail may contain confidential or privileged 
> information, if you are not the named addressee, you are not 
> authorised to retain, read, copy or disseminate this message 
> or any part of it. The Royal Bank of Scotland plc is 
> registered in Scotland No 90312 Registered Office: 36 St 
> Andrew Square, Edinburgh EH2 2YB 
> Regulated by the Financial Services Authority
> **
> *
> 

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



Re: Base Action Class

2003-04-01 Thread Max Cooper
Why couple it to your ActionBase class? You can make it self-contained so
that you can get access to it anywhere that you have a handle to the
request. To get the MySession object for the session associated with the
current request, you just call MySession.getMySession(request). It will even
make one for you if it isn't already there.

public MySession implements Serializable {
   public static final String SESSION_KEY = "mySession";

   // static access method
   public static MySession getMySession(HttpServletRequest request) {
  HttpSession session = request.getSession();
  // you can even synchronize this to ensure you only make one per
session...
  synchronized (session) {
 MySession mySession = session.getAttribute(SESSION_KEY);
 if (mySession == null) {
mySession = new MySession();
session.setAttribute(SESSION_KEY, mySession);
 }
  }
  return mySession;
   }

   // whatever else you want in here
   private String favoriteWesAndersonMovie;
   public String getFavoriteWesAndersonMovie() {
  return favoriteWesAndersonMovie;
   }
   public void setFavoriteWesAndersonMovie(String movie) {
  favoriteWesAndersonMovie = movie;
   }
}

This also solves a problem that is frequently posted about: how to load a
UserProfile object into the session when a user logs in. The answer is
"don't" -- just instantiate it the first time you need to use it by always
getting to it with a static method like this. That access restriction
doesn't work too well with the bean-oriented JSP custom tags, but you could
decide on a name for the profile (like I used "mySession" above) in the
session and then just call the static access method in your ActionBase for
each request to ensure its existence before the request gets passed to a JSP
(or whatever you are using to render the view).

-Max

- Original Message -
From: "Johnny Rask" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 4:02 PM
Subject: Base Action Class


> Hello,
>  I have created a BaseAction class which extends
> Action. I in turn extend this BaseAction class for my
> specific needs (for example a user registration
> action). Inside my BaseAction I was thinking of adding
> an instance variable named mySession of type MySession
> which is essentially a container(java bean) of
> different "things" and is stored in the session under
> a keyed name (MY_SESSION). Then adding a
> getMySession() method in BaseAction to retrieve this
> session scoped variable from the HttpSession.
>
> Basically I want a uniform way to access this
> container class from any of the Action classes methods
> that extend BaseAction.  Are there any downfalls to
> this concept? I thought I read a previous message
> somewhere saying never to have instance variables in
> your action classes because it is not thread safe, is
> this true?
>
> Side note I am using an HttpSessionListener to put a
> MySession instance into the HttpSession when a new one
> is created.
>
> Thanks,
> Gator
>
> __
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://platinum.yahoo.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: scaffold ProcessBaseBean and sessions

2003-04-01 Thread Steve_Akins

Hi Kirby,


You're right about the struts-user group, not much talk of Scaffold but we
should try and change that.
Another place to look is http://sourceforge.net/projects/struts/


I've been off the air for the last couple of days but will try to answer
what I can when I can.



This is what we do:

import org.apache.commons.scaffold.lang.Tokens;
   .
   .
   .
   .
ProcessResult result = new ProcessResultBase(this, true);

// DO STUFF

if (error) {
  result.setDispatch(Tokens.FAILURE);
  result.addMessage(new ActionError
("error.something.bad.has.happened"));
}



OR


ProcessResult result = new ProcessResultBase(this, true);

// DO STUFF

if (error) {
  result.setDispatch(Tokens.FAILURE);
  ActionErrors errors = new ActionErrors();
  errors.add("password", new ActionError
("error.you.have.stuffed.up","password"));
  errors.add("userid", new ActionError
("error.you.have.stuffed.up","userid"));
  result.addMessage(errors);
}




I have also made a modification to the Scaffold code so that you can add
multiple ActionError objects to the message response.  Here you can either
add an ActionError or ActionErrors object as a message response  (See
above). The original code for this method looks a bit odd.  It looks like
you have to add the message key and message parameters as separate adds to
the messages list object.  Strange!  I think what I've done makes a little
more sense but that's up to others to interpret.


The following method is in BaseAction



  protected void mergeAlerts(
HttpServletRequest request,
ActionErrors alerts,
List list) {

if ((null != list) && (0 != list.size())) {

  for (int i = 0; i < list.size(); i++) {
Object obj = list.get(i);

// if the obj is an ActionError_s_ then pull out
each
// ActionError and merge into the alerts with the
field key
if (obj instanceof ActionErrors) {

  ActionErrors errors = (ActionErrors) obj;

  Iterator itr = errors.properties();
  while(itr.hasNext()){
String key = (String)itr.next();
Object value = errors.get(key);
Iterator itrError = (Iterator) value;
while(itrError.hasNext()){
  alerts.add(key, (ActionError)
itrError.next());
}
  }

} else {
  // assume anything else is going to be an
ActionError
  alerts.add(ActionErrors.GLOBAL_ERROR,
(ActionError) list.get(i));
}

  }
}

  }



Hope this helps.


Regards,

Steve Akins
Team Leader, Frameworks, J2EE Engineering
Development Centre
Financial Services Australia Technology


( +61 3 8641 2846 2 +61 3 8641 4152 : [EMAIL PROTECTED]


National Australia Bank Limited
4th Floor/ 500 Bourke St
Melbourne, Victoria 3000


|-+>
| |   Kirby Vandivort  |
| |   <[EMAIL PROTECTED]|
| |   .edu>|
| ||
| |   01/04/2003 02:08 |
| ||
|-+>
  
>--|
  |
  |
  |   To:   [EMAIL PROTECTED]  
|
  |   cc:  
  |
  |   Subject:  Re: scaffold ProcessBaseBean and sessions  
  |
  
>--|




Steve,

Thanks for responding earlier.  It was helpful and was close to what I
was doing at the time.

For the most part, the struts-user group doesn't seem very responsive for
any scaffold related questions.  Right now, I'm having trouble with a
simple question and I was wondering if you could enlighten me on how
you handle this case.

I've got my logic bean that inherits from ProcessBean.  This bean has the
simple job of changing a password.  It gets 3 values in (old pass, new
pass,
and verification pass).

How do I send back a failure message from the bean?  Let's say that their
old pass isn't correct, or the two new passwords don't match.  As best
I can tell, I only have two routes to go:

* I can use 'addMessage' but that doesn't set any f

RE: Base Action Class

2003-04-01 Thread Brandon Goodin
HAHA! I sent my email off before I saw Craig's... oops :-o

Nice to know we agree :-D

Brandon Goodin
 

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 5:59 PM
To: Struts Users Mailing List
Subject: Re: Base Action Class




On Tue, 1 Apr 2003, Johnny Rask wrote:

> Date: Tue, 1 Apr 2003 16:02:43 -0800 (PST)
> From: Johnny Rask <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Base Action Class
>
> Hello,
>  I have created a BaseAction class which extends
> Action. I in turn extend this BaseAction class for my
> specific needs (for example a user registration
> action). Inside my BaseAction I was thinking of adding
> an instance variable named mySession of type MySession
> which is essentially a container(java bean) of
> different "things" and is stored in the session under
> a keyed name (MY_SESSION). Then adding a
> getMySession() method in BaseAction to retrieve this
> session scoped variable from the HttpSession.
>

If you store this in an instance variable of the BaseAction class (or one
of your subclasses), it is going to cause you nothing but problems when
two users access this action at the same time -- there's only one instance
of the action, so the two users will scribble on each other.

> Basically I want a uniform way to access this
> container class from any of the Action classes methods
> that extend BaseAction.  Are there any downfalls to
> this concept? I thought I read a previous message
> somewhere saying never to have instance variables in
> your action classes because it is not thread safe, is
> this true?

Yep.

One approach to implementing your getMySession() method would be more like
what some of the standard methods provided by Action do:  take a parameter
containing the request, so you can go get the correct attribute easily:

  protected MySession getMySession(HttpRequest request) {
return ((MySession) request.getSession().getAttribute(MY_SESSION));
  }

which saves a little typing on each access, but more importantly it hides
from your Action logic the precise place that MySession is getting
retrieved from.  That means you can change it later, if need be (sample
change - write a Filter that copies it into a *request* attribute instead
of a session attribute), without messing up existing classes.

>
> Side note I am using an HttpSessionListener to put a
> MySession instance into the HttpSession when a new one
> is created.
>
> Thanks,
> Gator
>

Craig

-
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: Base Action Class

2003-04-01 Thread Brandon Goodin
It doesn't sound like you have to store the bean as an instance variable.
Just store it in the session under your key defined as a Constant. Then use
your getMySession() method to retrieve the session stored javabean. The bean
is already stored in the session scope. There is no need to store it as an
instance variable in your Action class. Just retrieve it from the session.

For examples:

ExtendedBaseAction extends BaseAction {

...

public static final MY_SESSION="com.foo.MySession";

...

public MySession getMySession() {

return (MySession) request.getSession().getAttribute(MY_SESSION);

}

...

}


Brandon Goodin
Phase Web and Multimedia
PO Box 85
Whitefish MT 59937
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Derek Richardson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 5:56 PM
To: Struts Users Mailing List
Subject: RE: Base Action Class


Instance variables in your actions classes are not thread-safe. :)

Why not call getMySession from inside execute() and store it in a local
variable?

> -Original Message-
> From: Johnny Rask [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 7:03 PM
> To: [EMAIL PROTECTED]
> Subject: Base Action Class
>
>
> Hello,
>  I have created a BaseAction class which extends
> Action. I in turn extend this BaseAction class for my
> specific needs (for example a user registration
> action). Inside my BaseAction I was thinking of adding
> an instance variable named mySession of type MySession
> which is essentially a container(java bean) of
> different "things" and is stored in the session under
> a keyed name (MY_SESSION). Then adding a
> getMySession() method in BaseAction to retrieve this
> session scoped variable from the HttpSession.
>
> Basically I want a uniform way to access this
> container class from any of the Action classes methods
> that extend BaseAction.  Are there any downfalls to
> this concept? I thought I read a previous message
> somewhere saying never to have instance variables in
> your action classes because it is not thread safe, is
> this true?
>
> Side note I am using an HttpSessionListener to put a
> MySession instance into the HttpSession when a new one
> is created.
>
> Thanks,
> Gator
>
> __
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://platinum.yahoo.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]



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



Re: Base Action Class

2003-04-01 Thread Craig R. McClanahan


On Tue, 1 Apr 2003, Johnny Rask wrote:

> Date: Tue, 1 Apr 2003 16:02:43 -0800 (PST)
> From: Johnny Rask <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Base Action Class
>
> Hello,
>  I have created a BaseAction class which extends
> Action. I in turn extend this BaseAction class for my
> specific needs (for example a user registration
> action). Inside my BaseAction I was thinking of adding
> an instance variable named mySession of type MySession
> which is essentially a container(java bean) of
> different "things" and is stored in the session under
> a keyed name (MY_SESSION). Then adding a
> getMySession() method in BaseAction to retrieve this
> session scoped variable from the HttpSession.
>

If you store this in an instance variable of the BaseAction class (or one
of your subclasses), it is going to cause you nothing but problems when
two users access this action at the same time -- there's only one instance
of the action, so the two users will scribble on each other.

> Basically I want a uniform way to access this
> container class from any of the Action classes methods
> that extend BaseAction.  Are there any downfalls to
> this concept? I thought I read a previous message
> somewhere saying never to have instance variables in
> your action classes because it is not thread safe, is
> this true?

Yep.

One approach to implementing your getMySession() method would be more like
what some of the standard methods provided by Action do:  take a parameter
containing the request, so you can go get the correct attribute easily:

  protected MySession getMySession(HttpRequest request) {
return ((MySession) request.getSession().getAttribute(MY_SESSION));
  }

which saves a little typing on each access, but more importantly it hides
from your Action logic the precise place that MySession is getting
retrieved from.  That means you can change it later, if need be (sample
change - write a Filter that copies it into a *request* attribute instead
of a session attribute), without messing up existing classes.

>
> Side note I am using an HttpSessionListener to put a
> MySession instance into the HttpSession when a new one
> is created.
>
> Thanks,
> Gator
>

Craig

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



RE: Base Action Class

2003-04-01 Thread Derek Richardson
Instance variables in your actions classes are not thread-safe. :)

Why not call getMySession from inside execute() and store it in a local variable?

> -Original Message-
> From: Johnny Rask [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 7:03 PM
> To: [EMAIL PROTECTED]
> Subject: Base Action Class
> 
> 
> Hello,
>  I have created a BaseAction class which extends
> Action. I in turn extend this BaseAction class for my
> specific needs (for example a user registration
> action). Inside my BaseAction I was thinking of adding
> an instance variable named mySession of type MySession
> which is essentially a container(java bean) of
> different "things" and is stored in the session under
> a keyed name (MY_SESSION). Then adding a
> getMySession() method in BaseAction to retrieve this
> session scoped variable from the HttpSession. 
> 
> Basically I want a uniform way to access this
> container class from any of the Action classes methods
> that extend BaseAction.  Are there any downfalls to
> this concept? I thought I read a previous message
> somewhere saying never to have instance variables in
> your action classes because it is not thread safe, is
> this true?
> 
> Side note I am using an HttpSessionListener to put a
> MySession instance into the HttpSession when a new one
> is created.
> 
> Thanks,
> Gator
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://platinum.yahoo.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: /do or .do

2003-04-01 Thread jbaker
That's what I'm doing for an application I'm working on (e.g. 
/countries/china/index.do).  This keeps things consistent with the static 
site I'm replacing (/countries/china/index.html) and they look familiar to 
people.

Joe Baker
Director of Internet Communications
Amnesty International USA
600 Pennsylvania Ave SE 5th Floor
Washington, DC 20003
202-544-0200 x285
http://www.amnestyusa.org
[EMAIL PROTECTED]




"Brandon Goodin" <[EMAIL PROTECTED]>
04/01/03 07:21 PM
Please respond to "Struts Users Mailing List"

 
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc: 
Subject:RE: /do or .do


h! very good! I've spent the last 1 1/2 years using /do so I did not
know a blended option was possible. Great! Thanks!

Brandon Goodin

-Original Message-
From: Thorin Linderholm [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 5:15 PM
To: 'Struts Users Mailing List'
Subject: RE: /do or .do


If you wanted to switch to *.do you could use:

/admin/cms/article/add.do

That will still match your *.do servlet mapping.

-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 4:15 PM
To: Struts User List
Subject: /do or .do


I have been in the habit of /do pattern. It seems to work fine for me. 
Apart
from having different 'modules' or subapps, is there a compelling reason 
to
use .do.

In the course of using /do I have found it easier to map the functions of 
my
actions.

For examples:
/do/admin/cms/article/add vs
adminCMSArticleAdd.do

To me the first one is cleaner. Can I stir all of your thoughts on this
subject. I am at a place where I can change to the .do if there is a good
reason.

Brandon Goodin



-
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: /do or .do

2003-04-01 Thread Brandon Goodin
h! very good! I've spent the last 1 1/2 years using /do so I did not
know a blended option was possible. Great! Thanks!

Brandon Goodin

-Original Message-
From: Thorin Linderholm [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 5:15 PM
To: 'Struts Users Mailing List'
Subject: RE: /do or .do


If you wanted to switch to *.do you could use:

/admin/cms/article/add.do

That will still match your *.do servlet mapping.

-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 4:15 PM
To: Struts User List
Subject: /do or .do


I have been in the habit of /do pattern. It seems to work fine for me. Apart
from having different 'modules' or subapps, is there a compelling reason to
use .do.

In the course of using /do I have found it easier to map the functions of my
actions.

For examples:
/do/admin/cms/article/add vs
adminCMSArticleAdd.do

To me the first one is cleaner. Can I stir all of your thoughts on this
subject. I am at a place where I can change to the .do if there is a good
reason.

Brandon Goodin



-
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: /do or .do

2003-04-01 Thread Thorin Linderholm
If you wanted to switch to *.do you could use:

/admin/cms/article/add.do

That will still match your *.do servlet mapping.

-Original Message-
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 4:15 PM
To: Struts User List
Subject: /do or .do


I have been in the habit of /do pattern. It seems to work fine for me. Apart
from having different 'modules' or subapps, is there a compelling reason to
use .do.

In the course of using /do I have found it easier to map the functions of my
actions.

For examples:
/do/admin/cms/article/add vs
adminCMSArticleAdd.do

To me the first one is cleaner. Can I stir all of your thoughts on this
subject. I am at a place where I can change to the .do if there is a good
reason.

Brandon Goodin



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



/do or .do

2003-04-01 Thread Brandon Goodin
I have been in the habit of /do pattern. It seems to work fine for me. Apart
from having different 'modules' or subapps, is there a compelling reason to
use .do.

In the course of using /do I have found it easier to map the functions of my
actions.

For examples:
/do/admin/cms/article/add vs
adminCMSArticleAdd.do

To me the first one is cleaner. Can I stir all of your thoughts on this
subject. I am at a place where I can change to the .do if there is a good
reason.

Brandon Goodin



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



Base Action Class

2003-04-01 Thread Johnny Rask
Hello,
 I have created a BaseAction class which extends
Action. I in turn extend this BaseAction class for my
specific needs (for example a user registration
action). Inside my BaseAction I was thinking of adding
an instance variable named mySession of type MySession
which is essentially a container(java bean) of
different "things" and is stored in the session under
a keyed name (MY_SESSION). Then adding a
getMySession() method in BaseAction to retrieve this
session scoped variable from the HttpSession. 

Basically I want a uniform way to access this
container class from any of the Action classes methods
that extend BaseAction.  Are there any downfalls to
this concept? I thought I read a previous message
somewhere saying never to have instance variables in
your action classes because it is not thread safe, is
this true?

Side note I am using an HttpSessionListener to put a
MySession instance into the HttpSession when a new one
is created.

Thanks,
Gator

__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com

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



Re: design question about action chaining

2003-04-01 Thread Kris Schneider
+1 for David's recommendation to look at filters (Servlet 2.3) and his emphasis 
that the responsibility of a Struts action is controller logic, not business 
logic. Of course, there's nothing to keep you from (ab)using them that way, but 
it's certainly not a "best practice". In fact, if you've got your business logic 
too tightly coupled to your controller framework, I bet it makes it a PITA to 
port to a different controller framework.

As for using filters with Struts, I'd wager it's pretty common (I do it 
routinely). For example, a search through the archives on SecurityFilter 
(http://securityfilter.sourceforge.net/) results in about 120 hits. It just 
doesn't make sense to me to ignore a standard piece of functionality just to 
reimplement it as an extension to a custom framework. I suppose I can understand 
the potential problem of having to sift through both web.xml and 
struts-config.xml to get a complete picture of how a given request gets 
processed though.

Stepping back for a moment, I like to view the interface to my web apps as a set 
of request URIs (e.g. http://host/app/do/profile/edit). This is the contract my 
app has with its clients. With that established, I'm free to implement the 
servicing of requests for those URIs in any way I see fit. If I don't need to 
tie that handling to Struts (or any other framework), I won't. It makes my life 
that much easier downt the road.

David Graham wrote:
You need to understand what Struts does for you.  The Action classes are 
*not* for business logic, they are part of the controller and define 
page flow and call business logic methods.  If you need special 
authentication, logging, etc. for particular views then a filter is your 
best choice.

Filters aren't a parallel system to Struts because they logically sit in 
front of Struts handling requests before Struts gets them.

David



From: Thorin Linderholm <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: design question about action chaining
Date: Tue, 1 Apr 2003 12:08:09 -0800
Filters are one of the design/imp choices I've considered under the
'parallel system' heading, though I hadn't thought of trying to use the
web.xml for this.  I'd have to look into these more.
I take it you recomending that a second, parallel system of specifying
functionality on a per-page or per-page-set basis is the way to go?
What reasons would you have for this design choice, as opposed to 
extending
struts to contain this functionality?

Have you (or others,) implemented something similar to this?

(This port is going to be a large chunk of time and I'm just trying to 
find
out if other people have already thought through and implemented this 
type
of functionality before I just pick something, run with it, and end up 
with
some kind of maintenance or design nightmare :-)

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: design question about action chaining
I think Filters would be a good choice for your needs.  You can define a
filter for each piece of logic and then configure them in web.xml for 
groups

of pages.  You'll need to put related pages in the same path scheme so 
that
you can map a filter to the group instead of each page.

David



>From: Thorin Linderholm <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: design question about action chaining
>Date: Tue, 1 Apr 2003 11:30:39 -0800
>
>
>I have been tasked with porting an existing web application with it's 
own
>proprietary controller architecture to using Struts.
>
>As they are both web controller architectures, they have many 
similarities,
>but I'm running into one difference in overall architecture that I'm 
having
>difficulty resolving.
>
>This difficulty is most closely related to the 'action chaining' 
posts I've
>been able to find in the mailing list archives.
>
>Specifically, I have over 400 pages mapped to various actions (our
>controller calls them that, and they're roughly synonymous with struts
>actions.)  However, our controller allows specifying a list of 
actions to
>execute on a per-page, and per-page-set basis.  In other words, we can
>assign an action like 'Ensure Session initialization has been
>completed/Initialize session' to every page in the site with a single
>mapping (assuming you've already listed all the pages.)  Or you can 
assign
>it to 90% of your pages if you happen to desire.  We have 
approximatly ten
>actions that happen on between 60-99% of the pages on our site.  If 
we were
>to directly translate this to the struts mapping system we would end up
>having to re-specify those ten actions on most of those 400+ pages,
>creating
>long action chains for each page (a whole lot of duplication: hard to
>maintain, easy to get wrong, etc.)
>
>So, concep

RE: BeanUtils ArrayIndexOutOfBoundsException on session timeout of form submit.

2003-04-01 Thread Derek Richardson
Handle the session time out with a filter?

> -Original Message-
> From: Ka-Wai Chan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 4:26 PM
> To: [EMAIL PROTECTED]
> Subject: BeanUtils ArrayIndexOutOfBoundsException on session 
> timeout of
> form submit.
> 
> 
> Hello
> 
> I currently have arrays of objects in my Session Form object 
> which gets 
> populated by struts.  All is fine except when the session times out, 
> Struts still wants to populate the arrays but can't because 
> they aren't 
> initialized to the right size anymore.  And the place where I handle 
> session time out (BaseAction) is called after this happens.  Any 
> suggestions on how to intercept this?  Do I have to extend the 
> controller servlet?
> 
> Thanks
> Ka-Wai
> 
> Here is the stack trace:
> 
> 
> java.lang.ArrayIndexOutOfBoundsException
>   at java.lang.reflect.Array.set(Native Method)
>   at 
> org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(
> PropertyUtils.java:1468)
>   at 
> org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:918)
>   at 
> org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729)
>   at 
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097)
>   at 
> org.apache.struts.action.RequestProcessor.processPopulate(Requ
> estProcessor.java:798)
>   at 
> org.apache.struts.action.RequestProcessor.process(RequestProce
> ssor.java:254)
>   at 
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1422)
>   at 
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:247)
>   at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:193)
>   at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:256)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>   at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>   at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:191)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>   at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>   at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2415)
>   at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>   at 
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.java:171)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
>   at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:641)
>   at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>   at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:174)
>   at 
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invokeNext(StandardPipeline.java:643)
>   at 
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>   at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.
> java:223)
>   at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:594)
>   at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConnection(Http11Protocol.java:392)
>   at 
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:565)
>   at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:619)
>   at java.lang.Thread.run(Thread.java:479)
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

RE: Help with validation

2003-04-01 Thread Wendy Smoak
Rick wrote:
> Maybe I'm missing something because if you are setting this up why do
> you really need to validate it? I usually only need the validation
> framework for making sure the user doesn't mess up. It sounds like you
> are using it to double check that you added the hidden field on the
> page - but why would that need to be validated if you put it there?
> Sorry if I'm missing something.

There's more to the story, but I'm still making it MUCH harder than it has
to be.

For various reasons I have never been able to convince a Form bean to hold
all of the data that I need to manipulate.  So most of my Forms are used in
conjunction with a DTO which sits in session scope alongside the Form bean.
(These forms are for editing fairly complex database records.)

In this case, I'm not trying to make sure a form field has been filled in,
I'm really trying to make sure that a property of the DTO has been set.  But
while Boolean seemed natural, what I really need is a String that either
gets set to some text, or else left blank, and then I can just use
'required'.

Thanks for being there to bounce ideas off of!  I may still be completely on
the wrong track, but so far, things are working.  I might be able to ditch
the DTO's if I could figure out nested and/or indexed properties.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


Re: design question about action chaining

2003-04-01 Thread Igor Shabalov
	Sure, you can.
	Sorry, I'm thinking in Russian, sometimes that produces really ugly 
English at the output :-)

On Tue, 1 Apr 2003 17:18:15 -0500, Paul Yunusov <[EMAIL PROTECTED]> 
wrote:

On Tuesday 01 April 2003 03:59 pm, Igor Shabalov wrote:
You can not possibly imagine how useful and powerful can be good GUI 
tool
when you handle really big and cumbersome struts-config file. 	Actually 
it
can give you much more capability to implement such pipes, filers and
“assembling” of application from pre-defined action components.
Why, I can.

Paul


On Tue, 1 Apr 2003 15:12:34 -0500, Paul Yunusov <[EMAIL PROTECTED]>

wrote:
> On Tuesday 01 April 2003 03:00 pm, Thorin Linderholm wrote:
>> The static method you suggest would be very cumbersome to implement 
and
>> maintain, requiring hard-coding calls to each bit of functionality I
>> wanted
>> on each page (aghh!)  But thanks for the reply :-)
>>
>> I have to disagree that 'If they are a business tier concept, Struts
>> should
>> have nothing to do with
>> chaining them.'
>>
>> The struts ActionServlet and the page mappings in the struts-config 
are
>> the
>> 'controller' portion of Struts.  The whole of Struts is much more 
than
>> the
>> 'C' in MVC.  It has taglibs for supporting the V, and actions are in
>> fact
>> always implementing buisness logic (they decide what page to go to by
>> returning a 'forward': definite buisness logic, if there is such a
>> thing.)
>> And that's always been a gray area in MVC for me: does all the 
buisness
>> logic belong in the model, or can it also go in the controller?  Or 
is
>> there an MVCC where there is a 'view' controller and 'buisness'
>> controller
>> (which seems a bit redundant to me.)
>
> Well, at one point you will wonder which is more cumbersome: coding
> Action classes or having a mile-long struts-config.xml.
>
> Paul
>
>> -Original Message-
>> From: Paul Yunusov [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, April 01, 2003 11:43 AM
>> To: Struts Users Mailing List
>> Subject: Re: design question about action chaining
>>
>> On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
>> > I have been tasked with porting an existing web application with 
it's
>>
>> own
>>
>> > proprietary controller architecture to using Struts.
>> >
>> > As they are both web controller architectures, they have many
>>
>> similarities,
>>
>> > but I'm running into one difference in overall architecture that 
I'm
>>
>> having
>>
>> > difficulty resolving.
>> >
>> > This difficulty is most closely related to the 'action chaining' 
posts
>>
>> I've
>>
>> > been able to find in the mailing list archives.
>> >
>> > Specifically, I have over 400 pages mapped to various actions (our
>> > controller calls them that, and they're roughly synonymous with 
struts
>> > actions.)  However, our controller allows specifying a list of 
actions
>>
>> to
>>
>> > execute on a per-page, and per-page-set basis.  In other words, we 
can
>> > assign an action like 'Ensure Session initialization has been
>> > completed/Initialize session' to every page in the site with a 
single
>> > mapping (assuming you've already listed all the pages.)  Or you can
>> > assign it to 90% of your pages if you happen to desire.  We have
>> > approximatly ten actions that happen on between 60-99% of the pages 
on
>> > our site.  If we
>>
>> were
>>
>> > to directly translate this to the struts mapping system we would 
end
>>
>> up
>>
>> > having to re-specify those ten actions on most of those 400+ pages,
>> > creating long action chains for each page (a whole lot of 
duplication:
>>
>> hard
>>
>> > to maintain, easy to get wrong, etc.)
>> >
>> > So, conceptually, I want to be able to apply a few different bits 
of
>> > logic to whole sets of pages.  Some of those 'bits of logic' 
(actions
>>
>> if
>>
>> > you will,) interrupt the process and forward to a different page 
(page
>> > access rules for instance.)
>> >
>> > There are several possible solutions that I've come up with, but so
>>
>> far
>>
>> all
>>
>> > of them involve either hacks, extending struts (which happens to
>>
>> partialy
>>
>> > eliminate the reason I'm being required to move to Struts, and so
>>
>> isn't
>>
>> > very favored by my supperiors,) some complicated java inheritance
>>
>> hierarchy
>>
>> > where I inherit non-related functionality in those ten actions into 
a
>>
>> set
>>
>> > of compound actions, each inheriting in the set of functionality we
>>
>> want
>>
>> > (lame,) or I could implement a 'view preprocessor' of some kind 
that
>> > parallels the struts-config and defines processing that I need to 
do
>>
>> for
>>
>> > each view page (which requires me to have two completely redundant
>>
>> sets
>>
>> > of page mappings, and apears to me to obsolete the need for Struts 
in
>>
>> the
>>
>> > first place (if we were to ignore it's tag libraries and other 
helper
>> > classes which we also already have proprietary equivalents to.)
>> >
>> > I'd love to hear from anyone about other poss

RE: HELP: Dispaly Date in a JSP that used Tiles

2003-04-01 Thread Gareth Andrew
I think your problem has nothing to do with tiles or jsp.  You just need 
to write the output to a control instead of trying to write to the page.
If the browser were to allow your code to work as you have written it 
you would actually get a list of times.
The following code should work - it renders to a named textBox.

BEGINNING OF CODE SAMPLE --


function aff_heure() {
var d=new Date()
var weekdays=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

var weekday=weekdays[d.getDay()]
var date = d.getDate()
var month = monthname[d.getMonth()]
var year = d.getFullYear()
var hour = d.getHours()
var minute = d.getMinutes()
var second = d.getSeconds()
var time = new String(weekday + " " + date
+ "." + month + " " + year
+ ", " + hour + ":" + minute
+ ":" + second)
document.myForm.dateControl.value=time;


setTimeout("aff_heure()",100);
}
END OF CODE SAMPLE -- Hope this helps, Gareth PS. You can also render to put your answer in other html objects such as spans and divs but if you're trying to make it work on as many browsers as possible that might be a bit of a headache. PPS. Why not use d.toGMTString() or d.toLocaleString() instead of trying to format the string yourself? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help with validation

On Tue, 01 Apr 2003 15:16:08 -0700
Wendy Smoak <[EMAIL PROTECTED]> wrote:

  
> I have what is basically a true/false radio button on a form, except
> that I'm really doing it with a hidden field that I set based on some
> stuff sitting in the session.

Maybe I'm missing something because if you are setting this up why do
you really need to validate it? I usually only need the validation
framework for making sure the user doesn't mess up. It sounds like you
are using it to double check that you added the hidden field on the
page - but why would that need to be validated if you put it there?

Sorry if I'm missing something.

-- 
Rick Reumann

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



Re: design question about action chaining

On Tuesday 01 April 2003 03:59 pm, Igor Shabalov wrote:
> You can not possibly imagine how useful and powerful can be good GUI tool
> when you handle really big and cumbersome struts-config file. Actually it
> can give you much more capability to implement such pipes, filers and
> “assembling” of application from pre-defined action components.

Why, I can.

Paul


>
> On Tue, 1 Apr 2003 15:12:34 -0500, Paul Yunusov <[EMAIL PROTECTED]>
>
> wrote:
> > On Tuesday 01 April 2003 03:00 pm, Thorin Linderholm wrote:
> >> The static method you suggest would be very cumbersome to implement and
> >> maintain, requiring hard-coding calls to each bit of functionality I
> >> wanted
> >> on each page (aghh!)  But thanks for the reply :-)
> >>
> >> I have to disagree that 'If they are a business tier concept, Struts
> >> should
> >> have nothing to do with
> >> chaining them.'
> >>
> >> The struts ActionServlet and the page mappings in the struts-config are
> >> the
> >> 'controller' portion of Struts.  The whole of Struts is much more than
> >> the
> >> 'C' in MVC.  It has taglibs for supporting the V, and actions are in
> >> fact
> >> always implementing buisness logic (they decide what page to go to by
> >> returning a 'forward': definite buisness logic, if there is such a
> >> thing.)
> >> And that's always been a gray area in MVC for me: does all the buisness
> >> logic belong in the model, or can it also go in the controller?  Or is
> >> there an MVCC where there is a 'view' controller and 'buisness'
> >> controller
> >> (which seems a bit redundant to me.)
> >
> > Well, at one point you will wonder which is more cumbersome: coding
> > Action classes or having a mile-long struts-config.xml.
> >
> > Paul
> >
> >> -Original Message-
> >> From: Paul Yunusov [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, April 01, 2003 11:43 AM
> >> To: Struts Users Mailing List
> >> Subject: Re: design question about action chaining
> >>
> >> On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
> >> > I have been tasked with porting an existing web application with it's
> >>
> >> own
> >>
> >> > proprietary controller architecture to using Struts.
> >> >
> >> > As they are both web controller architectures, they have many
> >>
> >> similarities,
> >>
> >> > but I'm running into one difference in overall architecture that I'm
> >>
> >> having
> >>
> >> > difficulty resolving.
> >> >
> >> > This difficulty is most closely related to the 'action chaining' posts
> >>
> >> I've
> >>
> >> > been able to find in the mailing list archives.
> >> >
> >> > Specifically, I have over 400 pages mapped to various actions (our
> >> > controller calls them that, and they're roughly synonymous with struts
> >> > actions.)  However, our controller allows specifying a list of actions
> >>
> >> to
> >>
> >> > execute on a per-page, and per-page-set basis.  In other words, we can
> >> > assign an action like 'Ensure Session initialization has been
> >> > completed/Initialize session' to every page in the site with a single
> >> > mapping (assuming you've already listed all the pages.)  Or you can
> >> > assign it to 90% of your pages if you happen to desire.  We have
> >> > approximatly ten actions that happen on between 60-99% of the pages on
> >> > our site.  If we
> >>
> >> were
> >>
> >> > to directly translate this to the struts mapping system we would end
> >>
> >> up
> >>
> >> > having to re-specify those ten actions on most of those 400+ pages,
> >> > creating long action chains for each page (a whole lot of duplication:
> >>
> >> hard
> >>
> >> > to maintain, easy to get wrong, etc.)
> >> >
> >> > So, conceptually, I want to be able to apply a few different bits of
> >> > logic to whole sets of pages.  Some of those 'bits of logic' (actions
> >>
> >> if
> >>
> >> > you will,) interrupt the process and forward to a different page (page
> >> > access rules for instance.)
> >> >
> >> > There are several possible solutions that I've come up with, but so
> >>
> >> far
> >>
> >> all
> >>
> >> > of them involve either hacks, extending struts (which happens to
> >>
> >> partialy
> >>
> >> > eliminate the reason I'm being required to move to Struts, and so
> >>
> >> isn't
> >>
> >> > very favored by my supperiors,) some complicated java inheritance
> >>
> >> hierarchy
> >>
> >> > where I inherit non-related functionality in those ten actions into a
> >>
> >> set
> >>
> >> > of compound actions, each inheriting in the set of functionality we
> >>
> >> want
> >>
> >> > (lame,) or I could implement a 'view preprocessor' of some kind that
> >> > parallels the struts-config and defines processing that I need to do
> >>
> >> for
> >>
> >> > each view page (which requires me to have two completely redundant
> >>
> >> sets
> >>
> >> > of page mappings, and apears to me to obsolete the need for Struts in
> >>
> >> the
> >>
> >> > first place (if we were to ignore it's tag libraries and other helper
> >> > classes which we also already have prop

Help with validation


I have what is basically a true/false radio button on a form, except that
I'm really doing it with a hidden field that I set based on some stuff
sitting in the session.

So in the JSP, it's either:
   
or
   
which is wrapped by a  arrangement.

What do I put in validation.xml to ensure that staffPresent=true when the
form is submitted, or else have the validator return an error?

I can do 'required' but I can't tell how to check whether a Boolean is true.

Is this something I should be doing manually in the validate method, or is
there a way to do it with Validator?  Do I need to write my own Validator
for this?  I see you can require a field to be in integer in a range, but
this would be like putting a radio button on a page ("I agree to these
terms: Yes/No") and then needing to validate that the user set it to "Yes".

The problem seems to be that when I call initialize() in the reset method,
the form property 'staffPresent' is set to false.  So if I just use
'required', that always passes since there's _something_ in staffPresent.


Snippets that may help...

validation.xml:

 
 

 


struts-config.xml:
  
  
  
 

ClearanceRequestForm.java:
   public ActionErrors validate( ActionMapping mapping,
 HttpServletRequest request )
   {
  //only validate if 'Finish' has been clicked
  if ( "Finish".equals( request.getParameter("userAction") ) {
 super.validate( mapping, request );
  }
   }

Thanks!

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


RE: design question about action chaining

You need to understand what Struts does for you.  The Action classes are 
*not* for business logic, they are part of the controller and define page 
flow and call business logic methods.  If you need special authentication, 
logging, etc. for particular views then a filter is your best choice.

Filters aren't a parallel system to Struts because they logically sit in 
front of Struts handling requests before Struts gets them.

David



From: Thorin Linderholm <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: design question about action chaining
Date: Tue, 1 Apr 2003 12:08:09 -0800
Filters are one of the design/imp choices I've considered under the
'parallel system' heading, though I hadn't thought of trying to use the
web.xml for this.  I'd have to look into these more.
I take it you recomending that a second, parallel system of specifying
functionality on a per-page or per-page-set basis is the way to go?
What reasons would you have for this design choice, as opposed to extending
struts to contain this functionality?
Have you (or others,) implemented something similar to this?

(This port is going to be a large chunk of time and I'm just trying to find
out if other people have already thought through and implemented this type
of functionality before I just pick something, run with it, and end up with
some kind of maintenance or design nightmare :-)
-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: design question about action chaining
I think Filters would be a good choice for your needs.  You can define a
filter for each piece of logic and then configure them in web.xml for 
groups

of pages.  You'll need to put related pages in the same path scheme so that
you can map a filter to the group instead of each page.
David



>From: Thorin Linderholm <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: design question about action chaining
>Date: Tue, 1 Apr 2003 11:30:39 -0800
>
>
>I have been tasked with porting an existing web application with it's own
>proprietary controller architecture to using Struts.
>
>As they are both web controller architectures, they have many 
similarities,
>but I'm running into one difference in overall architecture that I'm 
having
>difficulty resolving.
>
>This difficulty is most closely related to the 'action chaining' posts 
I've
>been able to find in the mailing list archives.
>
>Specifically, I have over 400 pages mapped to various actions (our
>controller calls them that, and they're roughly synonymous with struts
>actions.)  However, our controller allows specifying a list of actions to
>execute on a per-page, and per-page-set basis.  In other words, we can
>assign an action like 'Ensure Session initialization has been
>completed/Initialize session' to every page in the site with a single
>mapping (assuming you've already listed all the pages.)  Or you can 
assign
>it to 90% of your pages if you happen to desire.  We have approximatly 
ten
>actions that happen on between 60-99% of the pages on our site.  If we 
were
>to directly translate this to the struts mapping system we would end up
>having to re-specify those ten actions on most of those 400+ pages,
>creating
>long action chains for each page (a whole lot of duplication: hard to
>maintain, easy to get wrong, etc.)
>
>So, conceptually, I want to be able to apply a few different bits of 
logic
>to whole sets of pages.  Some of those 'bits of logic' (actions if you
>will,) interrupt the process and forward to a different page (page access
>rules for instance.)
>
>There are several possible solutions that I've come up with, but so far 
all
>of them involve either hacks, extending struts (which happens to partialy
>eliminate the reason I'm being required to move to Struts, and so isn't
>very
>favored by my supperiors,) some complicated java inheritance hierarchy
>where
>I inherit non-related functionality in those ten actions into a set of
>compound actions, each inheriting in the set of functionality we want
>(lame,) or I could implement a 'view preprocessor' of some kind that
>parallels the struts-config and defines processing that I need to do for
>each view page (which requires me to have two completely redundant sets 
of
>page mappings, and apears to me to obsolete the need for Struts in the
>first
>place (if we were to ignore it's tag libraries and other helper classes
>which we also already have proprietary equivalents to.)
>
>I'd love to hear from anyone about other possibilities, or (even better,)
>pointers to somebody/some package already solving this problem.
>
>Another way to look at the whole thing:  How have other people solved the
>problem of being able to apply a set of page access rules to arbitrary 
sets
>of pages without having to crea

BeanUtils ArrayIndexOutOfBoundsException on session timeout of formsubmit.

Hello

I currently have arrays of objects in my Session Form object which gets 
populated by struts.  All is fine except when the session times out, 
Struts still wants to populate the arrays but can't because they aren't 
initialized to the right size anymore.  And the place where I handle 
session time out (BaseAction) is called after this happens.  Any 
suggestions on how to intercept this?  Do I have to extend the 
controller servlet?

Thanks
Ka-Wai
Here is the stack trace:

java.lang.ArrayIndexOutOfBoundsException
	at java.lang.reflect.Array.set(Native Method)
	at 
org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(PropertyUtils.java:1468)
	at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:918)
	at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729)
	at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097)
	at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
	at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:479)



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


Re: Is Strut too primitive for really useful Controller function?

	I can not find original post from Thorin - but I'm 100% agree with his 
point.
	Moreover – I have real experience with system that allows me to implement 
what Thorin is talking about. We implements almost all business logic in 
controller layer, moreover – we have two sub-layer inside controller – 
“presentation” controller, which handles all page flow and input 
validations, and “business” controller – where actual business logic where 
implemented on “high” level.
	All this because of using our own implementation of MVC framework – 
Exadel.
	I’m not here to convince you to switch from Struts to Exadel, but I can 
tell you that Struts “controller” component is too primitive compared to 
Exadel.
	We used widely concept of module. In Exadel you can define module (we call 
it “process”) with “process context” and actually use it like “function 
calls”. You even can use recursion. That gives us ability to split system 
to modules using “vertical” (by functional areas) and “horizontal” (by 
architecture layer) approach. And we design system in a way where we have 
two horizontal layers – one (top) designed to handle page flow and all 
“interface” relater issues. And second (bottom) layer was dedicated to 
business functions.

	I feel that there is something good in such design, the only problem – 
Strut do not really helps here.
	

Best,
Igor.
http://www.exadel.com
http://www.exadel.com/products_strutsstudio.htm
On Tue, 1 Apr 2003 12:08:09 -0800, Thorin Linderholm 
<[EMAIL PROTECTED]> wrote:

Filters are one of the design/imp choices I've considered under the
'parallel system' heading, though I hadn't thought of trying to use the
web.xml for this.  I'd have to look into these more.
I take it you recomending that a second, parallel system of specifying
functionality on a per-page or per-page-set basis is the way to go?
What reasons would you have for this design choice, as opposed to 
extending
struts to contain this functionality?

Have you (or others,) implemented something similar to this?

(This port is going to be a large chunk of time and I'm just trying to 
find
out if other people have already thought through and implemented this 
type
of functionality before I just pick something, run with it, and end up 
with
some kind of maintenance or design nightmare :-)

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: design question about action chaining
I think Filters would be a good choice for your needs.  You can define a 
filter for each piece of logic and then configure them in web.xml for 
groups

of pages.  You'll need to put related pages in the same path scheme so 
that you can map a filter to the group instead of each page.

David



From: Thorin Linderholm <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: design question about action chaining
Date: Tue, 1 Apr 2003 11:30:39 -0800
I have been tasked with porting an existing web application with it's 
own
proprietary controller architecture to using Struts.

As they are both web controller architectures, they have many 
similarities,
but I'm running into one difference in overall architecture that I'm 
having
difficulty resolving.

This difficulty is most closely related to the 'action chaining' posts 
I've
been able to find in the mailing list archives.

Specifically, I have over 400 pages mapped to various actions (our
controller calls them that, and they're roughly synonymous with struts
actions.)  However, our controller allows specifying a list of actions 
to
execute on a per-page, and per-page-set basis.  In other words, we can
assign an action like 'Ensure Session initialization has been
completed/Initialize session' to every page in the site with a single
mapping (assuming you've already listed all the pages.)  Or you can 
assign
it to 90% of your pages if you happen to desire.  We have approximatly 
ten
actions that happen on between 60-99% of the pages on our site.  If we 
were
to directly translate this to the struts mapping system we would end up
having to re-specify those ten actions on most of those 400+ pages, 
creating
long action chains for each page (a whole lot of duplication: hard to
maintain, easy to get wrong, etc.)

So, conceptually, I want to be able to apply a few different bits of 
logic
to whole sets of pages.  Some of those 'bits of logic' (actions if you
will,) interrupt the process and forward to a different page (page 
access
rules for instance.)

There are several possible solutions that I've come up with, but so far 
all
of them involve either hacks, extending struts (which happens to 
partialy
eliminate the reason I'm being required to move to Struts, and so isn't 
very
favored by my supperiors,) some complicated java inheritance hierarchy 
where
I inherit non-related functionality in those ten actions into a set of
compound actions, each in

html:link

Does html:link automatically encode any parameters in the generated url?  Is there a 
way to turn this off?

I believe the answer to the first question is yes.  I have a problem where I need to 
pass as a parameter to a action a link to another document including any anchor 
reference in that document. 

Need:


When outputted with html:link with: 


I get:




If I cannot turn off the encoding can I do something like:
" 
paramId="link" paramName="bean" paramProperty="link"/> 

I guess the above question can be asked in a more generic context.  How can I use a 
bean tag within another tag from say the html or logic lib?

Thanks,
Matt

Re: design question about action chaining

	You can not possibly imagine how useful and powerful can be good GUI tool 
when you handle really big and cumbersome struts-config file. 	Actually it 
can give you much more capability to implement such pipes, filers and 
“assembling” of application from pre-defined action components.

Best,
Igor.
http://www.exadel.com
http://www.exadel.com/products_strutsstudio.htm
On Tue, 1 Apr 2003 15:12:34 -0500, Paul Yunusov <[EMAIL PROTECTED]> 
wrote:

On Tuesday 01 April 2003 03:00 pm, Thorin Linderholm wrote:
The static method you suggest would be very cumbersome to implement and
maintain, requiring hard-coding calls to each bit of functionality I 
wanted
on each page (aghh!)  But thanks for the reply :-)

I have to disagree that 'If they are a business tier concept, Struts 
should
have nothing to do with
chaining them.'

The struts ActionServlet and the page mappings in the struts-config are 
the
'controller' portion of Struts.  The whole of Struts is much more than 
the
'C' in MVC.  It has taglibs for supporting the V, and actions are in 
fact
always implementing buisness logic (they decide what page to go to by
returning a 'forward': definite buisness logic, if there is such a 
thing.)
And that's always been a gray area in MVC for me: does all the buisness
logic belong in the model, or can it also go in the controller?  Or is
there an MVCC where there is a 'view' controller and 'buisness' 
controller
(which seems a bit redundant to me.)

Well, at one point you will wonder which is more cumbersome: coding 
Action classes or having a mile-long struts-config.xml.

Paul





-Original Message-
From: Paul Yunusov [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:43 AM
To: Struts Users Mailing List
Subject: Re: design question about action chaining
On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
> I have been tasked with porting an existing web application with it's 
own
> proprietary controller architecture to using Struts.
>
> As they are both web controller architectures, they have many

similarities,

> but I'm running into one difference in overall architecture that I'm

having

> difficulty resolving.
>
> This difficulty is most closely related to the 'action chaining' posts
I've

> been able to find in the mailing list archives.
>
> Specifically, I have over 400 pages mapped to various actions (our
> controller calls them that, and they're roughly synonymous with struts
> actions.)  However, our controller allows specifying a list of actions 
to
> execute on a per-page, and per-page-set basis.  In other words, we can
> assign an action like 'Ensure Session initialization has been
> completed/Initialize session' to every page in the site with a single
> mapping (assuming you've already listed all the pages.)  Or you can
> assign it to 90% of your pages if you happen to desire.  We have
> approximatly ten actions that happen on between 60-99% of the pages on
> our site.  If we

were

> to directly translate this to the struts mapping system we would end 
up
> having to re-specify those ten actions on most of those 400+ pages,
> creating long action chains for each page (a whole lot of duplication:

hard

> to maintain, easy to get wrong, etc.)
>
> So, conceptually, I want to be able to apply a few different bits of
> logic to whole sets of pages.  Some of those 'bits of logic' (actions 
if
> you will,) interrupt the process and forward to a different page (page
> access rules for instance.)
>
> There are several possible solutions that I've come up with, but so 
far

all

> of them involve either hacks, extending struts (which happens to 
partialy
> eliminate the reason I'm being required to move to Struts, and so 
isn't
> very favored by my supperiors,) some complicated java inheritance

hierarchy

> where I inherit non-related functionality in those ten actions into a 
set
> of compound actions, each inheriting in the set of functionality we 
want
> (lame,) or I could implement a 'view preprocessor' of some kind that
> parallels the struts-config and defines processing that I need to do 
for
> each view page (which requires me to have two completely redundant 
sets
> of page mappings, and apears to me to obsolete the need for Struts in 
the
> first place (if we were to ignore it's tag libraries and other helper
> classes which we also already have proprietary equivalents to.)
>
> I'd love to hear from anyone about other possibilities, or (even 
better,)
> pointers to somebody/some package already solving this problem.
>
> Another way to look at the whole thing:  How have other people solved 
the
> problem of being able to apply a set of page access rules to arbitrary

sets

> of pages without having to create a system parallel to struts that
> re-defines every page in the application?  Or do people consider a
parallel

> system that respecifies every page as the proper design?
>
> Thorin
Ever thought of defining functionality equivalent to your propr

Re: DynaActionForm with logic:present

Yes, thanks, that would have been too simple! I believe that tag looks for 
an empty string also, and in my case it is alright to have an empty. I 
just need to weed out the null properties ... the ones not specifically 
"set" in the action. 

On 04/01/2003 03:42:31 PM "Ian Hunter" wrote:

> check logic:empty
> 
> - Original Message -
> From: "Susan Bradeen" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, April 01, 2003 3:32 PM
> Subject: Re: DynaActionForm with logic:present
> 
> 
> > It appears (I am sure I missed some docs about this somewhere ... ) 
that
> > DynaActionForm String properties are initialized to an empty String,
> > unless otherwise set in the config file. The  will 
never
> > work as expected, since there aren't any null String property values.
> 
> 
> -
> 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: DynaActionForm with logic:present

check logic:empty

- Original Message - 
From: "Susan Bradeen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 3:32 PM
Subject: Re: DynaActionForm with logic:present


> It appears (I am sure I missed some docs about this somewhere ... ) that 
> DynaActionForm String properties are initialized to an empty String, 
> unless otherwise set in the config file. The  will never 
> work as expected, since there aren't any null String property values. 


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



Re: DynaActionForm with logic:present

It appears (I am sure I missed some docs about this somewhere ... ) that 
DynaActionForm String properties are initialized to an empty String, 
unless otherwise set in the config file. The  will never 
work as expected, since there aren't any null String property values. 
Subclassing the DynaActionForm (or DynaValidatorForm in my case), and 
overriding the initialize() method, the String properties can be set to 
null. If these property values are not set again in the action, the values 
remain at null. This allows the  in the JSP to work as 
expected.
 
If I have missed some glaring negative issue in doing this, please someone 
feel free to share it with me. 

Thanks,
Susan

On 04/01/2003 01:18:56 PM "Susan Bradeen" wrote:

> Can I use  with DynaActionForm properties?
> 
> If my form property is null, I don't want the property text box, to
> display in my jsp page. This works fine with an ActionForm, but using a
> DynaActionForm I get a blank text box for the property showing up.
> 
> In the code below, the action's if-statement will not invoke, and the
> property value will not be set. Doesn't this mean that the property 
value
> should be null? And doesn't that mean that the  in the 
jsp
> should not invoke either?
> 
> JSP contains (in part):
> 
> 
> 
> 
> 
> Action contains:
> 
> DynaValidatorForm myForm = (DynaValidatorForm)form;
> if (false) { myForm.set("firstName", myBean.getFirstName); }
> 
> struts-config contains:
> 
> 
> 
> 
> 
> I haven't been able to find an example using this tag and this form type
> together. Can anyone please point me to an example of this? And, as 
usual,
> other suggestions and corrections to the above are greatly appreciated.
> 
> Susan Bradeen
> [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: design question about action chaining

On Tuesday 01 April 2003 03:00 pm, Thorin Linderholm wrote:
> The static method you suggest would be very cumbersome to implement and
> maintain, requiring hard-coding calls to each bit of functionality I wanted
> on each page (aghh!)  But thanks for the reply :-)
>
> I have to disagree that 'If they are a business tier concept, Struts should
> have nothing to do with
> chaining them.'
>
> The struts ActionServlet and the page mappings in the struts-config are the
> 'controller' portion of Struts.  The whole of Struts is much more than the
> 'C' in MVC.  It has taglibs for supporting the V, and actions are in fact
> always implementing buisness logic (they decide what page to go to by
> returning a 'forward': definite buisness logic, if there is such a thing.)
> And that's always been a gray area in MVC for me: does all the buisness
> logic belong in the model, or can it also go in the controller?  Or is
> there an MVCC where there is a 'view' controller and 'buisness' controller
> (which seems a bit redundant to me.)
>

Well, at one point you will wonder which is more cumbersome: coding Action 
classes or having a mile-long struts-config.xml.

Paul



>
>
> -Original Message-
> From: Paul Yunusov [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 11:43 AM
> To: Struts Users Mailing List
> Subject: Re: design question about action chaining
>
> On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
> > I have been tasked with porting an existing web application with it's own
> > proprietary controller architecture to using Struts.
> >
> > As they are both web controller architectures, they have many
>
> similarities,
>
> > but I'm running into one difference in overall architecture that I'm
>
> having
>
> > difficulty resolving.
> >
> > This difficulty is most closely related to the 'action chaining' posts
>
> I've
>
> > been able to find in the mailing list archives.
> >
> > Specifically, I have over 400 pages mapped to various actions (our
> > controller calls them that, and they're roughly synonymous with struts
> > actions.)  However, our controller allows specifying a list of actions to
> > execute on a per-page, and per-page-set basis.  In other words, we can
> > assign an action like 'Ensure Session initialization has been
> > completed/Initialize session' to every page in the site with a single
> > mapping (assuming you've already listed all the pages.)  Or you can
> > assign it to 90% of your pages if you happen to desire.  We have
> > approximatly ten actions that happen on between 60-99% of the pages on
> > our site.  If we
>
> were
>
> > to directly translate this to the struts mapping system we would end up
> > having to re-specify those ten actions on most of those 400+ pages,
> > creating long action chains for each page (a whole lot of duplication:
>
> hard
>
> > to maintain, easy to get wrong, etc.)
> >
> > So, conceptually, I want to be able to apply a few different bits of
> > logic to whole sets of pages.  Some of those 'bits of logic' (actions if
> > you will,) interrupt the process and forward to a different page (page
> > access rules for instance.)
> >
> > There are several possible solutions that I've come up with, but so far
>
> all
>
> > of them involve either hacks, extending struts (which happens to partialy
> > eliminate the reason I'm being required to move to Struts, and so isn't
> > very favored by my supperiors,) some complicated java inheritance
>
> hierarchy
>
> > where I inherit non-related functionality in those ten actions into a set
> > of compound actions, each inheriting in the set of functionality we want
> > (lame,) or I could implement a 'view preprocessor' of some kind that
> > parallels the struts-config and defines processing that I need to do for
> > each view page (which requires me to have two completely redundant sets
> > of page mappings, and apears to me to obsolete the need for Struts in the
> > first place (if we were to ignore it's tag libraries and other helper
> > classes which we also already have proprietary equivalents to.)
> >
> > I'd love to hear from anyone about other possibilities, or (even better,)
> > pointers to somebody/some package already solving this problem.
> >
> > Another way to look at the whole thing:  How have other people solved the
> > problem of being able to apply a set of page access rules to arbitrary
>
> sets
>
> > of pages without having to create a system parallel to struts that
> > re-defines every page in the application?  Or do people consider a
>
> parallel
>
> > system that respecifies every page as the proper design?
> >
> > Thorin
>
> Ever thought of defining functionality equivalent to your proprietory
> "actions" in classes that don't extend the Struts framework and chaining
> calls to instances of these classes in your Struts Actions?
>
> This is a static solution as opposed to having struts-config.xml support
> some
> sort of action chaining tags but Struts Actions are only HTTP adapters, 

Re: [OT]Credit card processing

Check out 
http://www.openecho.com/
pretty easy to use JAVA API and well documented too

Louis Majanja

On Mon, 2003-03-31 at 18:13, P Dunham wrote:
> Hi all,
> 
> Anyone here have recommendations on credit card processing
> services? As well as any resources for implementing credit card processing
> with struts/java.
> 
> Thank you,
> 
> Philip Dunham
> 

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



Re: Does a degree matter?



a read actuall a nice book called Underworld Survival Guide he got's

some nice tip :



FREE EDUCATION



  Usually when you ask somebody in college why they are there, they'll
tell you it's to get an education. The truth of it is, they are there to get
the degree so that they can get ahead in the rat race. Too many college
radicals are two-timing punks. The only reason you should be in college is
to destroy it. If there is stuff that you want to learn though, there is a
way to get a college education absolutely free. Simply send away for the
schedule of courses at the college of your choice. Make up the schedule you
want and audit the classes. In smaller classes this might be a problem, but
even then, if, the teacher is worth anything at all, he'll let you stay. In
large classes, no one will ever object.If you need books for a course, write
to the publisher claiming you are a lecturer at some school and considering
using their book in your course. They will always send you free books.There
are Free Universities springing up all over our new Nation. Anybody can
teach any course. People sign up for the courses and sometimes pay a token
registration fee. This money is used to publish a catalogue and pay the
rent. If you're on welfare you don't have to pay. You can take as many or as
few courses as you want. Classes are held everywhere: in the instructor's
house, in the park, on the beach, at one of the student's houses or in
liberated buildings. Free Universities offer courses ranging from Astrology
to the Use of Firearms. The teaching is usually of excellent quality and
you'll learn in a community-type atmosphere.



LIST OF FREE UNIVERSITIES

  ¥ Alternative University-69 W. 14th St., New York, NY 10011 (catalogue
on request)

  ¥ Baltimore Free U-c/o Harry, 233 E. 25th St., Baltimore, Maryland
21218

  ¥ Berkeley Free U-1703 Grove St., Berkeley, California 94709

  ¥ Bowling Green Free U-c/o Student Council, University of Bowling
Green, Bowling Green  Ohio 43402

  ¥ Colorado State Free U-Box 12-Fraisen, Colorado State College,
Greeley, Colorado 80631   ¥ Detroit Area Free U-Student Union, 4001 W.
McNichols Rd., Detroit, Michigan 48221

  ¥ Detroit Area Free U-343 University Center, Wayne State University,
Detroit, Mich.

  ¥ Georgetown Free U-Loyola Bldg., 28, Georgetown University Washington
D.C. 20007

  ¥ Golden Gate Free U-2120 Market St., Rm. 206, San Francisco,
California 94114

  ¥ Heliotrope-2201 Filbert, San Francisco, California 94118

  ¥ Illinois Free U-298A Illini Union, University of Illinois,
Champaign, Illinois 61820

  ¥ Kansas Free U-107 W. 7th St., Lawrence, Kansas 66044

  ¥ Knox College Free U-Galesbury, Illinois 60401

  ¥ Madison Free U-c/o P. Carroll, 1205 Shorewood Blvd., Madison,
Wisconsin 53705

  ¥ Metropolitan State Free U-Associated Students, 1345 Banrock St.,
Denver, Colorado 80204   ¥ Michigan State Free U-Associated Students,
Student Service Bldg., Michigan State College, East Lansing,
Michigan 48823

  ¥ Mid-Peninsula Free U-1060 El Camino Real, Menlo Park, California
94015

  ¥ Minnesota Free U-1817 S. 3rd St., Minneapolis, Minnesota 55404

  ¥ Monterey Peninsula Free U-2120 Etna Place, Monterey, California

New Free U-Box ALL 303, Santa Barbara, California 93107

  ¥ Northwest Free U-Box 1255, Bellingham, Washington 98225

  ¥ Ohio-Wesleyan Free U-Box 47-Welsh Hall, Ohio Wesleyan University,
Delevan, Ohio 43015   ¥ Pittsburgh Free U-4401 Fifth Ave., Pittsburgh,
Pennsylvania 15213Rutgers Free U-Rutgers   College, Student Center, 1
Lincoln Ave., Newark, NJ 07102

  ¥ St. Louis Free U-c/o Student Congress, 3rd floor BMC, St. Louis
University, St. Louis,Missouri 63103

  ¥ San Luis Obispo Free U-Box 1305, San Luis Obispo, California 94301

  ¥ Santa Cruz Free U-604 River St., Santa Cruz, California 95060

  ¥ Seattle Free U-4144¸ University Way NE, Seattle, Washington 98105 ¥
Southern Illinois Free U-Carbondale, Illinois 62901

  ¥ Valley Free U-2045 N. Wishon Ave., Fresno, California 93704

  ¥ Washington Area Free U-5519 Prospect Place, Chevy Chase, Maryland
20015 and 1854 Park Rd. NW, Washington, D.C. 20010

  ¥ Wayne-Locke Free U-Student Congress, University of Texas, Arlington,
Texas 76010

  And a complete list of experimental schools, free universities, free
schools, can be obtained by sending one dollar to ALTERNATIVES! 1526
Gravenstein Highway N., Sebastopol, California 97452, and requesting the
Directory of Free Schools.


- Original Message -
From: "Tim Shadel" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 1:47 AM
Subject: Re: Does a degree matter?


> Craig R. McClanahan wrote:
> >   Any specific
> >   technology you learn in your first year is going to be totally
> >   obsolete by the time you graduate from the pr

RE: design question about action chaining

Filters are one of the design/imp choices I've considered under the
'parallel system' heading, though I hadn't thought of trying to use the
web.xml for this.  I'd have to look into these more.

I take it you recomending that a second, parallel system of specifying
functionality on a per-page or per-page-set basis is the way to go?

What reasons would you have for this design choice, as opposed to extending
struts to contain this functionality?

Have you (or others,) implemented something similar to this?

(This port is going to be a large chunk of time and I'm just trying to find
out if other people have already thought through and implemented this type
of functionality before I just pick something, run with it, and end up with
some kind of maintenance or design nightmare :-)

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: design question about action chaining


I think Filters would be a good choice for your needs.  You can define a 
filter for each piece of logic and then configure them in web.xml for groups

of pages.  You'll need to put related pages in the same path scheme so that 
you can map a filter to the group instead of each page.

David



>From: Thorin Linderholm <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: design question about action chaining
>Date: Tue, 1 Apr 2003 11:30:39 -0800
>
>
>I have been tasked with porting an existing web application with it's own
>proprietary controller architecture to using Struts.
>
>As they are both web controller architectures, they have many similarities,
>but I'm running into one difference in overall architecture that I'm having
>difficulty resolving.
>
>This difficulty is most closely related to the 'action chaining' posts I've
>been able to find in the mailing list archives.
>
>Specifically, I have over 400 pages mapped to various actions (our
>controller calls them that, and they're roughly synonymous with struts
>actions.)  However, our controller allows specifying a list of actions to
>execute on a per-page, and per-page-set basis.  In other words, we can
>assign an action like 'Ensure Session initialization has been
>completed/Initialize session' to every page in the site with a single
>mapping (assuming you've already listed all the pages.)  Or you can assign
>it to 90% of your pages if you happen to desire.  We have approximatly ten
>actions that happen on between 60-99% of the pages on our site.  If we were
>to directly translate this to the struts mapping system we would end up
>having to re-specify those ten actions on most of those 400+ pages, 
>creating
>long action chains for each page (a whole lot of duplication: hard to
>maintain, easy to get wrong, etc.)
>
>So, conceptually, I want to be able to apply a few different bits of logic
>to whole sets of pages.  Some of those 'bits of logic' (actions if you
>will,) interrupt the process and forward to a different page (page access
>rules for instance.)
>
>There are several possible solutions that I've come up with, but so far all
>of them involve either hacks, extending struts (which happens to partialy
>eliminate the reason I'm being required to move to Struts, and so isn't 
>very
>favored by my supperiors,) some complicated java inheritance hierarchy 
>where
>I inherit non-related functionality in those ten actions into a set of
>compound actions, each inheriting in the set of functionality we want
>(lame,) or I could implement a 'view preprocessor' of some kind that
>parallels the struts-config and defines processing that I need to do for
>each view page (which requires me to have two completely redundant sets of
>page mappings, and apears to me to obsolete the need for Struts in the 
>first
>place (if we were to ignore it's tag libraries and other helper classes
>which we also already have proprietary equivalents to.)
>
>I'd love to hear from anyone about other possibilities, or (even better,)
>pointers to somebody/some package already solving this problem.
>
>Another way to look at the whole thing:  How have other people solved the
>problem of being able to apply a set of page access rules to arbitrary sets
>of pages without having to create a system parallel to struts that
>re-defines every page in the application?  Or do people consider a parallel
>system that respecifies every page as the proper design?
>
>Thorin
>
>
>-
>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-mai

RE: design question about action chaining

I had come to the conclusion that Struts Actions are moreover 'View Adapter
Components' or "VAC's" (you can quote me on that one!) and should not be
relied on for handling business logic or data collection by any means, just
as a facsimile for "pulling" model/controller data into the view.

I wrote a logical framework that runs under the same premise as Ant's
targets and depends attributes (storingUser depends on validateUser).  My
LogicalAction class allowed properties to be set through normal means with
the struts-config w/ a plugin too, that would have a comma delimited list of
'modules' to execute.  Using the Filter Pattern and FilterChain-type object,
LogicalActions are provided with an executeLogic() method that throws an
exception.

So basically, your struts-config defines the "controller" calls per action,
but the controllers are actually referenced in a separate document that
defines their dependency.  Keeping your business logic separate, you may
want to create a separate DTO object that wraps the http request, much like
torque uses.

BTW, only after writing this framework did I see that turbine has this
framework already built with valves and pipelines:

http://jakarta.apache.org/turbine/turbine-3/pipeline.html


-Jacob


| -Original Message-
| From: Thorin Linderholm [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, April 01, 2003 1:31 PM
| To: '[EMAIL PROTECTED]'
| Subject: design question about action chaining
| 
| 
| I have been tasked with porting an existing web application with it's own
| proprietary controller architecture to using Struts.
| 
| As they are both web controller architectures, they have many
| similarities,
| but I'm running into one difference in overall architecture that I'm
| having
| difficulty resolving.
| 
| This difficulty is most closely related to the 'action chaining' posts
| I've
| been able to find in the mailing list archives.
| 
| Specifically, I have over 400 pages mapped to various actions (our
| controller calls them that, and they're roughly synonymous with struts
| actions.)  However, our controller allows specifying a list of actions to
| execute on a per-page, and per-page-set basis.  In other words, we can
| assign an action like 'Ensure Session initialization has been
| completed/Initialize session' to every page in the site with a single
| mapping (assuming you've already listed all the pages.)  Or you can assign
| it to 90% of your pages if you happen to desire.  We have approximatly ten
| actions that happen on between 60-99% of the pages on our site.  If we
| were
| to directly translate this to the struts mapping system we would end up
| having to re-specify those ten actions on most of those 400+ pages,
| creating
| long action chains for each page (a whole lot of duplication: hard to
| maintain, easy to get wrong, etc.)
| 
| So, conceptually, I want to be able to apply a few different bits of logic
| to whole sets of pages.  Some of those 'bits of logic' (actions if you
| will,) interrupt the process and forward to a different page (page access
| rules for instance.)
| 
| There are several possible solutions that I've come up with, but so far
| all
| of them involve either hacks, extending struts (which happens to partialy
| eliminate the reason I'm being required to move to Struts, and so isn't
| very
| favored by my supperiors,) some complicated java inheritance hierarchy
| where
| I inherit non-related functionality in those ten actions into a set of
| compound actions, each inheriting in the set of functionality we want
| (lame,) or I could implement a 'view preprocessor' of some kind that
| parallels the struts-config and defines processing that I need to do for
| each view page (which requires me to have two completely redundant sets of
| page mappings, and apears to me to obsolete the need for Struts in the
| first
| place (if we were to ignore it's tag libraries and other helper classes
| which we also already have proprietary equivalents to.)
| 
| I'd love to hear from anyone about other possibilities, or (even better,)
| pointers to somebody/some package already solving this problem.
| 
| Another way to look at the whole thing:  How have other people solved the
| problem of being able to apply a set of page access rules to arbitrary
| sets
| of pages without having to create a system parallel to struts that
| re-defines every page in the application?  Or do people consider a
| parallel
| system that respecifies every page as the proper design?
| 
| Thorin
| 
| 
| -
| 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: design question about action chaining

The static method you suggest would be very cumbersome to implement and
maintain, requiring hard-coding calls to each bit of functionality I wanted
on each page (aghh!)  But thanks for the reply :-)

I have to disagree that 'If they are a business tier concept, Struts should
have nothing to do with 
chaining them.'

The struts ActionServlet and the page mappings in the struts-config are the
'controller' portion of Struts.  The whole of Struts is much more than the
'C' in MVC.  It has taglibs for supporting the V, and actions are in fact
always implementing buisness logic (they decide what page to go to by
returning a 'forward': definite buisness logic, if there is such a thing.)
And that's always been a gray area in MVC for me: does all the buisness
logic belong in the model, or can it also go in the controller?  Or is there
an MVCC where there is a 'view' controller and 'buisness' controller (which
seems a bit redundant to me.)



-Original Message-
From: Paul Yunusov [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:43 AM
To: Struts Users Mailing List
Subject: Re: design question about action chaining


On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
> I have been tasked with porting an existing web application with it's own
> proprietary controller architecture to using Struts.
>
> As they are both web controller architectures, they have many
similarities,
> but I'm running into one difference in overall architecture that I'm
having
> difficulty resolving.
>
> This difficulty is most closely related to the 'action chaining' posts
I've
> been able to find in the mailing list archives.
>
> Specifically, I have over 400 pages mapped to various actions (our
> controller calls them that, and they're roughly synonymous with struts
> actions.)  However, our controller allows specifying a list of actions to
> execute on a per-page, and per-page-set basis.  In other words, we can
> assign an action like 'Ensure Session initialization has been
> completed/Initialize session' to every page in the site with a single
> mapping (assuming you've already listed all the pages.)  Or you can assign
> it to 90% of your pages if you happen to desire.  We have approximatly ten
> actions that happen on between 60-99% of the pages on our site.  If we
were
> to directly translate this to the struts mapping system we would end up
> having to re-specify those ten actions on most of those 400+ pages,
> creating long action chains for each page (a whole lot of duplication:
hard
> to maintain, easy to get wrong, etc.)
>
> So, conceptually, I want to be able to apply a few different bits of logic
> to whole sets of pages.  Some of those 'bits of logic' (actions if you
> will,) interrupt the process and forward to a different page (page access
> rules for instance.)
>
> There are several possible solutions that I've come up with, but so far
all
> of them involve either hacks, extending struts (which happens to partialy
> eliminate the reason I'm being required to move to Struts, and so isn't
> very favored by my supperiors,) some complicated java inheritance
hierarchy
> where I inherit non-related functionality in those ten actions into a set
> of compound actions, each inheriting in the set of functionality we want
> (lame,) or I could implement a 'view preprocessor' of some kind that
> parallels the struts-config and defines processing that I need to do for
> each view page (which requires me to have two completely redundant sets of
> page mappings, and apears to me to obsolete the need for Struts in the
> first place (if we were to ignore it's tag libraries and other helper
> classes which we also already have proprietary equivalents to.)
>
> I'd love to hear from anyone about other possibilities, or (even better,)
> pointers to somebody/some package already solving this problem.
>
> Another way to look at the whole thing:  How have other people solved the
> problem of being able to apply a set of page access rules to arbitrary
sets
> of pages without having to create a system parallel to struts that
> re-defines every page in the application?  Or do people consider a
parallel
> system that respecifies every page as the proper design?
>
> Thorin


Ever thought of defining functionality equivalent to your proprietory 
"actions" in classes that don't extend the Struts framework and chaining 
calls to instances of these classes in your Struts Actions?

This is a static solution as opposed to having struts-config.xml support
some 
sort of action chaining tags but Struts Actions are only HTTP adapters, and 
chaining them violates the spirit of the framework. That's why I think 
implementing "chaining" with non-Struts classes is a better idea.

Your  "actions" seem to be pretty fine-grained ("Ensure Session
initialization 
has been completed/Initialize session"). If session in this case refers to 
the HttpSession, then they are almost as low-level as the Servlet API
(why?). 
If they are a business tier concep

Re: design question about action chaining

I think Filters would be a good choice for your needs.  You can define a 
filter for each piece of logic and then configure them in web.xml for groups 
of pages.  You'll need to put related pages in the same path scheme so that 
you can map a filter to the group instead of each page.

David



From: Thorin Linderholm <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: design question about action chaining
Date: Tue, 1 Apr 2003 11:30:39 -0800
I have been tasked with porting an existing web application with it's own
proprietary controller architecture to using Struts.
As they are both web controller architectures, they have many similarities,
but I'm running into one difference in overall architecture that I'm having
difficulty resolving.
This difficulty is most closely related to the 'action chaining' posts I've
been able to find in the mailing list archives.
Specifically, I have over 400 pages mapped to various actions (our
controller calls them that, and they're roughly synonymous with struts
actions.)  However, our controller allows specifying a list of actions to
execute on a per-page, and per-page-set basis.  In other words, we can
assign an action like 'Ensure Session initialization has been
completed/Initialize session' to every page in the site with a single
mapping (assuming you've already listed all the pages.)  Or you can assign
it to 90% of your pages if you happen to desire.  We have approximatly ten
actions that happen on between 60-99% of the pages on our site.  If we were
to directly translate this to the struts mapping system we would end up
having to re-specify those ten actions on most of those 400+ pages, 
creating
long action chains for each page (a whole lot of duplication: hard to
maintain, easy to get wrong, etc.)

So, conceptually, I want to be able to apply a few different bits of logic
to whole sets of pages.  Some of those 'bits of logic' (actions if you
will,) interrupt the process and forward to a different page (page access
rules for instance.)
There are several possible solutions that I've come up with, but so far all
of them involve either hacks, extending struts (which happens to partialy
eliminate the reason I'm being required to move to Struts, and so isn't 
very
favored by my supperiors,) some complicated java inheritance hierarchy 
where
I inherit non-related functionality in those ten actions into a set of
compound actions, each inheriting in the set of functionality we want
(lame,) or I could implement a 'view preprocessor' of some kind that
parallels the struts-config and defines processing that I need to do for
each view page (which requires me to have two completely redundant sets of
page mappings, and apears to me to obsolete the need for Struts in the 
first
place (if we were to ignore it's tag libraries and other helper classes
which we also already have proprietary equivalents to.)

I'd love to hear from anyone about other possibilities, or (even better,)
pointers to somebody/some package already solving this problem.
Another way to look at the whole thing:  How have other people solved the
problem of being able to apply a set of page access rules to arbitrary sets
of pages without having to create a system parallel to struts that
re-defines every page in the application?  Or do people consider a parallel
system that respecifies every page as the proper design?
Thorin

-
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: Why is generateToken() "protected"?

On Tuesday 01 April 2003 02:45 pm, David Graham wrote:
> The Action class' token methods are moving to RequestUtils in 1.2 to allow
> the RequestProcessor to use them.  Your classes can then use the token
> methods as well.
>
> David

Good news!

Paul




>
>
>
> From: Paul Yunusov <[EMAIL PROTECTED]>
>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Why is generateToken() "protected"?
> >Date: Tue, 1 Apr 2003 14:21:14 -0500
> >
> >I think at least one reason is the wish to separate the business tier from
> >the
> >Struts API as in "the business tier shall not call Struts methods" mantra.
> >Besides, generateToken() seems to be meant for collaboration with Struts
> >tags. However, the cost of this decision is that direct extensibility
> >options
> >are limited to inheritance, and, in some cases, this is a tangible cost.
> >
> >For example, I use a helper class for defining functionality common to
> >multiple actions instead of using a custom superclass that extends Action.
> >The helper class doesn't extend Action and it can be designed for
> >composition
> >or based on static methods. I also do not use any Struts tag libraries,
> >however, my helper class does need to generate a token for form workflow
> >control, for which generateToken() is useful.
> >
> >The problem is generateToken() is not accessible outside of the Struts
> >Action
> >heirarchy, and that seems to be based on an assumption that Struts users
> >will
> >rely largle on inheritance to extend the framework, or, at least, it seems
> >inheritance is very encouraged. I can create a wrapper around Action with
> > a public method calling generateToken() and beat the inheritance
> > assumption but
> >I don't like fighting with frameworks.
> >
> >generateToken() especially, can be useful outside the Struts Action+tags
> >model
> >so are there any reasons to keep generateToken() "protected" and is the
> >separation of the Struts API from the business tier a strong enough reason
> >in
> >this case?
> >
> >Paul
> >
> >-
> >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: Why is generateToken() "protected"?

The Action class' token methods are moving to RequestUtils in 1.2 to allow 
the RequestProcessor to use them.  Your classes can then use the token 
methods as well.

David



From: Paul Yunusov <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Why is generateToken() "protected"?
Date: Tue, 1 Apr 2003 14:21:14 -0500
I think at least one reason is the wish to separate the business tier from 
the
Struts API as in "the business tier shall not call Struts methods" mantra.
Besides, generateToken() seems to be meant for collaboration with Struts
tags. However, the cost of this decision is that direct extensibility 
options
are limited to inheritance, and, in some cases, this is a tangible cost.

For example, I use a helper class for defining functionality common to
multiple actions instead of using a custom superclass that extends Action.
The helper class doesn't extend Action and it can be designed for 
composition
or based on static methods. I also do not use any Struts tag libraries,
however, my helper class does need to generate a token for form workflow
control, for which generateToken() is useful.

The problem is generateToken() is not accessible outside of the Struts 
Action
heirarchy, and that seems to be based on an assumption that Struts users 
will
rely largle on inheritance to extend the framework, or, at least, it seems
inheritance is very encouraged. I can create a wrapper around Action with a
public method calling generateToken() and beat the inheritance assumption 
but
I don't like fighting with frameworks.

generateToken() especially, can be useful outside the Struts Action+tags 
model
so are there any reasons to keep generateToken() "protected" and is the
separation of the Struts API from the business tier a strong enough reason 
in
this case?

Paul

-
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: Netscape 4.7 & disable fields

You could also have an onfocus event handler that calls blur() on the field
or sets focus to the next field. They can't change the field if they can't
put the cursor in it. This affects tabbing from field to field.


 -Original Message-
From:   Moore, Scott R. [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, April 01, 2003 11:26 AM
To: 'Struts Users Mailing List'
Subject:RE: Netscape 4.7 & disable fields


Potential workaround to keep those 3 ns4 users happy (actually i think
there's more like 7):

- Clicking the button sets a Javascript variable "disableTextBoxes" to true
- The textboxes have an onchange function that:
- if disableTextBoxes is false, it stores the textbox value in an array
- if disableTextBoxes is true, it changes the textbox value back to the
previous value saved in the array

So when disableTextBoxes is true, the user could edit the field value, but
as soon as the focus leaves that field it will change back to its orig
value--it's in effect uneditable.

A nice extra touch would be to have an onfocus handler in the textboxes that
calls a function tellUserIfDisabled().  tellUserIfDisabled() checks
disableTextBoxes, and if it is true, shows them an alert saying that they
shouldn't change the value in that textbox.

It's a total hack but having had to work with NS 4.7 before I got used to
doing such things...  ugh.

HTH,
Scott.

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:06 PM
To: Struts Users Mailing List
Subject: Re: Netscape 4.7 & disable fields


A couple of years back i had to get disabled form element behaviour 
working on ns4 and used dynamically gnerated and positioned divs with a 
tranparent image to cover the elements ... But i think its very silly 
and a waste of time.

It quite a lot of dhtml fiddlyness for all 3 ns4 users.. :)

Lunedì, 31 mar 2003, alle 18:19 Europe/Rome, James Mitchell ha scritto:

> On Mon, 2003-03-31 at 11:12, Gus Delgado wrote:
>> Has anyone run with his/her Struts application and Nestcape 4.7. I 
>> have
>> a few textfields that once a button is click the text field go from
>> being enable to disable (read-only) it works great on IE 5.5 and
>> Netscape 6.0 but it seems that Netscape 4.7 does not understand the
>> disable=true attribute.  Any ideas?
>
> Netscape 4.x does not support disabled fields.
> If you must support that browser version, use html:hidden with the 
> write
> option:
>  http://jakarta.apache.org/struts/userGuide/struts-html.html#hidden
>
>>
>> Thanks
>> Gus
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
>
>
>
>
> -
> 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: design question about action chaining

On Tuesday 01 April 2003 02:30 pm, Thorin Linderholm wrote:
> I have been tasked with porting an existing web application with it's own
> proprietary controller architecture to using Struts.
>
> As they are both web controller architectures, they have many similarities,
> but I'm running into one difference in overall architecture that I'm having
> difficulty resolving.
>
> This difficulty is most closely related to the 'action chaining' posts I've
> been able to find in the mailing list archives.
>
> Specifically, I have over 400 pages mapped to various actions (our
> controller calls them that, and they're roughly synonymous with struts
> actions.)  However, our controller allows specifying a list of actions to
> execute on a per-page, and per-page-set basis.  In other words, we can
> assign an action like 'Ensure Session initialization has been
> completed/Initialize session' to every page in the site with a single
> mapping (assuming you've already listed all the pages.)  Or you can assign
> it to 90% of your pages if you happen to desire.  We have approximatly ten
> actions that happen on between 60-99% of the pages on our site.  If we were
> to directly translate this to the struts mapping system we would end up
> having to re-specify those ten actions on most of those 400+ pages,
> creating long action chains for each page (a whole lot of duplication: hard
> to maintain, easy to get wrong, etc.)
>
> So, conceptually, I want to be able to apply a few different bits of logic
> to whole sets of pages.  Some of those 'bits of logic' (actions if you
> will,) interrupt the process and forward to a different page (page access
> rules for instance.)
>
> There are several possible solutions that I've come up with, but so far all
> of them involve either hacks, extending struts (which happens to partialy
> eliminate the reason I'm being required to move to Struts, and so isn't
> very favored by my supperiors,) some complicated java inheritance hierarchy
> where I inherit non-related functionality in those ten actions into a set
> of compound actions, each inheriting in the set of functionality we want
> (lame,) or I could implement a 'view preprocessor' of some kind that
> parallels the struts-config and defines processing that I need to do for
> each view page (which requires me to have two completely redundant sets of
> page mappings, and apears to me to obsolete the need for Struts in the
> first place (if we were to ignore it's tag libraries and other helper
> classes which we also already have proprietary equivalents to.)
>
> I'd love to hear from anyone about other possibilities, or (even better,)
> pointers to somebody/some package already solving this problem.
>
> Another way to look at the whole thing:  How have other people solved the
> problem of being able to apply a set of page access rules to arbitrary sets
> of pages without having to create a system parallel to struts that
> re-defines every page in the application?  Or do people consider a parallel
> system that respecifies every page as the proper design?
>
> Thorin


Ever thought of defining functionality equivalent to your proprietory 
"actions" in classes that don't extend the Struts framework and chaining 
calls to instances of these classes in your Struts Actions?

This is a static solution as opposed to having struts-config.xml support some 
sort of action chaining tags but Struts Actions are only HTTP adapters, and 
chaining them violates the spirit of the framework. That's why I think 
implementing "chaining" with non-Struts classes is a better idea.

Your  "actions" seem to be pretty fine-grained ("Ensure Session initialization 
has been completed/Initialize session"). If session in this case refers to 
the HttpSession, then they are almost as low-level as the Servlet API (why?). 
If they are a business tier concept, Struts should have nothing to do with 
chaining them.

Paul

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



RE: OnMouseOut

I haven't used StrutsMenu so these are just suggestions:

1. Do you have JavaScript enabled?
2. Should "location=javascript:..." be "href=javascript:...", if not in the
tag at least when the html is rendered. You probably don't need the
"javascript:".
3. Is the tag rendering the html event names in all lowercase? It should be,
proper-cased event names are not supported in all browsers.
4. Have you tried with a different web browser?
5. Are you properly delimiting any nested double and single quotes?
6. Try setting onmouseout="alert('mouse out fired');"
7. Is the method you're calling returning true or false? This affects what
the browser does when you click on the link.


 -Original Message-
From:   Raible, Matt [mailto:[EMAIL PROTECTED] 
Sent:   Tuesday, April 01, 2003 10:22 AM
To: 'Struts Users Mailing List'
Subject:RE: OnMouseOut

Try the struts-menu user list.  I didn't write this displayer, but I'm
guessing it doesn't support these attributes.

Matt

> -Original Message-
> From: Alessio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 5:33 AM
> To: Struts User
> Subject: OnMouseOut
> 
> 
> Hi, i' ve a problem with StrutsMenu...how use OnMouseOut with
> StrutsMenu? i try in this way:
> 
> 
>location="javascript:document.forms.MyForm.submit()"
> OnMouseOut="...OnMouseOut"  OnMouseOver="...OnMouseOver..."   />
> 
> 
> in this example i use an SimpleMenuDisplayer for render it and an form
> for submit my information...but the OnMouseOver and OnMouseOut don't
> work...whi?
> 
> Thanks in advance.
> Alessio
> 


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



design question about action chaining


I have been tasked with porting an existing web application with it's own
proprietary controller architecture to using Struts.

As they are both web controller architectures, they have many similarities,
but I'm running into one difference in overall architecture that I'm having
difficulty resolving.

This difficulty is most closely related to the 'action chaining' posts I've
been able to find in the mailing list archives.

Specifically, I have over 400 pages mapped to various actions (our
controller calls them that, and they're roughly synonymous with struts
actions.)  However, our controller allows specifying a list of actions to
execute on a per-page, and per-page-set basis.  In other words, we can
assign an action like 'Ensure Session initialization has been
completed/Initialize session' to every page in the site with a single
mapping (assuming you've already listed all the pages.)  Or you can assign
it to 90% of your pages if you happen to desire.  We have approximatly ten
actions that happen on between 60-99% of the pages on our site.  If we were
to directly translate this to the struts mapping system we would end up
having to re-specify those ten actions on most of those 400+ pages, creating
long action chains for each page (a whole lot of duplication: hard to
maintain, easy to get wrong, etc.)

So, conceptually, I want to be able to apply a few different bits of logic
to whole sets of pages.  Some of those 'bits of logic' (actions if you
will,) interrupt the process and forward to a different page (page access
rules for instance.)

There are several possible solutions that I've come up with, but so far all
of them involve either hacks, extending struts (which happens to partialy
eliminate the reason I'm being required to move to Struts, and so isn't very
favored by my supperiors,) some complicated java inheritance hierarchy where
I inherit non-related functionality in those ten actions into a set of
compound actions, each inheriting in the set of functionality we want
(lame,) or I could implement a 'view preprocessor' of some kind that
parallels the struts-config and defines processing that I need to do for
each view page (which requires me to have two completely redundant sets of
page mappings, and apears to me to obsolete the need for Struts in the first
place (if we were to ignore it's tag libraries and other helper classes
which we also already have proprietary equivalents to.)

I'd love to hear from anyone about other possibilities, or (even better,)
pointers to somebody/some package already solving this problem.

Another way to look at the whole thing:  How have other people solved the
problem of being able to apply a set of page access rules to arbitrary sets
of pages without having to create a system parallel to struts that
re-defines every page in the application?  Or do people consider a parallel
system that respecifies every page as the proper design?

Thorin


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



RE: How does Struts handle A list attribute in an AcitonForm

This actual helps me we another problem I had not found until I thought
through my order process.  

Thanks, 

Jamie Cruz
Software Engineering 
[EMAIL PROTECTED] 
(301)688-1430 





-Original Message-
From: Ian Hunter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:59 PM
To: Struts Users Mailing List
Subject: Re: How does Struts handle A list attribute in an AcitonForm


What I've done in the past is something like this -- first, I try to always
use DynaActionForms.  In my struts-config file I'd declare something like


  
  
  
  
  
  
  


elsewhere I have PersonBean defined to have firstName, lastName, etc. as
strings;

Then in my JSP it looks like:


  
Address:
 
 ,   
Home Phone: 


First NameLast NameCellWork












And in the corresponding Action it looks like

try {
HouseholdView hv = DataStore.getNewHouseholdView();
hv.setAddress1 (dynaForm.get("address1").toString());
hv.setAddress2 (dynaForm.get("address2").toString());
hv.setCity (dynaForm.get("city").toString());
hv.setState (dynaForm.get("state").toString());
hv.setZip (dynaForm.get("zip").toString());
hv.setPhoneHome (dynaForm.get("phoneHome").toString());
Integer fkHousehold = hv.add();

for (int i = 0; i < Constants.MAXFAMILYMEMBERSFORADD; i++) {
if (!((PersonBean)dynaForm.get("family",
i)).getFirstName().equals("")) { // is this entry filled in?
MemberView mv = DataStore.getNewMemberView();
mv.setFirstName (((PersonBean)dynaForm.get("family",
i)).getFirstName());
mv.setLastName (((PersonBean)dynaForm.get("family",
i)).getLastName());
mv.setPhoneCell(((PersonBean)dynaForm.get("family",
i)).getCellPhone());
mv.setPhoneWork (((PersonBean)dynaForm.get("family",
i)).getWorkPhone());
mv.setFkHousehold (fkHousehold);
Integer fkMember = DataStore.addMemberView (mv);
}
}
servlet.log(user.getName() + " added family");

Does that help?

- Original Message -
From: "Cruz, Edward J." <[EMAIL PROTECTED]>
To: "Struts-User List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 12:39 PM
Subject: How does Struts handle A list attribute in an AcitonForm


> Hi All,
>
> I have a question regarding an ActionForm.
>
> I have an ActionForm
>
> public class OrderForm extends ActionForm {
> String orderID;
> Header header;
> List items;
>
> }
>
> I have looked at the struts-exercise-taglib example and see how to display
> the items list via the logic-iterate tag.  My question is if I use this
form
> for a multi-page form where header information is filled in on one page
and
> submitted.  This forwards to a page which displays all the header
> information and a form which allows the user to add an item.  The form to
> add an item has several fields which are stored in an item which I need to
> store in the list as shown above.
>
> Do I need to have a single item which I access through the form as I
access
> the header then in an appropriate place add that item to the list for use
> later in a display or transfer to the business logic?
>
> For instance,
>
> public class OrderForm extends ActionForm {
> String orderID;
> Header header;
> Item tempItem;
> List items;
>
> }
>
> Then in my form to add an item to the order  I have the appropriate html
> text boxes... etc.  They will be access through the tempItem.id method.
> Then once the item passes validation I can add it to the list of items I
> will later display to the user?
>
> Jamie Cruz
> Software Engineering
> [EMAIL PROTECTED]
> (301)688-1430
>
>
>
>






> -
> 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: How does Struts handle A list attribute in an AcitonForm

The header and items are related to each other.  In the business validation
there are rules which require both to be present for validation and
therefore are in a single class in the business layer.  For the presentation
each page of the multi-page form must redisplay the information from the
previous page and for the items page we have to allow for the addition of as
many as 400 items to an order.  Therefore, I placed them in a single class
so that I didn't not have to have multiple beans in the session scope.  The
Order information, header and items make up the order as a hole.  

As for your solution it seems to me it is the same as I suggested with the
exception of removing the item from the orderForm form-bean and making it
its own.  Then creating another form-bean to hold the list of items which
needs to be displayed.  In our order everything must be displayed including
order information, header information and the list of items so that is why I
put them into one form-bean as opposed to several form-beans and this one
form-bean will stay in session scope.  

I was just trying to find out if there was a way to have the item form
submit and use the list of items as opposed to it's own form-bean or a
temporary field either of which would work.  

I have decided to go the separate form-bean route to separate the item
addition from the actual order.

Thanks,   

Jamie Cruz
Software Engineering 
[EMAIL PROTECTED] 
(301)688-1430 




-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 1:01 PM
To: Struts Users Mailing List
Subject: RE: How does Struts handle A list attribute in an AcitonForm


You don't have to create a tempItem to satisfy the needs of a form that
spans several pages. 

At the risk of digressing into a (lengthy) design discussion, why do you
have the header and items in a single class?  They seem unrelated and never
updated together.

Why not have a form-bean representing an Item?  On the page that the user
provides data for the item, use the Item form-bean.  So validation is
self-contained.  The processing of this could be something like:
* User submits values for an item
* server 
  * performs necessary validations
  * updates the list of items
* User is shown updated list

Now when the list is being displayed a different form-bean -- this one
containing a List of items -- is being used.

Am I missing the point?

Sri


-Original Message-
From: Cruz, Edward J. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2003 12:40 PM
To: Struts-User List
Subject: How does Struts handle A list attribute in an AcitonForm


Hi All, 

I have a question regarding an ActionForm.  

I have an ActionForm 

public class OrderForm extends ActionForm {
String orderID;
Header header;
List items;

}

I have looked at the struts-exercise-taglib example and see how to display
the items list via the logic-iterate tag.  My question is if I use this form
for a multi-page form where header information is filled in on one page and
submitted.  This forwards to a page which displays all the header
information and a form which allows the user to add an item.  The form to
add an item has several fields which are stored in an item which I need to
store in the list as shown above.  

Do I need to have a single item which I access through the form as I access
the header then in an appropriate place add that item to the list for use
later in a display or transfer to the business logic?  

For instance, 

public class OrderForm extends ActionForm {
String orderID;
Header header;
Item tempItem;
List items;

}

Then in my form to add an item to the order  I have the appropriate html
text boxes... etc.  They will be access through the tempItem.id method. Then
once the item passes validation I can add it to the list of items I will
later display to the user?

Jamie Cruz
Software Engineering 
[EMAIL PROTECTED] 
(301)688-1430 




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



Why is generateToken() "protected"?

I think at least one reason is the wish to separate the business tier from the 
Struts API as in "the business tier shall not call Struts methods" mantra. 
Besides, generateToken() seems to be meant for collaboration with Struts 
tags. However, the cost of this decision is that direct extensibility options 
are limited to inheritance, and, in some cases, this is a tangible cost.

For example, I use a helper class for defining functionality common to 
multiple actions instead of using a custom superclass that extends Action. 
The helper class doesn't extend Action and it can be designed for composition 
or based on static methods. I also do not use any Struts tag libraries, 
however, my helper class does need to generate a token for form workflow 
control, for which generateToken() is useful.

The problem is generateToken() is not accessible outside of the Struts Action 
heirarchy, and that seems to be based on an assumption that Struts users will 
rely largle on inheritance to extend the framework, or, at least, it seems 
inheritance is very encouraged. I can create a wrapper around Action with a 
public method calling generateToken() and beat the inheritance assumption but 
I don't like fighting with frameworks.

generateToken() especially, can be useful outside the Struts Action+tags model 
so are there any reasons to keep generateToken() "protected" and is the 
separation of the Struts API from the business tier a strong enough reason in 
this case?

Paul

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



Re: A question

or using the scriptlet-free version




 .name



 


  <-- remove this unless you just want to print
it out on the page



--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org



- Original Message -
From: "Karr, David" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 11:14 AM
Subject: RE: A  question


> This might work:
>
> 
> 
> 
>
> > -Original Message-
> > From: Binaghi Mauro [mailto:[EMAIL PROTECTED]
> >
> > Hi
> > I have the "user.name" property in my "ApplicationResource.properties"
> > file.
> > Can I take its value with the following instrucition in my JSP page?
> >
> > 
> >  > %>.name"/>
> > 
> >
> > Of course, I call my JSP with this URI
> "/myPage.jsp?httpParameter=user"
>
> -
> 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] Is there a taglib documentation generator (Javadoc-like)?

I would just copy the relevant files and targets from the build.xml and
replicate it for your build.

Open the build.xml (from the source distribution) and take a look at
'compile.library' target and also the 'compile.website' target.

Just copy and change what you need.


--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org



- Original Message -
From: "Jorge Mascena" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 2:15 PM
Subject: RES: [OT] Is there a taglib documentation generator (Javadoc-like)?


> Could I get some references on how to do that? I would need to know the
> step-by-step to achieve a documentation similar to the struts taglibs'
> documentation.
>
> I'm developing a taglib and want my documentation to follow the struts
> standards.
>
> Thanks in advance and sorry for the inconvenience.
>
> Jorge Mascena
>
> > -Mensagem original-
> > De: James Mitchell [mailto:[EMAIL PROTECTED]
> > Enviada em: Tuesday, April 01, 2003 10:53 AM
> > Para: Struts Users Mailing List
> > Assunto: Re: [OT] Is there a taglib documentation generator
> > (Javadoc-like)?
> >
> >
> > On Tue, 2003-04-01 at 08:33, Jorge Mascena wrote:
> > > How are the taglibs' api references generated? I believe
> > there must be
> > > some sort of documentation generator, like javadoc, but I
> > can't seem
> > > to find it out.
> >
> > The taglib documentation is generated as part of the site documentaion
> > (userguide/faq/etc) from stylesheets (xsl) from the source
> > (xml) files.
> > Those same files are also what is used to generate the .tld
> > files for deployment.  So, basically, we keep the taglib
> > descriptors with the documentation.
> >
> > There was a recent addition to the contrib section which
> > (when configured to build) will generate a javadoc-like view
> > of the taglibs.
> > It also generates a grid view (matrix) of tags and their
> > attributes by package (shortname).  Very handy!!
> >
> >
> > >
> > > Jorge Mascena
> > >
> > >
> > >
> > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.open-tools.org
> >
> >
> >
> >
> > -
> > 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]



RES: [OT] Is there a taglib documentation generator (Javadoc-like)?

Could I get some references on how to do that? I would need to know the
step-by-step to achieve a documentation similar to the struts taglibs'
documentation.

I'm developing a taglib and want my documentation to follow the struts
standards.

Thanks in advance and sorry for the inconvenience.

Jorge Mascena

> -Mensagem original-
> De: James Mitchell [mailto:[EMAIL PROTECTED] 
> Enviada em: Tuesday, April 01, 2003 10:53 AM
> Para: Struts Users Mailing List
> Assunto: Re: [OT] Is there a taglib documentation generator 
> (Javadoc-like)?
> 
> 
> On Tue, 2003-04-01 at 08:33, Jorge Mascena wrote:
> > How are the taglibs' api references generated? I believe 
> there must be 
> > some sort of documentation generator, like javadoc, but I 
> can't seem 
> > to find it out.
> 
> The taglib documentation is generated as part of the site documentaion
> (userguide/faq/etc) from stylesheets (xsl) from the source 
> (xml) files. 
> Those same files are also what is used to generate the .tld 
> files for deployment.  So, basically, we keep the taglib 
> descriptors with the documentation.
> 
> There was a recent addition to the contrib section which 
> (when configured to build) will generate a javadoc-like view 
> of the taglibs. 
> It also generates a grid view (matrix) of tags and their 
> attributes by package (shortname).  Very handy!!
> 
> 
> > 
> > Jorge Mascena
> > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> 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]



Vlidation problem by using indexed="true" in

Hi

I am facing a problem with validation by using indexed="true" in ...

My form is AmountForm and here is the code

public class AmountForm extends ActionForm
{
private ArrayList amountVO = null;

public ArrayList getAmountVO()
{
return m_promiseToPay;
}

public void setAmountVO(ArrayList amountVO)
{
this.amountVO = amountVO;
}   
}

The arraylist in AmountForm.java contains the object of AmountVO. The AmountVO looks 
like

public class AmountVO
implements java.io.Serializable
{

private String   amount;
private String   date;

}

in the jsp i am iterating it like this




   





   







 


 
   





Here there is no problem in rendering the page ...I am able to see the 2 rows if the 
array list contains 2 AmountVO object.
Now the problem is, if i enter a new date value in "date",i want it to validate with 
validation.xml..

so i added an entry like this in validation.xml







even after entering this , I am not able to validate...

in the view source of the jsp i will see this codeyou can see the function 
required() is blank..

 

 


basically my problem is how will i validate a Form with listit is very urgent..
so any body can help me out...

Thanx in advance.

rgds
Guru

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



DynaActionForm with logic:present

Can I use  with DynaActionForm properties? 

If my form property is null, I don't want the property text box, to 
display in my jsp page. This works fine with an ActionForm, but using a 
DynaActionForm I get a blank text box for the property showing up. 

In the code below, the action's if-statement will not invoke, and the 
property value will not be set. Doesn't this mean that the property value 
should be null? And doesn't that mean that the  in the jsp 
should not invoke either? 

JSP contains (in part):

 

  

Action contains:

  DynaValidatorForm myForm = (DynaValidatorForm)form;
  if (false) { myForm.set("firstName", myBean.getFirstName); }

struts-config contains:

  

  

I haven't been able to find an example using this tag and this form type 
together. Can anyone please point me to an example of this? And, as usual, 
other suggestions and corrections to the above are greatly appreciated. 

Susan Bradeen
[EMAIL PROTECTED]

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



RE: Right way to extends Action

> -Original Message-
> From: V. Cekvenich [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 31, 2003 5:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Right way to extends Action
> > 
> > What about DispatchAction and LookupDispatchAction? Anyone 
> have a good
> > solution for reuse of common action logic across these 
> multiple action base
> > classes provided by Struts?
> > 
> 
> 
> I wrote my own dispatch:
> 
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/bP/
> WEB-INF/src/war/org/apache/scaffoldingLib/base/BaseAct.java
> 
> .V

I think this is the strategy I will be going with myself. Since we have the
source of these helper actions, I think it is cleaner to have common action
logic in one base action class of my own and then extend all my application
actions from this one base action class. I'm good at cut/paste. So, it is
easy to create my own versions from Struts sources for the helper classes
that extend from my own base action class. :-)

Still, that means I need to track changes made in these helper actions as
Struts improves over time. I would hate to miss out on any
refinements/improvements made over subsequent releases. Which is why I was
wondering if there was a better way that I am missing.

- Van <[EMAIL PROTECTED]>

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



[sslExt] Switching from HTTPS to HTTP and avoiding the "You are about to be redirected to a connection."

I'm using Struts1.1rc1 and sslExtRC1-2. BTW, thanks to
Steve for this package.

There is one caveat however...

If you submit a request to the server via HTTPS
and that request is redirected to HTTP before returning
to the client (server side code does a Response.sendRedirect() switching
the protocol from HTTPS to HTTP), then IE and NS7.x  display a pop-up
security alert.

I have found a work around to be to redirect to a page with
embedded logic to determine where to send the user and then
use the  to
redirect the user to the appropriate destination.

I don't currently see how the sslExt addresses this issue.

If it does, can someone please let me know how.


robert

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:17 PM
To: [EMAIL PROTECTED]
Subject: [sslEXt] You are about to be redirected to a connection which
is not secure


I am using Struts1.1rc1 with the sslExtRC1-2. My current requirements don't
allow me to have all requests go through the Struts Action servlet. (please
don't lecture me on the benefits of all requests going through the
controller...you're preachin' to the chior)

I have a situation where I need to provide a login form through out my site
on pages that are directly accessed via HTTP, although the action attribute
for the login form element on those pages is HTTPS (providing secure data
transport). Validation error or not, the user is always returned to the page
from which they signed in.

For MSIE and Netscape 7.02 this causes a "security" alert to pop-up.

MSIE:
"You are about to be redirected to a connection which
 is not secure. The information you are sending to the
 current site might be retransmitted to a nonsecure site.
 Do you wish to continue?"

Netscape 7.02:
"You have requested an encrypted page that contains some
 unencrypted information. Information that you see or enter
 on this page could easily be read by a third party."


I have found a work around to be to redirect to a page with
embedded logic to determine where to send the user and then
use the  to
redirect
the user to the appropriate destination.

This seems like such a hack and I was wondering if there is a cleaner
solution.


robert

BTW, I have searched the mailing list archives and Google and have yet to
find a cleaner (any) solution.


-
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: How does Struts handle A list attribute in an AcitonForm

You don't have to create a tempItem to satisfy the needs of a form that spans several 
pages. 

At the risk of digressing into a (lengthy) design discussion, why do you have the 
header and items in a single class?  They seem unrelated and never updated together.

Why not have a form-bean representing an Item?  On the page that the user provides 
data for the item, use the Item form-bean.  So validation is self-contained.  The 
processing of this could be something like:
* User submits values for an item
* server 
  * performs necessary validations
  * updates the list of items
* User is shown updated list

Now when the list is being displayed a different form-bean -- this one containing a 
List of items -- is being used.

Am I missing the point?

Sri


-Original Message-
From: Cruz, Edward J. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2003 12:40 PM
To: Struts-User List
Subject: How does Struts handle A list attribute in an AcitonForm


Hi All, 

I have a question regarding an ActionForm.  

I have an ActionForm 

public class OrderForm extends ActionForm {
String orderID;
Header header;
List items;

}

I have looked at the struts-exercise-taglib example and see how to display the items 
list via the logic-iterate tag.  My question is if I use this form for a multi-page 
form where header information is filled in on one page and submitted.  This forwards 
to a page which displays all the header information and a form which allows the user 
to add an item.  The form to add an item has several fields which are stored in an 
item which I need to store in the list as shown above.  

Do I need to have a single item which I access through the form as I access the header 
then in an appropriate place add that item to the list for use later in a display or 
transfer to the business logic?  

For instance, 

public class OrderForm extends ActionForm {
String orderID;
Header header;
Item tempItem;
List items;

}

Then in my form to add an item to the order  I have the appropriate html text boxes... 
etc.  They will be access through the tempItem.id method. Then once the item passes 
validation I can add it to the list of items I will later display to the user?

Jamie Cruz
Software Engineering 
[EMAIL PROTECTED] 
(301)688-1430 




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



Re: How does Struts handle A list attribute in an AcitonForm

What I've done in the past is something like this -- first, I try to always
use DynaActionForms.  In my struts-config file I'd declare something like


  
  
  
  
  
  
  


elsewhere I have PersonBean defined to have firstName, lastName, etc. as
strings;

Then in my JSP it looks like:


  
Address:
 
 ,   
Home Phone: 


First NameLast NameCellWork












And in the corresponding Action it looks like

try {
HouseholdView hv = DataStore.getNewHouseholdView();
hv.setAddress1 (dynaForm.get("address1").toString());
hv.setAddress2 (dynaForm.get("address2").toString());
hv.setCity (dynaForm.get("city").toString());
hv.setState (dynaForm.get("state").toString());
hv.setZip (dynaForm.get("zip").toString());
hv.setPhoneHome (dynaForm.get("phoneHome").toString());
Integer fkHousehold = hv.add();

for (int i = 0; i < Constants.MAXFAMILYMEMBERSFORADD; i++) {
if (!((PersonBean)dynaForm.get("family",
i)).getFirstName().equals("")) { // is this entry filled in?
MemberView mv = DataStore.getNewMemberView();
mv.setFirstName (((PersonBean)dynaForm.get("family",
i)).getFirstName());
mv.setLastName (((PersonBean)dynaForm.get("family",
i)).getLastName());
mv.setPhoneCell(((PersonBean)dynaForm.get("family",
i)).getCellPhone());
mv.setPhoneWork (((PersonBean)dynaForm.get("family",
i)).getWorkPhone());
mv.setFkHousehold (fkHousehold);
Integer fkMember = DataStore.addMemberView (mv);
}
}
servlet.log(user.getName() + " added family");

Does that help?

- Original Message -
From: "Cruz, Edward J." <[EMAIL PROTECTED]>
To: "Struts-User List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 12:39 PM
Subject: How does Struts handle A list attribute in an AcitonForm


> Hi All,
>
> I have a question regarding an ActionForm.
>
> I have an ActionForm
>
> public class OrderForm extends ActionForm {
> String orderID;
> Header header;
> List items;
>
> }
>
> I have looked at the struts-exercise-taglib example and see how to display
> the items list via the logic-iterate tag.  My question is if I use this
form
> for a multi-page form where header information is filled in on one page
and
> submitted.  This forwards to a page which displays all the header
> information and a form which allows the user to add an item.  The form to
> add an item has several fields which are stored in an item which I need to
> store in the list as shown above.
>
> Do I need to have a single item which I access through the form as I
access
> the header then in an appropriate place add that item to the list for use
> later in a display or transfer to the business logic?
>
> For instance,
>
> public class OrderForm extends ActionForm {
> String orderID;
> Header header;
> Item tempItem;
> List items;
>
> }
>
> Then in my form to add an item to the order  I have the appropriate html
> text boxes... etc.  They will be access through the tempItem.id method.
> Then once the item passes validation I can add it to the list of items I
> will later display to the user?
>
> Jamie Cruz
> Software Engineering
> [EMAIL PROTECTED]
> (301)688-1430
>
>
>
>






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

Mark Lowe wrote:

Anyone got any cunning suggestions/workarounds as to change property 
type in a  DynaBean?

I'm attempting to replace an int that has been created from a 
ResultSetDynaClass with a DynaBean, or other useful object

I do not fully understand your problem.  I had a problem where I wanted 
a replacement for java.sql.TimeStamp (to get a better toString) and I 
ended up in doing custom "constructor" and "copy-to-permanent-bean" 
methods, which was cumbersome and tedious.

So I basically get the fields of type java.sql.TimeStamp cast to another 
class, and the result of that entered in the permanent bean.

Is that what you need?

--
 Thorbjørn Ravn Andersen  Scandiatransplant
  Skejby Sygehus, indgang 3
 +45 89 49 53 01  DK-8200 Århus N
 http://biobase.dk/~tra 



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


How does Struts handle A list attribute in an AcitonForm

Hi All, 

I have a question regarding an ActionForm.  

I have an ActionForm 

public class OrderForm extends ActionForm {
String orderID;
Header header;
List items;

}

I have looked at the struts-exercise-taglib example and see how to display
the items list via the logic-iterate tag.  My question is if I use this form
for a multi-page form where header information is filled in on one page and
submitted.  This forwards to a page which displays all the header
information and a form which allows the user to add an item.  The form to
add an item has several fields which are stored in an item which I need to
store in the list as shown above.  

Do I need to have a single item which I access through the form as I access
the header then in an appropriate place add that item to the list for use
later in a display or transfer to the business logic?  

For instance, 

public class OrderForm extends ActionForm {
String orderID;
Header header;
Item tempItem;
List items;

}

Then in my form to add an item to the order  I have the appropriate html
text boxes... etc.  They will be access through the tempItem.id method.
Then once the item passes validation I can add it to the list of items I
will later display to the user?

Jamie Cruz
Software Engineering 
[EMAIL PROTECTED] 
(301)688-1430 



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

[OT] April Fools?


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

RE: Netscape 4.7 & disable fields


Potential workaround to keep those 3 ns4 users happy (actually i think
there's more like 7):

- Clicking the button sets a Javascript variable "disableTextBoxes" to true
- The textboxes have an onchange function that:
- if disableTextBoxes is false, it stores the textbox value in an array
- if disableTextBoxes is true, it changes the textbox value back to the
previous value saved in the array

So when disableTextBoxes is true, the user could edit the field value, but
as soon as the focus leaves that field it will change back to its orig
value--it's in effect uneditable.

A nice extra touch would be to have an onfocus handler in the textboxes that
calls a function tellUserIfDisabled().  tellUserIfDisabled() checks
disableTextBoxes, and if it is true, shows them an alert saying that they
shouldn't change the value in that textbox.

It's a total hack but having had to work with NS 4.7 before I got used to
doing such things...  ugh.

HTH,
Scott.

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:06 PM
To: Struts Users Mailing List
Subject: Re: Netscape 4.7 & disable fields


A couple of years back i had to get disabled form element behaviour 
working on ns4 and used dynamically gnerated and positioned divs with a 
tranparent image to cover the elements ... But i think its very silly 
and a waste of time.

It quite a lot of dhtml fiddlyness for all 3 ns4 users.. :)

Lunedì, 31 mar 2003, alle 18:19 Europe/Rome, James Mitchell ha scritto:

> On Mon, 2003-03-31 at 11:12, Gus Delgado wrote:
>> Has anyone run with his/her Struts application and Nestcape 4.7. I 
>> have
>> a few textfields that once a button is click the text field go from
>> being enable to disable (read-only) it works great on IE 5.5 and
>> Netscape 6.0 but it seems that Netscape 4.7 does not understand the
>> disable=true attribute.  Any ideas?
>
> Netscape 4.x does not support disabled fields.
> If you must support that browser version, use html:hidden with the 
> write
> option:
>  http://jakarta.apache.org/struts/userGuide/struts-html.html#hidden
>
>>
>> Thanks
>> Gus
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> -- 
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
>
>
>
>
> -
> 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: how to switch of logging with log4j at initialization



On Tue, 1 Apr 2003, Martin Monsorno wrote:

> Date: Tue, 01 Apr 2003 16:42:32 +0200
> From: Martin Monsorno <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "Niesen, Nathan" <[EMAIL PROTECTED]>
> Cc: 'Edgar Dollin' <[EMAIL PROTECTED]>,
>  'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: Re: how to switch of logging with log4j at initialization
>
> "Niesen, Nathan" <[EMAIL PROTECTED]> writes:
> > There is a bug in commons-logging 1.0.2+ that causes log4j to be used if
> > it's found in the classpath.  Just remove the log4j jar from your webapps
> > lib dir.
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17561
> >
> > There is also a bug in the commons-logging nightly build, which is what the
> > current Struts build uses, that causes the commons-logging.properties to be
> > ignored.
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17894
>
> As I wrote as an answer to Edgar Dollin, my problem is not that log4j
> is used, but that my log4j configuration seems to be not the only one
> used, as I set the logging for "com.apache" to a file with ERROR
> level, but the output for (some of?) the commons-classes is logged
> anyway to stdout.
>

Assuming that "com.apache" is not a typo, you might try "org.apache"
instead.

> --
> Martin

Craig

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



Re: Netscape 4.7 & disable fields

A couple of years back i had to get disabled form element behaviour 
working on ns4 and used dynamically gnerated and positioned divs with a 
tranparent image to cover the elements ... But i think its very silly 
and a waste of time.

It quite a lot of dhtml fiddlyness for all 3 ns4 users.. :)

Lunedì, 31 mar 2003, alle 18:19 Europe/Rome, James Mitchell ha scritto:

On Mon, 2003-03-31 at 11:12, Gus Delgado wrote:
Has anyone run with his/her Struts application and Nestcape 4.7. I 
have
a few textfields that once a button is click the text field go from
being enable to disable (read-only) it works great on IE 5.5 and
Netscape 6.0 but it seems that Netscape 4.7 does not understand the
disable=true attribute.  Any ideas?
Netscape 4.x does not support disabled fields.
If you must support that browser version, use html:hidden with the 
write
option:
 http://jakarta.apache.org/struts/userGuide/struts-html.html#hidden

Thanks
Gus
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org


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

On Tue, 01 Apr 2003 17:37:27 +0100
"Pat Quinn" <[EMAIL PROTECTED]> wrote:

> Has anyone tried using log4j-1.2.7.jar with Struts
> 
I use it.


-- 
Rick Reumann

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



RE: [log4j]

yup. no problems...

-Original Message-
From: Pat Quinn [mailto:[EMAIL PROTECTED]
Sent: April 01, 2003 11:37 AM
To: [EMAIL PROTECTED]
Subject: [log4j]


Has anyone tried using log4j-1.2.7.jar with Struts





_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Logic Tag - Type

We wish to develop a TILE that could render a typical table listing in our
application.
This TILE shall access a particular arraylist to display the table.
This arraylist shall be of different DTO's for different screens. I want to
pass the type of DTO to this TILE while I do 

inside my TILE I am trying to do the following:





 >
XXX


Above code does not work,
but If I remove type=<%= cType %>, it works fine

What shall I do to make it work ?




[log4j]

Has anyone tried using log4j-1.2.7.jar with Struts





_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Logic Tag - Type

We wish to develop a TILE that could render a typical table listing in our 
application. 
This TILE shall access a particular arraylist to display the table. 
This arraylist shall be of different DTO's for different screens. I want to pass the 
type of DTO to this TILE while I do 

inside my TILE I am trying to do the following:





 >
XXX


Above code does not work,
but If I remove type=<%= cType %>. What shall I do to make it work ?




[RESEND] : Error coming in AppLogin tag - CheckLogin.java - Sample mail application

Hi friends,
I am working on struts -1.1 rc and tomcat 4.0.6.
I have installed  mail registration application and it is working fine.
I can see all the pages properly.

However if I open a new browser window and type the URL direcly :-
http://localhost:8080/myExample/mainMenu.jsp

I get a null pointer. Ideally it should send me to the login page.


javax.servlet.ServletException: java.lang.NullPointerException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:343)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
Cont  
root cause
javax.servlet.jsp.JspException: java.lang.NullPointerException
at
org.apache.struts.webapp.example.CheckLogonTag.doEndTag(CheckLogonTag.java:185)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



I tried to debug and found that :
In the below method, in the request.getAttribute()
 
ModuleConfig config = (ModuleConfig) pageContext.getRequest()   
.getAttribute(org.apache.struts.Globals.MODULE_KEY);

The *attribute* is not available and hence the null pointer.

Pleaese suggest how can I have org.apache.struts.Globals.MODULE_KEY in
the request.


public int doEndTag() throws JspException {
// Is there a valid user logged on?
boolean valid = false;
HttpSession session = pageContext.getSession();
if ((session != null) && (session.getAttribute(name) != null))
valid = true;
// ERROR - null
System.out.println( "MODULE ~~ PC "+
pageContext.getRequest().getAttribute(org.apache.struts.Globals.MODULE_KEY); );
// Forward control based on the results
if (valid)
return (EVAL_PAGE);
else {
  ModuleConfig config = (ModuleConfig)
pageContext.getRequest()
.getAttribute(org.apache.struts.Globals.MODULE_KEY);
try {
pageContext.forward(config.getPrefix() + page);
} catch (Exception e) {
throw new JspException(e.toString());
}
return (SKIP_PAGE);
}
   }

Please suggest.
Thanks
Tapan



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



RE: [OT]Credit card processing

Thanks a lot
-Philip

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 01, 2003 5:21 AM
To: [EMAIL PROTECTED]
Subject: RE: [OT]Credit card processing

PayFlow PRO has a java API. What is wrong with that?
I looked at it and it looked _very_ easy.
I use PFP in my Miva storefront, and am about to use it in my new
application.

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 1:14 PM
To: Struts Users Mailing List
Subject: RE: [OT]Credit card processing


I use java API CyberSource provides:

http://www.cybersource.com/products_and_services/electronic_payments/credit_
card_processing/

We also ended up writing a thin wrapper to abstract the implementation.
In general it's been easy to use.

robert

> -Original Message-
> From: Jeff Caddel [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 31, 2003 10:27 PM
> To: Struts Users Mailing List
> Subject: Re: [OT]Credit card processing
>
>
> I use the java API Verisign provides:
> http://www.verisign.com/products/payflow/pro/PayFlowPro.pdf
>
> Their API is functional tho not exactly elegant.  I ended up putting a
> "payment services" layer in between our application code and the
> Verisign API calls mostly so I wouldn't be tied to Verisign any more
> than necessary, but also because some of their method/class names are
> really funky.
>
>
> -
> 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]


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


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

Try the struts-menu user list.  I didn't write this displayer, but I'm
guessing it doesn't support these attributes.

Matt

> -Original Message-
> From: Alessio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 5:33 AM
> To: Struts User
> Subject: OnMouseOut
> 
> 
> Hi, i' ve a problem with StrutsMenu...how use OnMouseOut with
> StrutsMenu? i try in this way:
> 
> 
>location="javascript:document.forms.MyForm.submit()"
> OnMouseOut="...OnMouseOut"  OnMouseOver="...OnMouseOver..."   />
> 
> 
> in this example i use an SimpleMenuDisplayer for render it and an form
> for submit my information...but the OnMouseOver and OnMouseOut don't
> work...whi?
> 
> Thanks in advance.
> Alessio
> 


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



RE: Redirects

This is a known issue with WebSphere. There is an e-fix for this but you
also have to explicitly set a System Properties value. In the admin console
under Application Servers > Default Server > JVM Settings add:

name com.ibm.websphere.sendredirect.compliance
value 1

This makes WebSphere compliant to Servlet spec 2.3.

Be aware if there has been any workarounds in existing code to address
this...adding this System property may break them ;)

HTH,

Shane


-Original Message-
From: Damian Staniforth [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 10:54 AM
To: [EMAIL PROTECTED]
Subject: Redirects


Hi,

We are currently using 1.1 b3 and are having problems with redirect 
ActionForwards in certain servlet containers.

In WebSphere 4.0.3 if I have an application deployed with a context root 
of '/app' and within an ActionForward redirect to '/add.do', the browser 
actually redirects to '/app/app/add.do' and struts sees '/app/add.do' 
rather than '/add.do'.

In Tomcat (4.0.3?) I don't see the problem.

Looking at the code of RequestProcessor.java the processForwardConfig 
method prepends request.getContextPath to the path in the ActionForward.
Reading the servlet spec I believe that the servlet container should 
worry about the context root and not the application.


Is anyone else having problems with redirects, or have I misunderstood 
struts redirecting?

Cheers
Damian


-
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: A question

This might work:





> -Original Message-
> From: Binaghi Mauro [mailto:[EMAIL PROTECTED]
> 
> Hi
> I have the "user.name" property in my "ApplicationResource.properties"
> file.
> Can I take its value with the following instrucition in my JSP page?
> 
> 
>%>.name"/>
> 
> 
> Of course, I call my JSP with this URI
"/myPage.jsp?httpParameter=user"

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



RE: A question

You will have to do something like this:

<%
String key = request.getParameter("httpParameter") + ".name";
%>




robert
-Original Message-
From: Binaghi Mauro [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:09 AM
To: Struts Users Mailing List
Subject: A  question
Importance: High


Hi
I have the "user.name" property in my "ApplicationResource.properties" file.
Can I take its value with the following instrucition in my JSP page?


.name"/>


Of course, I call my JSP with this URI "/myPage.jsp?httpParameter=user"

Thx
Mauro

-
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: do we have to wrtie a methods in bean classes to iterate

Hi,
i have field in my dbtable on which i need to iterate and display on the
webpage, do i need to write a method in the bean class to iterate on that
field and call that in my JSP.

--Mohan



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



A question

Hi
I have the "user.name" property in my "ApplicationResource.properties" file.
Can I take its value with the following instrucition in my JSP page?


.name"/>


Of course, I call my JSP with this URI "/myPage.jsp?httpParameter=user"

Thx
Mauro

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



RE: Struts link to map viewer

I had this problem a few months ago.
hehe It took me hours to figure out why all my forms were working except the
one that (burried among a lot of other fields) had a field named action.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 1 April 2003 23:56
To: [EMAIL PROTECTED]
Subject: RE: Struts link to map viewer


'sorry didn't noticed that. Obviously you cannot use any reserved word as
variable name ;-]

> -Original Message-
> From: Andrew Hill [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 5:54 PM
> To:   Struts Users Mailing List
> Subject:  RE: Struts link to map viewer
>
> Not in this case as he has shadowed that property by calling his field
> "action" - which is why instead of getting the forms action attribute he
> gets the action field in that form.
> "action" is not a suitable name for any form fields if one intends to make
> use of the form.action attribute to read or modify in javascript the url
> to
> which form is submitted...
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 1 April 2003 23:23
> To: [EMAIL PROTECTED]
> Subject: RE: Struts link to map viewer
>
>
> document.formName.action
> will return the string rappresenting in the action attribute of the Form
> object
>
> > -Original Message-
> > From:   Balraj Goulikar [SMTP:[EMAIL PROTECTED]
> > Sent:   Monday, March 31, 2003 7:08 PM
> > To: Struts Users Mailing List
> > Subject:Re: Struts link to map viewer
> >
> > hi,
> > i have a small problem, which might be for html.
> >
> > i have a form called frm
> > 
> > 
> >
> > wen i refer document.frm.action.value it refers to text box
> >
> > how to refer the value of action of form.
> >
> > i think i m confused or missing my basics
> >
> > balraj
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> IMPORTANT:
> This e-mail transmission is intended for the named addressee(s) only.
> Its contents are private, confidential and protected from disclosure and
> should not be read, copied or disclosed by any other person.
> If you are not the intended recipient, we kindly ask you to notify the
> sender immediately by telephone (+41-91-612 26 11),
> to redirect the message to the account "[EMAIL PROTECTED]" and to delete
> this
> e-mail.
> E-mail transmissions may be intercepted, altered or read by unauthorized
> persons and may contain viruses. Therefore, it is recommended that you use
> regular mail or courier services for any information intended to be
> confidential. However, by sending us messages through e-mail, you
> authorize
> and instruct us to correspond by e-mail in the relevant matter.
> 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]
>
>
IMPORTANT:
This e-mail transmission is intended for the named addressee(s) only.
Its contents are private, confidential and protected from disclosure and
should not be read, copied or disclosed by any other person.
If you are not the intended recipient, we kindly ask you to notify the
sender immediately by telephone (+41-91-612 26 11),
to redirect the message to the account "[EMAIL PROTECTED]" and to delete this
e-mail.
E-mail transmissions may be intercepted, altered or read by unauthorized
persons and may contain viruses. Therefore, it is recommended that you use
regular mail or courier services for any information intended to be
confidential. However, by sending us messages through e-mail, you authorize
and instruct us to correspond by e-mail in the relevant matter.
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: Redirects

This is fixed in RC1.

David



From: Damian Staniforth <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Redirects
Date: Tue, 01 Apr 2003 16:54:20 +0100
Hi,

We are currently using 1.1 b3 and are having problems with redirect 
ActionForwards in certain servlet containers.

In WebSphere 4.0.3 if I have an application deployed with a context root of 
'/app' and within an ActionForward redirect to '/add.do', the browser 
actually redirects to '/app/app/add.do' and struts sees '/app/add.do' 
rather than '/add.do'.

In Tomcat (4.0.3?) I don't see the problem.

Looking at the code of RequestProcessor.java the processForwardConfig 
method prepends request.getContextPath to the path in the ActionForward.
Reading the servlet spec I believe that the servlet container should worry 
about the context root and not the application.

Is anyone else having problems with redirects, or have I misunderstood 
struts redirecting?

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


_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


RE: Struts link to map viewer

'sorry didn't noticed that. Obviously you cannot use any reserved word as
variable name ;-]

> -Original Message-
> From: Andrew Hill [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 5:54 PM
> To:   Struts Users Mailing List
> Subject:  RE: Struts link to map viewer
> 
> Not in this case as he has shadowed that property by calling his field
> "action" - which is why instead of getting the forms action attribute he
> gets the action field in that form.
> "action" is not a suitable name for any form fields if one intends to make
> use of the form.action attribute to read or modify in javascript the url
> to
> which form is submitted...
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 1 April 2003 23:23
> To: [EMAIL PROTECTED]
> Subject: RE: Struts link to map viewer
> 
> 
> document.formName.action
> will return the string rappresenting in the action attribute of the Form
> object
> 
> > -Original Message-
> > From:   Balraj Goulikar [SMTP:[EMAIL PROTECTED]
> > Sent:   Monday, March 31, 2003 7:08 PM
> > To: Struts Users Mailing List
> > Subject:Re: Struts link to map viewer
> >
> > hi,
> > i have a small problem, which might be for html.
> >
> > i have a form called frm
> > 
> > 
> >
> > wen i refer document.frm.action.value it refers to text box
> >
> > how to refer the value of action of form.
> >
> > i think i m confused or missing my basics
> >
> > balraj
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> IMPORTANT:
> This e-mail transmission is intended for the named addressee(s) only.
> Its contents are private, confidential and protected from disclosure and
> should not be read, copied or disclosed by any other person.
> If you are not the intended recipient, we kindly ask you to notify the
> sender immediately by telephone (+41-91-612 26 11),
> to redirect the message to the account "[EMAIL PROTECTED]" and to delete
> this
> e-mail.
> E-mail transmissions may be intercepted, altered or read by unauthorized
> persons and may contain viruses. Therefore, it is recommended that you use
> regular mail or courier services for any information intended to be
> confidential. However, by sending us messages through e-mail, you
> authorize
> and instruct us to correspond by e-mail in the relevant matter.
> 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]
> 
> 
IMPORTANT: 
This e-mail transmission is intended for the named addressee(s) only. 
Its contents are private, confidential and protected from disclosure and
should not be read, copied or disclosed by any other person. 
If you are not the intended recipient, we kindly ask you to notify the
sender immediately by telephone (+41-91-612 26 11), 
to redirect the message to the account "[EMAIL PROTECTED]" and to delete this
e-mail. 
E-mail transmissions may be intercepted, altered or read by unauthorized
persons and may contain viruses. Therefore, it is recommended that you use
regular mail or courier services for any information intended to be
confidential. However, by sending us messages through e-mail, you authorize
and instruct us to correspond by e-mail in the relevant matter. 
Thank you. 


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



RE: Struts link to map viewer

btw: I dont see where the 'map viewer' mentioned in the subject comes into
any of this?

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 1 April 2003 23:54
To: Struts Users Mailing List
Subject: RE: Struts link to map viewer


Not in this case as he has shadowed that property by calling his field
"action" - which is why instead of getting the forms action attribute he
gets the action field in that form.
"action" is not a suitable name for any form fields if one intends to make
use of the form.action attribute to read or modify in javascript the url to
which form is submitted...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 1 April 2003 23:23
To: [EMAIL PROTECTED]
Subject: RE: Struts link to map viewer


document.formName.action
will return the string rappresenting in the action attribute of the Form
object

> -Original Message-
> From: Balraj Goulikar [SMTP:[EMAIL PROTECTED]
> Sent: Monday, March 31, 2003 7:08 PM
> To:   Struts Users Mailing List
> Subject:  Re: Struts link to map viewer
>
> hi,
> i have a small problem, which might be for html.
>
> i have a form called frm
> 
> 
>
> wen i refer document.frm.action.value it refers to text box
>
> how to refer the value of action of form.
>
> i think i m confused or missing my basics
>
> balraj
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
IMPORTANT:
This e-mail transmission is intended for the named addressee(s) only.
Its contents are private, confidential and protected from disclosure and
should not be read, copied or disclosed by any other person.
If you are not the intended recipient, we kindly ask you to notify the
sender immediately by telephone (+41-91-612 26 11),
to redirect the message to the account "[EMAIL PROTECTED]" and to delete this
e-mail.
E-mail transmissions may be intercepted, altered or read by unauthorized
persons and may contain viruses. Therefore, it is recommended that you use
regular mail or courier services for any information intended to be
confidential. However, by sending us messages through e-mail, you authorize
and instruct us to correspond by e-mail in the relevant matter.
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]


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



Redirects

Hi,

We are currently using 1.1 b3 and are having problems with redirect 
ActionForwards in certain servlet containers.

In WebSphere 4.0.3 if I have an application deployed with a context root 
of '/app' and within an ActionForward redirect to '/add.do', the browser 
actually redirects to '/app/app/add.do' and struts sees '/app/add.do' 
rather than '/add.do'.

In Tomcat (4.0.3?) I don't see the problem.

Looking at the code of RequestProcessor.java the processForwardConfig 
method prepends request.getContextPath to the path in the ActionForward.
Reading the servlet spec I believe that the servlet container should 
worry about the context root and not the application.

Is anyone else having problems with redirects, or have I misunderstood 
struts redirecting?

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


  1   2   >