Servlet action is currently unavailable.

2003-01-14 Thread Simon Kelly
Hi all,

I've just written a small struts package, and tried to run it but I'm
getting an HTTP Status 503 -
Servlet action is currently unavailable error.  I have checked the setup of
both the struts-config and my .web and they both look to be correct (Checked
against a know working one).

Has anyone seen this sort of thing before and if so are tere any other
possible causes?

Cheers

Simon

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


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




RE: Servlet action is currently unavailable.

2003-01-14 Thread du Plessis, Corneil C
Seems your servlet or web application may not be running.

-Original Message-
From: Simon Kelly [mailto:[EMAIL PROTECTED]]
Sent: 14 January, 2003 10:37
To: Struts Users Mailing List
Subject: Servlet action is currently unavailable.


Hi all,

I've just written a small struts package, and tried to run it but I'm
getting an HTTP Status 503 -
Servlet action is currently unavailable error.  I have checked the setup of
both the struts-config and my .web and they both look to be correct (Checked
against a know working one).

Has anyone seen this sort of thing before and if so are tere any other
possible causes?

Cheers

Simon

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


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

__

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relating to the official business of 
Standard Bank Group Limited is proprietary to the company. It is confidential, legally 
privileged and protected by law. Standard Bank does not own and endorse any other 
content. 
Views and opinions are those of the sender unless clearly stated as being that of 
Standard Bank. 

The person addressed in the e-mail is the sole authorised recipient. Please notify the 
sender 
immediately if it has unintentionally reached you and do not read, disclose or use the 
content
in any way. 

Standard Bank can not assure that the integrity of this communication has been 
maintained nor 
that it is free of errors, virus, interception or interference.

__

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




Re: Servlet action is currently unavailable.

2003-01-14 Thread Gemes Tibor
2003. január 14. 09:37 dátummal Simon Kelly ezt írtad:
 Hi all,

 I've just written a small struts package, and tried to run it but I'm
 getting an HTTP Status 503 -
 Servlet action is currently unavailable error.  I have checked the setup
 of both the struts-config and my .web and they both look to be correct
 (Checked against a know working one).

 Has anyone seen this sort of thing before and if so are tere any other
 possible causes?

I've seen this kind of error in case I accessed a page before the war was 
completely deployed the whole application turned into unreachable state. A 
redeployment helped...

Tib

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




[Info] Servlet action is currently unavailable.

2003-01-14 Thread Simon Kelly
Just checked the Tomcat startup log and found that the following two errors
occur during the start up routine.  Do you think these maybe causing the
problem?

[snip]
Apache Tomcat/4.1.12
14-Jan-2003 09:45:40 org.apache.struts.util.PropertyMessageResources init
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
14-Jan-2003 09:45:40 org.apache.struts.util.PropertyMessageResources init
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
14-Jan-2003 09:45:40 org.apache.struts.action.ActionServlet initServlet
SEVERE: null
java.lang.VerifyError: Cannot inherit from final class
[/snip]

[snip]
14-Jan-2003 09:45:40 org.apache.struts.action.ActionServlet initModuleConfig
SEVERE: Parsing error processing resource path /WEB-INF/struts-config.xml
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass0(Native Method)
[/snip]

cheers

simon

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]


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




Re: Servlet action is currently unavailable.

2003-01-14 Thread Simon Kelly
Thanks Tib and Corneil(Think it's you first name??),

Just checked the manager and the app has deployed and is running.  Any
ideas?

Cheers

Simon

- Original Message -
From: Gemes Tibor [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 9:45 AM
Subject: Re: Servlet action is currently unavailable.


2003. január 14. 09:37 dátummal Simon Kelly ezt írtad:
 Hi all,

 I've just written a small struts package, and tried to run it but I'm
 getting an HTTP Status 503 -
 Servlet action is currently unavailable error.  I have checked the setup
 of both the struts-config and my .web and they both look to be correct
 (Checked against a know working one).

 Has anyone seen this sort of thing before and if so are tere any other
 possible causes?

I've seen this kind of error in case I accessed a page before the war was
completely deployed the whole application turned into unreachable state. A
redeployment helped...

Tib

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



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




Struts--- Validator plugin HELP NEEDED!!

2003-01-14 Thread Vijay Khanna
Hello to all struts users.

I am facing somewhat unusual problem.The cuurent project is being built on
struts 1.1
All the validations were earlier done is ACTIONFORMS.for good application
architecture we have decided to go for StrutsValidator/ Validator plugin
which will take care of all the validations.

All common validations are being done using the validation.xml and
validator-rules.xml.
(minlength, maxlength, email, required)
for customised validation we have made validation-custom.xml and
validator-custom-rules.xml.
(field comparison etc)

I have removed the Validate() from the ActionForm and set validation=false
in the action mapping of struts-config.xml(This was done later as we thought
setting to true invoked the validate().So we set it to validate=false,
inorder to invloke the plugin).When the application starts-up the digestor
reads the xml files and hold the validation in struts memory.All the error
messages are given in the resource file.But we don't understand the
validation is not occuring.We believe struts is not able invoke and passe it
to the plugin.

Below is an extract from the struts-config.xml.The Tiles plugin works just
fine ..but Validator plugin does not work at all.

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-custom.xml,/WEB-INF/validator-custom-rules.xml/
/plug-in


plug-in className=org.apache.struts.tiles.TilesPlugin 
set-property property=definitions-config
value=/WEB-INF/tiles-defs.xml /
set-property property=definitions-debug value=1 /
set-property property=definitions-parser-details value=0 /
set-property property=definitions-parser-validate value=true /
/plug-in



Any ideas from your guys...?

Help is appreciated.

thanx
Vijay



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




Struts Validator Problem

2003-01-14 Thread Amit Keshav Kulkarni

Hi All

I facing problem in Validator - Struts 1.1 .

I am having two fields and checking for the empty fields.While submitting the form 
with empty fields,
I am getting the following error in Tomcat 4.0.3

This is the error  that it is throwing in the Browser..

java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:380)
at 
org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229)
at org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:250)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:185)

This is my validation.xml

form-validation
   formset
  formname=loginForm
 fieldproperty=userId
 depends=required
 arg0 key=prompt.userId  /
 /field
 fieldproperty=password
depends=required
 arg0 key=prompt.userId  /
 
/field
/form 
 /formset
 /form-validation


Regards
M.Saravanan


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




RE: Controlling Direct Access to jsp pages

2003-01-14 Thread Mohan Radhakrishnan
Hi,
   Shouldn't this work for tomcat too ? I am trying to lock-down some JSP's
using the same procedure with an empty auth-constraint.

 But http://localhost/x/y.jsp

still shows the JSP.

Thanks,
Mohan

-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 11:55 PM
To: Struts Users Mailing List
Subject: RE: Controlling Direct Access to jsp pages


Here's an approach that works with WebLogic 7. All the JSP's except
index.jsp
(the welcome page) are kept in a directory called pages. index.jsp simply
contains:

%@ taglib prefix=logic uri=http://jakarta.apache.org/struts/tags-logic;
%
logic:forward name=main/

Where main is the name of a global forward that represents the true entry
point into the app. web.xml contains:

security-constraint
  web-resource-collection
web-resource-namePages/web-resource-name
url-pattern/pages/*/url-pattern
  /web-resource-collection
  auth-constraint/auth-constraint
/security-constraint

An empty auth-constraint is interpreted to mean deny all access.

Quoting Colquhoun, Adrian [EMAIL PROTECTED]:

 
 I have had a go at this - I get a 500 error message Cannot perform access
 control without an authenticated principal - presumably I need to do
 something else as well ?
 
 
 -Original Message-
 From: David Graham [mailto:[EMAIL PROTECTED]]
 Sent: 13 January 2003 15:54
 To: [EMAIL PROTECTED]
 Subject: Re: Controlling Direct Access to jsp pages
 
 
 Put this security info at the bottom of your web.xml to prevent access to 
 any *.jsp file:
 
 security-constraint
   web-resource-collection
   web-resource-nameSecureAllJSPs/web-resource-name
   url-pattern*.jsp/url-pattern
   /web-resource-collection
   auth-constraint
   role-namenobody/role-name
   /auth-constraint
   /security-constraint
 
   security-role
   descriptionNo one should be put in this
 role./description
   role-namenobody/role-name
 /security-role
 
 
 David
 
 
 
 
 
 
 From: Colquhoun, Adrian [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: Controlling Direct Access to jsp pages
 Date: Mon, 13 Jan 2003 15:40:45 -
 
 
 Hi
 
 If I have three pages in my view layer that must be called in sequence
 e.g.
 
   - step1.jsp then
   - step2.jsp then
   - step3.jsp
 
   How do I ensure that my users do not call step2 and step3 directly via
a
 web browser.  Do I need to use a custom tag in pages 2 and 3 to check
this
 or is there some way to force all requests for .jsp pages in my
 application
 to route via the ActionServlet
 
 Thanks
 
 Adrian
 
 
 ===
 Information in this email and any attachments are confidential, and may
 not be copied or used by anyone other than the addressee, nor disclosed
 to any third party without our permission.  There is no intention to
 create any legally binding contract or other commitment through the use
 of this email.
 
 Experian Limited (registration number 653331).
 Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 
 _
 MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* 
 http://join.msn.com/?page=features/virus
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 ===
 Information in this email and any attachments are confidential, and may
 not be copied or used by anyone other than the addressee, nor disclosed
 to any third party without our permission.  There is no intention to
 create any legally binding contract or other commitment through the use
 of this email.
 
 Experian Limited (registration number 653331).  
 Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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

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




Re: Tiles and cewolf Taglibs

2003-01-14 Thread Cedric Dumoulin

 Is there any errors reported ? Check in the webserver logs, and in the 
client page source.
 What version of Struts do you use, and what webserver ?

   Cedric

Nick Torenvliet wrote:

I am trying to get the cewolf charting tools to render a graph from
within tiles.

My action forwards to a tiles-def(myApp/WEB-INF) which picks up pieces
of a page(the classic layout in fact) from two different
direstories(myApp/tiles/layouts and myApp/tiles)  the body of the page
is /tiles/graphBody.jsp and it is as follows ...

%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %
H1Page View Statistics/H1
HR
jsp:useBean id=pageViews
class=fieldstone.cewolf.PageViewCountData/
cewolf:chart 
   id=line 
   title=Page View Statistics 
   type=line 
   xaxislabel=Page 
   yaxislabel=Views
   cewolf:data
   cewolf:producer id=pageViews /
   /cewolf:data
/cewolf:chart
cewolf:img chartid=line renderer=cewolf width=300 height=300/

The renderer won't push the graph out onto the page properly though.  It
all works when I drop tiles and get my action to forward straight to a
jsp. How can I get tiles to accept the output of the cewolf taglib? 

~/nick



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


 



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




Re: No value found for attribute

2003-01-14 Thread Cedric Dumoulin

 You try to do something like tiles:insert attribute=menubar /, but 
there is no menubar attribute defined for your current tiles.
 Check the definition used to insert the current tiles: is there a 
menubar attribute ?

 Cedric

Wendy Smoak wrote:

Any idea why this would start happening when I add a new piece to an
existing [working] layout?

[ServletException in:basicLayout.jsp] Error - Tag Insert : No value found
for attribute 'menubar'.'
javax.servlet.ServletException: Error - Tag Insert : No value found for
attribute 'menubar'.


 



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




Re: nested tiles, I think

2003-01-14 Thread Cedric Dumoulin

 Hi,

 I am not sure I understand your question, but

 You can reference the menu tile definition directly from the sidebar, 
but you need to put the layout code into the sidebar, and pass the 
appropriate menu list to the sidebar (put name=sidebar 
value=sidebar.menu / ... and
definition name=sidebar.menu path=/sidebar.jsp.../)

 Cedric

Jonathan Hodges wrote:

Hello,

I have a tile definition as follows:

definition name=pageConstructTile path=/jsp/templates/hscf.jsp
 put name=title value= /
 put name=header value=/jsp/pageConstruct/header.jsp/
 put name=sidebar value=/jsp/pageConstruct/sidebar.jsp/
 put name=footer value=/jsp/pageConstruct/footer.jsp/
 put name=content value=/jsp/pageConstruct/content.jsp/
/definition

I want the sidebar to reference a list of items to build the menu.  I accomplished it by adding a menu definition and menu.jsp as follows:

definition name=menu path=/jsp/pageConstruct/menu.jsp
 putList name=items
   item value=Page One
 link=pageOneLink.do
 classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
   item value=Page Two
 link=pageTwoLink.do
 classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
   item value=Page Three
 link=pageThreeLink.do
 classtype=org.apache.struts.tiles.beans.SimpleMenuItem /
 /putList
/definition

%@ include file=/jsp/global/init.jsp %

table width='100%'
 tr
   tdnbsp;/td
 /tr
 
 %-- Push tiles attributes in page context --%
 tiles:importAttribute /
 
 logic:iterate id=item name=items type=org.apache.struts.tiles.beans.MenuItem  
   tr
 td align=centera href=%=item.getLink()% class=menuApplications%=item.getValue()%/td
   /tr
   tr
 tdnbsp;/td
   /tr
   tr
 tdnbsp;/td
   /tr
 /logic:iterate

/table

I then reference the menu definition in sidebar.jsp like this:

%@ include file=/jsp/global/init.jsp %

tiles:insert definition=menu flush=true/

I was wondering if there would be a way to reference the menu tile definition directly in sidebar.jsp without having to create the menu.jsp.  I hope my question is clear.  I have heard people speak of nested tile definitions, but I have been unable to find an example.

Any help with this would be greatly appreciated,

Jonathan

 



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




Disable the log messages

2003-01-14 Thread Alireza Fattahi
Hi,
 
How can we disable the log messages which is printed out during application
start up with commons-validation plug-in. 
It prints out all the contents in validation.xml.
 
Alireza.



RE: Disable the log messages

2003-01-14 Thread Ahmed ALAMI
I'm using log4J with minium level INFO, so DEBUG messages won't be printed

-Message d'origine-
De : Alireza Fattahi [mailto:[EMAIL PROTECTED]]
Envoyé : Tuesday, January 14, 2003 11:09 AM
À : 'Struts Users Mailing List'
Objet : Disable the log messages


Hi,
 
How can we disable the log messages which is printed out during application
start up with commons-validation plug-in. 
It prints out all the contents in validation.xml.
 
Alireza.


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




validator-rules.xml ignores datePattern param

2003-01-14 Thread Gemes Tibor
It seems to me as if dateValidation javascript ignores the datePattern so if I 
provide this parameter then only server side validation occures in this case. 

Is this the required behaviour? 

Tib

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




display messages, not errors

2003-01-14 Thread Heather Buch
Hi all,

I finally had success in displaying messages in my jsp page, and wanted to
share this because it was kinda hard.

(disclaimer, I may not being using ActionMessages in the right way, but I like
the way it worked out, so I don't care).

problem: When the user of my little study schedule program adds or deletes a
new course to her study schedule, I want to give her a message in the next jsp
page, telling her how many courses she has added/deleted. I don't want the
message to print out as a big ugly red ERROR, but rather as a bullet list of
messages. Therefore, I want to use ActionMessages, not ActionErrors. As I
interpret ActionMessages, I can use them to display results of actions that
aren't necessarily errors.

Here is what I did:

In my SaveScheduleAction, after courses are added or deleted from my database,
I do this:

  String rowsadded = sslogic.getRowsAdded().toString();
  String rowsdeleted = sslogic.getRowsDeleted().toString();
  amessages.add(rowsadded, new ActionMessage(message.rows.added,
rowsadded)); 
  amessages.add(rowsdeleted, new ActionMessage(message.rows.deleted,
rowsdeleted)); 

Then, in SaveScheduleAction, I save all my ActionMessages: 

// Report any messages we have discovered back to the original form
if (!amessages.empty()) {
saveMessages(request, amessages);
  System.out.println(saved  + amessages.size() + messages in the
request);
}

Here is how my messages look in ApplicationResources.properties:

message.rows.added=Du har tilføjet {0} ny kursus
message.rows.deleted=Du har bortvist {0} kursus

And finally, and this was the tricky part, I had to get the messages to 
print in my jsp page. I borrowed from Ted Husted's very informative tip
on how to optimize error printing in jsp: Don't settle for html:error/ at
http://husted.com/struts/tips/017.html

This is what I have in viewschedule.jsp:

logic:messagesPresent message=true 
there were some messages
UL
 html:messages id=message message=true/
LIbean:write name=message//LI
 /html:messages 
/UL 
/logic:messagesPresent

As you can see in the above, there are id=message and name=message. I'm
not positive, but I think that one of those =message refers to the
message in 

message.rows.added=Du har tilføjet {0} ny kursus
message.rows.deleted=Du har bortvist {0} kursus

from my ApplicationResources.properties, so it may be important to prefix
any strings that you want to display as messages, with message.

Hope this helps someone!

Heather Buch

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




Any reflection based utility to copy ActionForm to/from Domain object?

2003-01-14 Thread Jagdish Arora

On my ActionForm, I have a lot of HTML input elements, which come from the
domain object (Shipment).  To copy them to the ActionForm (in displayPage(),
and from the ActionForm (in saveShipment()), I have quite repetitive code
such as:

// in displayPage..
form.setName (shipment.getName());
form.setEndDate (shipment.getEndDate());
..
..  // 26 such lines.

// in saveShipment..
shipment.setName (form.getName());
shipment.setBeginDate (form.getBeginName());
..
..  // 26 such lines.

Since I have seen this problem with multiple domain objects, I was wondering
if there is any reflection based utility that can copy all fields with the
same name.  If there is none, I can write one though, but wanted to check
first.

best,
Amrinder


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




Re: Controlling Direct Access to jsp pages

2003-01-14 Thread Matthias Bauer
Definitely yes. We are using this struts extension in all our major 
projects and I know of a couple of people who are using it, because I 
get some input and new ideas from them every now and then, which I very 
much appreciate.

--- Matthias

Colquhoun, Adrian wrote:

Thanks Matthias

This looks like it is exactly what I was looking for - I will have a go with
this today. Do you still have this code under active development ?

Regards

Adrian

-Original Message-
From: Matthias Bauer [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2003 07:57
To: Struts Users Mailing List
Subject: Re: Controlling Direct Access to jsp pages


Adrian,

I saw a lot of answers to your question regarding how to protect the jsp 
files. I think protecting direct access to the jsp files is only one 
thing. The other is, to force the execution of the associated actions in 
the right order, i. e. step3.do after step2.do and this one after step1.do.

For this task you might want to check out the following: 
http://www.livinglogic.de/Struts/

This is a simple workflow framework incoporated into struts, that allows 
you to do exactly this via definitions in the struts config file.

--- Matthias



Colquhoun, Adrian wrote:

 

Hi

If I have three pages in my view layer that must be called in sequence e.g.

- step1.jsp then
- step2.jsp then
- step3.jsp

How do I ensure that my users do not call step2 and step3 directly via a
web browser.  Do I need to use a custom tag in pages 2 and 3 to check this
or is there some way to force all requests for .jsp pages in my application
to route via the ActionServlet

Thanks

Adrian


===
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF

--
To unsubscribe, e-mail:
   

mailto:[EMAIL PROTECTED]
 

For additional commands, e-mail:
   

mailto:[EMAIL PROTECTED]
 



   





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


===
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
 





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




RE: Any reflection based utility to copy ActionForm to/from Domain object?

2003-01-14 Thread Alireza Fattahi
Use BeanUtils.copyProperties

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 2:24 PM
To: Struts Users Mailing List
Subject: Any reflection based utility to copy ActionForm to/from Domain
object?


On my ActionForm, I have a lot of HTML input elements, which come from the
domain object (Shipment).  To copy them to the ActionForm (in displayPage(),
and from the ActionForm (in saveShipment()), I have quite repetitive code
such as:

// in displayPage..
form.setName (shipment.getName());
form.setEndDate (shipment.getEndDate());
..
..  // 26 such lines.

// in saveShipment..
shipment.setName (form.getName());
shipment.setBeginDate (form.getBeginName());
..
..  // 26 such lines.

Since I have seen this problem with multiple domain objects, I was wondering
if there is any reflection based utility that can copy all fields with the
same name.  If there is none, I can write one though, but wanted to check
first.

best,
Amrinder


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

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




Cannot use ActionBeans - Error cannot find ActionMappings or ActionFormBeans

2003-01-14 Thread Jaime Marcondes
Hello, All.

I'm a new in the struts framework and i tried to make a little project using this 
framework, but when i try to use a actionbean, it says:

org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans 
collection ...

The web.xml:
===
?xml version=1.0 encoding=ISO-8859-1?

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

web-app

!-- Servlet used by application --
servlet
  servlet-nameBook/servlet-name
  servlet-classteste.struts.Book/servlet-class
/servlet

servlet
  servlet-nameBookAction/servlet-name
  servlet-classteste.struts.BookAction/servlet-class
/servlet

!-- Action Servlet Configuration --
servlet
  servlet-nameaction/servlet-name
  servlet-classorg.apache.struts.action.ActionServlet/servlet-class
  init-param
  param-nameapplication/param-name
  param-valueorg.apache.struts.webapp.example.ApplicationResources/param-value
  /init-param
  init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
  /init-param
  init-param
  param-namedebug/param-name
  param-value2/param-value
  /init-param
  init-param
  param-namedetail/param-name
  param-value2/param-value
  /init-param
  init-param
  param-namevalidate/param-name
  param-valuetrue/param-value
  /init-param
  load-on-startup2/load-on-startup
/servlet

servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern*.do/url-pattern
/servlet-mapping

servlet-mapping
  servlet-nameBook/servlet-name
  url-pattern/Book/url-pattern
/servlet-mapping

servlet-mapping
  servlet-nameBookAction/servlet-name
  url-pattern/BookAction/url-pattern
/servlet-mapping

welcome-file-list
  welcome-fileindex.jsp/welcome-file
/welcome-file-list

!-- Struts Tag Library Descriptors --
taglib
  taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
  taglib-location/WEB-INF/struts-bean.tld/taglib-location
/taglib

taglib
  taglib-uri/WEB-INF/struts-html.tld/taglib-uri
  taglib-location/WEB-INF/struts-html.tld/taglib-location
/taglib

taglib
  taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
  taglib-location/WEB-INF/struts-logic.tld/taglib-location
/taglib

/web-app


The struts-config.xml
===
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

struts-config
 form-beans
   form-bean name=bookForm 
  type=teste.struts.Book/
 /form-beans
 
 global-forwards
   forward name=bookCreated path=/BookView.jsp/
 /global-forwards
 
 action-mappings
   action path=/createBook
 type=teste.struts.BookAction
 name=bookForm
 scope=request
 input=/CreateBook.jsp
   /action
 /action-mappings
 
/struts-config


The BookView.jsp
=
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
 head
   html:base/
   titleTeste/title
 /head
 
 body
   h2BookView/h2
   
   html:form action=/createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
   /html:form
 /body
 
/html:html


I don't know what is wrong, since this is a test from the faq of struts, which i 
modified to
learn. 

Thanks for help,

Jaime



Validator not performing validations!!!!

2003-01-14 Thread Vijay Khanna
Hello to all struts users.

I am facing somewhat unusual problem.The cuurent project is being built on
struts 1.1
All the validations were earlier done is ACTIONFORMS.for good application
architecture we have decided to go for StrutsValidator/ Validator plugin
which will take care of all the validations.

All common validations are being done using the validation.xml and
validator-rules.xml.
(minlength, maxlength, email, required)
for customised validation we have made validation-custom.xml and
validator-custom-rules.xml.
(field comparison etc)

I have removed the Validate() from the ActionForm and set validation=false
in the action mapping of struts-config.xml(This was done later as we thought
setting to true invoked the validate().So we set it to validate=false,
inorder to invloke the plugin).When the application starts-up the digestor
reads the xml files and hold the validation in struts memory.All the error
messages are given in the resource file.But we don't understand the
validation is not occuring.We believe struts is not able invoke and passe it
to the plugin.

Below is an extract from the struts-config.xml.The Tiles plugin works just
fine ..but Validator plugin does not work at all.

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-custom.xml,/WEB-INF/validator-custom-rules.xml/
/plug-in


plug-in className=org.apache.struts.tiles.TilesPlugin 
set-property property=definitions-config
value=/WEB-INF/tiles-defs.xml /
set-property property=definitions-debug value=1 /
set-property property=definitions-parser-details value=0 /
set-property property=definitions-parser-validate value=true /
/plug-in



Any ideas from your guys...?

Help is appreciated.

thanx
Vijay


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




RE: Struts--- Validator plugin HELP NEEDED!!

2003-01-14 Thread VEDRE, RANAPRATAP REDDY

Validator does not call the validate() method if validate=false

you should set validation=true for the plugin to work or call the
validate{} method in ur action class.  


ActionErrors errors = form.validate(mapping,
 
request);

-Rana. 

-Original Message-
From: Vijay Khanna
To: [EMAIL PROTECTED]
Sent: 1/14/2003 4:07 AM
Subject: Struts--- Validator plugin HELP NEEDED!!

Hello to all struts users.

I am facing somewhat unusual problem.The cuurent project is being built
on
struts 1.1
All the validations were earlier done is ACTIONFORMS.for good
application
architecture we have decided to go for StrutsValidator/ Validator plugin
which will take care of all the validations.

All common validations are being done using the validation.xml and
validator-rules.xml.
(minlength, maxlength, email, required)
for customised validation we have made validation-custom.xml and
validator-custom-rules.xml.
(field comparison etc)

I have removed the Validate() from the ActionForm and set
validation=false
in the action mapping of struts-config.xml(This was done later as we
thought
setting to true invoked the validate().So we set it to validate=false,
inorder to invloke the plugin).When the application starts-up the
digestor
reads the xml files and hold the validation in struts memory.All the
error
messages are given in the resource file.But we don't understand the
validation is not occuring.We believe struts is not able invoke and
passe it
to the plugin.

Below is an extract from the struts-config.xml.The Tiles plugin works
just
fine ..but Validator plugin does not work at all.

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/val
idat
ion-custom.xml,/WEB-INF/validator-custom-rules.xml/
/plug-in


plug-in className=org.apache.struts.tiles.TilesPlugin 
set-property property=definitions-config
value=/WEB-INF/tiles-defs.xml /
set-property property=definitions-debug value=1 /
set-property property=definitions-parser-details value=0 /
set-property property=definitions-parser-validate value=true /
/plug-in



Any ideas from your guys...?

Help is appreciated.

thanx
Vijay



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

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




Re: Servlet action is currently unavailable.

2003-01-14 Thread Puneet Agarwal
We faced this problem very frequently in our development environment, when
many a people were working in same environment.
Later we discovered that, it is always due to some error in some program
like
1.We had defined max connections for connection pool to be 50, and
some programs were not releasing the connections, it used to reach max and
give us same error.
2.wrong NDC push caused this.

and similar type of problems...
Its certainly due to some memory leak type of reason that it gives this
error.

Regards
Puneet

- Original Message -
From: Simon Kelly [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 8:57 AM
Subject: Re: Servlet action is currently unavailable.


 Thanks Tib and Corneil(Think it's you first name??),

 Just checked the manager and the app has deployed and is running.  Any
 ideas?

 Cheers

 Simon

 - Original Message -
 From: Gemes Tibor [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 9:45 AM
 Subject: Re: Servlet action is currently unavailable.


 2003. január 14. 09:37 dátummal Simon Kelly ezt írtad:
  Hi all,
 
  I've just written a small struts package, and tried to run it but I'm
  getting an HTTP Status 503 -
  Servlet action is currently unavailable error.  I have checked the
setup
  of both the struts-config and my .web and they both look to be correct
  (Checked against a know working one).
 
  Has anyone seen this sort of thing before and if so are tere any other
  possible causes?

 I've seen this kind of error in case I accessed a page before the war was
 completely deployed the whole application turned into unreachable state. A
 redeployment helped...

 Tib

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



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




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




Using properties of DynaActionForm in HTML Tags

2003-01-14 Thread Fischer ,A.,DP ITS,SMN,DD
Hello,

The problem: If I use a DynaActionForm like the following:

  form-bean  name=parcelSearchForm
  dynamic=true
  type=org.apache.struts.action.DynaActionForm
  form-property name=parcelType   type=java.lang.String/
  form-property name=parcelTypeList
type=java.util.Collection/
  /form-bean

and the use its properties in a optionsCollection HTML Tag

html:select property=parcelType size=1
html:optionsCollection property=parcelTypeList
label=description value=id/
/html:select

I get the following Error:
javax.servlet.jsp.JspException: Failed to obtain specified collection
at
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollect
ionTag.java:233)
at
jsp_servlet._content.__parcelsearch._jspService(__parcelsearch.java:420)

It all works fine if I use a normal Form class.

Any idea? Thanks

Andreas.

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




Transforming a String to valid HTML encoding

2003-01-14 Thread Hirschmann, Bernhard


I still have the problem to transform a String containing national special
characters to the appropriate HTML encoding.

i.e.: schön  reich -- schouml;n amp reich

The class org.apache.struts.util.ResponseUtils only transforms the 4
characters , ,  and  into their html representative. 

Is there another transformer around?

Any hints highly appreciated.

Regards,
Bernhard


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




Re: Precompiling JSPs

2003-01-14 Thread William W

Hi,
What do you think about never precompile the JSPs ?
William.



From: Billy Ng [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: Precompiling JSPs
Date: Mon, 13 Jan 2003 13:05:17 -0800

I used Ant to precompile the JSPs before.  It was very good but took much
longer to compile a build.  If you have 2,000 JSPs, mm...

And I can tell how hard to maintain 2000 entries in the web.xml.

Billy Ng

- Original Message -
From: William W [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 13, 2003 12:01 PM
Subject: Precompiling JSPs



 Hi All,

 My app has more than 2,000 JSPs. I can precompile my JSP and map it into
the
 web.xml file. But I think that it would become a little big.

 Sugestions ???

 Thanks,

 William.






 _
 The new MSN 8 is here: Try it free* for 2 months
 http://join.msn.com/?page=dept/dialup


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



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


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


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



Re: [Our Practice]Collection Population Post-Validation Best Practice

2003-01-14 Thread Puneet Agarwal
Even we had a similar problem in our application:

Agree that making the ActionForm scope to be session may cause problems,
but storing the information in request scope and copying all that
information in html and then sending it back to the server again may cause
extra network traffic.

We adopted following workaround for this.

1.  Make most of the ActionForm scope as session, and write a cleaning
mechanism which could keep cleaning up the HTTP session on some basis.
  What we adopted was as soon as the user shall operate on the top drop
down menu of the application, it shall remove any ActionForms more than last
5.(This 5 was configurable). This keeps the HTTP session lighter.

2. For the screens that have ActionForm scope defined as request, some
information was stored in HTML hidden variables but there was special
mechanism for collection objects. For every such screen one object was
stored in HTTP session and this object stored all collection objects.

Hope you too find this solution good for your application.

Regards
Puneet

- Original Message -
From: Phase Web and Multimedia [EMAIL PROTECTED]
To: Struts User List [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 12:31 AM
Subject: Collection Population Post-Validation Best Practice


 In the past I have not done any validation in my ActionForm so I have
never
 ran across this problem. I read a post from a while back regarding this
but
 the feedback was fairly obscure. I also read in Struts In Action
regarding
 this problem. But, the solutions were a little vague. So, I am looking for
 some creative specificity.

 Problem:

 I prepopulate some collections in an ActionForm through an Action class
 before I display the jsp form. I use the collections that I populate in
the
 form to create the drop down (html:options collection=foo). Upon
 submittal of the jsp form and a failed validate in my ActionForm i return
 back to the jsp page and my collections are not available/null (of course)
 because my form is set in request scope. Following are a few possible
 solutions ,that came to mind, for re-populating my collections prior to
 being sent back to ActionMapping's input. I am just wondering which is the
 best or if there are some better solutions.

 1) Specify the form as a session scope - I don't really want to do this
 because I am concerned that as the usage volume goes up I am potenially
 going to be passing around large complex objects in the session. I prefer
to
 keep it in the request.

 2) Call my logic classes that populate the collections set the values
 (setXXX(), getXXX())from within the validate method prior to returning the
 ActionErrors. - I am not sure how this would work using Validator. Can I
 override validate when extending ValidatorActionForm and call super() to
 make sure that the Validator validation is called and then run my logic
 classes to repopulate the form?

 3) Set my ActionMapping's input to go to the Action url rather than the
jsp
 (This was a suggestion in Struts In Action) - I tried this but I get
some
 looping and ultimately a StackOverflowError. See Following:

 java.lang.StackOverflowError
 at java.util.HashMap.hash(HashMap.java:257)
 at java.util.HashMap.removeEntryForKey(HashMap.java:518)
 at java.util.HashMap.remove(HashMap.java:507)
 at

org.apache.catalina.core.ApplicationHttpRequest.removeAttribute(ApplicationH
 ttpRequest.java:231)
 ...
   at

javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequestWrapper.ja
 va:340)
 at

org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
 java:676)
 at

org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
 er.java:431)
 at

org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
 .java:355)
 at

org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
 33)
 at

org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso
 r.java:269)
 at

org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(Requ
 estProcessor.java:980)
 at

org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(
 TilesRequestProcessor.java:336)
 at

org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
 ava:950)
 at

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
 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.ApplicationDispatcher.invoke(ApplicationDispatcher.
 java:683)
 at

org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
 er.java:431)
 at

org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
 .java:355)
 at


RE: Precompiling JSPs

2003-01-14 Thread Mark Galbreath
It's really a matter of preference and performance.  If you have 50k JSPs or
linked JSPs (forwards, includes, etc.), you probably want to precompile; if
your JSPs are 4k or less, the first-time performance hit is probably
negligible.  Run a performance tool against your site and compare the
difference of a typical first-time visit, keeping in mind your user-base
communications technology (56k modems/DSL/cable/T1).

Mark

-Original Message-
From: William W [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 6:34 AM


Hi,
What do you think about never precompile the JSPs ?
William.



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




Two Actions using the same form

2003-01-14 Thread João Paulo Batistella

Hi!

I have a doubt about using the same form in two different actions.

Let me explain.

I have a form (let's call form1) and, when I submit it, action1 is called. Action1 do 
whatever it wants and now the application have to show form2 (asscotiated with 
action2), with some data already filled, based on form1 selection.

I'm thinking about doing the following.

1. Submit form1 data

2. In action1, get the form1 data, process it and fill an instance of form2 for 
presentation. (here action1 is access form2)

3. Forward the control to action2. 

4. In action2, I can access an intance of form2 already filled and I can show it to 
the user, who can now interact with form2.

Is there any problem with this approach? Or any new idea?

Thanks,

Joao Paulo.



-
Busca Yahoo! 
O melhor lugar para encontrar tudo o que você procura na Internet


Re: [Our Practice]Collection Population Post-Validation Best Practice

2003-01-14 Thread Karim Saloojee
Hi

What we have done is introduce a ListManager class. This is a singleton
object that is accessible from the form via its superclass (our custom
superclass).

What we have done in our form is have two fields for a collection, i.e. our
dropdown list. The first field is used to populate the values of the list
and the second is used to store the selected value.

E.G.:
public Collection getListOfPeople() {
  return ListManager.getInstance().getPeople();
}

public String getSelectedPerson() {
  return selectedPerson;
}

public void setSelectedPerson(String selectedPerson) {
  this.selectedPerson = selectedPerson;
}

Our JSP is coded so that the setup of the dropdown calls getListOfPeople()
and the selected item populates setSelectedPerson(). The taglib allows this
Struts 1.1 b2.

This allows us to store the forms in the request and never have to worry
about pre-populating them, this seems to work very well for us.

I would appreciate feedback wrt this approach.

Regards,
Karim



- Original Message -
From: Puneet Agarwal [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 1:41 PM
Subject: Re: [Our Practice]Collection Population Post-Validation Best
Practice


 Even we had a similar problem in our application:

 Agree that making the ActionForm scope to be session may cause problems,
 but storing the information in request scope and copying all that
 information in html and then sending it back to the server again may cause
 extra network traffic.

 We adopted following workaround for this.

 1.  Make most of the ActionForm scope as session, and write a cleaning
 mechanism which could keep cleaning up the HTTP session on some basis.
   What we adopted was as soon as the user shall operate on the top drop
 down menu of the application, it shall remove any ActionForms more than
last
 5.(This 5 was configurable). This keeps the HTTP session lighter.

 2. For the screens that have ActionForm scope defined as request, some
 information was stored in HTML hidden variables but there was special
 mechanism for collection objects. For every such screen one object was
 stored in HTTP session and this object stored all collection objects.

 Hope you too find this solution good for your application.

 Regards
 Puneet

 - Original Message -
 From: Phase Web and Multimedia [EMAIL PROTECTED]
 To: Struts User List [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 12:31 AM
 Subject: Collection Population Post-Validation Best Practice


  In the past I have not done any validation in my ActionForm so I have
 never
  ran across this problem. I read a post from a while back regarding this
 but
  the feedback was fairly obscure. I also read in Struts In Action
 regarding
  this problem. But, the solutions were a little vague. So, I am looking
for
  some creative specificity.
 
  Problem:
 
  I prepopulate some collections in an ActionForm through an Action class
  before I display the jsp form. I use the collections that I populate in
 the
  form to create the drop down (html:options collection=foo). Upon
  submittal of the jsp form and a failed validate in my ActionForm i
return
  back to the jsp page and my collections are not available/null (of
course)
  because my form is set in request scope. Following are a few possible
  solutions ,that came to mind, for re-populating my collections prior to
  being sent back to ActionMapping's input. I am just wondering which is
the
  best or if there are some better solutions.
 
  1) Specify the form as a session scope - I don't really want to do this
  because I am concerned that as the usage volume goes up I am potenially
  going to be passing around large complex objects in the session. I
prefer
 to
  keep it in the request.
 
  2) Call my logic classes that populate the collections set the values
  (setXXX(), getXXX())from within the validate method prior to returning
the
  ActionErrors. - I am not sure how this would work using Validator. Can I
  override validate when extending ValidatorActionForm and call super() to
  make sure that the Validator validation is called and then run my logic
  classes to repopulate the form?
 
  3) Set my ActionMapping's input to go to the Action url rather than the
 jsp
  (This was a suggestion in Struts In Action) - I tried this but I get
 some
  looping and ultimately a StackOverflowError. See Following:
 
  java.lang.StackOverflowError
  at java.util.HashMap.hash(HashMap.java:257)
  at java.util.HashMap.removeEntryForKey(HashMap.java:518)
  at java.util.HashMap.remove(HashMap.java:507)
  at
 

org.apache.catalina.core.ApplicationHttpRequest.removeAttribute(ApplicationH
  ttpRequest.java:231)
  ...
at
 

javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequestWrapper.ja
  va:340)
  at
 

org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
  java:676)
  at
 


Re: Any reflection based utility to copy ActionForm to/from Domainobject?

2003-01-14 Thread Rob Leland
Reply in-Line:

Jagdish Arora wrote:


On my ActionForm, I have a lot of HTML input elements, which come from the
domain object (Shipment).  To copy them to the ActionForm (in displayPage(),
and from the ActionForm (in saveShipment()), I have quite repetitive code
such as:

// in displayPage..
form.setName (shipment.getName());
form.setEndDate (shipment.getEndDate());
..
..  // 26 such lines.

// in saveShipment..
shipment.setName (form.getName());


Beanutil.copyProperties() will handle bean names that are
exactly the same. The struts example uses it.


shipment.setBeginDate (form.getBeginName());


Bean names are different and so won't be copied.

-Rob


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




1.1-b3 link at Jakarta

2003-01-14 Thread Mark Galbreath
Is wrong.  It points to

http://jakarta.apache.org/site/[preferred]/jakarta/struts/binaries/

And returns a 404.  The correct URL is:

http://www.apache.org/dist/jakarta/struts/binaries/


Mark



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




RE: Controlling Direct Access to jsp pages

2003-01-14 Thread Kris Schneider
It should work, just differently. TC will return a 500 Configuration error:
Cannot perform access control without an authenticated principal. Whereas WLS7
will return a 403 Forbidden. What does the security-constraint element in
your web.xml look like? With TC, however, it's easier just to locate the pages
somewhere under WEB-INF and forget about the security-constraint. Personally,
I'd prefer to do it that way, it's just that my apps have to run under WLS7 when
they get released.

Quoting Mohan Radhakrishnan [EMAIL PROTECTED]:

 Hi,
Shouldn't this work for tomcat too ? I am trying to lock-down some JSP's
 using the same procedure with an empty auth-constraint.
 
  But http://localhost/x/y.jsp
 
 still shows the JSP.
 
 Thanks,
 Mohan
 
 -Original Message-
 From: Kris Schneider [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 13, 2003 11:55 PM
 To: Struts Users Mailing List
 Subject: RE: Controlling Direct Access to jsp pages
 
 
 Here's an approach that works with WebLogic 7. All the JSP's except
 index.jsp
 (the welcome page) are kept in a directory called pages. index.jsp simply
 contains:
 
 %@ taglib prefix=logic uri=http://jakarta.apache.org/struts/tags-logic;
 %
 logic:forward name=main/
 
 Where main is the name of a global forward that represents the true entry
 point into the app. web.xml contains:
 
 security-constraint
   web-resource-collection
 web-resource-namePages/web-resource-name
 url-pattern/pages/*/url-pattern
   /web-resource-collection
   auth-constraint/auth-constraint
 /security-constraint
 
 An empty auth-constraint is interpreted to mean deny all access.
 
 Quoting Colquhoun, Adrian [EMAIL PROTECTED]:
 
  
  I have had a go at this - I get a 500 error message Cannot perform
 access
  control without an authenticated principal - presumably I need to do
  something else as well ?
  
  
  -Original Message-
  From: David Graham [mailto:[EMAIL PROTECTED]]
  Sent: 13 January 2003 15:54
  To: [EMAIL PROTECTED]
  Subject: Re: Controlling Direct Access to jsp pages
  
  
  Put this security info at the bottom of your web.xml to prevent access to
 
  any *.jsp file:
  
  security-constraint
  web-resource-collection
  web-resource-nameSecureAllJSPs/web-resource-name
  url-pattern*.jsp/url-pattern
  /web-resource-collection
  auth-constraint
  role-namenobody/role-name
  /auth-constraint
  /security-constraint
  
  security-role
  descriptionNo one should be put in this
  role./description
  role-namenobody/role-name
  /security-role
  
  
  David
  
  
  
  
  
  
  From: Colquhoun, Adrian [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
  Subject: Controlling Direct Access to jsp pages
  Date: Mon, 13 Jan 2003 15:40:45 -
  
  
  Hi
  
  If I have three pages in my view layer that must be called in sequence
  e.g.
  
- step1.jsp then
- step2.jsp then
- step3.jsp
  
How do I ensure that my users do not call step2 and step3 directly via
 a
  web browser.  Do I need to use a custom tag in pages 2 and 3 to check
 this
  or is there some way to force all requests for .jsp pages in my
  application
  to route via the ActionServlet
  
  Thanks
  
  Adrian
  
  
  ===
  Information in this email and any attachments are confidential, and may
  not be copied or used by anyone other than the addressee, nor disclosed
  to any third party without our permission.  There is no intention to
  create any legally binding contract or other commitment through the use
  of this email.
  
  Experian Limited (registration number 653331).
  Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
  
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
  
  
  _
  MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* 
  http://join.msn.com/?page=features/virus
  
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  
  ===
  Information in this email and any attachments are confidential, and may
  not be copied or used by anyone other than the addressee, nor disclosed
  to any third party without our permission.  There is no intention to
  create any legally binding contract or other commitment through the use
  of this email.
  
  Experian Limited (registration number 653331).  
  Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF
  
  --
  To unsubscribe, e-mail:  
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
 -- 
 Kris Schneider 

Re: Struts Validator Problem

2003-01-14 Thread Rob Leland
Amit Keshav Kulkarni wrote:


Hi All

I facing problem in Validator - Struts 1.1 .

I am having two fields and checking for the empty fields.While submitting the form with empty fields,
I am getting the following error in Tomcat 4.0.3

This is the error  that it is throwing in the Browser..

java.lang.NullPointerException
	at java.util.Hashtable.put(Hashtable.java:380)
	at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:229)
	at org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:250)
	at org.apache.jsp.login$jsp._jspService(login$jsp.java:185)


This doesn't look like a validator problem, since the error is occurring 
from the bean:message Tag.
You don't seem to be using a recient struts 1.1 version because the line 
numbers in the trace don't match the current CVS source.

-Rob

 



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




Locale Validator

2003-01-14 Thread Laurent Vanzeune

Hi,

I have recently upgraded Struts from 1.1 b2 to 1.1 b3 and my code is not
working anymore. I have a LocaleAction (like the one provided in the
validator example of the Struts distribution) but the validator does not
take the new Locale into account.

Any idea?

Thx,
L.


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




RE: It lives....

2003-01-14 Thread Mark Galbreath
I'm a follower of Cthulu. And I lead a mad horde, searching everywhere for
my evil overlord!

(what's this old shyte???)
:-)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 13, 2003 9:55 PM


One of the great old ones awakes! Be afraid mortals!

Ai! Cthulu ftagn! (etc...)

;-)



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




Re: Two Actions using the same form

2003-01-14 Thread Karim Saloojee
Hi

Sounds fine but you may not need to go to action 2 i.e.

JSP1  Form1  Action1 (new Form2)  JSP2

Regards,
Karim

- Original Message -
From: João Paulo Batistella [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 2:50 PM
Subject: Two Actions using the same form



 Hi!

 I have a doubt about using the same form in two different actions.

 Let me explain.

 I have a form (let's call form1) and, when I submit it, action1 is called.
Action1 do whatever it wants and now the application have to show form2
(asscotiated with action2), with some data already filled, based on form1
selection.

 I'm thinking about doing the following.

 1. Submit form1 data

 2. In action1, get the form1 data, process it and fill an instance of
form2 for presentation. (here action1 is access form2)

 3. Forward the control to action2.

 4. In action2, I can access an intance of form2 already filled and I can
show it to the user, who can now interact with form2.

 Is there any problem with this approach? Or any new idea?

 Thanks,

 Joao Paulo.



 -
 Busca Yahoo!
 O melhor lugar para encontrar tudo o que você procura na Internet



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




Re: Two Actions using the same form

2003-01-14 Thread João Paulo Batistella

Thanks.
But how can JSP2 understand that form2 is already filled and present it's data?
Joao Paulo.
 Karim Saloojee [EMAIL PROTECTED] wrote:Hi

Sounds fine but you may not need to go to action 2 i.e.

JSP1  Form1  Action1 (new Form2)  JSP2

Regards,
Karim

- Original Message -
From: João Paulo Batistella 
To: 
Sent: Tuesday, January 14, 2003 2:50 PM
Subject: Two Actions using the same form



 Hi!

 I have a doubt about using the same form in two different actions.

 Let me explain.

 I have a form (let's call form1) and, when I submit it, action1 is called.
Action1 do whatever it wants and now the application have to show form2
(asscotiated with action2), with some data already filled, based on form1
selection.

 I'm thinking about doing the following.

 1. Submit form1 data

 2. In action1, get the form1 data, process it and fill an instance of
form2 for presentation. (here action1 is access form2)

 3. Forward the control to action2.

 4. In action2, I can access an intance of form2 already filled and I can
show it to the user, who can now interact with form2.

 Is there any problem with this approach? Or any new idea?

 Thanks,

 Joao Paulo.



 -
 Busca Yahoo!
 O melhor lugar para encontrar tudo o que você procura na Internet



--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



-
Busca Yahoo! 
O melhor lugar para encontrar tudo o que você procura na Internet


Re: Any reflection based utility to copy ActionForm to/from Domain object?

2003-01-14 Thread Kris Schneider
One possible way to handle property name mismatches is to do something like:

Map propMap = BeanUtils.describe(form);
propMap.put(beginDate, propMap.remove(beginName));
BeanUtils.populate(shipment, propMap);

Of course, it's not much of a solution if more than a couple of names don't
match. I'm also thinking that was probably a typo in the original example...

Quoting Rob Leland [EMAIL PROTECTED]:

 Reply in-Line:
 
 Jagdish Arora wrote:
 
 On my ActionForm, I have a lot of HTML input elements, which come from the
 domain object (Shipment).  To copy them to the ActionForm (in
 displayPage(),
 and from the ActionForm (in saveShipment()), I have quite repetitive code
 such as:
 
 // in displayPage..
 form.setName (shipment.getName());
 form.setEndDate (shipment.getEndDate());
 ..
 ..  // 26 such lines.
 
 // in saveShipment..
 shipment.setName (form.getName());
 
 Beanutil.copyProperties() will handle bean names that are
 exactly the same. The struts example uses it.
 
 shipment.setBeginDate (form.getBeginName());
 
 Bean names are different and so won't be copied.
 
 -Rob
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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




Design of action classes

2003-01-14 Thread João Paulo Batistella

Hi.

We are deciding about how to use action classes in our project.

Is it a problem to let developers use the same action class to handle different 
operations?

Example:

The action UpdateUserAction could be used to insert a new user or to update the data 
of an existing user. Is it a problem? Or it's better to have InsertUserAction and 
SaveUserAction. They do almost the same thing so I think they could be same.

Thanks,

Joao Paulo.



-
Busca Yahoo! 
O melhor lugar para encontrar tudo o que você procura na Internet


AW: Design of action classes

2003-01-14 Thread Hirschmann, Bernhard

Hi Joao,

technically it is no problem to use one action for multiple tasks. You can
use a request attribute to determine which use case you want to work
through.

But on the other side it appears cleaner to have a single action for a
single use case. 

In our projects, we try to have separate actions for each use case. But
sometimes we also share a action for use cases which are similar, like in
your example.

Regards,
Bernhard

-Ursprüngliche Nachricht-
Von: João Paulo Batistella [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 14. Januar 2003 14:36
An: [EMAIL PROTECTED]
Betreff: Design of action classes



Hi.

We are deciding about how to use action classes in our project.

Is it a problem to let developers use the same action class to handle
different operations?

Example:

The action UpdateUserAction could be used to insert a new user or to update
the data of an existing user. Is it a problem? Or it's better to have
InsertUserAction and SaveUserAction. They do almost the same thing so I
think they could be same.

Thanks,

Joao Paulo.



-
Busca Yahoo! 
O melhor lugar para encontrar tudo o que você procura na Internet

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




RE: Design of action classes

2003-01-14 Thread Mark Galbreath
I think the consensus is to use one Action class per Action form (bean).
For a simple update like you describe, it would be natural for the same
Action to update the database (actually, call a DAO or EJB) whether it's a
new user or new information for an existing user.  Work through your use
cases and I think it will become apparent what Action classes are
appropriate for specific responsibilities.

Mark

-Original Message-
From: João Paulo Batistella [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 8:36 AM

We are deciding about how to use action classes in our project.

Is it a problem to let developers use the same action class to handle
different operations?

Example:

The action UpdateUserAction could be used to insert a new user or to update
the data of an existing user. Is it a problem? Or it's better to have
InsertUserAction and SaveUserAction. They do almost the same thing so I
think they could be same.

Thanks,

Joao Paulo.



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




Re: Design of action classes

2003-01-14 Thread Affan Qureshi
Also look at DispatchAction which provides a cleaner approach to this...
Affan

- Original Message -
From: Mark Galbreath [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 7:02 PM
Subject: RE: Design of action classes


I think the consensus is to use one Action class per Action form (bean).
For a simple update like you describe, it would be natural for the same
Action to update the database (actually, call a DAO or EJB) whether it's a
new user or new information for an existing user.  Work through your use
cases and I think it will become apparent what Action classes are
appropriate for specific responsibilities.

Mark

-Original Message-
From: João Paulo Batistella [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 8:36 AM

We are deciding about how to use action classes in our project.

Is it a problem to let developers use the same action class to handle
different operations?

Example:

The action UpdateUserAction could be used to insert a new user or to update
the data of an existing user. Is it a problem? Or it's better to have
InsertUserAction and SaveUserAction. They do almost the same thing so I
think they could be same.

Thanks,

Joao Paulo.



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



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




Design Help

2003-01-14 Thread Weber, Jeremy
Hello all,

I have a unique requirement and was wondering if anyone had any ideas on how
to implement it.  I am using struts to install our server based product.
Our product has several components which can be installed multiple times. If
you choose to install a component you have to provide some configuration
information for each instance installed.  So if you install 5 times, you
need to configure some port 5 times.  I would like the configuration screens
to accept text in the following format.

Port: ,,,,.

I can validate that there are 5 entries, no problem.  How do I then validate
each individual entry as being an integer and in the valid port range.  If
anyone has any suggestions, I would appreciate it.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

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




Re: Design Help

2003-01-14 Thread Chris Trawick
You can write a custom validator to parse the tokens, parse the integers,
and then validate their range.  See
http://jakarta.apache.org/struts/userGuide/dev_validator.html under
Pluggable Validators for details.

chris

- Original Message -
From: Weber, Jeremy [EMAIL PROTECTED]
To: 'Struts Users Mailing List' (E-mail) [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 9:18 AM
Subject: Design Help


 Hello all,

 I have a unique requirement and was wondering if anyone had any ideas on
how
 to implement it.  I am using struts to install our server based product.
 Our product has several components which can be installed multiple times.
If
 you choose to install a component you have to provide some configuration
 information for each instance installed.  So if you install 5 times, you
 need to configure some port 5 times.  I would like the configuration
screens
 to accept text in the following format.

 Port: ,,,,.

 I can validate that there are 5 entries, no problem.  How do I then
validate
 each individual entry as being an integer and in the valid port range.  If
 anyone has any suggestions, I would appreciate it.

 Thanks,

 Jeremy Weber
 [EMAIL PROTECTED]

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



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




RE: Design Help

2003-01-14 Thread Jarnot Voytek Contr AU HQ/SC
You mean something other that using StringTokenizer to split the input
string on commas and Integer.parseInt to convert to ints and ,  to check
if the numbers are in a valid range?

http://home.earthlink.net/~dwinterfeldt/overview.html has some examples for
writing a pluggable validator to use with Struts and the Validator - but I
think it's out of date (might be a start, though).

--
Voytek Jarnot
Quidquid latine dictum sit, altum viditur.


-Original Message-
From: Weber, Jeremy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 8:19 AM
To: 'Struts Users Mailing List' (E-mail)
Subject: Design Help


Hello all,

I have a unique requirement and was wondering if anyone had any ideas on how
to implement it.  I am using struts to install our server based product.
Our product has several components which can be installed multiple times. If
you choose to install a component you have to provide some configuration
information for each instance installed.  So if you install 5 times, you
need to configure some port 5 times.  I would like the configuration screens
to accept text in the following format.

Port: ,,,,.

I can validate that there are 5 entries, no problem.  How do I then validate
each individual entry as being an integer and in the valid port range.  If
anyone has any suggestions, I would appreciate it.

Thanks,

Jeremy Weber
[EMAIL PROTECTED]

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

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




RE: Collection Population Post-Validation Best Practice

2003-01-14 Thread Robert Taylor
If there are 2 actions, one to prepare the page and one to process the
user input, we define the input attribute value of the process action
mapping to be the URL of the prepare action. This is simple and it works
flawlessly every time. I'm not sure why you are getting a loop unless your
input attribute value is the URL to the process action instead of the
prepare action.

There are certainly other creative ways to solve this problem. I just chose
the path of least complexity.

robert

 -Original Message-
 From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 13, 2003 7:32 PM
 To: Struts User List
 Subject: Collection Population Post-Validation Best Practice


 In the past I have not done any validation in my ActionForm so I
 have never
 ran across this problem. I read a post from a while back
 regarding this but
 the feedback was fairly obscure. I also read in Struts In
 Action regarding
 this problem. But, the solutions were a little vague. So, I am looking for
 some creative specificity.

 Problem:

 I prepopulate some collections in an ActionForm through an Action class
 before I display the jsp form. I use the collections that I
 populate in the
 form to create the drop down (html:options collection=foo). Upon
 submittal of the jsp form and a failed validate in my ActionForm i return
 back to the jsp page and my collections are not available/null (of course)
 because my form is set in request scope. Following are a few possible
 solutions ,that came to mind, for re-populating my collections prior to
 being sent back to ActionMapping's input. I am just wondering which is the
 best or if there are some better solutions.

 1) Specify the form as a session scope - I don't really want to do this
 because I am concerned that as the usage volume goes up I am potenially
 going to be passing around large complex objects in the session.
 I prefer to
 keep it in the request.

 2) Call my logic classes that populate the collections set the values
 (setXXX(), getXXX())from within the validate method prior to returning the
 ActionErrors. - I am not sure how this would work using Validator. Can I
 override validate when extending ValidatorActionForm and call super() to
 make sure that the Validator validation is called and then run my logic
 classes to repopulate the form?

 3) Set my ActionMapping's input to go to the Action url rather
 than the jsp
 (This was a suggestion in Struts In Action) - I tried this but
 I get some
 looping and ultimately a StackOverflowError. See Following:

 java.lang.StackOverflowError
   at java.util.HashMap.hash(HashMap.java:257)
   at java.util.HashMap.removeEntryForKey(HashMap.java:518)
   at java.util.HashMap.remove(HashMap.java:507)
   at
 org.apache.catalina.core.ApplicationHttpRequest.removeAttribute(Ap
 plicationH
 ttpRequest.java:231)
   ...
   at
 javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequest
 Wrapper.ja
 va:340)
   at
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationD
 ispatcher.
 java:676)
   at
 org.apache.catalina.core.ApplicationDispatcher.doForward(Applicati
 onDispatch
 er.java:431)
   at
 org.apache.catalina.core.ApplicationDispatcher.forward(Application
 Dispatcher
 .java:355)
   at
 org.apache.struts.action.RequestProcessor.doForward(RequestProcess
 or.java:10
 33)
   at
 org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesReque
 stProcesso
 r.java:269)
   at
 org.apache.struts.action.RequestProcessor.internalModuleRelativeFo
 rward(Requ
 estProcessor.java:980)
   at
 org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelati
 veForward(
 TilesRequestProcessor.java:336)
   at
 org.apache.struts.action.RequestProcessor.processValidate(RequestP
 rocessor.j
 ava:950)
   at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor
 .java:255)
   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.ApplicationDispatcher.invoke(ApplicationD
 ispatcher.
 java:683)
   at
 org.apache.catalina.core.ApplicationDispatcher.doForward(Applicati
 onDispatch
 er.java:431)
   at
 org.apache.catalina.core.ApplicationDispatcher.forward(Application
 Dispatcher
 .java:355)
   at
 org.apache.struts.action.RequestProcessor.doForward(RequestProcess
 or.java:10
 33)
   at
 org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesReque
 stProcesso
 r.java:269)
   at
 org.apache.struts.action.RequestProcessor.internalModuleRelativeFo
 rward(Requ
 estProcessor.java:980)
   at
 org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelati
 veForward(
 TilesRequestProcessor.java:336)

 4) Make sure I have an html 

Collection within Collection

2003-01-14 Thread Cohan, Sean
I have a collection (of ArrayLists) within a collection of (ArrayLists).
That is:

public class HistoryItemImpl implements HistoryItem {

private String objectName;
private List deltaList; ...
}

public class DeltaItemImpl implements DeltaItem {

private String columnName;
private Object oldValue;
private Object newValue; ...
}

In my action class I call a method that returns a collection of
historyItems.  I set that in request scope:

 request.setAttribute(historyItems, historyList);

And then iterate though it on me page:

  logic:iterate id=historyItem name=historyItems
type=com.gosps.cbd.util.HistoryItem 

For each historyItem iteration, I want to iterate though the deltaItems:

logic:iterate id=deltaItem name=deltaItems
type=com.gosps.cbd.util.DeltaItem 

How can I do this?  How do I refer to the deltaItem collection within each
historyItem collection?

Thanks.


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




RE: Collection within Collection

2003-01-14 Thread pqin
Try nested:iterate tag

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: January 14, 2003 9:59 AM
To: Struts (E-mail)
Subject: Collection within Collection

I have a collection (of ArrayLists) within a collection of (ArrayLists).
That is:

public class HistoryItemImpl implements HistoryItem {

private String objectName;
private List deltaList; ...
}

public class DeltaItemImpl implements DeltaItem {

private String columnName;
private Object oldValue;
private Object newValue; ...
}

In my action class I call a method that returns a collection of
historyItems.  I set that in request scope:

 request.setAttribute(historyItems, historyList);

And then iterate though it on me page:

  logic:iterate id=historyItem name=historyItems
type=com.gosps.cbd.util.HistoryItem 

For each historyItem iteration, I want to iterate though the deltaItems:

logic:iterate id=deltaItem name=deltaItems
type=com.gosps.cbd.util.DeltaItem 

How can I do this?  How do I refer to the deltaItem collection within each
historyItem collection?

Thanks.


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



RE: Collection within Collection

2003-01-14 Thread Cohan, Sean
That was quick!  Thanks.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 9:57 AM
To: [EMAIL PROTECTED]
Subject: RE: Collection within Collection


Try nested:iterate tag

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: January 14, 2003 9:59 AM
To: Struts (E-mail)
Subject: Collection within Collection

I have a collection (of ArrayLists) within a collection of (ArrayLists).
That is:

public class HistoryItemImpl implements HistoryItem {

private String objectName;
private List deltaList; ...
}

public class DeltaItemImpl implements DeltaItem {

private String columnName;
private Object oldValue;
private Object newValue; ...
}

In my action class I call a method that returns a collection of
historyItems.  I set that in request scope:

 request.setAttribute(historyItems, historyList);

And then iterate though it on me page:

  logic:iterate id=historyItem name=historyItems
type=com.gosps.cbd.util.HistoryItem 

For each historyItem iteration, I want to iterate though the deltaItems:

logic:iterate id=deltaItem name=deltaItems
type=com.gosps.cbd.util.DeltaItem 

How can I do this?  How do I refer to the deltaItem collection within each
historyItem collection?

Thanks.


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

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




RE:Collection Population Post-Validation Best Practice

2003-01-14 Thread Phase Web and Multimedia
Greetings again,

I appreciate the afformentioned approaches (Robert, Karim, Puneet). I find
Roberts to be the most logical, simple and clean for myself. I use
LookupDispatchAction so this would actually be easy to do. I was getting the
loop for the very reason you mentioned :-D. It was a test app to see how to
address the problem of populating collections post validation and I was
calling the process Action.

So the practice would be to separate the entry Action from the process
Action. Use the entry action as your input for errors and it will have the
logic to populate your collections prior to showing the page.

It also seems to me that the ActionForm does not exclude us from making
calls to our business logic from within the validate method. So if I have
any standard prepopulation (post validation)... I can just call my logic
classes and set the appropriate members of the ActionForm from within the
validate prior to the ActionErrors returning to the input page.

Something like (with validator):

public MyActionForm extends ValidatorActionForm {

...

public void setMyCollection(ArrayList myCollection) {

this.myCollection = myCollection;

}

...

public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request)
{

// run my validator validation and capture error
ActionErrors errors = super.validate(mapping,request);

// run my own validation
if (x != 5) {

errors.add(myErrorMessage,
new ActionError(my.custom.error));

}

if (errors.empty())
{
 return null;
} else {
...
// populate ActionForm collections here and return errors
this.myCollection = MyLogicClass.getMyCollection(); //retrieves Collection

return errors;
}


}

}

So then here is the final question:
Is it appropriate practice to have logic classes being called in the
validate method to populate collections in the form? What's the official
position?

Thanks,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 5:41 AM
To: Struts Users Mailing List
Subject: Re: [Our Practice]Collection Population Post-Validation Best
Practice


Hi

What we have done is introduce a ListManager class. This is a singleton
object that is accessible from the form via its superclass (our custom
superclass).

What we have done in our form is have two fields for a collection, i.e. our
dropdown list. The first field is used to populate the values of the list
and the second is used to store the selected value.

E.G.:
public Collection getListOfPeople() {
  return ListManager.getInstance().getPeople();
}

public String getSelectedPerson() {
  return selectedPerson;
}

public void setSelectedPerson(String selectedPerson) {
  this.selectedPerson = selectedPerson;
}

Our JSP is coded so that the setup of the dropdown calls getListOfPeople()
and the selected item populates setSelectedPerson(). The taglib allows this
Struts 1.1 b2.

This allows us to store the forms in the request and never have to worry
about pre-populating them, this seems to work very well for us.

I would appreciate feedback wrt this approach.

Regards,
Karim



- Original Message -
From: Puneet Agarwal [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 1:41 PM
Subject: Re: [Our Practice]Collection Population Post-Validation Best
Practice


 Even we had a similar problem in our application:

 Agree that making the ActionForm scope to be session may cause problems,
 but storing the information in request scope and copying all that
 information in html and then sending it back to the server again may cause
 extra network traffic.

 We adopted following workaround for this.

 1.  Make most of the ActionForm scope as session, and write a cleaning
 mechanism which could keep cleaning up the HTTP session on some basis.
   What we adopted was as soon as the user shall operate on the top drop
 down menu of the application, it shall remove any ActionForms more than
last
 5.(This 5 was configurable). This keeps the HTTP session lighter.

 2. For the screens that have ActionForm scope defined as request, some
 information was stored in HTML hidden variables but there was special
 mechanism for collection objects. For every such screen one object was
 stored in HTTP session and this object stored all collection objects.

 Hope you too find this solution good for your application.

 Regards
 Puneet

 - Original Message -
 From: Phase Web and Multimedia [EMAIL PROTECTED]
 To: Struts User List [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 12:31 AM
 Subject: Collection Population Post-Validation Best Practice


  In the past I have not done any validation in my ActionForm so I have
 never
  ran across this problem. I read a post from a while back regarding this
 but
  

RE: Any reflection based utility to copy ActionForm to/from Domai n object?

2003-01-14 Thread Elbert, Denise M
In the struts API Documentation it says that the
PropertiesUtil.copyProperties is depracated and there isn't any
BeanUtils.copyProperties defined.  Where can I get information about this
method.

Thanks

-Original Message-
From: Alireza Fattahi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 6:03 AM
To: 'Struts Users Mailing List'
Subject: RE: Any reflection based utility to copy ActionForm to/from
Domai n object?


Use BeanUtils.copyProperties

-Original Message-
From: Jagdish Arora [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 2:24 PM
To: Struts Users Mailing List
Subject: Any reflection based utility to copy ActionForm to/from Domain
object?


On my ActionForm, I have a lot of HTML input elements, which come from the
domain object (Shipment).  To copy them to the ActionForm (in displayPage(),
and from the ActionForm (in saveShipment()), I have quite repetitive code
such as:

// in displayPage..
form.setName (shipment.getName());
form.setEndDate (shipment.getEndDate());
..
..  // 26 such lines.

// in saveShipment..
shipment.setName (form.getName());
shipment.setBeginDate (form.getBeginName());
..
..  // 26 such lines.

Since I have seen this problem with multiple domain objects, I was wondering
if there is any reflection based utility that can copy all fields with the
same name.  If there is none, I can write one though, but wanted to check
first.

best,
Amrinder


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

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

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




RE: Collection within Collection

2003-01-14 Thread Wendy Smoak
 I have a collection (of ArrayLists) within a collection of (ArrayLists).
 In my action class I call a method that returns a collection of
 historyItems.  I set that in request scope:
 For each historyItem iteration, I want to iterate though the deltaItems:
 How can I do this?  How do I refer to the deltaItem collection within each
 historyItem collection?

Is JSTL an option?  You can nest c:forEach tags and iterate through
collections of collections.

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



RE: Collection Population Post-Validation Best Practice

2003-01-14 Thread Robert Taylor
Personally, I like to keep my ActionForms as dumb as possible (I actually
use DynaValidatorActionForms). I see them as simple data transport
mechanism. When ever I have to prepopulate the ActionForm for a prepare
type of Action I do it within a the Action class (not explicitely - I
delegate to a service layer to handle this).

For me, this keeps things separate, simple and cohesive.

robert

 -Original Message-
 From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:12 AM
 To: Struts Users Mailing List
 Subject: RE:Collection Population Post-Validation Best Practice


 Greetings again,

 I appreciate the afformentioned approaches (Robert, Karim, Puneet). I find
 Roberts to be the most logical, simple and clean for myself. I use
 LookupDispatchAction so this would actually be easy to do. I was
 getting the
 loop for the very reason you mentioned :-D. It was a test app to
 see how to
 address the problem of populating collections post validation and I was
 calling the process Action.

 So the practice would be to separate the entry Action from the process
 Action. Use the entry action as your input for errors and it will have the
 logic to populate your collections prior to showing the page.

 It also seems to me that the ActionForm does not exclude us from making
 calls to our business logic from within the validate method. So if I have
 any standard prepopulation (post validation)... I can just call my logic
 classes and set the appropriate members of the ActionForm from within the
 validate prior to the ActionErrors returning to the input page.

 Something like (with validator):

 public MyActionForm extends ValidatorActionForm {

 ...

 public void setMyCollection(ArrayList myCollection) {

   this.myCollection = myCollection;

 }

 ...

 public ActionErrors validate(
   ActionMapping mapping,
   HttpServletRequest request)
 {

 // run my validator validation and capture error
 ActionErrors errors = super.validate(mapping,request);

 // run my own validation
 if (x != 5) {

   errors.add(myErrorMessage,
   new ActionError(my.custom.error));

 }

 if (errors.empty())
 {
return null;
 } else {
   ...
   // populate ActionForm collections here and return errors
   this.myCollection = MyLogicClass.getMyCollection();
 //retrieves Collection

   return errors;
 }


 }

 }

 So then here is the final question:
 Is it appropriate practice to have logic classes being called in the
 validate method to populate collections in the form? What's the official
 position?

 Thanks,
 Brandon Goodin
 Phase Web and Multimedia
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws


 -Original Message-
 From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 5:41 AM
 To: Struts Users Mailing List
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


 Hi

 What we have done is introduce a ListManager class. This is a singleton
 object that is accessible from the form via its superclass (our custom
 superclass).

 What we have done in our form is have two fields for a
 collection, i.e. our
 dropdown list. The first field is used to populate the values of the list
 and the second is used to store the selected value.

 E.G.:
 public Collection getListOfPeople() {
   return ListManager.getInstance().getPeople();
 }

 public String getSelectedPerson() {
   return selectedPerson;
 }

 public void setSelectedPerson(String selectedPerson) {
   this.selectedPerson = selectedPerson;
 }

 Our JSP is coded so that the setup of the dropdown calls getListOfPeople()
 and the selected item populates setSelectedPerson(). The taglib
 allows this
 Struts 1.1 b2.

 This allows us to store the forms in the request and never have to worry
 about pre-populating them, this seems to work very well for us.

 I would appreciate feedback wrt this approach.

 Regards,
 Karim



 - Original Message -
 From: Puneet Agarwal [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 1:41 PM
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


  Even we had a similar problem in our application:
 
  Agree that making the ActionForm scope to be session may
 cause problems,
  but storing the information in request scope and copying all that
  information in html and then sending it back to the server
 again may cause
  extra network traffic.
 
  We adopted following workaround for this.
 
  1.  Make most of the ActionForm scope as session, and write a cleaning
  mechanism which could keep cleaning up the HTTP session on some basis.
What we adopted was as soon as the user shall operate on the top drop
  down menu of the application, it shall remove any ActionForms more than
 last
  5.(This 5 was configurable). This keeps the HTTP session lighter.
 
  2. For the screens that have 

RE: Collection within Collection

2003-01-14 Thread Mark Galbreath
You can use the Index property of the iterate tag to iterate through a
collection of collections.

Mark

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 10:04 AM


 I have a collection (of ArrayLists) within a collection of 
 (ArrayLists). In my action class I call a method that returns a 
 collection of historyItems.  I set that in request scope: For each 
 historyItem iteration, I want to iterate though the deltaItems: How 
 can I do this?  How do I refer to the deltaItem collection within each 
 historyItem collection?

Is JSTL an option?  You can nest c:forEach tags and iterate through
collections of collections.

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



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




RE: Collection Population Post-Validation Best Practice

2003-01-14 Thread pqin
I usually use two Action classes.

- LoadAction class to check if user is returned from page. Then I can
decide whether I shall populate page using what he has entered before or
instantiate a new page.
- Action class to process form submission and chain to next
LoadAction.

Regards,
 
 
PQ
 
This Guy Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED]] 
Sent: January 14, 2003 10:13 AM
To: Struts Users Mailing List
Subject: RE: Collection Population Post-Validation Best Practice

Personally, I like to keep my ActionForms as dumb as possible (I actually
use DynaValidatorActionForms). I see them as simple data transport
mechanism. When ever I have to prepopulate the ActionForm for a prepare
type of Action I do it within a the Action class (not explicitely - I
delegate to a service layer to handle this).

For me, this keeps things separate, simple and cohesive.

robert

 -Original Message-
 From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:12 AM
 To: Struts Users Mailing List
 Subject: RE:Collection Population Post-Validation Best Practice


 Greetings again,

 I appreciate the afformentioned approaches (Robert, Karim, Puneet). I find
 Roberts to be the most logical, simple and clean for myself. I use
 LookupDispatchAction so this would actually be easy to do. I was
 getting the
 loop for the very reason you mentioned :-D. It was a test app to
 see how to
 address the problem of populating collections post validation and I was
 calling the process Action.

 So the practice would be to separate the entry Action from the process
 Action. Use the entry action as your input for errors and it will have the
 logic to populate your collections prior to showing the page.

 It also seems to me that the ActionForm does not exclude us from making
 calls to our business logic from within the validate method. So if I have
 any standard prepopulation (post validation)... I can just call my logic
 classes and set the appropriate members of the ActionForm from within the
 validate prior to the ActionErrors returning to the input page.

 Something like (with validator):

 public MyActionForm extends ValidatorActionForm {

 ...

 public void setMyCollection(ArrayList myCollection) {

   this.myCollection = myCollection;

 }

 ...

 public ActionErrors validate(
   ActionMapping mapping,
   HttpServletRequest request)
 {

 // run my validator validation and capture error
 ActionErrors errors = super.validate(mapping,request);

 // run my own validation
 if (x != 5) {

   errors.add(myErrorMessage,
   new ActionError(my.custom.error));

 }

 if (errors.empty())
 {
return null;
 } else {
   ...
   // populate ActionForm collections here and return errors
   this.myCollection = MyLogicClass.getMyCollection();
 //retrieves Collection

   return errors;
 }


 }

 }

 So then here is the final question:
 Is it appropriate practice to have logic classes being called in the
 validate method to populate collections in the form? What's the official
 position?

 Thanks,
 Brandon Goodin
 Phase Web and Multimedia
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws


 -Original Message-
 From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 5:41 AM
 To: Struts Users Mailing List
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


 Hi

 What we have done is introduce a ListManager class. This is a singleton
 object that is accessible from the form via its superclass (our custom
 superclass).

 What we have done in our form is have two fields for a
 collection, i.e. our
 dropdown list. The first field is used to populate the values of the list
 and the second is used to store the selected value.

 E.G.:
 public Collection getListOfPeople() {
   return ListManager.getInstance().getPeople();
 }

 public String getSelectedPerson() {
   return selectedPerson;
 }

 public void setSelectedPerson(String selectedPerson) {
   this.selectedPerson = selectedPerson;
 }

 Our JSP is coded so that the setup of the dropdown calls getListOfPeople()
 and the selected item populates setSelectedPerson(). The taglib
 allows this
 Struts 1.1 b2.

 This allows us to store the forms in the request and never have to worry
 about pre-populating them, this seems to work very well for us.

 I would appreciate feedback wrt this approach.

 Regards,
 Karim



 - Original Message -
 From: Puneet Agarwal [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 1:41 PM
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


  Even we had a similar problem in our application:
 
  Agree that making the ActionForm scope to be session may
 cause problems,
  but storing the information in 

Tiles and Velocity

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
Do Velocity Templates and Tiles definitions work together?  Can I have a definition 
that points to different vm files and have this perform the way expected?

Thanks,

David Durham

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




Problem: Login with Struts; Security Bug?

2003-01-14 Thread frazz
Hi,
I'm  using Struts 1.0.2  and experienced a unwanted behavior.
I tested it with the struts-example coming with the binaries and it's the
same.
I'll explain it with the example so you can test it for yourself.

1.  Ok, first you need a registered user. If you haven't registered one do
so.
2. Enter http://localhost:8080/struts-example/index.jsp into your browser.
(whatever portnumber)
3. Click Log on to the MailReader Demonstration Application
4. Enter username and password. Click Login.
5. ClickLog off MailReader Demonstration Application
6. Click Back in your Browser
7. Click Edit your user registration profile
- you are  redirected to the login site. OK! You logged off, thats the
way it should be.
8. Click Back in your browser as many times as you need to get back to the
main Menu
You should be here:
   http://localhost:8080/struts-example/logon.do;jsessionid=ssf0t8t181;
(whatever sessionid)
9. Click Reload in your Browser
10. Click Link Edit your user registration profile  
What is this??? You are in again. You can edit your profile ! After the
logout you performed and
without to login again. It's somekind done automatically.
   I don't want that
   I logout and the next person using  my computer can log into my account
by reloading
   an old site from the browser-cache?.
   Is there a way to prevent it?? If have tried severel mata-tags in the
html for no-caching
   but nothing helps.
   Maybe the  browser is caching the userid and the password
   Is the only solution to close the window or to close the whole browser?

Thanks for your help!!
Greets frazz

-- 
  

+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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




Réf. : RE: Collection Population Post-ValidationBest Practice

2003-01-14 Thread Jean-Pierre Romeyer
I have the same problem and solve it as you do

I think the cleanest way would be to have a init method on the form for 
populating bean to be output
It will be  more simple,  lighter way to do it







Robert Taylor [EMAIL PROTECTED]
14/01/2003 16:12
Veuillez répondre à Struts Users Mailing List

 
Pour :  Struts Users Mailing List [EMAIL PROTECTED]
cc : 
Objet : RE: Collection Population Post-Validation Best Practice


Personally, I like to keep my ActionForms as dumb as possible (I actually
use DynaValidatorActionForms). I see them as simple data transport
mechanism. When ever I have to prepopulate the ActionForm for a prepare
type of Action I do it within a the Action class (not explicitely - I
delegate to a service layer to handle this).

For me, this keeps things separate, simple and cohesive.

robert

 -Original Message-
 From: Phase Web and Multimedia [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:12 AM
 To: Struts Users Mailing List
 Subject: RE:Collection Population Post-Validation Best Practice


 Greetings again,

 I appreciate the afformentioned approaches (Robert, Karim, Puneet). I 
find
 Roberts to be the most logical, simple and clean for myself. I use
 LookupDispatchAction so this would actually be easy to do. I was
 getting the
 loop for the very reason you mentioned :-D. It was a test app to
 see how to
 address the problem of populating collections post validation and I was
 calling the process Action.

 So the practice would be to separate the entry Action from the process
 Action. Use the entry action as your input for errors and it will have 
the
 logic to populate your collections prior to showing the page.

 It also seems to me that the ActionForm does not exclude us from making
 calls to our business logic from within the validate method. So if I 
have
 any standard prepopulation (post validation)... I can just call my logic
 classes and set the appropriate members of the ActionForm from within 
the
 validate prior to the ActionErrors returning to the input page.

 Something like (with validator):

 public MyActionForm extends ValidatorActionForm {

 ...

 public void setMyCollection(ArrayList myCollection) {

this.myCollection = myCollection;

 }

 ...

 public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request)
 {

 // run my validator validation and capture error
 ActionErrors errors = super.validate(mapping,request);

 // run my own validation
 if (x != 5) {

errors.add(myErrorMessage,
new ActionError(my.custom.error));

 }

 if (errors.empty())
 {
 return null;
 } else {
...
// populate ActionForm collections here and return errors
this.myCollection = MyLogicClass.getMyCollection();
 //retrieves Collection

return errors;
 }


 }

 }

 So then here is the final question:
 Is it appropriate practice to have logic classes being called in the
 validate method to populate collections in the form? What's the official
 position?

 Thanks,
 Brandon Goodin
 Phase Web and Multimedia
 P (406) 862-2245
 F (406) 862-0354
 [EMAIL PROTECTED]
 http://www.phase.ws


 -Original Message-
 From: Karim Saloojee [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 5:41 AM
 To: Struts Users Mailing List
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


 Hi

 What we have done is introduce a ListManager class. This is a singleton
 object that is accessible from the form via its superclass (our custom
 superclass).

 What we have done in our form is have two fields for a
 collection, i.e. our
 dropdown list. The first field is used to populate the values of the 
list
 and the second is used to store the selected value.

 E.G.:
 public Collection getListOfPeople() {
   return ListManager.getInstance().getPeople();
 }

 public String getSelectedPerson() {
   return selectedPerson;
 }

 public void setSelectedPerson(String selectedPerson) {
   this.selectedPerson = selectedPerson;
 }

 Our JSP is coded so that the setup of the dropdown calls 
getListOfPeople()
 and the selected item populates setSelectedPerson(). The taglib
 allows this
 Struts 1.1 b2.

 This allows us to store the forms in the request and never have to worry
 about pre-populating them, this seems to work very well for us.

 I would appreciate feedback wrt this approach.

 Regards,
 Karim



 - Original Message -
 From: Puneet Agarwal [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 1:41 PM
 Subject: Re: [Our Practice]Collection Population Post-Validation Best
 Practice


  Even we had a similar problem in our application:
 
  Agree that making the ActionForm scope to be session may
 cause problems,
  but storing the information in request scope and copying all that
  

Re: Collection within Collection

2003-01-14 Thread Gemes Tibor
2003. január 14. 16:19 dátummal Mark Galbreath ezt írtad:
 You can use the Index property of the iterate tag to iterate through a
 collection of collections.

or indexId ?

Tib

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




tiles scopes and .do in definitions

2003-01-14 Thread Adolfo Miguelez

Hi all,

I am glancing the 11th chapter of Struts in action chapter: Tiles. In 
11.3.3 it says that by declaring a definition in the XML file, it will be 
available for the app. It also says for Definition tag the syntax used 
wuthin the XML config file is similar to the tiles definition tag.

However, when we do the definition in a JSP page we have available the scope 
attribute to specify scope. Why is not this attribute available in the XML 
definition. where am I mistaking.

Another question. Can I specify a .do rather than a jsp file in definitions?

TIA,

Adolfo.






_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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



RE: Collection within Collection

2003-01-14 Thread Mark Galbreath
Yep - been awhile  :-)

Mark

-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 10:32 AM
To: Struts Users Mailing List
Subject: Re: Collection within Collection


2003. január 14. 16:19 dátummal Mark Galbreath ezt írtad:
 You can use the Index property of the iterate tag to iterate through 
 a collection of collections.

or indexId ?

Tib

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




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




RE: Any reflection based utility to copy ActionForm to/from Domai n object?

2003-01-14 Thread Kris Schneider
http://jakarta.apache.org/commons/beanutils/api/index.html

Quoting Elbert, Denise M [EMAIL PROTECTED]:

 In the struts API Documentation it says that the
 PropertiesUtil.copyProperties is depracated and there isn't any
 BeanUtils.copyProperties defined.  Where can I get information about this
 method.
 
 Thanks

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

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




Re: ActionServlet.findForward replacement?

2003-01-14 Thread Giri Alwar
Another useful method in the ActionMapping object  is the getInputForward()
method which automatically returns an ActionForward representing the input
attribute in your action mapping.

- Original Message -
From: martin j nilsson [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 1:40 AM
Subject: RE: ActionServlet.findForward replacement?


Hi again,

Thank you for your reply!

Yes, I noticed this and although that way works fine for me, this comment in
the javadoc makes me think that it's not the preferred best-practice:

--- 8 
This class would have been deprecated and replaced by
org.apache.struts.config.ActionConfig except for the fact that it is part of
the public API that existing applications are using.
--- 8 


regards,
martin


 One of the parameters you receive in the execute function, is
 an Actionmapping object. On that object you can call, e.g.
 mapping.findForward(SUCCESS); or better yet,
 mapping.findForward(MappingKeys.SUCCESS);



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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/31/2002

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




RE: It lives....

2003-01-14 Thread Chappell, Simon P
What??? You have a mad horde? I thought I had the only one!

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 7:13 AM
To: 'Struts Users Mailing List'
Subject: RE: It lives


I'm a follower of Cthulu. And I lead a mad horde, searching 
everywhere for
my evil overlord!

(what's this old shyte???)
:-)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 13, 2003 9:55 PM


One of the great old ones awakes! Be afraid mortals!

Ai! Cthulu ftagn! (etc...)

;-)



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



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




RE: Collection within Collection

2003-01-14 Thread Cohan, Sean
Excuse my naiveté, how would I refer to collection within a collection?
Thanks

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 10:20 AM
To: 'Struts Users Mailing List'
Subject: RE: Collection within Collection


You can use the Index property of the iterate tag to iterate through a
collection of collections.

Mark

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 10:04 AM


 I have a collection (of ArrayLists) within a collection of 
 (ArrayLists). In my action class I call a method that returns a 
 collection of historyItems.  I set that in request scope: For each 
 historyItem iteration, I want to iterate though the deltaItems: How 
 can I do this?  How do I refer to the deltaItem collection within each 
 historyItem collection?

Is JSTL an option?  You can nest c:forEach tags and iterate through
collections of collections.

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



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

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




Re: Struts--- Validator plugin HELP NEEDED!!

2003-01-14 Thread Giri Alwar
The problem is that you have set the validate attribute to false in the
action mapping essentially turning off validation. This attribute should be
set to true or omitted (in which case it defaults to true - I would
recommend explicitly setting it to true to help others understand that
validation is turned on). Do your ActionForms extend ValidatorForm instead
of ActionForm? You were right in removing the validate method in your form
beans. This will allow the validate method in the ValidatorForm class (which
you extend) to be called and this method will then enforce the validation as
per the rules in validation.xml.

- Original Message -
From: Vijay Khanna [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 3:07 AM
Subject: Struts--- Validator plugin HELP NEEDED!!


 Hello to all struts users.

 I am facing somewhat unusual problem.The cuurent project is being built on
 struts 1.1
 All the validations were earlier done is ACTIONFORMS.for good application
 architecture we have decided to go for StrutsValidator/ Validator plugin
 which will take care of all the validations.

 All common validations are being done using the validation.xml and
 validator-rules.xml.
 (minlength, maxlength, email, required)
 for customised validation we have made validation-custom.xml and
 validator-custom-rules.xml.
 (field comparison etc)

 I have removed the Validate() from the ActionForm and set validation=false
 in the action mapping of struts-config.xml(This was done later as we
thought
 setting to true invoked the validate().So we set it to validate=false,
 inorder to invloke the plugin).When the application starts-up the digestor
 reads the xml files and hold the validation in struts memory.All the error
 messages are given in the resource file.But we don't understand the
 validation is not occuring.We believe struts is not able invoke and passe
it
 to the plugin.

 Below is an extract from the struts-config.xml.The Tiles plugin works just
 fine ..but Validator plugin does not work at all.

 plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames

value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
 ion-custom.xml,/WEB-INF/validator-custom-rules.xml/
 /plug-in


 plug-in className=org.apache.struts.tiles.TilesPlugin 
 set-property property=definitions-config
 value=/WEB-INF/tiles-defs.xml /
 set-property property=definitions-debug value=1 /
 set-property property=definitions-parser-details value=0 /
 set-property property=definitions-parser-validate value=true /
 /plug-in



 Any ideas from your guys...?

 Help is appreciated.

 thanx
 Vijay



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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/31/2002

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




problem of deploying with new commons-beanutils.jar

2003-01-14 Thread Ginger Cheng
I can not deploy with the latest vesion of commons-beanutil. here is the 
msg from jboss. Can someone tell me what is going on? Thankyou.
ginger

10:48:02,257 ERROR [URLDeploymentScanner] Failed to deploy: 
org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@846058b3{ url=fil
org.jboss.deployment.DeploymentException: Could not create deployment: 
file:/D:/apps/jboss-3.0.2/server/default/tmp/deploy/server/default/d
 jzfile = 188541840,
 total = 55,
 name = C:\Documents and Settings\zcheng\Local 
Settings\Temp\Jetty__8080___sequencing\webapp\WEB-INF\lib\commons-beanutils.jar,
 i = 9,
 message = invalid LOC header (bad signature))
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:822)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:794)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy4.deploy(Unknown Source)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:427)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:553)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
Caused by: java.lang.InternalError: jzentry == 0,
 jzfile = 188541840,
 total = 55,
 name = C:\Documents and Settings\zcheng\Local 
Settings\Temp\Jetty__8080___sequencing\webapp\WEB-INF\lib\commons-beanutils.jar,
 i = 9,
 message = invalid LOC header (bad signature)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:309)
at java.util.jar.JarFile$1.nextElement(JarFile.java:201)
at 
org.apache.jasper.compiler.TldLocationsCache.tldConfigJar(TldLocationsCache.java:238)
at 
org.apache.jasper.compiler.TldLocationsCache.processJars(TldLocationsCache.java:211)
at 
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:139)
at 
org.apache.jasper.EmbededServletOptions.init(EmbededServletOptions.java:350)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:265)
at 
org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:208)
at 
org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:427)
at 
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:405)
at org.jboss.jetty.Jetty.deploy(Jetty.java:409)
at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
at 
org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
... 15 more
10:48:32,257 ERROR [STDERR] 2003/01/14 10:48:32:257 EST [DEBUG] 
LimsWebController - -.init(ServletContext context)
10:48:32,257 ERROR [STDERR] 2003/01/14 10:48:32:257 EST [DEBUG] 
LimsWebController - -destroy()
10:48:32,273 WARN  [jbossweb] WARNING:
java.lang.IllegalStateException
at 
org.mortbay.jetty.servlet.AbstractSessionManager$Session.getAttribute(AbstractSessionManager.java:494)
at 
com.genomequebec.genomecenter.lims.controller.web.LimsWebController.destroy(LimsWebController.java:78)
at 
com.sun.j2ee.blueprints.waf.controller.web.DefaultComponentManager.sessionDestroyed(DefaultComponentManager.java:131)
at 
org.mortbay.jetty.servlet.AbstractSessionManager$Session.invalidate(AbstractSessionManager.java:476)
at 
org.mortbay.jetty.servlet.AbstractSessionManager.scavenge(AbstractSessionManager.java:294)
at 
org.mortbay.jetty.servlet.AbstractSessionManager.access$100(AbstractSessionManager.java:47)
at 
org.mortbay.jetty.servlet.AbstractSessionManager$SessionScavenger.run(AbstractSessionManager.java:323)


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



Re: display messages, not errors

2003-01-14 Thread Giri Alwar
 This is what I have in viewschedule.jsp:

 logic:messagesPresent message=true
 there were some messages
 UL
  html:messages id=message message=true/
 LIbean:write name=message//LI
  /html:messages
 /UL
 /logic:messagesPresent

 As you can see in the above, there are id=message and name=message.
I'm
 not positive, but I think that one of those =message refers to the
 message in

 message.rows.added=Du har tilføjet {0} ny kursus
 message.rows.deleted=Du har bortvist {0} kursus

 from my ApplicationResources.properties, so it may be important to prefix
 any strings that you want to display as messages, with message.


Not true. In the html:messages tag, the id attribute can be set to any
name. Think of the html:messages tag as a for loop that iterates over the
messages. Think of the id attribute as the for loop counter variable that
is set in page scope (local variable in your JSP). For each iteration of the
html:messages tag, you want to display the counter variable message. When
you use a bean:write and specify the name attribute, you are specifying
the name of an attribute to lookup in some scope. Since you did not specify
a scope in the bean:write tag, it looks for this attribute in all scopes
starting with the page scope. Since the surrounding html:messages tag
declared a variable called message in the page scope, it finds this one
and displays it.

The important thing in your above example is the message atttribute which
should be set to true. If you don't do this, the errors (as opposed to
messages) will be displayed.




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/31/2002

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




RE: tiles scopes and .do in definitions

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
The book also says that these definitions are put into a definition factory so that 
they are available to jsp tags and action forwards.  So the scope appears to be the 
definition factory, and there is some auto-magic so that tags and action forwards can 
find these definitions.

Please, someone correct me if I'm wrong.

-Dave


 -Original Message-
 From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 9:37 AM
 To: [EMAIL PROTECTED]
 Subject: tiles scopes and .do in definitions
 
 
 
 Hi all,
 
 I am glancing the 11th chapter of Struts in action chapter: 
 Tiles. In 
 11.3.3 it says that by declaring a definition in the XML 
 file, it will be 
 available for the app. It also says for Definition tag the 
 syntax used 
 wuthin the XML config file is similar to the tiles definition tag.
 
 However, when we do the definition in a JSP page we have 
 available the scope 
 attribute to specify scope. Why is not this attribute 
 available in the XML 
 definition. where am I mistaking.
 
 Another question. Can I specify a .do rather than a jsp file 
 in definitions?
 
 TIA,
 
 Adolfo.
 
 
 
 
 
 
 _
 Protect your PC - get McAfee.com VirusScan Online 
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


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




RE: Problem: Login with Struts; Security Bug?

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
You are probably reposting your username and password to logon.do.  Essentially 
logging on twice.



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 9:27 AM
 To: [EMAIL PROTECTED]
 Subject: Problem: Login with Struts; Security Bug?
 
 
 Hi,
 I'm  using Struts 1.0.2  and experienced a unwanted behavior.
 I tested it with the struts-example coming with the binaries 
 and it's the
 same.
 I'll explain it with the example so you can test it for yourself.
 
 1.  Ok, first you need a registered user. If you haven't 
 registered one do
 so.
 2. Enter http://localhost:8080/struts-example/index.jsp into 
 your browser.
 (whatever portnumber)
 3. Click Log on to the MailReader Demonstration Application
 4. Enter username and password. Click Login.
 5. ClickLog off MailReader Demonstration Application
 6. Click Back in your Browser
 7. Click Edit your user registration profile
 - you are  redirected to the login site. OK! You logged 
 off, thats the
 way it should be.
 8. Click Back in your browser as many times as you need to 
 get back to the
 main Menu
 You should be here:

 http://localhost:8080/struts-example/logon.do;jsessionid=ssf0t8t181;
 (whatever sessionid)
 9. Click Reload in your Browser
 10. Click Link Edit your user registration profile  
 What is this??? You are in again. You can edit your 
 profile ! After the
 logout you performed and
 without to login again. It's somekind done automatically.
I don't want that
I logout and the next person using  my computer can log 
 into my account
 by reloading
an old site from the browser-cache?.
Is there a way to prevent it?? If have tried severel 
 mata-tags in the
 html for no-caching
but nothing helps.
Maybe the  browser is caching the userid and the password
Is the only solution to close the window or to close the 
 whole browser?
 
 Thanks for your help!!
 Greets frazz
 
 -- 
   
 
 +++ GMX - Mail, Messaging  more  http://www.gmx.net +++
 NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


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




RE: Unmarshalling using the Digester

2003-01-14 Thread Toni
Ok, I figured it out.

  rules
  definition objectClassName=net.pnh.base.Group
  enforcer
priority=5net.pnh.rule.GroupRuleEnforcer/enforcer
  enforcer
priority=9net.pnh.rule.GroupRuleEnforcer2/enforcer
  definition/
   definition objectClassName=net.pnh.base.Individual
  enforcer
priority=1net.pnh.rule.IndividualRuleEnforcer/enforcer
  enforcer
priority=4net.pnh.rule.IndividualRuleEnforcer2/enforcer
  definition/
 
  /rules

I needed to have an EnforcerElement object and add each element to a
list in the EnforcerDefinition class.  Furthermore, the name attribute
in the definition tags was changed to objectClassName match the setter
in the EnforcerDefinition Class.

I needed three classes:
 1. EnforcerDefinitions
  methods: set(EnforcerDefinition edef);

 2. EnforcerDefinition
  methods: addEnforcerElement(EnforcerElement elem)
   setObjectClassName(String val)

 3. EnforcerElement
  methods: setPriority(int val);
   setClassName(String val)


Here is the digester setting:

digester.addObjectCreate(rules/definition, 
 
biz.isman.rule.engine.EnforcerDefinition.class);
digester.addSetProperties(rules/definition);

// parse through enforcer elements
digester.addObjectCreate(rules/definition/enforcer, 
biz.isman.rule.engine.EnforcerElement.class);

digester.addSetProperties(rules/definition/enforcer);
digester.addCallMethod(rules/definition/enforcer,
setClassName, 0);

// insert the new EnforcerElement in the EnforcerDefinition
digester.addSetNext(rules/definition/enforcer,
addEnforcerElement);

// put the new EnforcerDefinition somewhere for later use.
digester.addSetNext(rules/definition, set);


-Original Message-
From: Toni Charlot [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 13, 2003 4:01 PM
To: [EMAIL PROTECTED]
Subject: Unmarshalling using the Digester


Can anyone figure out what I'm doing wrong here?  Oh, please?

001 digester.addObjectCreate(rules/definition/enforcerClassName, 
002
biz.isman.rule.engine.EnforcerDefinition.class);
003
004//
005digester.addCallMethod(rules/definition/enforcer,
setEnforcerClassName, 0);
006digester.addSetProperty(rules/definition, name,
setObjectClassName);
007digester.addSetProperties(rules/definition/enforcer);
008//
009digester.addSetNext(rules/definition/enforcer,
addDefinition);

Here is the file I'm trying unmarshall:

  rules
  definition name=net.pnh.base.Group
  enforcer
priority=5net.pnh.rule.GroupRuleEnforcer/enforcer
  enforcer
priority=9net.pnh.rule.GroupRuleEnforcer2/enforcer
  definition/
   definition name=net.pnh.base.Individual
  enforcer
priority=1net.pnh.rule.IndividualRuleEnforcer/enforcer
  enforcer
priority=4net.pnh.rule.IndividualRuleEnforcer2/enforcer
  definition/
 
  /rules

I would like to end up with a list of definitions objects where

Definition1: name=net.pnh.base.Group;
enforcer=net.pnh.rule.GroupRuleEnforcer; priority=5
Definition2: name=net.pnh.base.Group;
enforcer=net.pnh.rule.GroupRuleEnforcer2; priority=9 ..

Thank you.



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




AW: Transforming a String to valid HTML encoding

2003-01-14 Thread Hirschmann, Bernhard

I wonder if this problem is too easy or too hard - may please somebody
comment this? 

Craig?

Thank you very much


- original message -

I still have the problem to transform a String containing national special
characters to the appropriate HTML encoding.

i.e.: schön  reich -- schouml;n amp reich

The class org.apache.struts.util.ResponseUtils only transforms the 4
characters , ,  and  into their html representative. 

Is there another transformer around?

Any hints highly appreciated.

Regards,
Bernhard


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


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




Nested tags configuration

2003-01-14 Thread Mark Lowe
anyone had any problems getting netsted tags running?

i've been working through the monkey - banna example and i keep getting  
this:


org.apache.jasper.compiler.ParseException: End of content reached while  
more parsing required: tag nesting error?
at  
org.apache.jasper.compiler.JspReader.popFile(JspReader.java:293)
at  
org.apache.jasper.compiler.JspReader.hasMoreInput(JspReader.java:337)
at  
org.apache.jasper.compiler.JspReader.nextChar(JspReader.java:346)
at  
org.apache.jasper.compiler.JspReader.skipUntil(JspReader.java:473)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:868)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:892)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:892)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at  
org.apache.jasper.compiler.ParserController.parse(ParserController.java: 
214)
at  
org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at  
org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
at  
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J 
spServlet.java:176)
at  
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle 
t.java:188)
at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at  
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:247)
at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:193)
at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv 
e.java:243)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:566)
at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
72)
at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv 
e.java:190)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:566)
at  
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja 
va:246)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:564)
at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
72)
at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at  
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234 
7)
at  
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java 
:180)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:566)
at  
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa 
lve.java:170)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:564)
at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 
:170)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:564)
at  
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468 
)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:564)
at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
72)
at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at  
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. 
java:174)
at  
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja 
va:566)
at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
72)
at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at  
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j 
ava:1027)
at  
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 
1125)
at java.lang.Thread.run(Thread.java:491)

The jsp is that from the example...

  html:form action=/action-tutorial.do
Monkey Name: nested:text property=monkeyName /br
Monkey Age: nested:text property=monkeyAge /br

br
html:submitSubmit Form/html:submit
  /html:form


The bean is compiled 

Validator

2003-01-14 Thread Alvarado, Juan (c)
Can anyone explain to me what this regular expression means:

^\d{5}\d*$ -- Zip validation that comes with the validator

I thought it meant you could only type in a five digit zip code. Ex: 33634

However, I am allowed to type: 3363455 and that works.

Of course, since I am no expert on regular expressions, I am sure I am
missing something. 

What I basically need to accomplish is to allow a user to be able to type in
a zip code in two formats and only those two formats:

33634-6661 OR 33634

Any help is greatly appreciated.

Thanks




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




RE: How to integrate servlet with parameters into tiles definition

2003-01-14 Thread Dealy, Brian
Gemes, Many thanks, I tried for several days to hit upon the right
combinations
to get this to work within my struts/tiles environment and your solution 
worked perfectly!! many thanks!
Brian

-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 13, 2003 11:14 PM
To: Struts Users Mailing List
Subject: Re: How to integrate servlet with parameters into tiles definition


2003. január 13. 21:48 dátummal bdealy1 ezt írtad:
 Hi, I have been having a problem integrating a servlet into
 a tiles definition. It takes a config file as parameter config and I 
 have tried to directly call the servlet by putting it in the 
 tiles-def.xml file like this:

 definition name=.gradebook.Assignments extends=.gradebook.Base
put name=zcontent 
 value=http://localhost:8080/gradebooktest/servlet/Forum/

I create a new page (callForum.jsp) which contains only the following:

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % bean:include
id=text href=/gradebooktest/servlet/Forum / bean:write name=text
filter=false/

And put into tiles definition a call for this jsp:
   put name=zcontent
 value=/callForum.jsp/

Hth,

Tib


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

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




RE: Validator

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
it says match beginning of string/line, match 5 digits, match 0 or more digits and 
match the end of the string/line.



 -Original Message-
 From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:49 AM
 To: 'Struts Users Mailing List'
 Subject: Validator
 
 
 Can anyone explain to me what this regular expression means:
 
 ^\d{5}\d*$ -- Zip validation that comes with the validator
 
 I thought it meant you could only type in a five digit zip 
 code. Ex: 33634
 
 However, I am allowed to type: 3363455 and that works.
 
 Of course, since I am no expert on regular expressions, I am sure I am
 missing something. 
 
 What I basically need to accomplish is to allow a user to be 
 able to type in
 a zip code in two formats and only those two formats:
 
 33634-6661 OR 33634
 
 Any help is greatly appreciated.
 
 Thanks
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Validator

2003-01-14 Thread Nelson, Laird
 -Original Message-
 From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
 Can anyone explain to me what this regular expression means:
 
 ^\d{5}\d*$ -- Zip validation that comes with the validator

Start of line followed by five digits followed by zero or more digits
followed by end of line.  This has the effect of making the {5} ineffectual.
Probably not what you want.

 What I basically need to accomplish is to allow a user to be 
 able to type in
 a zip code in two formats and only those two formats:
 
 33634-6661 OR 33634

Untested RE follows:

  ^\d{5}(-\d{4})?$

Give that a shot.

Cheers,
Laird

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




Re: Validator

2003-01-14 Thread Eric Jain
 ^\d{5}\d*$ -- Zip validation that comes with the validator

Would be the same as ^\d{5,}$, meaning 'at least five digits'.


 33634-6661 OR 33634

Try ^\d{4,}(\-\d{4,})?$


--
Eric Jain


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




RE: Validator

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
Forgot second part, try something like ^\d{5}(-\d{4})?$

 -Original Message-
 From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:49 AM
 To: 'Struts Users Mailing List'
 Subject: Validator
 
 
 Can anyone explain to me what this regular expression means:
 
 ^\d{5}\d*$ -- Zip validation that comes with the validator
 
 I thought it meant you could only type in a five digit zip 
 code. Ex: 33634
 
 However, I am allowed to type: 3363455 and that works.
 
 Of course, since I am no expert on regular expressions, I am sure I am
 missing something. 
 
 What I basically need to accomplish is to allow a user to be 
 able to type in
 a zip code in two formats and only those two formats:
 
 33634-6661 OR 33634
 
 Any help is greatly appreciated.
 
 Thanks
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: No value found for attribute

2003-01-14 Thread Wendy Smoak
Cedric wrote:
 You try to do something like tiles:insert attribute=menubar /, but 
 there is no menubar attribute defined for your current tiles.
 Check the definition used to insert the current tiles: is there a 
 menubar attribute ?

Sorry for the incomplete message, I hit the wrong button as I was shutting
down yesterday.  Here's what I've done to take a working tiles page and
cause it to turn into a page of errors:

definition name=masterPage path=/WEB-INF/jsp/basicLayout.jsp
 put name=stylesheet  value=/css/style.css /
 put name=title   value=Benefactor Web /
 put name=banner  value=/WEB-INF/jsp/banner.jsp /
 put name=menubar value=/WEB-INF/jsp/menubar.jsp /  !-- added
this line --
 put name=footer  value=/WEB-INF/jsp/footer.jsp /
 put name=script  value=/WEB-INF/jsp/javaScript.jsp /
  /definition

.../WEB-INF/jsp/menubar.jsp merely contains the text:
menu bar

Added this to basicLayout.jsp:
tiles:insert attribute=menubar /

Stop and start Tomcat, and the page that was working now displays:
[ServletException in:basicLayout.jsp] Error - Tag Insert : No value found
for attribute 'menubar'.'
javax.servlet.ServletException: Error - Tag Insert : No value found for
attribute 'menubar'.

If I take the insert out of basicLayout, it all goes back to working again.

The REALLY WEIRD thing is that this worked, once, yesterday.  I saw the text
stored in menubar.jsp appear on my page, but it was in the wrong place.
When I edited basicLayout.jsp and moved the tiles:insert tag to a
different place, this started happening.

I can see in the log that BeanUtils is working with the menubar and
/WEB-INF/jsp/menubar.jsp values, but I don't really know what I'm looking
at.

I've tried deleting all the files in the work directory, stopping and
starting Tomcat [4.1.18] and I also tried 1.1b3 and the nightly from the
13th.  Those, unfortunately, leave me with a completely blank page.

Has anyone seen a similar problem?

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



RE: Validator

2003-01-14 Thread Alvarado, Juan (c)
FYI... A colleague of mine came up with this: ^\d{5}$|^\d{5}-\d{4}$

That does what I want.

Thanks to everyone who replied.

-Original Message-
From: Durham David Cntr 805CSS/SCBE [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 11:57 AM
To: Struts Users Mailing List
Subject: RE: Validator


Forgot second part, try something like ^\d{5}(-\d{4})?$

 -Original Message-
 From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 10:49 AM
 To: 'Struts Users Mailing List'
 Subject: Validator
 
 
 Can anyone explain to me what this regular expression means:
 
 ^\d{5}\d*$ -- Zip validation that comes with the validator
 
 I thought it meant you could only type in a five digit zip 
 code. Ex: 33634
 
 However, I am allowed to type: 3363455 and that works.
 
 Of course, since I am no expert on regular expressions, I am sure I am
 missing something. 
 
 What I basically need to accomplish is to allow a user to be 
 able to type in
 a zip code in two formats and only those two formats:
 
 33634-6661 OR 33634
 
 Any help is greatly appreciated.
 
 Thanks
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




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




RE: No value found for attribute [FIXED]

2003-01-14 Thread Wendy Smoak
 If I take the insert out of basicLayout, it all goes back to working
again.

Never mind... I switched to using tiles-defs.xml when I started using tabbed
pages, but I did not switch all of my old pages over, and the one in
question still has the inserts in the .jsp file.

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



RE: Any reflection based utility to copy ActionForm to/from Domain object?

2003-01-14 Thread Craig R. McClanahan


On Tue, 14 Jan 2003, Elbert, Denise M wrote:

 Date: Tue, 14 Jan 2003 10:02:18 -0500
 From: Elbert, Denise M [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Any reflection based utility to copy ActionForm to/from
 Domai n object?

 In the struts API Documentation it says that the
 PropertiesUtil.copyProperties is depracated and there isn't any
 BeanUtils.copyProperties defined.  Where can I get information about this
 method.


In Struts 1.1, use the APIs from commons-beanutils.  They are documented
at:

  http://jakarta.apache.org/commons/beanutils/api/

with other similar URLs for the other Commons packages that are included.

 Thanks

Craig


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




RE: Collection within Collection

2003-01-14 Thread Mark Galbreath
If you have a collection like an ArrayList, every element has an index.  At
each of these element addresses, you have another ArrayList.  With Struts,
if you iterate through the parent collection based on the indexId (first
element = 0, last element = n-1), you can retrieve the contents of each
collection stored at the element index of the collection automatically:

logic:iterate name=parentCollection
   property=parentProperty
   indexId=parentIndex  //arbitrary name
   id=parent//arbitrary name
   type=java.util.List
  logic:iterate name=parent
 property=childProperty
 indexId=childIndex  //arbitrary name
 id=child//arbitrary name
 type=java.util.List
bean:write name=child property=_whatever_ /
// etc.
  /logic:iterate
/logic:iterate


Mark

-Original Message-
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 11:08 AM


Excuse my naiveté, how would I refer to collection within a collection?
Thanks



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




RE: Regular Expressions

2003-01-14 Thread Mark Galbreath
A handy online reference:

http://developer.netscape.com/docs/manuals/js/client/jsref/index.html

Hardcopy references:

Wall, Christianson, Programming Perl or Learning Perl (O'Reilly)
Travis, Understanding and Using Regular Expressions in Java (Manning)


Mark

-Original Message-
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 12:06 PM


FYI... A colleague of mine came up with this: ^\d{5}$|^\d{5}-\d{4}$



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




Dynamically changing the form class in the execute() method

2003-01-14 Thread Jordan Thomas
Hi,

How can I dynamically change the the form class and name that my action is
using? i.e. In the middle of the execute() method.

thanks

Jordan


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




Re: Login with Struts; Security Bug?

2003-01-14 Thread frazz
Obviously  It's posted again when you reload the page, but I don't think
this is the way it has to be. Why does the browser post information
(Password)
it should not be aware any more after the Login-request has been
processesed?
Anyway, I am interested in a solution how to disable this behaviour.
Any  ideas?

frazz

 -Original Message- 
MIME-Version: 1.0
Content-Type: text/plain;
   charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Subject: RE: Problem: Login with Struts; Security Bug?
Date: Tue, 14 Jan 2003 10:19:10 -0600
Message-ID:
[EMAIL PROTECTED]
From: Durham David Cntr 805CSS/SCBE [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]

You are probably reposting your username and password to logon.do.  =
Essentially logging on twice.




-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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




Re: AW: Transforming a String to valid HTML encoding

2003-01-14 Thread Craig R. McClanahan


On Tue, 14 Jan 2003, Hirschmann, Bernhard wrote:

 Date: Tue, 14 Jan 2003 17:31:03 +0100
 From: Hirschmann, Bernhard [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: AW: Transforming a String to valid HTML encoding


 I wonder if this problem is too easy or too hard - may please somebody
 comment this?


ResponseUtils is only worried about filtering the characters that could
cause security problems -- it is not designed to be a general purpose URL
encoder.  For that, check out the java.net.URLEncoder class.

 Craig?

 Thank you very much

Craig




 - original message -

 I still have the problem to transform a String containing national special
 characters to the appropriate HTML encoding.

 i.e.: schön  reich -- schouml;n amp reich

 The class org.apache.struts.util.ResponseUtils only transforms the 4
 characters , ,  and  into their html representative.

 Is there another transformer around?

 Any hints highly appreciated.

 Regards,
 Bernhard


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


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




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




Re: Regular Expressions

2003-01-14 Thread Eric Jain
 Thanks to everyone who replied.

I do hope this wasn't just a trick question to expose the closet Perl
programmers...


--
Eric Jain


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




Hijacking ActionErrors to display in frames

2003-01-14 Thread Viggio, Alex
I'm having a problem due to the frame-based layout of one of our pages.
Because the framing page (w/ the frameset/frames definition) gets the
request first, the ActionErrors in the request don't make it down to the
sub-frame pages. Is it possible to hijack the action errors via a scriplet
in the framing page that forwards the ActionErrors (as ActionErrors) along
to one or more framed JSPs.

I found the following posting, but I'd prefer to forward the actual
ActionErrors instead of just an HTML string representation.

Anyone have experience with this? What is the identifying name for the
ActionErrors object in the request?

Thanks,
- Alex

*** http://www.mail-archive.com/struts-user@jakarta.apache.org/msg22734.html
***

Solved: ActionErrors within frames manually forwarded




From: holger.wiechert 
Subject: Solved: ActionErrors within frames manually forwarded 
Date: Tue, 05 Feb 2002 10:42:10 -0800 




Well, after an eternity, the problem found was
that the ApplicationResources property errors.header 
had a value with double quotes in it (like font color=red).
That spoiled the src string in the frame page.

Have fun,
Holger

-Ursprüngliche Nachricht-
Von:[EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Gesendet am:Dienstag, 5. Februar 2002 12:37
An: [EMAIL PROTECTED]
Betreff:ActionErrors within frames manually forwarded

Hi,

I've spent some time checking the list for this issue,
but I could only find related topics, that didn't really help. 
In case that this has been answered before, please ignore it
and send me a link.

I think that there must be something I've missed
when using the Struts validation feature within frames.
In short: I'm trying to manually retrieve and forward the ActionErrors
within a frame definition page (which is the input page
for a mapping). But those manually set request parameters
are gone when I access them.

The situation is as follows:

The page myframe.jsp consists of two frames: 
mynavigation.jsp and myContent.jsp. 
myContent.jsp is the JSP that is validated. 
In case that a validation error (ActionError) occurs,
the follwoing (relevant) events occur (correct me if I'm wrong)
- Struts puts the ActionErrors I created within validate into the request
- a forward to the input page is done as defined in the struts-config (in
  my case the action entry is:
action  path=/myContentActionPath
 type=some.SomeAction
 name=contentForm
 scope=session
 validate=true
 input=/myframe.jsp
  forward name=back path=/somePrev.jsp/
  forward name=next path=/someNext.jsp/
/action

  so it leads to the frame page.
- within the myframe.jsp, two new requests are created: one for each frame

But I think I should still be able to access the request with the
ActionErrors
within the frame definition page. So in myframe.jsp I could do something
like:

myframe.jsp:
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
head
  html:base/ 
  titleMyTitle/title
meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1
/head
frameset cols=150,* frameborder=no border=0 framespacing=0 
  frame src=myNavigation.jsp NAME=Menue
  frame src=myContent.jsp?manuallySetParam=html:errors 
property=myErrorProperty/ NAME=content
  /frameset
noframes
/noframes 
/html:html


in order to retrieve the ActionError String for property myErrorProperty
within the content page:

myContent.jsp:

...

P %= request.getParameter(manuallySetParam) % /P




This - I agree - doesn't look elegant, but at least it should work.

If I have the input page defined as a pure jsp (no frames),
the html:errors are retrieved as expected.

Are there any ideas, why the parameter manuallySetParam does not
contain the error message of key myErrorProperty ?

Help and/or design suggestions greatly appreciated!

Thanks in advance,
Holger

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




Re: Transforming a String to valid HTML encoding

2003-01-14 Thread Dan Tran
Did you follow the instructions in

http://www.anassina.com/struts/i18n/i18n.html ?

-D

- Original Message -
From: Hirschmann, Bernhard [EMAIL PROTECTED]
To: Struts User Mailing List (E-Mail) [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 3:32 AM
Subject: Transforming a String to valid HTML encoding




I still have the problem to transform a String containing national special
characters to the appropriate HTML encoding.

i.e.: schön  reich -- schouml;n amp reich

The class org.apache.struts.util.ResponseUtils only transforms the 4
characters , ,  and  into their html representative.

Is there another transformer around?

Any hints highly appreciated.

Regards,
Bernhard


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

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




Re: Transforming a String to valid HTML encoding

2003-01-14 Thread Dan Tran
please disregard my last comment, you dont need to configure UTF8 to work
with your character set.

-D
- Original Message -
From: Dan Tran [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 10:17 AM
Subject: Re: Transforming a String to valid HTML encoding


 Did you follow the instructions in

 http://www.anassina.com/struts/i18n/i18n.html ?

 -D

 - Original Message -
 From: Hirschmann, Bernhard [EMAIL PROTECTED]
 To: Struts User Mailing List (E-Mail) [EMAIL PROTECTED]
 Sent: Tuesday, January 14, 2003 3:32 AM
 Subject: Transforming a String to valid HTML encoding




 I still have the problem to transform a String containing national special
 characters to the appropriate HTML encoding.

 i.e.: schön  reich -- schouml;n amp reich

 The class org.apache.struts.util.ResponseUtils only transforms the 4
 characters , ,  and  into their html representative.

 Is there another transformer around?

 Any hints highly appreciated.

 Regards,
 Bernhard


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

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


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




RE: Dynamically changing the form class in the execute() method

2003-01-14 Thread Durham David Cntr 805CSS/SCBE
I don't think that you can.  What is it, specifically, that you are trying to do?

 -Original Message-
 From: Jordan Thomas [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 11:51 AM
 To: Struts-User
 Subject: Dynamically changing the form class in the execute() method
 
 
 Hi,
 
 How can I dynamically change the the form class and name that 
 my action is
 using? i.e. In the middle of the execute() method.
 
 thanks
 
 Jordan
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




xml validation error on Tiles plugin entry

2003-01-14 Thread Tim T. Young

I am using WSAD 5 and am having a problem enabling the Tiles plugin in the
struts-config.xml file.

I put this entry into the file:

plug-in className=org.apache.struts.tiles.TilesPlugin
  set-property property=definitions-config value=
/WEB-INF/tiles-defs.xml /
  set-property property=definitions-parser-validate value=true /
  set-property property=moduleAware value=true /
/plug-in

and I get validation errors on the first 2 set-property lines

set-property property=definitions-config value=/WEB-INF/tiles-defs.xml
/
set-property property=definitions-parser-validate value=true /

The error messages are:
Invalid data for attribute property in part definitions-config type
set-property
and
Invalid data for attribute property in part definitions-parser-validate
type set-property

Oddly enough when I take the - (dash) out of the property= the validation
errors go away.

The DTD I am pointing at is:

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

Any help would be appreciated!

Thanks
Tim



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




RE: [REQUEST] Corrections for Struts Kick Start

2003-01-14 Thread Mark Silva
hmmm...

should i wait a month or two for this 2nd printing?  will there be anything worth 
waiting for (other than typos, etc...)  when do you think it will be released approx.  
 

i was just about to order kickstart from amazon when i saw this message!

thanks,
mark


-Original Message-
From: James Turner [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: [REQUEST] Corrections for Struts Kick Start


Kevin and I have been informed that Struts Kick Start will be going
into a second printing in February, and because of the just-in-time
printing method that SAMS uses, we have an opportunity to make
corrections.  So, if you've come across typos, errors or general
unclearness in the text, please let us know so that we can get the fixes
into the second printing. 

Unfortunately, what we can change is limited by the desire not to
heavily repaginate, so A chapter on Struts-EL is the kind of request
that falls outside the scope of what we can get done.  

James



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


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




RE: [REQUEST] Corrections for Struts Kick Start

2003-01-14 Thread James Turner
 -Original Message-
 From: Mark Silva [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, January 14, 2003 1:49 PM
 To: Struts Users Mailing List
 Subject: RE: [REQUEST] Corrections for Struts Kick Start
 
 
 hmmm...
 
 should i wait a month or two for this 2nd printing?  will 
 there be anything worth waiting for (other than typos, 
 etc...)  when do you think it will be released approx.   

The changes will be largly typos, and Things That Have Changed (such as
mentioning the new size= option on form properties or that html:link now
takes an action property.

And since the same information will be available at strutskickstart.com
(now running on MoveableType) in the Errata section, you might as well
buy now and get the use of the book (hurry, I'm told only 800 copies of
the first printing are left! :-)

James



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




general directory structure question

2003-01-14 Thread Ashish Kulkarni
Hi,
I have to work on a web project and need some comments
on the directory structure i will be using, the below
diagram gives the overview of the directory structure,
need comments on it
c:\mywebsite-
|
|-WEB-INF-|
| |- web.xml
| | 
| |- classes-
| |  |
| |  -all xml files
| |  |- all class files
| |- lib all jar file
|
|-pages- |
||- index.html all jsp  images
|
|
|-Src-|
| |- org etc all java casses
|
|   
|-Doc-|
  |-Documentation   


=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: general directory structure question

2003-01-14 Thread David Graham
Looks pretty standard to me although I wouldn't name a directory pages and 
then put images in it.

David






From: Ashish Kulkarni [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: general directory structure question
Date: Tue, 14 Jan 2003 11:16:29 -0800 (PST)

Hi,
I have to work on a web project and need some comments
on the directory structure i will be using, the below
diagram gives the overview of the directory structure,
need comments on it
c:\mywebsite	-
		|
		|-WEB-INF-|
		|	  |- web.xml
		| 	  |
		|	  |- classes-
		|	  |	 |
		|	  |	 -all xml files
		|	  |	 |- all class files
		|	  |- lib all jar file
		|
		|-pages- |
		|	 |- index.html all jsp  images
		|
		|
		|-Src-|
		| |- org etc all java casses
		|
		|
		|-Doc-|
		  |-Documentation


=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Paging using struts

2003-01-14 Thread Pat Quinn
Does anyone have a good example of Paging using struts??


_
The new MSN 8 is here: Try it free* for 2 months 
http://join.msn.com/?page=dept/dialup


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



Re: Paging using struts

2003-01-14 Thread Gus Delgado
Pat Quinn wrote:


Does anyone have a good example of Paging using struts??


_
The new MSN 8 is here: Try it free* for 2 months 
http://join.msn.com/?page=dept/dialup


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


.






pager-taglib-1.1.jar
Description: Binary data
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


  1   2   >