RE: Avoiding app server restarts while doing struts development

2004-03-02 Thread jasper_lin18
I am using Weblogic 6.1.
I always deploy a developing web application as a
DIRECTORY instead of WAR file. I found that I can
deploy new java class by simply copy it into the right
place of WEB-INF/classes directory (not to mention JSP
files, it works for JSP too). But it doesn't work for
resource bundle properties files. Weblogic 6.1 will
auto-deploy the whole web application when it finds
that there are some new class file in WEB-INF/classes.
But after several times of auto-reploying processes,
the server usually encounters some sort of
out-of-memory problem. Then you have to restart
Weblogic again.

Regards,
Vincent


 --- Marco Mistroni [EMAIL PROTECTED]
 HI,
   I guess those changes,which have 'context scope',
 need 
 Always a redeploy
 Only changes that don't need a redeploy can be jsp
 changes (provided
 that
 You deploy your application as a 'directory' rather
 than war file)
 
 Regards
   marco
 
 -Original Message-
 From: Abhishek Srivastava
 [mailto:[EMAIL PROTECTED] 
 Sent: 01 March 2004 11:28
 To: 'Struts Users Mailing List'
 Subject: Avoiding app server restarts while doing
 struts development
 
 Hello All,
 
 I develop my apps on weblogic app server. When doing
 development on
 struts I
 feel for every little operation (change in resource
 file, change in
 source
 file, change config files) it requires me to either
 redeploy the app or
 to
 restart the app server. 
 
 I have tried to switch to the debug mode, but still
 the number of
 redeploys
 or restarts have not reduced.
 
 I find these very time-consuming. 
 
 Has someone figured out a way in which they can do
 development without
 redeployment at every single change? 
 
 Regards,
 Abhishek.
 
 

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

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

-
 Yahoo!

http://tw.promo.yahoo.com/mail_premium/stationery.html

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



DispatchAction and validate

2004-03-02 Thread Frers Michael
Hello

i want to use DispatchAction
now my questions is can i use in one action the struts-config entry validate=true
and in the other action validate=false

Thx for any hints

Michael

Re: java.lang.NullPointerException struts form is null

2004-03-02 Thread jasper_lin18
Please check these 2 lines of your code more
carefully.

 Teacher teacher= null;
 teacher.setLast(teacherAddForm.getLast());

Because teacher is null. When you called
teacher.setLast(...), NullPointerException occured.

Regards

-
 Yahoo!

http://tw.promo.yahoo.com/mail_premium/stationery.html

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



RE: [OT] Applet communication with web app

2004-03-02 Thread Jesse Alexander (KAID 11)
1. - Which socket? remember firewalls?
2. - remember firewalls? jdk-compatibility-issues
3. Other
3.a) use http/https to transfer serialized objects
 - jdk-compatibility issues
  b) use http/https to transfer command-strings
 (sort of roll your own serialization, but simplified
  - comand-strings, name/value pairs)
  c) use http/https to transfer XML-messages
why http/https?
- easy 
- firewall-friendly
why limitation to strings?
- less problems with jdk-changes
- easier to test and debug

hope this helps
Aexander


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 2. März 2004 05:03
To: Struts
Subject: [OT] Applet communication with web app


Quick question:

Given an applet that is part of a web app, what is the usual (best/easiest?)
technique for said applet to communicate with the server and vice-versa:

1. Handle the socket stuff itself and open a connection with the server
2. Use RMI
3. Other?



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

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



JSP context in an action

2004-03-02 Thread Mark Lowe
Does anyone know how to retrieve the servlet context of a given jsp and 
place an object in that context (say a map) and then request the page ?

I've been putting together a email templating system using velocity, 
but logic tells me i can do this using the servlet and struts api's 
without using velocity. Velocity wont let me retrieve the *.vm file 
without extending velocity servlet which i dont see as nessesary other 
than to do this.

I want to do something like this

DynaActionForm theForm = (DynaActionForm) form;
jspContext = ...
Map map = BeanUtils.describe(theForm);
jspContext.setAttribute(email,map);
//and now request the page and stream it.
.. ???
My nose is firmly lodged in the servlet and struts api's, just hoping 
someone can help nudge me in the right direction.





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


ServletContextListener init parameters

2004-03-02 Thread harm
Hi all,

I have my ActionServlet serving as a ServletContextListener:

public class ActionServlet
extends org.apache.struts.action.ActionServlet implements 
ServletContextListener


In the following method (which gets called upon startup) I need the 
ActionServlet init Parameters:

public void contextInitialized(ServletContextEvent event)


I want to do something like:

public void contextInitialized(ServletContextEvent event) {
ServletContext ctx = event.getServletContext();
Enumeration e = ctx.getInitParameterNames();
while (e.hasMoreElements()) {
log.debug(Parameter:  + e.nextElement());
}
}

Unfortunatly when I use the code above, my enumeration is empty.

My web.xml looks like this:

servlet

init-param
 param-nameconfig/param-name
 param-value/WEB-INF/struts-config.xml/param-value
 description![CDATA[Struts configuration file]]/description
  /init-param
  init-param
 param-namejcaConnector/param-name
 param-valuejava:/eis/bongers/autos/content/param-value
  /init-param
  init-param
 param-nametempFile/param-name
 param-valuec:/mtbtemp/param-value
  /init-param
  init-param
 param-nameproperties_db_name/param-name
 param-valuebmpauto/bau_content.nsf/param-value
  /init-param

... etc ... etc ... etc ...


How can I obtain those init parameters when 
contextInitialized(ServletContextEvent event) is called?

Your help is highly appreciated. 

Regards,

Harm de Laat
Informatiefabriek
The Netherlands.


Struts logic combined with the struts validato

2004-03-02 Thread Alexander Craen
Hello,
I am making a registration procedure that works with some logic based on the
choices the customer makes on a previous page

logic:equal name=LogonForm property=customertype scope=session
value=business
span class=labellabelbean:message
key=text.data.label.bill_vat_number//label/span
html:text property=bill_vat_nr styleId=bill_vat_nr /
/logic:equal

Problem description :
When a customer is of customertype 'business' the field bill_vat_nr is
showed on the page and is required when a customer is not of customertype
'business' the field bill_vat_nr is not showed on the page and theirfor is
not required

I tried to use a standard struts validator implementation
field property=bill_vat_nr depends=required
arg0 key=text.data.label.bill_vat_number/
arg1 key=${dummy}/
/field

I first thought about using the requiredif implementation. Problem is that I
only get it to work with elements from the same form.

The result :
The bill_vat_nr is required even if it has been left out of the form by
struts logic

My question :
Is their a way to combine struts logic and the validator framework? Do I
have to write a custom validator that does some kind of introspection on the
jsp? Or are their validators that are used for that purpose? What would be
the best solution to tackle this problem?

Tnx in advance
Alexander Craen


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



Send the response to a different frame

2004-03-02 Thread Ruben Pardo
Hi , 
I've got a page with 3 frames, the action, forward  to
reload always the page with the 3 frames. If there is
an error, i want to reload only one frame, how can i 
send the response  
from the action to only one frame??
thanks

___
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es

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



Re: JSP context in an action

2004-03-02 Thread Niall Pemberton
Mark,

I'd like to know how to do what you're but, unless someone else knows, how
about a different approach:

You could have a store tag which gets the body of a tag and stores it
somewhere (in the request or session or in a bean in the request or session)
and then forwards to an email action which then gets the stored content and
sends an email. Something like:

--EmailTemplate.jsp-
custom:store name=myForm property=emailContent scope=session
-- format your email here -
/custom:store
logic:forward name=emailForward/


--- StoreTag.java-

package lib.framework.taglib;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException;
import org.apache.struts.util.RequestUtils;
import org.apache.commons.beanutils.BeanUtils;
/**
* @author Niall Pemberton
* @version 1.0.0
*/
public class StoreTag extends BodyTagSupport {

protected String name = null;
protected String property = null;
protected String scope = null;

public StoreTag() {
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setProperty(String property) {
this.property = property;
}
public String getProperty() {
return property;
}
public void setScope(String scope) {
this.scope = scope;
}
public String getScope() {
return scope;
}
public int doAfterBody() throws JspException {
org.apache.struts.action.RequestProcessor ccc;
String value = null;
if (bodyContent != null) {
value = bodyContent.getString().trim();
}
if (property == null) {
pageContext.setAttribute(name, value, RequestUtils.getScope(scope));
} else {
// find the bean
Object bean = RequestUtils.lookup(pageContext, name, scope);
if (bean == null)
throw new JspException(Cannot find bean '+name+' in scope '+scope+');
try {
BeanUtils.setProperty(bean, property, value);
}
catch (Exception ex) {
throw new JspException(Error setting property '+property+' on bean
'+name+' in scope '+scope+': +ex);
}
}
return (SKIP_BODY);
}
public void release() {
name = null;
property = null;
scope = null;
}
}



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



RE: DispatchAction and validate

2004-03-02 Thread Robert Taylor
Yes.

The DispatchAction will only invoke the method defined in the request under the name 
defined in the parameter attribute of your
action mapping. So if I had update() and restore() as methods in a DispatchAction, and 
I only wanted to validate on the update, then
I would only define validate=true in the action mappping for the DispatchAction 
which is designated to invoke update(). This is
assuming you have two separate action mappings which map to the same DispatchAction.


robert

 -Original Message-
 From: Frers Michael [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 3:23 AM
 To: Struts Users Mailing List
 Subject: DispatchAction and validate


 Hello

 i want to use DispatchAction
 now my questions is can i use in one action the struts-config entry validate=true
 and in the other action validate=false

 Thx for any hints

 Michael


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



How do I access Message Resources in an Action?

2004-03-02 Thread Tim . Adler
Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

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

 


Re: How do I access Message Resources in an Action?

2004-03-02 Thread James Mitchell
The same way it is done in the struts-example.  Did you run that yet?


--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
MSN: [EMAIL PROTECTED]



- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 7:37 AM
Subject: How do I access Message Resources in an Action?


Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.

Can somebody help me?!

Thx!

P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

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






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



RE: ServletContextListener init parameters

2004-03-02 Thread Robert Taylor
The problem is your servlet init parameters don't exist in the ServletContext.
If you want them to be available to your code, then define them
as init parameters to your application:

?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
display-nameapp name/display-name

context-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
  description![CDATA[Struts configuration file]]/description
   /context-param
   context-param
  param-namejcaConnector/param-name
  param-valuejava:/eis/bongers/autos/content/param-value
   /context-param
   context-param
  param-nametempFile/param-name
  param-valuec:/mtbtemp/param-value
   /context-param
   context-param
  param-nameproperties_db_name/param-name
  param-valuebmpauto/bau_content.nsf/param-value
   /context-param

etc...


Then your code will yield the expected results.


robert

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 4:45 AM
 To: [EMAIL PROTECTED]
 Subject: ServletContextListener  init parameters


 Hi all,

 I have my ActionServlet serving as a ServletContextListener:

 public class ActionServlet
 extends org.apache.struts.action.ActionServlet implements
 ServletContextListener


 In the following method (which gets called upon startup) I need the
 ActionServlet init Parameters:

 public void contextInitialized(ServletContextEvent event)


 I want to do something like:

 public void contextInitialized(ServletContextEvent event) {
 ServletContext ctx = event.getServletContext();
 Enumeration e = ctx.getInitParameterNames();
 while (e.hasMoreElements()) {
 log.debug(Parameter:  + e.nextElement());
 }
 }

 Unfortunatly when I use the code above, my enumeration is empty.

 My web.xml looks like this:

 servlet

 init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
  description![CDATA[Struts configuration file]]/description
   /init-param
   init-param
  param-namejcaConnector/param-name
  param-valuejava:/eis/bongers/autos/content/param-value
   /init-param
   init-param
  param-nametempFile/param-name
  param-valuec:/mtbtemp/param-value
   /init-param
   init-param
  param-nameproperties_db_name/param-name
  param-valuebmpauto/bau_content.nsf/param-value
   /init-param

 ... etc ... etc ... etc ...


 How can I obtain those init parameters when
 contextInitialized(ServletContextEvent event) is called?

 Your help is highly appreciated.

 Regards,

 Harm de Laat
 Informatiefabriek
 The Netherlands.



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



RE: How do I access Message Resources in an Action?

2004-03-02 Thread Kommineni, Sateesh \(GE Consumer Industrial\)
Hi,

  User PropertyResourceBundle ..
  
  PropertyResourceBundle propBundle = null;
try{
  propBundle = (PropertyResourceBundle)PropertyResourceBundle.getBundle(resFileName);  
 
}

-Sateesh

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 6:07 PM
To: [EMAIL PROTECTED]
Subject: How do I access Message Resources in an Action?


Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

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

 

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



Re: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Adam Hardy
I just found that mozilla had put this complete thread in my spam 
folder. Obviously mozilla's opinion on the content.

I found it interesting though.

Since we're talking about the quality of mailing lists, does anybody 
know which the best JBoss list is? The forum and associated mailing list 
at www.jboss.org is not up to the standard I'm used to at Jakarta. In 
fact, I'm wondering whether there is an alternative at all actually.

Thanks
Adam
On 03/02/2004 04:46 AM Andrew Hill wrote:
Ive found the best way to avoid those kind of morons is to work at small
companies where any deadwood has nowhere to hide and is quickly pruned :-)
Our tech leads really know their stuff here.
-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 2 March 2004 06:28
To: Struts Users Mailing List
Subject: Life, the Universe and Everything (was: RE: [OT] RE: Memory
usage)
While the original flame war was less helpful, the question that has emerged
from it's ashes is a good one. I don't claim to have all the answers, but I
can offer some personal observations. Feel free to disagree.
1. You can do nothing about those who choose not to learn. I've tried
changing them and it doesn't work. I consider this a basic fact.
2. You have a great deal of control over your ability to learn. If you
aren't big time into learning, then I recommend catching some enthusiasm for
it.
3. There will be always be good and bad tech leads. I am a tech lead; I try
to be a good one. I can put a String to standard out or standard error! ;-)
4. I had the same frustrations that you have. I made the decision that the
best way to restore the balance of good in the universe, was to try to
become the kind of tech lead that I would have wanted when I was a
newbie/humble grunt. I teach a class on learning Java one lunchtime a week
and try to bestow a little wisdom and encouragement whenever I can. I am a
Java mentor here and I lead a study group of us that are seeking our Java
Certification.
5. No one reads documentation. This is a fact. Learn what is drop dead
fired and escorted from the building important and then try to
auto-generate it. :-)
6. Leadership is a rare commodity. There's a lot of management out there,
but precious little leadership. Again, deal with it. Become a leader and
just do what needs to be done. This is what I have tended to do. The ol'
saying about it's easier to ask forgiveness than permission is very true
(except I sometimes forget to ask for forgiveness! :-)
7. Black team? How 90's, Our team wears Hawaiian shirts! (Honest. :-)

Simon


-Original Message-
From: P K [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 3:58 PM
To: [EMAIL PROTECTED]
Subject: RE: [OT] RE: Memory usage
Sorry to continue on this topic. I've learnt a great deal of
non struts stuff on this list and this only adds to it.
I've been bothered (mostly in my mind) with questions about
peoples capabilities and desires when it comes to work. Viru,
this original poster of the question on Memory Usage clearly
has a desire to learn, but what about people who don't? How do
you deal with them?
I currently work with a Tech Lead who wouldn't be able to
output a String to standard out if asked to write a program. I
don't care about her taking credit for the work that we do.
She doesn't provide any leadership whatsoever to the project
except produce paper that no one bothers to read. Have you
guys come across situations like this? What have you done
about it? Don't get me wrong - I am not prone to complaining
nor do I think I am a member of the elite 'Black Team'.

Quoting Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED]:
+1

I agree with everyone who has responded. We should not
clutter this very

friendly mailing list with things that don't belong here,
that includes not

so nice responses. I haven't been on many, but this is by
far my favorite

list, even though I am mainly a spectator.

I lashed out because this question clearly didn't belong
here. If the person

had followed anything in
http://www.catb.org/~esr/faqs/smart-questions.html,

it must that they were polite. They certainly didn't do much
investigation

outside on the internet. The little bit of unfriendliness, I
dunno why it

came out. Unprofessional, it shouldn't have came out.

Even questions that don't belong here deserve to be treated
with respect. That
is the single most obvious characteristic of STRUTS-USER that
is distinctive
(even though it has lots of other good qualities).
Unfortunately, you decided to unload on a poster in a manner
that is decidedly
out of the norm for STRUTS-USER. Your response is the kind of
behavior that
creates problems for the perception of open source projects as
being friendly
to users or not. If you think the topic is totally out of scope for
STRUTS-USER, then you should either (a) answer the question
anyway but point
people to where they should really be asking; (b) *gently*
encourage the user
to 

Re: How do I access Message Resources in an Action?

2004-03-02 Thread Adam Hardy
I could send you off to look at the Javadoc, but sometimes working stuff 
out painstaking. Here's what I do:

MessageResources resources = (MessageResources)
context.getAttribute(Globals.MESSAGES_KEY);
String msg = resources.getMessage(my.key);
Globals.MESSAGES_KEY is the default. If you set up other bundles, just 
change it appropriately. context is the page context - I took this from 
a taglib - you'd have to convert it to the servlet context I presume.

Adam

On 03/02/2004 01:37 PM [EMAIL PROTECTED] wrote:
Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh
Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED] 

 



--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


AW: How do I access Message Resources in an Action?

2004-03-02 Thread Tim . Adler
Thx everybody!

I found that Sateesh' advise worked quite well.
I added something like this here to my ActionServlet subclass

protected String getLocalizedMessage(String key,Locale l)
{
ResourceBundle rb =
PropertyResourceBundle.getBundle(resources.application,l);
Object value = rb.getObject(key);
debug(message-resource-lookup: KEY:+key+ VALUE:+value);

return value.toString();
}

-Ursprüngliche Nachricht-
Von: Adam Hardy [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 2. März 2004 14:04
An: Struts Users Mailing List
Betreff: Re: How do I access Message Resources in an Action?


I could send you off to look at the Javadoc, but sometimes working stuff 
out painstaking. Here's what I do:

MessageResources resources = (MessageResources)
 context.getAttribute(Globals.MESSAGES_KEY);
String msg = resources.getMessage(my.key);

Globals.MESSAGES_KEY is the default. If you set up other bundles, just 
change it appropriately. context is the page context - I took this from 
a taglib - you'd have to convert it to the servlet context I presume.

Adam

On 03/02/2004 01:37 PM [EMAIL PROTECTED] wrote:
 Hey everybody!
 
 Well the subject basically states my problem already. I'd like to create a
 dynamical Navigation Bar that holds some pages you visited last. Therefore
 I'd like to add Name, Link and Parameters to a Collection for later
 printing. Problem is that the Name needs to come from the Message
Resources,
 and I don't know how to access those in an Action.
  
 Can somebody help me?!
  
 Thx!
  
 P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
 Either my company's net is broken or the page is really down.
 
 ___
 Tim Adler, Abt. SDA1
 Adress Management Solutions
 AZ | Direct
 Carl-Bertelsmann Straße 161s
 D-33311 Gütersloh
 
 Tel.: 05241/ 80 - 89574
 [EMAIL PROTECTED] 
 
  
 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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

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



Cannot retrieve mapping for action

2004-03-02 Thread Daniel
I have 2 modules moduleA and moduleB, and when I try to execute the action of muduleB 
this message open:

Cannot retrieve mapping for action inside my module, I need use relativepath inside my 
actionsmappings forwards on modules , because if i try use inside the action return 
new ActionForward(mapping.getInput()) its ok, but if I try to use one forward with the 
same path of input actionmapping i have this error.


obrigado
Daniel S.

IdGenerator ... is null

2004-03-02 Thread Silviu Marcu
Hi
I configured torque for mysql and into schema I wrote
defaultIdMethod=native ... so the ID BROKER should not be used.
BUT I receive the following exception:

org.apache.torque.TorqueException: IdGenerator for table '...my table
...' is null
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:708)

I also searched the mail archives and this error is present but with no
response.
Regards
silviu marcu


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



RE: Validator multiple message-resources

2004-03-02 Thread Mainguy, Mike
I'm not 100% sure but I believe this came up before.  I that, while you can
define multiple message.resources, you really can only actually USE one of
them in sruts 1.1.  I'd do a search of the archive because I think this has
come up before.

An Obstacle is something you see when you take your eyes off the goal

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 7:42 PM
To: [EMAIL PROTECTED]
Subject: Validator  multiple message-resources


Hi,

I have successfully used validator with a single message resources file
specified in the config file, everything works out fine. Since the project
has gotten bigger, i created another message-resource file but when
'required' error happens, the message specifying the field name which is in
the 2nd file doesn't come out. Only the validator part which is specified in
the 1st file comes out.

Amin

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

-
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


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



RE: splitting struts-config into multiple files

2004-03-02 Thread Anderson, James H [IT]
Nadeem,

I think I didn't read your reply carefully enough. Are you saying that I
could maintain global-forwards.xml somewhere on the filesystem outside
the app and xdoclet could be setup to merge it with struts-config.xml?

jim

-Original Message-
From: Nadeem Bitar [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 29, 2004 7:03 AM
To: Struts Users Mailing List
Subject: Re: splitting struts-config into multiple files


You can take advantage of xdoclet merging capabilities. 
You would have your action mapping in struts-actions.xml, your global-
forwards in global-forwards.xml, your form beans inside struts-forms.
xml ... and xdoclet would merge the files for you.



On Sat, 2004-02-28 at 13:36 -0700, Manish Singla wrote:

 May be Ant task can help in your environment.
 
 HTH
 Manish Singla
 
 Jim Anderson wrote:
 
  We have many apps that require the same global forwards. Rather than
  copy this info into the config file for each app, we'd like to be
able
  to place it in a struts-config file that lives somewhere on the
  filesystem outside WEB-INF, and then specify that as one of the
config
  files to use. I know it's possible to split struts-config, but is
there
  some way that one of the config files can reside outside the app?
 
  Thanks,
 
  jim
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 

Nadeem Bitar
Software Engineer
IzuCode, LLC
5230 Fiore Terrace #k208
San Diego, Ca 92122
 


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

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



[OT]Re: IdGenerator ... is null

2004-03-02 Thread Mark Lowe
Looks like a torque question to me, but that list can get kinda 
robot-wars.

Its been a while but, does the id field in your schema look like this?

column name=FOO_ID type=INTEGER required=true primaryKey=true 
/

On 2 Mar 2004, at 14:41, Silviu Marcu wrote:

Hi
I configured torque for mysql and into schema I wrote
defaultIdMethod=native ... so the ID BROKER should not be used.
BUT I receive the following exception:
org.apache.torque.TorqueException: IdGenerator for table '...my table
...' is null
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:708)
I also searched the mail archives and this error is present but with no
response.
Regards
silviu marcu
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


RE: Send the response to a different frame

2004-03-02 Thread Kransen, J.
Hi, 

The one page you always want to reload can contain this tag:
body onload=parent.navleft.location.href='navleft.jsp';
with which you fill the another frame(s). 

If you make this tag conditional, then you can control the other frame to be
reloaded or not:

(pseudo-code:)
if (error)
body
else
body onload=parent.navleft.location.href='navleft.jsp';

Hope this is helpful


-Oorspronkelijk bericht-
Van: Ruben Pardo [mailto:[EMAIL PROTECTED] 
Verzonden: dinsdag 2 maart 2004 11:51
Aan: [EMAIL PROTECTED]
Onderwerp: Send the response to a different frame

Hi , 
I've got a page with 3 frames, the action, forward  to
reload always the page with the 3 frames. If there is
an error, i want to reload only one frame, how can i 
send the response  
from the action to only one frame??
thanks

___
Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...
http://messenger.yahoo.es


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



Re: JSP context in an action

2004-03-02 Thread Mark Lowe
I'm still chewing on the problem. But a custom tag lib would seem a 
possibility. I ended up using a velocity servlet and doing things that 
way, my aim in trying otherwise was not to have to use velocity as its 
another bunch of libraries that in theory I shouldn't need.

Ideally i'd have a template directory under WEB-INF where numb-nuts 
dreamweaver types can edit email templates and i particularly like the 
expression syntax which is like jsp2. So i was trying to think of a way 
of using just that.

Velocity would be a really tidy way of doing things if the 
VelocityEngine class had a getTemplate method that takes in a file 
rather than just a string. At the moment I've a velocity servlet thats 
really only there to get around this problem.

But as things are its not that bad i've have just preferred not having 
to have a velocity servlet running just to find the where abouts of the 
template.

Using jsp even better as everythings already there, just how to drill 
to what i need. RequestDispatcher could be an option request the file 
get its context and then stuff the map in there, but could be 
tree-barking or/and smoking too much crack.



On 2 Mar 2004, at 12:59, Niall Pemberton wrote:

Mark,

I'd like to know how to do what you're but, unless someone else knows, 
how
about a different approach:

You could have a store tag which gets the body of a tag and stores it
somewhere (in the request or session or in a bean in the request or 
session)
and then forwards to an email action which then gets the stored 
content and
sends an email. Something like:

--EmailTemplate.jsp-
custom:store name=myForm property=emailContent scope=session
-- format your email here -
/custom:store
logic:forward name=emailForward/
--- StoreTag.java-

package lib.framework.taglib;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException;
import org.apache.struts.util.RequestUtils;
import org.apache.commons.beanutils.BeanUtils;
/**
* @author Niall Pemberton
* @version 1.0.0
*/
public class StoreTag extends BodyTagSupport {
protected String name = null;
protected String property = null;
protected String scope = null;
public StoreTag() {
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setProperty(String property) {
this.property = property;
}
public String getProperty() {
return property;
}
public void setScope(String scope) {
this.scope = scope;
}
public String getScope() {
return scope;
}
public int doAfterBody() throws JspException {
org.apache.struts.action.RequestProcessor ccc;
String value = null;
if (bodyContent != null) {
value = bodyContent.getString().trim();
}
if (property == null) {
pageContext.setAttribute(name, value, RequestUtils.getScope(scope));
} else {
// find the bean
Object bean = RequestUtils.lookup(pageContext, name, scope);
if (bean == null)
throw new JspException(Cannot find bean '+name+' in scope 
'+scope+');
try {
BeanUtils.setProperty(bean, property, value);
}
catch (Exception ex) {
throw new JspException(Error setting property '+property+' on bean
'+name+' in scope '+scope+': +ex);
}
}
return (SKIP_BODY);
}
public void release() {
name = null;
property = null;
scope = null;
}
}



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


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


log4j example?

2004-03-02 Thread Dean A. Hoover
Where can I find an example of setting up
and using log4j under commons-logging
for struts 1.1? I have used log4j before and
want to continue using it.
Dean Hoover

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


RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Chappell, Simon P
Of course, it's possible to take that to the extreme. The first place where I worked 
when I moved to America, was so small that I was the IS department! :-)

Simon

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 9:47 PM
To: Struts Users Mailing List
Subject: RE: Life, the Universe and Everything (was: RE: [OT] 
RE: Memory
usage)


Ive found the best way to avoid those kind of morons is to 
work at small
companies where any deadwood has nowhere to hide and is 
quickly pruned :-)
Our tech leads really know their stuff here.

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



Re: Struts logic combined with the struts validator

2004-03-02 Thread Alexander Craen
Maybe i`ll better rephrase my question to make it more easy for the reader
:)

I want to make a field in a form required when it exists on the form

if it is not on the form (due to some logic tags that make it disappear), I
dont want to generate an error.

How would I best solve this?

make a new validator requiredifpresent ?
or could I use the requiredif together with some logic based on values in
other beans ?


- Original Message - 
From: Alexander Craen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 11:25 AM
Subject: Struts logic combined with the struts validato


 Hello,
 I am making a registration procedure that works with some logic based on
the
 choices the customer makes on a previous page

 logic:equal name=LogonForm property=customertype scope=session
 value=business
 span class=labellabelbean:message
 key=text.data.label.bill_vat_number//label/span
 html:text property=bill_vat_nr styleId=bill_vat_nr /
 /logic:equal

 Problem description :
 When a customer is of customertype 'business' the field bill_vat_nr is
 showed on the page and is required when a customer is not of customertype
 'business' the field bill_vat_nr is not showed on the page and theirfor is
 not required

 I tried to use a standard struts validator implementation
 field property=bill_vat_nr depends=required
 arg0 key=text.data.label.bill_vat_number/
 arg1 key=${dummy}/
 /field

 I first thought about using the requiredif implementation. Problem is that
I
 only get it to work with elements from the same form.

 The result :
 The bill_vat_nr is required even if it has been left out of the form by
 struts logic

 My question :
 Is their a way to combine struts logic and the validator framework? Do I
 have to write a custom validator that does some kind of introspection on
the
 jsp? Or are their validators that are used for that purpose? What would be
 the best solution to tackle this problem?

 Tnx in advance
 Alexander Craen


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



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



RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Andrew Hill
When I was fresh out of uni - back before the turn of the century, I
interviewed for a position like that.

Didnt get it, but one of the things they tested me was for typing speed (I
scored 60wpm as I recall. Reckon I could better that nowdays though!) It was
one of those small seceratial outsourcing companies (who needed someone to
manage their network and software and such like) so I guess the idea of
interviewing anyone without giving them a typing test was simply heretical.
Pity, I reckon that could have been a fun job.

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 2 March 2004 22:08
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory
usage)


Of course, it's possible to take that to the extreme. The first place where
I worked when I moved to America, was so small that I was the IS department!
:-)

Simon

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 9:47 PM
To: Struts Users Mailing List
Subject: RE: Life, the Universe and Everything (was: RE: [OT]
RE: Memory
usage)


Ive found the best way to avoid those kind of morons is to
work at small
companies where any deadwood has nowhere to hide and is
quickly pruned :-)
Our tech leads really know their stuff here.


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



Best Error Page solution

2004-03-02 Thread Julio Cesar De Salvo
Hi,
 
What would be the best approach for handling the error messages?
- set in very page %@ page errorPage=error_page.jsp %?
- or  to use a global mapping for handling error messages (eg. Session
timeout, db connection broken, etc).
 
 
Thanks for any hint.
 
Julio


Re: JSP context in an action

2004-03-02 Thread Niall Pemberton
Yeah, RequestDsiapatcher would work (like the struts IncludeAction) with the
StoreTag I sent, then you wouldn't have to forward in the jsp.

---Action.execute()---
// Determine Email Template
Strint emailTemplate = EmailTemplate.jsp;

// Get formatted email content
javax.servlet.RequestDispatcher rd =
servlet.getServletContext().getRequestDispatcher(emailTemplate);
rd.include(request, response);
String emailContent = form.getEmailContent();

// Process
send email---

 --EmailTemplate.jsp-
 custom:store name=myForm property=emailContent scope=session
 -- format your email here -
 /custom:store


...and use the StoreTag to just save the contents of the jsp in a
bean/request/session

Niall

P.S. The first line in the doAfterBody() was a mistake in the StoreTag.


- Original Message - 
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 2:02 PM
Subject: Re: JSP context in an action


 I'm still chewing on the problem. But a custom tag lib would seem a
 possibility. I ended up using a velocity servlet and doing things that
 way, my aim in trying otherwise was not to have to use velocity as its
 another bunch of libraries that in theory I shouldn't need.

 Ideally i'd have a template directory under WEB-INF where numb-nuts
 dreamweaver types can edit email templates and i particularly like the
 expression syntax which is like jsp2. So i was trying to think of a way
 of using just that.

 Velocity would be a really tidy way of doing things if the
 VelocityEngine class had a getTemplate method that takes in a file
 rather than just a string. At the moment I've a velocity servlet thats
 really only there to get around this problem.

 But as things are its not that bad i've have just preferred not having
 to have a velocity servlet running just to find the where abouts of the
 template.

 Using jsp even better as everythings already there, just how to drill
 to what i need. RequestDispatcher could be an option request the file
 get its context and then stuff the map in there, but could be
 tree-barking or/and smoking too much crack.



 On 2 Mar 2004, at 12:59, Niall Pemberton wrote:

  Mark,
 
  I'd like to know how to do what you're but, unless someone else knows,
  how
  about a different approach:
 
  You could have a store tag which gets the body of a tag and stores it
  somewhere (in the request or session or in a bean in the request or
  session)
  and then forwards to an email action which then gets the stored
  content and
  sends an email. Something like:
 
  --EmailTemplate.jsp-
  custom:store name=myForm property=emailContent scope=session
  -- format your email here -
  /custom:store
  logic:forward name=emailForward/
 
 
  --- StoreTag.java-
 
  package lib.framework.taglib;
  import javax.servlet.jsp.tagext.BodyTagSupport;
  import javax.servlet.jsp.JspException;
  import org.apache.struts.util.RequestUtils;
  import org.apache.commons.beanutils.BeanUtils;
  /**
  * @author Niall Pemberton
  * @version 1.0.0
  */
  public class StoreTag extends BodyTagSupport {
 
  protected String name = null;
  protected String property = null;
  protected String scope = null;
 
  public StoreTag() {
  }
  public void setName(String name) {
  this.name = name;
  }
  public String getName() {
  return name;
  }
  public void setProperty(String property) {
  this.property = property;
  }
  public String getProperty() {
  return property;
  }
  public void setScope(String scope) {
  this.scope = scope;
  }
  public String getScope() {
  return scope;
  }
  public int doAfterBody() throws JspException {
  org.apache.struts.action.RequestProcessor ccc;
  String value = null;
  if (bodyContent != null) {
  value = bodyContent.getString().trim();
  }
  if (property == null) {
  pageContext.setAttribute(name, value, RequestUtils.getScope(scope));
  } else {
  // find the bean
  Object bean = RequestUtils.lookup(pageContext, name, scope);
  if (bean == null)
  throw new JspException(Cannot find bean '+name+' in scope
  '+scope+');
  try {
  BeanUtils.setProperty(bean, property, value);
  }
  catch (Exception ex) {
  throw new JspException(Error setting property '+property+' on bean
  '+name+' in scope '+scope+': +ex);
  }
  }
  return (SKIP_BODY);
  }
  public void release() {
  name = null;
  property = null;
  scope = null;
  }
  }
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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





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



Re: Struts logic combined with the struts validator

2004-03-02 Thread Matt Bathje
Alexander -

Usually when I have this situation I just put in an else (or a
logic:notEqual in your case) which prints out the form field as hidden with
some bogus data in it. That bogus data will be enough to make the
validation pass of course.

I had thought about doing the requiredifpresent or something like that, but
this always seemed much simpler.

Matt Bathje

- Original Message - 
From: Alexander Craen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 8:14 AM
Subject: Re: Struts logic combined with the struts validator


 Maybe i`ll better rephrase my question to make it more easy for the reader
 :)

 I want to make a field in a form required when it exists on the form

 if it is not on the form (due to some logic tags that make it disappear),
I
 dont want to generate an error.

 How would I best solve this?

 make a new validator requiredifpresent ?
 or could I use the requiredif together with some logic based on values in
 other beans ?


 - Original Message - 
 From: Alexander Craen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 11:25 AM
 Subject: Struts logic combined with the struts validato


  Hello,
  I am making a registration procedure that works with some logic based on
 the
  choices the customer makes on a previous page
 
  logic:equal name=LogonForm property=customertype scope=session
  value=business
  span class=labellabelbean:message
  key=text.data.label.bill_vat_number//label/span
  html:text property=bill_vat_nr styleId=bill_vat_nr /
  /logic:equal
 
  Problem description :
  When a customer is of customertype 'business' the field bill_vat_nr is
  showed on the page and is required when a customer is not of
customertype
  'business' the field bill_vat_nr is not showed on the page and theirfor
is
  not required
 
  I tried to use a standard struts validator implementation
  field property=bill_vat_nr depends=required
  arg0 key=text.data.label.bill_vat_number/
  arg1 key=${dummy}/
  /field
 
  I first thought about using the requiredif implementation. Problem is
that
 I
  only get it to work with elements from the same form.
 
  The result :
  The bill_vat_nr is required even if it has been left out of the form by
  struts logic
 
  My question :
  Is their a way to combine struts logic and the validator framework? Do I
  have to write a custom validator that does some kind of introspection on
 the
  jsp? Or are their validators that are used for that purpose? What would
be
  the best solution to tackle this problem?
 
  Tnx in advance
  Alexander Craen
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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



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



[OT] Your Message to struts-user@jakarta.apache.org is Blocked

2004-03-02 Thread Andrew Hill
Im suddenly getting these emails to me stating that my post to struts-user
was blocked for containing a virus (nonsense!). These messages contain a
fancy html page with the text:

snip
CxProtect™: Virus Found Notification
Your Message is Blocked since It contained virus/Spam Mail send by local
user or Contained virus which Neutralized and option set as Delete Infected
Mail
Message was addreessed to: [EMAIL PROTECTED]
/snip

They do not appear to be from Jakarta (nor is my message to the user list
blocked), which would seem to indicate that they are autoresponses probably
from someone subscribed to the list.

I like this not. Getting autoresponses everytime I post to struts-user is
most declasse. There ought to be some policy against subscribing to the list
with an address that has autoresponders hooked up to it. Its just not
cricket.

snip
Return-Path: [EMAIL PROTECTED]
X-Sieve: cmu-sieve 2.0
Received: from mail.s2lmail.com (mail.s2lmail.com [207.36.47.126])
by gridnode.com (8.12.9/8.12.4) with SMTP id i22EXpVm027236
for [EMAIL PROTECTED]; Tue, 2 Mar 2004 22:33:54 +0800
Date: Tue, 2 Mar 2004 22:33:51 +0800
Message-Id: [EMAIL PROTECTED]
Received: (qmail 17175 invoked by uid 0); 2 Mar 2004 14:20:13 -
From: CxProtect [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Your Message to [EMAIL PROTECTED] is Blocked
X-Mailer: Calibre - eCourier 3
X-AVNotify: CxProtect Notification Message
X-Priority: 1
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary=_NextPart_93A4-2189-002F26C1-054B
/snip


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



Re: [OT] Applet communication with web app

2004-03-02 Thread Thad Humphries
We use HTTP/HTTPS.  Our application is a web frontend to a document management 
a workflow system (http://www.mindwrap.com).  As such we move both text and 
binary data between applets and the server, calling both servlets and JSPs 
depending upon the requirement.

On Monday 01 March 2004 23:03, Andrew Hill wrote:
 Quick question:

 Given an applet that is part of a web app, what is the usual
 (best/easiest?) technique for said applet to communicate with the server
 and vice-versa:

 1. Handle the socket stuff itself and open a connection with the server
 2. Use RMI
 3. Other?
...


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



Re: Struts logic combined with the struts validator

2004-03-02 Thread Alexander Craen
Well ,

I thought about this as well.. however I cannot put bogus information in the
fields because their 'NULL' value matters to the registration process

I would have to filter on the bogus information... which I would not like to
do

tnx

Alexander Craen

- Original Message - 
From: Matt Bathje [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 3:24 PM
Subject: Re: Struts logic combined with the struts validator


 Alexander -

 Usually when I have this situation I just put in an else (or a
 logic:notEqual in your case) which prints out the form field as hidden
with
 some bogus data in it. That bogus data will be enough to make the
 validation pass of course.

 I had thought about doing the requiredifpresent or something like that,
but
 this always seemed much simpler.

 Matt Bathje

 - Original Message - 
 From: Alexander Craen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 8:14 AM
 Subject: Re: Struts logic combined with the struts validator


  Maybe i`ll better rephrase my question to make it more easy for the
reader
  :)
 
  I want to make a field in a form required when it exists on the form
 
  if it is not on the form (due to some logic tags that make it
disappear),
 I
  dont want to generate an error.
 
  How would I best solve this?
 
  make a new validator requiredifpresent ?
  or could I use the requiredif together with some logic based on values
in
  other beans ?
 
 
  - Original Message - 
  From: Alexander Craen [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, March 02, 2004 11:25 AM
  Subject: Struts logic combined with the struts validato
 
 
   Hello,
   I am making a registration procedure that works with some logic based
on
  the
   choices the customer makes on a previous page
  
   logic:equal name=LogonForm property=customertype scope=session
   value=business
   span class=labellabelbean:message
   key=text.data.label.bill_vat_number//label/span
   html:text property=bill_vat_nr styleId=bill_vat_nr /
   /logic:equal
  
   Problem description :
   When a customer is of customertype 'business' the field bill_vat_nr is
   showed on the page and is required when a customer is not of
 customertype
   'business' the field bill_vat_nr is not showed on the page and
theirfor
 is
   not required
  
   I tried to use a standard struts validator implementation
   field property=bill_vat_nr depends=required
   arg0 key=text.data.label.bill_vat_number/
   arg1 key=${dummy}/
   /field
  
   I first thought about using the requiredif implementation. Problem is
 that
  I
   only get it to work with elements from the same form.
  
   The result :
   The bill_vat_nr is required even if it has been left out of the form
by
   struts logic
  
   My question :
   Is their a way to combine struts logic and the validator framework? Do
I
   have to write a custom validator that does some kind of introspection
on
  the
   jsp? Or are their validators that are used for that purpose? What
would
 be
   the best solution to tackle this problem?
  
   Tnx in advance
   Alexander Craen
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


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



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



RE: [OT] Your Message to struts-user@jakarta.apache.org is Blocke d

2004-03-02 Thread Paananen, Tero
 Return-Path: [EMAIL PROTECTED]
^^^

I'm receiving these too. Please set the subscriber(s)
using s2lmail.com to digest or something.

-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.


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



RE: Semi-OT: Saving state when using EJB Session Beans and Struts

2004-03-02 Thread Smith, Darrin
Thanks for the reply!

That is kind of what is going on already.  The Action's act as the local
Java class talked about in the Business Delegate Pattern that create and
cache the Stateful Session Bean (a different one per Action).  They (the
Actions) then use the Session Bean's business logic. This is done in a
standard way though where each Session Bean will implement an interface that
is common to all of the other Session Beans in the application. This way
each action simply calls a factory and based on the way the factory is
called, a Stateful Session Bean for that type of action is returned, then
cached in the Action.  All actions then can make the submit(...),
inspect(...), etc. calls common to all types of Session Beans (but performed
differently by each one).

The question is though, for these actions, shouldn't they keep session state
that will match the Stateful Session Beans?  Typically, I know you want have
your Model hold Session state while your client holds request state, but in
this case, where the Action needs to remember the cached Session Bean,
doesn't it seem to make sense to mark the Action as session scope in the
struts config file as well?

  

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 5:35 PM
To: Struts Users Mailing List
Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
Struts


On 03/01/2004 05:47 PM Smith, Darrin wrote:
 In short, the Actions will be calling various Stateful Session Beans to do
 the actual work.  These are used for various reasons with the main one
being
 their built-in transaction support (online orders...need to be either
 done...or not done). How should state be handled and at what level
 (page...request...session...) in the upstream struts portion? 

Hmmm. Thought someone more knowledgeable would answer this, and was 
waiting with interest myself. Oh well. Without too much experience with 
EJBs myself, I can say a couple of things: the gurus say 'use the 
business delegate pattern with an EJB session facade'. Secondly, it 
depends heavily on what your stateful session beans are holding as 
state. Care to name something?

Adam
-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


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



Struts not suitable for shared hosting?

2004-03-02 Thread Tomeu Vizoso
Hi everybody,

I have come across this information on the net and I'm not sure if it's
true.

Basically they say that struts is known to hog server resources and
that's why it shouldn't be used a shared tomcat instance like in ensim's
webppliance.

I'm now on the try to deploy a struts application on an ensim shared
server (quite cheap) and I'm wondering if this is practical/feasible.

Somebody knows if this is possible? I'm having a hard time to get done
the things needed by this application by the sysadmins (*.do mapping,
log permissions, ...), but I still haven't lost the hope.

Private Tomcat/JVM allows you to run your own tomcat container within
your own virtual process. You will have the flexibility to stop and
start Tomcat, customize it and configure it to fit your needs. This will
give you the capability to run struts and other frameworks known to hog
server resources.

http://www.displayhosting.net/services/javahosting.php


Regards,

Tomeu Vizoso


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



Re: How do I access Message Resources in an Action?

2004-03-02 Thread rick
J2SE 1.5 preview beta was released, and the site is getting hammered.  Which
stinks because I need to see some APIs for a part of JSTL I'm not familiar with :-(

Rick DeBay

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 7:37 AM
Subject: How do I access Message Resources in an Action?


Hey everybody!

[snip]

P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

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



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



[OT] Re: How do I access Message Resources in an Action?

2004-03-02 Thread Kris Schneider
If you want, post the JSTL question here (OT) or on taglibs-user...

Quoting [EMAIL PROTECTED]:

 J2SE 1.5 preview beta was released, and the site is getting hammered.  Which
 stinks because I need to see some APIs for a part of JSTL I'm not familiar
 with :-(
 
 Rick DeBay
 
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 7:37 AM
 Subject: How do I access Message Resources in an Action?
 
 
 Hey everybody!
 
 [snip]
 
 P.S.: Can you guys access http://java.sun.com http://java.sun.com  ??!
 Either my company's net is broken or the page is really down.
 
 ___
 Tim Adler, Abt. SDA1
 Adress Management Solutions
 AZ | Direct
 Carl-Bertelsmann Straße 161s
 D-33311 Gütersloh
 
 Tel.: 05241/ 80 - 89574
 [EMAIL PROTECTED]

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

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



RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread P K
so you reckon that hinting to my Manager, whom we both report to, about my 
frustrations isn't going to help much?

Thanks for the suggestion about the small company though. Looking back, the most fun I 
had at work was working for a small company.
 
Simons, Your suggestion # 4 is great nad #5 really interesting. Thanks.

Andrew Hill [EMAIL PROTECTED] wrote:
Ive found the best way to avoid those kind of morons is to work at small
companies where any deadwood has nowhere to hide and is quickly pruned :-)
Our tech leads really know their stuff here.


-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 2 March 2004 06:28
To: Struts Users Mailing List
Subject: Life, the Universe and Everything (was: RE: [OT] RE: Memory
usage)


While the original flame war was less helpful, the question that has emerged
from it's ashes is a good one. I don't claim to have all the answers, but I
can offer some personal observations. Feel free to disagree.

1. You can do nothing about those who choose not to learn. I've tried
changing them and it doesn't work. I consider this a basic fact.

2. You have a great deal of control over your ability to learn. If you
aren't big time into learning, then I recommend catching some enthusiasm for
it.

3. There will be always be good and bad tech leads. I am a tech lead; I try
to be a good one. I can put a String to standard out or standard error! ;-)

4. I had the same frustrations that you have. I made the decision that the
best way to restore the balance of good in the universe, was to try to
become the kind of tech lead that I would have wanted when I was a
newbie/humble grunt. I teach a class on learning Java one lunchtime a week
and try to bestow a little wisdom and encouragement whenever I can. I am a
Java mentor here and I lead a study group of us that are seeking our Java
Certification.

5. No one reads documentation. This is a fact. Learn what is drop dead
fired and escorted from the building important and then try to
auto-generate it. :-)

6. Leadership is a rare commodity. There's a lot of management out there,
but precious little leadership. Again, deal with it. Become a leader and
just do what needs to be done. This is what I have tended to do. The ol'
saying about it's easier to ask forgiveness than permission is very true
(except I sometimes forget to ask for forgiveness! :-)

7. Black team? How 90's, Our team wears Hawaiian shirts! (Honest. :-)

Simon

-Original Message-
From: P K [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 3:58 PM
To: [EMAIL PROTECTED]
Subject: RE: [OT] RE: Memory usage


Sorry to continue on this topic. I've learnt a great deal of
non struts stuff on this list and this only adds to it.
I've been bothered (mostly in my mind) with questions about
peoples capabilities and desires when it comes to work. Viru,
this original poster of the question on Memory Usage clearly
has a desire to learn, but what about people who don't? How do
you deal with them?
I currently work with a Tech Lead who wouldn't be able to
output a String to standard out if asked to write a program. I
don't care about her taking credit for the work that we do.
She doesn't provide any leadership whatsoever to the project
except produce paper that no one bothers to read. Have you
guys come across situations like this? What have you done
about it? Don't get me wrong - I am not prone to complaining
nor do I think I am a member of the elite 'Black Team'.

Quoting Dhaliwal, Pritpal (HQP) 
:
 +1

 I agree with everyone who has responded. We should not
clutter this very
 friendly mailing list with things that don't belong here,
that includes not
 so nice responses. I haven't been on many, but this is by
far my favorite
 list, even though I am mainly a spectator.

 I lashed out because this question clearly didn't belong
here. If the person
 had followed anything in
http://www.catb.org/~esr/faqs/smart-questions.html,
 it must that they were polite. They certainly didn't do much
investigation
 outside on the internet. The little bit of unfriendliness, I
dunno why it
 came out. Unprofessional, it shouldn't have came out.

Even questions that don't belong here deserve to be treated
with respect. That
is the single most obvious characteristic of STRUTS-USER that
is distinctive
(even though it has lots of other good qualities).
Unfortunately, you decided to unload on a poster in a manner
that is decidedly
out of the norm for STRUTS-USER. Your response is the kind of
behavior that
creates problems for the perception of open source projects as
being friendly
to users or not. If you think the topic is totally out of scope for
STRUTS-USER, then you should either (a) answer the question
anyway but point
people to where they should really be asking; (b) *gently*
encourage the user
to explore the other resources that are available (the
archives are full of
examples of folks who have done this), or (c) shut your 

RE: ServletContextListener init parameters

2004-03-02 Thread harm
Thanks Robert for this quick anwser.

This solved my problem. However. Is there a possibility to access 
context-params from a JSP page?

Thanks,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands





Robert Taylor [EMAIL PROTECTED] 
02-03-2004 13:43
Please respond to
Struts Users Mailing List [EMAIL PROTECTED]


To
Struts Users Mailing List [EMAIL PROTECTED]
cc

Subject
RE: ServletContextListener  init parameters






The problem is your servlet init parameters don't exist in the 
ServletContext.
If you want them to be available to your code, then define them
as init parameters to your application:

?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=
http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
display-nameapp name/display-name

 context-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
  description![CDATA[Struts configuration file]]/description
   /context-param
   context-param
  param-namejcaConnector/param-name
  param-valuejava:/eis/bongers/autos/content/param-value
   /context-param
   context-param
  param-nametempFile/param-name
  param-valuec:/mtbtemp/param-value
   /context-param
   context-param
  param-nameproperties_db_name/param-name
  param-valuebmpauto/bau_content.nsf/param-value
   /context-param

etc...


Then your code will yield the expected results.


robert

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 4:45 AM
 To: [EMAIL PROTECTED]
 Subject: ServletContextListener  init parameters


 Hi all,

 I have my ActionServlet serving as a ServletContextListener:

 public class ActionServlet
 extends org.apache.struts.action.ActionServlet implements
 ServletContextListener


 In the following method (which gets called upon startup) I need the
 ActionServlet init Parameters:

 public void contextInitialized(ServletContextEvent event)


 I want to do something like:

 public void contextInitialized(ServletContextEvent event) {
 ServletContext ctx = event.getServletContext();
 Enumeration e = ctx.getInitParameterNames();
 while (e.hasMoreElements()) {
 log.debug(Parameter:  + e.nextElement());
 }
 }

 Unfortunatly when I use the code above, my enumeration is empty.

 My web.xml looks like this:

 servlet

 init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
  description![CDATA[Struts configuration 
file]]/description
   /init-param
   init-param
  param-namejcaConnector/param-name
  param-valuejava:/eis/bongers/autos/content/param-value
   /init-param
   init-param
  param-nametempFile/param-name
  param-valuec:/mtbtemp/param-value
   /init-param
   init-param
  param-nameproperties_db_name/param-name
  param-valuebmpauto/bau_content.nsf/param-value
   /init-param

 ... etc ... etc ... etc ...


 How can I obtain those init parameters when
 contextInitialized(ServletContextEvent event) is called?

 Your help is highly appreciated.

 Regards,

 Harm de Laat
 Informatiefabriek
 The Netherlands.



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




Re: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Martin Gainty
Interesting point about tech leads.. I agree wholeheartedly
I specifically have agree with enthusiasm for learning new
technologies/methodologies
I would also add Must ensure product works on all client platforms
You would be surprised how much software is shipped without any testing or
consideration
for the user's environment
~My 2 cents~
Martin Gainty
- Original Message -
From: P K [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 10:50 AM
Subject: RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory
usage)


 so you reckon that hinting to my Manager, whom we both report to, about my
frustrations isn't going to help much?

 Thanks for the suggestion about the small company though. Looking back,
the most fun I had at work was working for a small company.

 Simons, Your suggestion # 4 is great nad #5 really interesting. Thanks.

 Andrew Hill [EMAIL PROTECTED] wrote:
 Ive found the best way to avoid those kind of morons is to work at small
 companies where any deadwood has nowhere to hide and is quickly pruned :-)
 Our tech leads really know their stuff here.


 -Original Message-
 From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, 2 March 2004 06:28
 To: Struts Users Mailing List
 Subject: Life, the Universe and Everything (was: RE: [OT] RE: Memory
 usage)


 While the original flame war was less helpful, the question that has
emerged
 from it's ashes is a good one. I don't claim to have all the answers, but
I
 can offer some personal observations. Feel free to disagree.

 1. You can do nothing about those who choose not to learn. I've tried
 changing them and it doesn't work. I consider this a basic fact.

 2. You have a great deal of control over your ability to learn. If you
 aren't big time into learning, then I recommend catching some enthusiasm
for
 it.

 3. There will be always be good and bad tech leads. I am a tech lead; I
try
 to be a good one. I can put a String to standard out or standard error!
;-)

 4. I had the same frustrations that you have. I made the decision that the
 best way to restore the balance of good in the universe, was to try to
 become the kind of tech lead that I would have wanted when I was a
 newbie/humble grunt. I teach a class on learning Java one lunchtime a week
 and try to bestow a little wisdom and encouragement whenever I can. I am a
 Java mentor here and I lead a study group of us that are seeking our Java
 Certification.

 5. No one reads documentation. This is a fact. Learn what is drop dead
 fired and escorted from the building important and then try to
 auto-generate it. :-)

 6. Leadership is a rare commodity. There's a lot of management out there,
 but precious little leadership. Again, deal with it. Become a leader and
 just do what needs to be done. This is what I have tended to do. The ol'
 saying about it's easier to ask forgiveness than permission is very true
 (except I sometimes forget to ask for forgiveness! :-)

 7. Black team? How 90's, Our team wears Hawaiian shirts! (Honest. :-)

 Simon

 -Original Message-
 From: P K [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 01, 2004 3:58 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [OT] RE: Memory usage
 
 
 Sorry to continue on this topic. I've learnt a great deal of
 non struts stuff on this list and this only adds to it.
 I've been bothered (mostly in my mind) with questions about
 peoples capabilities and desires when it comes to work. Viru,
 this original poster of the question on Memory Usage clearly
 has a desire to learn, but what about people who don't? How do
 you deal with them?
 I currently work with a Tech Lead who wouldn't be able to
 output a String to standard out if asked to write a program. I
 don't care about her taking credit for the work that we do.
 She doesn't provide any leadership whatsoever to the project
 except produce paper that no one bothers to read. Have you
 guys come across situations like this? What have you done
 about it? Don't get me wrong - I am not prone to complaining
 nor do I think I am a member of the elite 'Black Team'.
 
 Quoting Dhaliwal, Pritpal (HQP)
 :
  +1
 
  I agree with everyone who has responded. We should not
 clutter this very
  friendly mailing list with things that don't belong here,
 that includes not
  so nice responses. I haven't been on many, but this is by
 far my favorite
  list, even though I am mainly a spectator.
 
  I lashed out because this question clearly didn't belong
 here. If the person
  had followed anything in
 http://www.catb.org/~esr/faqs/smart-questions.html,
  it must that they were polite. They certainly didn't do much
 investigation
  outside on the internet. The little bit of unfriendliness, I
 dunno why it
  came out. Unprofessional, it shouldn't have came out.
 
 Even questions that don't belong here deserve to be treated
 with respect. That
 is the single most obvious 

calculating sum inside logic:iterate

2004-03-02 Thread Marco Mistroni
Hi all,
I have a colletion of items that have a method called price.
I was wandering if I could calculate the total of all prices via struts
Tags rather than using java code...

Anyone has any ideas?

Thanx in advance and regards
marco


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



[REPOST] MockStrutsTestCase problem

2004-03-02 Thread John Fitzpatrick
Sorry for the repost, but I really am stuck on this. If anyone could help,
I'd appreciate it.



I'm having a problem setting up tests where errors are created during
validation by a DynaActionForm using MockStrutsTestCase. Here's my code:

The DynaActionForm:
===
package test;

import javax.servlet.http.*;

import org.apache.struts.action.*;

public class BogusForm extends org.apache.struts.action.DynaActionForm {
ActionErrors errors = new ActionErrors ();

   public ActionErrors validate ( ActionMapping mapping,
HttpServletRequest request ) {

errors.add ( error, new ActionError ( error.message ) );
return errors;
   }
}

The Action:
===
package test;

import javax.servlet.http.*;

import org.apache.struts.action.*;

/**
 * @struts.action
 *name=BogusForm
 *input=.doActivity
 *path=/Bogus
 * @struts.action-forward
 *name=doActivity
 *path=.doActivity
 */
public class BogusAction extends org.apache.struts.action.Action {
   public ActionForward execute ( ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response )
throws Exception {

  return mapping.findForward ( doActivity );
   }
}

The MockStrutsTestCase:
===
package test;

import javax.servlet.*;
import servletunit.struts.*;

public class TestBogusAction extends MockStrutsTestCase {
   public void testFormPassed () {
  setRequestPathInfo ( /Bogus );
  actionPerform ();
  verifyNoActionErrors ();
   }
   public void testFormFailed () {
  setRequestPathInfo ( /Bogus );
  actionPerform ();
  verifyActionErrors( new String [] { error.message } );
   }
}

The result:
===
test:
[junit] Running mori.web.controller.registry.test.TestBogusAction
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 2.435 sec
[junit] Testsuite: mori.web.controller.registry.test.TestBogusAction
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 2.435 sec

[junit] Testcase: testFormPassed took 1.875 sec
[junit] Testcase: testFormFailed took 0.547 sec
[junit] FAILED
[junit] was expecting some error messages, but received none.
[junit] junit.framework.AssertionFailedError: was expecting some
error messages, but received none.
[junit] at 
servletunit.struts.Common.verifyActionMessages(Common.java:84)
[junit] at 
servletunit.struts.MockStrutsTestCase.verifyActionErrors(MockStrutsTestCase.
java:765)
[junit] at 
mori.web.controller.registry.test.TestBogusAction.testFormFailed(TestBogusAc
tion.java:17)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
[junit] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
[junit] TEST mori.web.controller.registry.test.TestBogusAction FAILED



Since the Form just creates an error, I should get exactly the opposite test
results from what I'm getting, right? It seems as though the
MockStrutsTestCase cannot see the errors generated by the DynaActionForm
even though the source says it should do exactly that. Any help appreciated.

John



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


-- End of Forwarded Message


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



Struts wizard workflows and stxx

2004-03-02 Thread Edd Dawson
Hi

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

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

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

page 1 will let  them choose a username and password

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

page 3 will let them enter their postal address

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


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

==

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


form-beans
form-bean  name=MyWizard
type=forms.MyWizard /
/form-beans

!-- the first screen of the wizard (next action only available)
--
!-- no validation, since the finish action is not available --
actions
action path=/mywizard1
type=actions.MyWizard
name=MyWizard
validate=false
input=/WEB-INF/jsp/mywizard1.jsp
forward name=next
path=/WEB-INF/jsp/mywizard2.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

!-- the second screen of the wizard (back, next and
finish) --
!-- since finish action is available, bean should
validated, note
validation should not necessarily validate if back action
requested, you
might delay validation or do conditional validation --
action path=/mywizard2
type=actions.MyWizard
name=MyWizard
validate=true
input=/WEB-INF/jsp/mywizard2.jsp
forward name=back
path=/WEB-INF/jsp/mywizard1.jsp /
forward name=next
path=/WEB-INF/jsp/mywizard3.jsp /
forward name=finish
path=/WEB-INF/jsp/mywizarddone.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

!-- the last screen of the wizard (back, finish and
cancel only) --
action path=/mywizard3
type=actions.MyWizard
name=MyWizard
validate=true
input=/WEB-INF/jsp/mywizard3.jsp
forward name=back
path=/WEB-INF/jsp/mywizard2.jsp /
forward name=finish
path=/WEB-INF/jsp/mywizarddone.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

The pieces of the wizard are as follows: 

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

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

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

mywizarddone.jsp - the 'success' page 

mywizardcancel.jsp - the 'cancel' page 




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

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

Thanks for reading all this!

cheers
Edd :)

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



Re: calculating sum inside logic:iterate

2004-03-02 Thread Mark Lowe
Depends how you've done things.

If your items are nested in a form (indexed/mapped proerties) you could 
have a total that is calculated there. Thus no need to do it in an 
action or a jsp.



On 2 Mar 2004, at 17:18, Marco Mistroni wrote:

Hi all,
I have a colletion of items that have a method called price.
I was wandering if I could calculate the total of all prices via struts
Tags rather than using java code...
Anyone has any ideas?

Thanx in advance and regards
marco
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


Re: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Shyam A
+1

On action alone be thy interest,
Never on its fruits.
Let not the fruits of action be thy motive,
Nor be thy attachment to inaction.

- Bhagavad Gita (250 BC - 250 AD), Chapter 2

http://timesofindia.indiatimes.com/articleshow/8487868.cms



--- atta-ur rehman [EMAIL PROTECTED] wrote:
 +1
 
 ATTA
 
 On Mar 1, 2004, at 8:19 PM, Vic Cekvenich wrote:
 
 
  -Original Message-
  From: Chappell, Simon P
 [mailto:[EMAIL PROTECTED]
 
  4. I had the same frustrations that you have. I
 made the decision 
  that the
  best way to restore the balance of good in the
 universe, was to try to
  become the kind of tech lead that I would have
 wanted when I was a
  newbie/humble grunt.
 
  +1
  .V
 
 
 

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

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


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: ServletContextListener init parameters

2004-03-02 Thread Robert Taylor
You should be able to use either scriptlets or JSTL because they are in the 
ServletContext:

%
Enumeration enum = application.getInitParameterNames();
%

c:forEach var=paramName items=${application.initParameterNames}

/c:forEach

robert


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 11:17 AM
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: RE: ServletContextListener  init parameters
 
 
 Thanks Robert for this quick anwser.
 
 This solved my problem. However. Is there a possibility to access 
 context-params from a JSP page?
 
 Thanks,
 
 Regards,
 
 Harm de Laat
 Informatiefabriek
 The Netherlands
 
 
 
 
 
 Robert Taylor [EMAIL PROTECTED] 
 02-03-2004 13:43
 Please respond to
 Struts Users Mailing List [EMAIL PROTECTED]
 
 
 To
 Struts Users Mailing List [EMAIL PROTECTED]
 cc
 
 Subject
 RE: ServletContextListener  init parameters
 
 
 
 
 
 
 The problem is your servlet init parameters don't exist in the 
 ServletContext.
 If you want them to be available to your code, then define them
 as init parameters to your application:
 
 ?xml version=1.0 encoding=UTF-8?
 web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 display-nameapp name/display-name
 
  context-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config.xml/param-value
   description![CDATA[Struts configuration file]]/description
/context-param
context-param
   param-namejcaConnector/param-name
   param-valuejava:/eis/bongers/autos/content/param-value
/context-param
context-param
   param-nametempFile/param-name
   param-valuec:/mtbtemp/param-value
/context-param
context-param
   param-nameproperties_db_name/param-name
   param-valuebmpauto/bau_content.nsf/param-value
/context-param
 
 etc...
 
 
 Then your code will yield the expected results.
 
 
 robert
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 02, 2004 4:45 AM
  To: [EMAIL PROTECTED]
  Subject: ServletContextListener  init parameters
 
 
  Hi all,
 
  I have my ActionServlet serving as a ServletContextListener:
 
  public class ActionServlet
  extends org.apache.struts.action.ActionServlet implements
  ServletContextListener
 
 
  In the following method (which gets called upon startup) I need the
  ActionServlet init Parameters:
 
  public void contextInitialized(ServletContextEvent event)
 
 
  I want to do something like:
 
  public void contextInitialized(ServletContextEvent event) {
  ServletContext ctx = event.getServletContext();
  Enumeration e = ctx.getInitParameterNames();
  while (e.hasMoreElements()) {
  log.debug(Parameter:  + e.nextElement());
  }
  }
 
  Unfortunatly when I use the code above, my enumeration is empty.
 
  My web.xml looks like this:
 
  servlet
 
  init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config.xml/param-value
   description![CDATA[Struts configuration 
 file]]/description
/init-param
init-param
   param-namejcaConnector/param-name
   param-valuejava:/eis/bongers/autos/content/param-value
/init-param
init-param
   param-nametempFile/param-name
   param-valuec:/mtbtemp/param-value
/init-param
init-param
   param-nameproperties_db_name/param-name
   param-valuebmpauto/bau_content.nsf/param-value
/init-param
 
  ... etc ... etc ... etc ...
 
 
  How can I obtain those init parameters when
  contextInitialized(ServletContextEvent event) is called?
 
  Your help is highly appreciated.
 
  Regards,
 
  Harm de Laat
  Informatiefabriek
  The Netherlands.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



Re: [REPOST] MockStrutsTestCase problem

2004-03-02 Thread Richard Yee
John,
In your form, you should extend
org.apache.struts.validator.DynaValidatorForm instead
of org.apache.struts.action.DynaActionForm

-Richard


--- John Fitzpatrick [EMAIL PROTECTED] wrote:
 Sorry for the repost, but I really am stuck on this.
 If anyone could help,
 I'd appreciate it.
 
 
 
 I'm having a problem setting up tests where errors
 are created during
 validation by a DynaActionForm using
 MockStrutsTestCase. Here's my code:
 
 The DynaActionForm:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 public class BogusForm extends
 org.apache.struts.action.DynaActionForm {
 ActionErrors errors = new ActionErrors ();
 
public ActionErrors validate ( ActionMapping
 mapping,
 HttpServletRequest request ) {
 
 errors.add ( error, new ActionError (
 error.message ) );
 return errors;
}
 }
 
 The Action:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 /**
  * @struts.action
  *name=BogusForm
  *input=.doActivity
  *path=/Bogus
  * @struts.action-forward
  *name=doActivity
  *path=.doActivity
  */
 public class BogusAction extends
 org.apache.struts.action.Action {
public ActionForward execute ( ActionMapping
 mapping,
 ActionForm form, HttpServletRequest
 request,
 HttpServletResponse response )
 throws Exception {
 
   return mapping.findForward ( doActivity
 );
}
 }
 
 The MockStrutsTestCase:
 ===
 package test;
 
 import javax.servlet.*;
 import servletunit.struts.*;
 
 public class TestBogusAction extends
 MockStrutsTestCase {
public void testFormPassed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyNoActionErrors ();
}
public void testFormFailed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyActionErrors( new String [] {
 error.message } );
}
 }
 
 The result:
 ===
 test:
 [junit] Running
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 [junit] Testsuite:
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 
 [junit] Testcase: testFormPassed took 1.875 sec
 [junit] Testcase: testFormFailed took 0.547 sec
 [junit] FAILED
 [junit] was expecting some error messages, but
 received none.
 [junit] junit.framework.AssertionFailedError:
 was expecting some
 error messages, but received none.
 [junit] at 

servletunit.struts.Common.verifyActionMessages(Common.java:84)
 [junit] at 

servletunit.struts.MockStrutsTestCase.verifyActionErrors(MockStrutsTestCase.
 java:765)
 [junit] at 

mori.web.controller.registry.test.TestBogusAction.testFormFailed(TestBogusAc
 tion.java:17)
 [junit] at
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 [junit] at 

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
 )
 [junit] at 

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
 .java:25)
 [junit] TEST
 mori.web.controller.registry.test.TestBogusAction
 FAILED
 
 
 
 Since the Form just creates an error, I should get
 exactly the opposite test
 results from what I'm getting, right? It seems as
 though the
 MockStrutsTestCase cannot see the errors generated
 by the DynaActionForm
 even though the source says it should do exactly
 that. Any help appreciated.
 
 John
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 -- End of Forwarded Message
 
 

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


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)

2004-03-02 Thread Chappell, Simon P
Good point about the testing. I didn't mention it because I was responding to specific 
issues in the original email, but testing is everything. Your end-user/customer will 
not care if you used all the trendy GoF patterns, if the software doesn't work. The 
software must work. Testing is the best way that we have at this time of ensuring 
that. Thus we have:

Simon's 1st of Software Development: Working code trumps everything.

Learn it, live it , love it. There will be a test (pun intended! :-)

Simon

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 10:18 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Life, the Universe and Everything (was: RE: [OT] 
RE: Memory
usage)


Interesting point about tech leads.. I agree wholeheartedly
I specifically have agree with enthusiasm for learning new
technologies/methodologies
I would also add Must ensure product works on all client platforms
You would be surprised how much software is shipped without 
any testing or
consideration
for the user's environment
~My 2 cents~
Martin Gainty
- Original Message -
From: P K [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 10:50 AM
Subject: RE: Life, the Universe and Everything (was: RE: [OT] 
RE: Memory
usage)


 so you reckon that hinting to my Manager, whom we both 
report to, about my
frustrations isn't going to help much?

 Thanks for the suggestion about the small company though. 
Looking back,
the most fun I had at work was working for a small company.

 Simons, Your suggestion # 4 is great nad #5 really 
interesting. Thanks.

 Andrew Hill [EMAIL PROTECTED] wrote:
 Ive found the best way to avoid those kind of morons is to 
work at small
 companies where any deadwood has nowhere to hide and is 
quickly pruned :-)
 Our tech leads really know their stuff here.


 -Original Message-
 From: Chappell, Simon P [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, 2 March 2004 06:28
 To: Struts Users Mailing List
 Subject: Life, the Universe and Everything (was: RE: [OT] RE: Memory
 usage)


 While the original flame war was less helpful, the question that has
emerged
 from it's ashes is a good one. I don't claim to have all the 
answers, but
I
 can offer some personal observations. Feel free to disagree.

 1. You can do nothing about those who choose not to learn. I've tried
 changing them and it doesn't work. I consider this a basic fact.

 2. You have a great deal of control over your ability to 
learn. If you
 aren't big time into learning, then I recommend catching 
some enthusiasm
for
 it.

 3. There will be always be good and bad tech leads. I am a 
tech lead; I
try
 to be a good one. I can put a String to standard out or 
standard error!
;-)

 4. I had the same frustrations that you have. I made the 
decision that the
 best way to restore the balance of good in the universe, was 
to try to
 become the kind of tech lead that I would have wanted when I was a
 newbie/humble grunt. I teach a class on learning Java one 
lunchtime a week
 and try to bestow a little wisdom and encouragement whenever 
I can. I am a
 Java mentor here and I lead a study group of us that are 
seeking our Java
 Certification.

 5. No one reads documentation. This is a fact. Learn what is 
drop dead
 fired and escorted from the building important and then try to
 auto-generate it. :-)

 6. Leadership is a rare commodity. There's a lot of 
management out there,
 but precious little leadership. Again, deal with it. Become 
a leader and
 just do what needs to be done. This is what I have tended to 
do. The ol'
 saying about it's easier to ask forgiveness than 
permission is very true
 (except I sometimes forget to ask for forgiveness! :-)

 7. Black team? How 90's, Our team wears Hawaiian shirts! (Honest. :-)

 Simon

 -Original Message-
 From: P K [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 01, 2004 3:58 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [OT] RE: Memory usage
 
 
 Sorry to continue on this topic. I've learnt a great deal of
 non struts stuff on this list and this only adds to it.
 I've been bothered (mostly in my mind) with questions about
 peoples capabilities and desires when it comes to work. Viru,
 this original poster of the question on Memory Usage clearly
 has a desire to learn, but what about people who don't? How do
 you deal with them?
 I currently work with a Tech Lead who wouldn't be able to
 output a String to standard out if asked to write a program. I
 don't care about her taking credit for the work that we do.
 She doesn't provide any leadership whatsoever to the project
 except produce paper that no one bothers to read. Have you
 guys come across situations like this? What have you done
 about it? Don't get me wrong - I am not prone to complaining
 nor do I think I am a member of the elite 'Black Team'.
 
 Quoting Dhaliwal, Pritpal (HQP)
 

Re: calculating sum inside logic:iterate

2004-03-02 Thread Nick Wesselman
Technically this seems to be a business method, logic that would be 
better handled in your model code. So for example you have a 
ShoppingCart class which has a getItems() method to get your collection 
of items and a getTotal() method to add their prices.

Not the answer you're looking for I think but my 2 cents.

Nick

Marco Mistroni wrote:

Hi all,
I have a colletion of items that have a method called price.
I was wandering if I could calculate the total of all prices via struts
Tags rather than using java code...
Anyone has any ideas?

Thanx in advance and regards
marco
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


RE: Struts wizard workflows and stxx

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

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

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

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

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

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

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

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

HTH.
Regards,
Shirish

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


Hi

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

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

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

page 1 will let  them choose a username and password

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

page 3 will let them enter their postal address

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


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

==

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


form-beans
form-bean  name=MyWizard
type=forms.MyWizard /
/form-beans

!-- the first screen of the wizard (next action only available)
--
!-- no validation, since the finish action is not available --
actions
action path=/mywizard1
type=actions.MyWizard
name=MyWizard
validate=false
input=/WEB-INF/jsp/mywizard1.jsp
forward name=next
path=/WEB-INF/jsp/mywizard2.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

!-- the second screen of the wizard (back, next and
finish) --
!-- since finish action is available, bean should
validated, note
validation should not necessarily validate if back action
requested, you
might delay validation or do conditional validation --
action path=/mywizard2
type=actions.MyWizard
name=MyWizard
validate=true
input=/WEB-INF/jsp/mywizard2.jsp
forward name=back
path=/WEB-INF/jsp/mywizard1.jsp /
forward name=next
path=/WEB-INF/jsp/mywizard3.jsp /
forward name=finish
path=/WEB-INF/jsp/mywizarddone.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

!-- the last screen of the wizard (back, finish and
cancel only) --
action path=/mywizard3
type=actions.MyWizard
name=MyWizard
validate=true
input=/WEB-INF/jsp/mywizard3.jsp
forward name=back
path=/WEB-INF/jsp/mywizard2.jsp /
forward name=finish
path=/WEB-INF/jsp/mywizarddone.jsp /
forward name=cancel
path=/WEB-INF/jsp/mywizardcancel.jsp /
/action

The pieces of the wizard are as follows: 

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

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

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


Re: calculating sum inside logic:iterate

2004-03-02 Thread Mark Lowe
I see what you're saying. But at the same time, if you wanted to 
develop a shopping cart that you could plug onto any model. Then IMO 
calculating in a web tier bean say an action form isn't the most evil 
thing in the world.

I agree entirely that the total should be calculated in the model, 
before say saving to the db. But I think there's a case for doing this 
in the web-tier.

On 2 Mar 2004, at 17:39, Nick Wesselman wrote:

Technically this seems to be a business method, logic that would be 
better handled in your model code. So for example you have a 
ShoppingCart class which has a getItems() method to get your 
collection of items and a getTotal() method to add their prices.

Not the answer you're looking for I think but my 2 cents.

Nick

Marco Mistroni wrote:

Hi all,
	I have a colletion of items that have a method called price.
I was wandering if I could calculate the total of all prices via 
struts
Tags rather than using java code...

Anyone has any ideas?

Thanx in advance and regards
marco
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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


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


Re: ServletContextListener init parameters

2004-03-02 Thread Niall Pemberton
You can also do it with struts tags - expose the ServletContext as a
variable:

  bean:page id=servletContext property=application/

...and get an enumeration of init parameter names

   logic:iterate id=contextParamName name=servletContext
property=initParameterNames
  Init Parameter Name: bean:write name=contextParamName/
   /logic:iterate

...but theres nothing in strust to access getInitPramater(name) for the
value. So it would have to be scriptlet:

   Init Parameter Value: %=
servletContext.getInitParameter(contextParamName.toString()) %

Niall

- Original Message - 
From: Robert Taylor [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 4:37 PM
Subject: RE: ServletContextListener  init parameters


 You should be able to use either scriptlets or JSTL because they are in
the ServletContext:

 %
 Enumeration enum = application.getInitParameterNames();
 %

 c:forEach var=paramName items=${application.initParameterNames}

 /c:forEach

 robert


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 02, 2004 11:17 AM
  To: Struts Users Mailing List
  Cc: [EMAIL PROTECTED]
  Subject: RE: ServletContextListener  init parameters
 
 
  Thanks Robert for this quick anwser.
 
  This solved my problem. However. Is there a possibility to access
  context-params from a JSP page?
 
  Thanks,
 
  Regards,
 
  Harm de Laat
  Informatiefabriek
  The Netherlands
 
 
 
 
 
  Robert Taylor [EMAIL PROTECTED]
  02-03-2004 13:43
  Please respond to
  Struts Users Mailing List [EMAIL PROTECTED]
 
 
  To
  Struts Users Mailing List [EMAIL PROTECTED]
  cc
 
  Subject
  RE: ServletContextListener  init parameters
 
 
 
 
 
 
  The problem is your servlet init parameters don't exist in the
  ServletContext.
  If you want them to be available to your code, then define them
  as init parameters to your application:
 
  ?xml version=1.0 encoding=UTF-8?
  web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=
  http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  display-nameapp name/display-name
 
   context-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
description![CDATA[Struts configuration
file]]/description
 /context-param
 context-param
param-namejcaConnector/param-name
param-valuejava:/eis/bongers/autos/content/param-value
 /context-param
 context-param
param-nametempFile/param-name
param-valuec:/mtbtemp/param-value
 /context-param
 context-param
param-nameproperties_db_name/param-name
param-valuebmpauto/bau_content.nsf/param-value
 /context-param
 
  etc...
 
 
  Then your code will yield the expected results.
 
 
  robert
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, March 02, 2004 4:45 AM
   To: [EMAIL PROTECTED]
   Subject: ServletContextListener  init parameters
  
  
   Hi all,
  
   I have my ActionServlet serving as a ServletContextListener:
  
   public class ActionServlet
   extends org.apache.struts.action.ActionServlet implements
   ServletContextListener
  
  
   In the following method (which gets called upon startup) I need the
   ActionServlet init Parameters:
  
   public void contextInitialized(ServletContextEvent event)
  
  
   I want to do something like:
  
   public void contextInitialized(ServletContextEvent event) {
   ServletContext ctx = event.getServletContext();
   Enumeration e = ctx.getInitParameterNames();
   while (e.hasMoreElements()) {
   log.debug(Parameter:  + e.nextElement());
   }
   }
  
   Unfortunatly when I use the code above, my enumeration is empty.
  
   My web.xml looks like this:
  
   servlet
  
   init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
description![CDATA[Struts configuration
  file]]/description
 /init-param
 init-param
param-namejcaConnector/param-name
param-valuejava:/eis/bongers/autos/content/param-value
 /init-param
 init-param
param-nametempFile/param-name
param-valuec:/mtbtemp/param-value
 /init-param
 init-param
param-nameproperties_db_name/param-name
param-valuebmpauto/bau_content.nsf/param-value
 /init-param
  
   ... etc ... etc ... etc ...
  
  
   How can I obtain those init parameters when
   contextInitialized(ServletContextEvent event) is called?
  
   Your help is highly appreciated.
  
   Regards,
  
   Harm de Laat
   Informatiefabriek
   The Netherlands.
  
 
 
  

Re: [REPOST] MockStrutsTestCase problem

2004-03-02 Thread John Fitzpatrick
Richard,

Thanks for the pointer to DynaValidatorForm. I can see how that would be
more useful than DynaActionForm for validation.

However, I tried making the change you suggest and I get the same result.
Any other advice? It's as if the ActionErrors generated by the form are
invisible to the test.

John


On 20040302 11:37 AM, Richard Yee [EMAIL PROTECTED] wrote:

 John,
 In your form, you should extend
 org.apache.struts.validator.DynaValidatorForm instead
 of org.apache.struts.action.DynaActionForm
 
 -Richard
 
 
 --- John Fitzpatrick [EMAIL PROTECTED] wrote:
 Sorry for the repost, but I really am stuck on this.
 If anyone could help,
 I'd appreciate it.
 
 
 
 I'm having a problem setting up tests where errors
 are created during
 validation by a DynaActionForm using
 MockStrutsTestCase. Here's my code:
 
 The DynaActionForm:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 public class BogusForm extends
 org.apache.struts.action.DynaActionForm {
 ActionErrors errors = new ActionErrors ();
 
public ActionErrors validate ( ActionMapping
 mapping,
 HttpServletRequest request ) {
 
 errors.add ( error, new ActionError (
 error.message ) );
 return errors;
}
 }
 
 The Action:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 /**
  * @struts.action
  *name=BogusForm
  *input=.doActivity
  *path=/Bogus
  * @struts.action-forward
  *name=doActivity
  *path=.doActivity
  */
 public class BogusAction extends
 org.apache.struts.action.Action {
public ActionForward execute ( ActionMapping
 mapping,
 ActionForm form, HttpServletRequest
 request,
 HttpServletResponse response )
 throws Exception {
 
   return mapping.findForward ( doActivity
 );
}
 }
 
 The MockStrutsTestCase:
 ===
 package test;
 
 import javax.servlet.*;
 import servletunit.struts.*;
 
 public class TestBogusAction extends
 MockStrutsTestCase {
public void testFormPassed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyNoActionErrors ();
}
public void testFormFailed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyActionErrors( new String [] {
 error.message } );
}
 }
 
 The result:
 ===
 test:
 [junit] Running
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 [junit] Testsuite:
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 
 [junit] Testcase: testFormPassed took 1.875 sec
 [junit] Testcase: testFormFailed took 0.547 sec
 [junit] FAILED
 [junit] was expecting some error messages, but
 received none.
 [junit] junit.framework.AssertionFailedError:
 was expecting some
 error messages, but received none.
 [junit] at
 
 servletunit.struts.Common.verifyActionMessages(Common.java:84)
 [junit] at
 
 servletunit.struts.MockStrutsTestCase.verifyActionErrors(MockStrutsTestCase.
 java:765)
 [junit] at
 
 mori.web.controller.registry.test.TestBogusAction.testFormFailed(TestBogusAc
 tion.java:17)
 [junit] at
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 [junit] at
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
 )
 [junit] at
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
 .java:25)
 [junit] TEST
 mori.web.controller.registry.test.TestBogusAction
 FAILED
 
 
 
 Since the Form just creates an error, I should get
 exactly the opposite test
 results from what I'm getting, right? It seems as
 though the
 MockStrutsTestCase cannot see the errors generated
 by the DynaActionForm
 even though the source says it should do exactly
 that. Any help appreciated.
 
 John
 
 
 
 
 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 -- End of Forwarded Message
 
 
 
 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Search - Find what you?re looking for faster
 http://search.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail

ConcurrentModificationException

2004-03-02 Thread Sergei P. Volin
Greetings!

Why did I get this message when sending two concurent requests to the same page?
I'm using:
1) RH8.0, Linux 2.4.18 #2 SMP
2) java version 1.4.0
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a (JIT enabled: jitc))
3) Tomcat 5.0.19
4) Struts 1.1

The same exception I've got on 4.1.24. I really have problems (with other symptoms) 
with concurrent requests. Not often (because server is not highly exploited) but 
persisted. And more often on Linux platform than on Windows. Why so? Could it be a jvm 
issue? Or may be Tomcat? Or Struts? Or mine? Without concurrent requests application 
works smoothly.

Regards,

Sergei Volin.

HTTP Status 500 - 



type Exception report

message 

description The server encountered an internal error () that prevented it from 
fulfilling this request.

exception 

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)

root cause 

java.util.ConcurrentModificationException
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
java.util.AbstractList$Itr.next(AbstractList.java:417)
org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:401)

org.apache.jsp.admin.sidEditorSurveys_jsp._jspService(sidEditorSurveys_jsp.java:1214)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)

note The full stack trace of the root cause is available in the Tomcat logs.




Apache Tomcat/5.0.19

Struts Workflow - Questions ?

2004-03-02 Thread Joanne L Corless
Hi,

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

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

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

Basically the section of the flow is as follows:

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

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

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

Regards

Joanne Corless



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



Re: [REPOST] MockStrutsTestCase problem

2004-03-02 Thread John Fitzpatrick
Sorry all,

Figured out the problem. Typo in the form definition bangs head on desk.
Thanks.

John



On 20040302 12:12 PM, John Fitzpatrick [EMAIL PROTECTED] wrote:

 Richard,
 
 Thanks for the pointer to DynaValidatorForm. I can see how that would be
 more useful than DynaActionForm for validation.
 
 However, I tried making the change you suggest and I get the same result.
 Any other advice? It's as if the ActionErrors generated by the form are
 invisible to the test.
 
 John
 
 
 On 20040302 11:37 AM, Richard Yee [EMAIL PROTECTED] wrote:
 
 John,
 In your form, you should extend
 org.apache.struts.validator.DynaValidatorForm instead
 of org.apache.struts.action.DynaActionForm
 
 -Richard
 
 
 --- John Fitzpatrick [EMAIL PROTECTED] wrote:
 Sorry for the repost, but I really am stuck on this.
 If anyone could help,
 I'd appreciate it.
 
 
 
 I'm having a problem setting up tests where errors
 are created during
 validation by a DynaActionForm using
 MockStrutsTestCase. Here's my code:
 
 The DynaActionForm:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 public class BogusForm extends
 org.apache.struts.action.DynaActionForm {
 ActionErrors errors = new ActionErrors ();
 
public ActionErrors validate ( ActionMapping
 mapping,
 HttpServletRequest request ) {
 
 errors.add ( error, new ActionError (
 error.message ) );
 return errors;
}
 }
 
 The Action:
 ===
 package test;
 
 import javax.servlet.http.*;
 
 import org.apache.struts.action.*;
 
 /**
  * @struts.action
  *name=BogusForm
  *input=.doActivity
  *path=/Bogus
  * @struts.action-forward
  *name=doActivity
  *path=.doActivity
  */
 public class BogusAction extends
 org.apache.struts.action.Action {
public ActionForward execute ( ActionMapping
 mapping,
 ActionForm form, HttpServletRequest
 request,
 HttpServletResponse response )
 throws Exception {
 
   return mapping.findForward ( doActivity
 );
}
 }
 
 The MockStrutsTestCase:
 ===
 package test;
 
 import javax.servlet.*;
 import servletunit.struts.*;
 
 public class TestBogusAction extends
 MockStrutsTestCase {
public void testFormPassed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyNoActionErrors ();
}
public void testFormFailed () {
   setRequestPathInfo ( /Bogus );
   actionPerform ();
   verifyActionErrors( new String [] {
 error.message } );
}
 }
 
 The result:
 ===
 test:
 [junit] Running
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 [junit] Testsuite:
 mori.web.controller.registry.test.TestBogusAction
 [junit] Tests run: 2, Failures: 1, Errors: 0,
 Time elapsed: 2.435 sec
 
 [junit] Testcase: testFormPassed took 1.875 sec
 [junit] Testcase: testFormFailed took 0.547 sec
 [junit] FAILED
 [junit] was expecting some error messages, but
 received none.
 [junit] junit.framework.AssertionFailedError:
 was expecting some
 error messages, but received none.
 [junit] at
 
 servletunit.struts.Common.verifyActionMessages(Common.java:84)
 [junit] at
 
 servletunit.struts.MockStrutsTestCase.verifyActionErrors(MockStrutsTestCase.
 java:765)
 [junit] at
 
 mori.web.controller.registry.test.TestBogusAction.testFormFailed(TestBogusAc
 tion.java:17)
 [junit] at
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 [junit] at
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
 )
 [junit] at
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
 .java:25)
 [junit] TEST
 mori.web.controller.registry.test.TestBogusAction
 FAILED
 
 
 
 Since the Form just creates an error, I should get
 exactly the opposite test
 results from what I'm getting, right? It seems as
 though the
 MockStrutsTestCase cannot see the errors generated
 by the DynaActionForm
 even though the source says it should do exactly
 that. Any help appreciated.
 
 John
 
 
 
 
 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 -- End of Forwarded Message
 
 
 
 -
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 __
 Do you Yahoo!?
 Yahoo! Search - Find what you?re looking for faster
 http://search.yahoo.com
 
 -
 To unsubscribe

RE: DispatchAction and validate

2004-03-02 Thread as as
do I need an updated .xdt file for this?
y xdoclet generated Struts-config.xml is not having the action mappings for the actiin 
class of mine, extending Dispatch Action.
It shows it fine for classes extending Action class though.
Thanks n advance for the help,
Sam

Robert Taylor [EMAIL PROTECTED] wrote:
Yes.

The DispatchAction will only invoke the method defined in the request under the name 
defined in the parameter attribute of your
action mapping. So if I had update() and restore() as methods in a DispatchAction, and 
I only wanted to validate on the update, then
I would only define validate=true in the action mappping for the DispatchAction 
which is designated to invoke update(). This is
assuming you have two separate action mappings which map to the same DispatchAction.


robert

 -Original Message-
 From: Frers Michael [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 3:23 AM
 To: Struts Users Mailing List
 Subject: DispatchAction and validate


 Hello

 i want to use DispatchAction
 now my questions is can i use in one action the struts-config entry validate=true
 and in the other action validate=false

 Thx for any hints

 Michael


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


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Showing selected in struts option tag

2004-03-02 Thread as as
Hi,
 

Here is my code



 tr bgcolor=A9A9A4

 th align=right

 Supervisor:

 /th

 td



 select name=fullName style=width:225px

 logic:iterate id=supervisor name=supervisors

 option value=bean:write name=supervisor property =employeeID/

 bean:write name=supervisor property =fullName/

 /option

 /logic:iterate

 /select

 /td



 /tr
 
 
Please let me know how I can accomplish the same.


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

RE: Action not forwarding to another Action

2004-03-02 Thread Gopalakrishnan, Jayesh
Could you post the code snippet where you are trying to set  get
parameters.

I have a similar action chaining configuration that works fine for me.


-jayash


-Original Message-
From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 8:21 PM
To: 'Struts Users Mailing List'
Subject: RE: Action not forwarding to another Action


Nop.  I removed 'redirect=true' as followed and still can't retrieve the
parameter in OrderSearchAction.  I even tried to specifically do
request.setParamter(...) first and that doesn't work either.

actionpath=/app/DeleteOrder
   type=com.cat.action.OrderMaintainAction
   name=OrderFormBean
  scope=request
   validate=false
forward name=Content path=/app/ListOfOrder.exe /
forward name=ContentError path=/app/DeleteError.jsp/
/action

actionpath=/app/ListOfOrder
   type=com.cat.action.OrderSearchAction
   name=OrderSearchFormBean
  scope=request
   validate=false
forward name=Content path=/app/ListOfOrder.jsp/
forward name=ContentError path=/app/OrderError.jsp/

/action

-Original Message-
From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 6:45 PM
To: Struts Users Mailing List
Subject: RE: Action not forwarding to another Action


I think when you say 'redirect=true', then you lose 
your request object. This is like a client side/browser redirect.

Remove this attribute from your forward element and give it a try.



-Original Message-
From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 3:24 PM
To: Struts Users Mailing List
Subject: RE: Action not forwarding to another Action


If Im not wrongif .exe is what you hv configured in web.xml then I see
there is no reason why it is not picking up /

possible reason could be...

make sure that you are forwarding to Content which is mapped to
/app/ListOfOrder.exe in your OrderMaintainAction

1) Can someone also tell me if I have a Request attribute defined in 
OrderMaintainAction, if the above redirection works, will I be able to 
see the same Request attribute in OrderSearchAction?

the same scenarion where I'm not able to get the value of request attribute
which I set in my previous Action class then I set as session attribute and
Im able to get that value in the other Action class where Im redirecting to.

2) A general question: if formA is linked to formB through a 'link'.   If
I
click on the 'link' in formA, can I get to the passed parameter of 
FormA
by
doing Request.geParameter(id) or I can only retrieve 'id' throught a 
'submit' rather than through a 'link'?

I dont really understand your point but I assumed that you are passing a
parameter from one form to another in such case if you are calling other
page/calling action class by passing request parameter you could get those
parameters on the other page/action class. 

hth


-Ramadoss






-Original Message-
From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 5:51 PM
To: '[EMAIL PROTECTED]'
Subject: Action not forwarding to another Action


Hi:
   I have a similar problem that I can't invoke OrderSearchAction.exe from
OrderMaintainAction.  I set a debug breakpoint at the beginning of
OrderSearchAction and never get there.

actionpath=/app/DeleteOrder
   type=com.cat.action.OrderMaintainAction
   name=OrderFormBean
  scope=request
   validate=false
forward name=Content path=/app/ListOfOrder.exe redirect=true
/
forward name=ContentError path=/app/DeleteError.jsp/
/action

actionpath=/app/ListOfOrder
   type=com.cat.action.'redirect=true'
   name=OrderSearchFormBean
  scope=request
   validate=false
forward name=Content path=/app/ListOfOrder.jsp/
forward name=ContentError path=/app/OrderError.jsp/

/action

I have two other questions:
1) Can someone also tell me if I have a Request attribute defined in
OrderMaintainAction, if the above redirection works, will I be able to see
the same Request attribute in OrderSearchAction?
2) A general question: if formA is linked to formB through a 'link'.   If I
click on the 'link' in formA, can I get to the passed parameter of FormA by
doing Request.geParameter(id) or I can only retrieve 'id' throught a
'submit' rather than through a 'link'?

Thanks for any help!


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


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

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

Re: ConcurrentModificationException

2004-03-02 Thread Brad Balmer
Any chance that you were iterating through your HttpSession removing 
attributes?

Sergei P. Volin wrote:

Greetings!

Why did I get this message when sending two concurent requests to the same page?
I'm using:
1) RH8.0, Linux 2.4.18 #2 SMP
2) java version 1.4.0
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a (JIT enabled: jitc))
3) Tomcat 5.0.19
4) Struts 1.1
The same exception I've got on 4.1.24. I really have problems (with other symptoms) with concurrent requests. Not often (because server is not highly exploited) but persisted. And more often on Linux platform than on Windows. Why so? Could it be a jvm issue? Or may be Tomcat? Or Struts? Or mine? Without concurrent requests application works smoothly.

Regards,

Sergei Volin.

HTTP Status 500 - 



type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
root cause 

java.util.ConcurrentModificationException
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
java.util.AbstractList$Itr.next(AbstractList.java:417)
org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:401)

org.apache.jsp.admin.sidEditorSurveys_jsp._jspService(sidEditorSurveys_jsp.java:1214)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)

org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
note The full stack trace of the root cause is available in the Tomcat logs.



Apache Tomcat/5.0.19
 



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


RE: DispatchAction and validate

2004-03-02 Thread Robert Taylor
I've never used XDoclet (although I mean to learn about it) so I can't help you there.
Maybe someone else on the list can.

robert

 -Original Message-
 From: as as [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 02, 2004 12:39 PM
 To: Struts Users Mailing List
 Subject: RE: DispatchAction and validate


 do I need an updated .xdt file for this?
 y xdoclet generated Struts-config.xml is not having the action mappings for the 
 actiin class of mine, extending Dispatch Action.
 It shows it fine for classes extending Action class though.
 Thanks n advance for the help,
 Sam

 Robert Taylor [EMAIL PROTECTED] wrote:
 Yes.

 The DispatchAction will only invoke the method defined in the request under the name 
 defined in the parameter attribute of your
 action mapping. So if I had update() and restore() as methods in a DispatchAction, 
 and I only wanted to validate on the
 update, then
 I would only define validate=true in the action mappping for the DispatchAction 
 which is designated to invoke update(). This is
 assuming you have two separate action mappings which map to the same DispatchAction.


 robert

  -Original Message-
  From: Frers Michael [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 02, 2004 3:23 AM
  To: Struts Users Mailing List
  Subject: DispatchAction and validate
 
 
  Hello
 
  i want to use DispatchAction
  now my questions is can i use in one action the struts-config entry validate=true
  and in the other action validate=false
 
  Thx for any hints
 
  Michael


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


 -
 Do you Yahoo!?
 Yahoo! Search - Find what youre looking for faster.


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



Re: ConcurrentModificationException

2004-03-02 Thread Sergei P. Volin

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

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


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



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



RE: ConcurrentModificationException

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

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



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

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


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




RE: ConcurrentModificationException

2004-03-02 Thread Guillermo Meyer
If the collection you are iterating is not synchronized, you can get
this error if you remove or add elements. Try using java.util.Vector as
your collection implementation.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Martes, 02 de Marzo de 2004 03:12 p.m.
To: [EMAIL PROTECTED]
Subject: RE: ConcurrentModificationException


genarally you get this error with lists if you are iterating over list
and remove element/add element to list..

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



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

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


|
| Any chance that you were iterating through your HttpSession removing 
| attributes?
|
| Sergei P. Volin wrote:
|
| Greetings!
| 
| Why did I get this message when sending two concurent requests to the
same page?
| I'm using:
| 1) RH8.0, Linux 2.4.18 #2 SMP
| 2) java version 1.4.0
| Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0) 
| Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a 
| (JIT
enabled: jitc))
| 3) Tomcat 5.0.19
| 4) Struts 1.1
| 
| The same exception I've got on 4.1.24. I really have problems (with 
| other
symptoms) with concurrent requests. Not often (because server is not
highly
exploited) but persisted. And more often on Linux platform than on
Windows. Why so? Could it be a jvm issue? Or may be Tomcat? Or Struts?
Or mine? Without concurrent requests application works smoothly.
| 
| Regards,
| 
| Sergei Volin.
| 
| HTTP Status 500 -
| 
|
---

-
| 
| type Exception report
| 
| message
| 
| description The server encountered an internal error () that 
| prevented it
from fulfilling this request.
| 
| exception
| 
| org.apache.jasper.JasperException
| 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
58)
|  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
|  301)
|  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:10
69)
| 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr
oces
sor.java:455)
| 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
279)
|  org.apache.struts.action.ActionServlet.process(ActionServlet.java:14
|  82)
|  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| 
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
| 
| root cause
| 
| java.util.ConcurrentModificationException
|  
|
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444
)
|  java.util.AbstractList$Itr.next(AbstractList.java:417)
| 
org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:40
1)
| 
org.apache.jsp.admin.sidEditorSurveys_jsp._jspService(sidEditorSurveys_j
sp.j
ava:1214)
|  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:3
11)
|  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
|  301)
|  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:10
69)
| 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr
oces
sor.java:455)
| 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
279)
|  org.apache.struts.action.ActionServlet.process(ActionServlet.java:14
|  82)
|  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
|  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| 

RE: Action not forwarding to another Action

2004-03-02 Thread Shyam A
Use request.getAttribute(id).

hth,
Shyam

 Let me elaborate my question #3:
 If my .JSP has a html:form
 action=/app/UpdateOrder?id=30 ,  I know
 when I click a 'submit' button to get to an Action
 class, I can retrieve the
 id in my Action class by doing String id =
 Request.getParameter(id);
 But if my .jsp uses a link to pass the id such as
  a href=app/UpdateOrder.exec?id=30.. In
 other words, I get to the
 Action class through a 'link' rather than a
 'submit', can I still use 
 String id = Request.getParameter(id);  to
 retrieve the id?  I tried it
 and I can't find id from the Request object.
 
 
 -Original Message-
 From: Ramadoss Chinnakuzhandai
 [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 01, 2004 6:24 PM
 To: Struts Users Mailing List
 Subject: RE: Action not forwarding to another Action
 
 
 If Im not wrongif .exe is what you hv configured
 in web.xml then I see
 there is no reason why it is not picking up /
 
 possible reason could be...
 
 make sure that you are forwarding to Content which
 is mapped to
 /app/ListOfOrder.exe in your OrderMaintainAction
 
 1) Can someone also tell me if I have a Request
 attribute defined in 
 OrderMaintainAction, if the above redirection
 works, will I be able to 
 see the same Request attribute in
 OrderSearchAction?
 
 the same scenarion where I'm not able to get the
 value of request attribute
 which I set in my previous Action class then I set
 as session attribute and
 Im able to get that value in the other Action class
 where Im redirecting to.
 
 2) A general question: if formA is linked to formB
 through a 'link'.   If
 I
 click on the 'link' in formA, can I get to the
 passed parameter of 
 FormA by doing Request.geParameter(id) or I can
 only retrieve 'id' 
 throught a 'submit' rather than through a 'link'?
 
 I dont really understand your point but I assumed
 that you are passing a
 parameter from one form to another in such case if
 you are calling other
 page/calling action class by passing request
 parameter you could get those
 parameters on the other page/action class. 
 
 hth
 
 
 -Ramadoss
 
 
 
 
 
 
 -Original Message-
 From: Au-Yeung, Stella H
 [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 01, 2004 5:51 PM
 To: '[EMAIL PROTECTED]'
 Subject: Action not forwarding to another Action
 
 
 Hi:
I have a similar problem that I can't invoke
 OrderSearchAction.exe from
 OrderMaintainAction.  I set a debug breakpoint at
 the beginning of
 OrderSearchAction and never get there.
 
 actionpath=/app/DeleteOrder
   
 type=com.cat.action.OrderMaintainAction
name=OrderFormBean
   scope=request
validate=false
 forward name=Content
 path=/app/ListOfOrder.exe redirect=true
 /
 forward name=ContentError
 path=/app/DeleteError.jsp/
 /action
 
 actionpath=/app/ListOfOrder
   
 type=com.cat.action.OrderSearchAction
name=OrderSearchFormBean
   scope=request
validate=false
 forward name=Content
 path=/app/ListOfOrder.jsp/
   forward name=ContentError
 path=/app/OrderError.jsp/
 
 /action
 
 I have two other questions:
 1) Can someone also tell me if I have a Request
 attribute defined in
 OrderMaintainAction, if the above redirection works,
 will I be able to see
 the same Request attribute in OrderSearchAction?
 2) A general question: if formA is linked to formB
 through a 'link'.   If I
 click on the 'link' in formA, can I get to the
 passed parameter of FormA by
 doing Request.geParameter(id) or I can only
 retrieve 'id' throught a
 'submit' rather than through a 'link'?
 
 Thanks for any help!
 
 

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

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

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


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: Semi-OT: Saving state when using EJB Session Beans and Struts

2004-03-02 Thread Adam Hardy
It's difficult to know what scenario you are talking about here.

I assume you mean to cache the EJBs in the user's servlet session, so
you will have several remote EJBs in there depending on how many
different actions the user has accessed.
It sounds like you need to do this to allow transaction management
across a group of data operations?
I would not do it by caching the EJBs at all, or having stateful session
beans. I would keep my actionformbean in the user's servlet session
instead, accumulating the data over several http requests and then
marshall the whole collection of data across to the EJB session in one.
Struts is good at that. I expect you'd give yourself more headaches than
it's worth, trying to collect the user's session data in the EJB layer.
It sounds like you are writing a web interface for an already existing
client-server app.
On 03/02/2004 03:42 PM Smith, Darrin wrote:
Thanks for the reply!

That is kind of what is going on already.  The Action's act as the local
Java class talked about in the Business Delegate Pattern that create and
cache the Stateful Session Bean (a different one per Action).  They (the
Actions) then use the Session Bean's business logic. This is done in a
standard way though where each Session Bean will implement an interface that
is common to all of the other Session Beans in the application. This way
each action simply calls a factory and based on the way the factory is
called, a Stateful Session Bean for that type of action is returned, then
cached in the Action.  All actions then can make the submit(...),
inspect(...), etc. calls common to all types of Session Beans (but performed
differently by each one).
The question is though, for these actions, shouldn't they keep session state
that will match the Stateful Session Beans?  Typically, I know you want have
your Model hold Session state while your client holds request state, but in
this case, where the Action needs to remember the cached Session Bean,
doesn't it seem to make sense to mark the Action as session scope in the
struts config file as well?
  

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 5:35 PM
To: Struts Users Mailing List
Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
Struts
On 03/01/2004 05:47 PM Smith, Darrin wrote:

In short, the Actions will be calling various Stateful Session Beans to do
the actual work.  These are used for various reasons with the main one
being

their built-in transaction support (online orders...need to be either
done...or not done). How should state be handled and at what level
(page...request...session...) in the upstream struts portion? 


Hmmm. Thought someone more knowledgeable would answer this, and was 
waiting with interest myself. Oh well. Without too much experience with 
EJBs myself, I can say a couple of things: the gurus say 'use the 
business delegate pattern with an EJB session facade'. Secondly, it 
depends heavily on what your stateful session beans are holding as 
state. Care to name something?

Adam


--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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


RE: Showing selected in struts option tag

2004-03-02 Thread Wendy Smoak
 From: as as [mailto:[EMAIL PROTECTED] 
  select name=fullName style=width:225px
  logic:iterate id=supervisor name=supervisors
  option value=bean:write name=supervisor property 
 =employeeID/
  bean:write name=supervisor property =fullName/
  /option
  /logic:iterate
  /select

An example from my project that may get you started:
html-el:select property=calendarYear onchange=updateAccounts();
   html-el:options collection=years property=key
labelProperty=value/
/html-el:select

You can drop the '-el' in the tags, there are no expressions in this one
anyway.  The docs for html:select and html:options are here:
http://jakarta.apache.org/struts/userGuide/dev_html.html

Give it a try and post what you come up with!

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

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



Re: ConcurrentModificationException

2004-03-02 Thread Sergei P. Volin

I know this and I do not add/remove elements to/from list at all. Just as I
said - only reading elements from list.
Are jsps (Tomcat) thread safe? I'm really worry about that.

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 9:11 PM
Subject: RE: ConcurrentModificationException


|
| genarally you get this error with lists if you are iterating over list and
remove element/add element to list..
|
| -Original Message-
| From: Sergei P. Volin [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, March 02, 2004 7:08 PM
| To: Struts Users Mailing List
| Subject: Re: ConcurrentModificationException
|
|
|
| The exception arised by doAfterBody method of IterateTag class, namely at
| /logic:iterate. It means that at least one time the body of iteration
was
| done. I can guarantee that inside itereator tags -
| logic:iterate.../logic:iterate I do not change nor iterator either
| session attributes - just reading of session beans. So if smth of that
| changes is that only due to some kind of requests interaction. I don't
know
| how it could be. This is really painful to me since I can't even think
what
| could it be and the issue persists from time to time. And again - the
| application works smoothly when there is no collision of requests.
|
| - Original Message - 
| From: Brad Balmer [EMAIL PROTECTED]
| To: Struts Users Mailing List [EMAIL PROTECTED]
| Sent: Tuesday, March 02, 2004 8:49 PM
| Subject: Re: ConcurrentModificationException
|
|
| |
| | Any chance that you were iterating through your HttpSession removing
| | attributes?
| |
| | Sergei P. Volin wrote:
| |
| | Greetings!
| | 
| | Why did I get this message when sending two concurent requests to the
| same page?
| | I'm using:
| | 1) RH8.0, Linux 2.4.18 #2 SMP
| | 2) java version 1.4.0
| | Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
| | Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a (JIT
| enabled: jitc))
| | 3) Tomcat 5.0.19
| | 4) Struts 1.1
| | 
| | The same exception I've got on 4.1.24. I really have problems (with
other
| symptoms) with concurrent requests. Not often (because server is not
highly
| exploited) but persisted. And more often on Linux platform than on
Windows.
| Why so? Could it be a jvm issue? Or may be Tomcat? Or Struts? Or mine?
| Without concurrent requests application works smoothly.
| | 
| | Regards,
| | 
| | Sergei Volin.
| | 
| | HTTP Status 500 -
| | 
| |
|
---
| -
| | 
| | type Exception report
| | 
| | message
| | 
| | description The server encountered an internal error () that prevented
it
| from fulfilling this request.
| | 
| | exception
| | 
| | org.apache.jasper.JasperException
| | 
|
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
| 58)
| | 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
| |  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
| |  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| | 
|
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
| 69)
| | 
|
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
| sor.java:455)
| | 
|
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
| | 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
| |  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
| |  javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
| |  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| | 
com.volin.filters.CompressionFilter.doFilter(CompressionFilter.java:85)
| | 
| | root cause
| | 
| | java.util.ConcurrentModificationException
| | 
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
| |  java.util.AbstractList$Itr.next(AbstractList.java:417)
| | 
| org.apache.struts.taglib.logic.IterateTag.doAfterBody(IterateTag.java:401)
| | 
|
org.apache.jsp.admin.sidEditorSurveys_jsp._jspService(sidEditorSurveys_jsp.j
| ava:1214)
| |  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
| |  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| | 
|
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
| 11)
| | 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
| |  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
| |  javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| | 
|
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
| 69)
| | 
|
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
| sor.java:455)
| | 
|
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
| | 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
| |  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
| |  

Re: ConcurrentModificationException

2004-03-02 Thread Sergei P. Volin

No add, no remove. More interesting fresh result. As I said it happens
sometimes, not always. Sometimes when I send two concurrent requests (from 2
*diferent* browser sessions!) there is no errors at all but the result jsp
data sheet is summarised! E.g. I get doubled amount of elements in the list
on both pages - 304 instead of 152 in normal situation. It seems obviously
that somewhere session objects of two different users are overlapped. How do
you like it?

- Original Message - 
From: Guillermo Meyer [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 9:14 PM
Subject: RE: ConcurrentModificationException


|
| If the collection you are iterating is not synchronized, you can get
| this error if you remove or add elements. Try using java.util.Vector as
| your collection implementation.
|
| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]
| Sent: Martes, 02 de Marzo de 2004 03:12 p.m.
| To: [EMAIL PROTECTED]
| Subject: RE: ConcurrentModificationException
|
|
| genarally you get this error with lists if you are iterating over list
| and remove element/add element to list..
|
| -Original Message-
| From: Sergei P. Volin [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, March 02, 2004 7:08 PM
| To: Struts Users Mailing List
| Subject: Re: ConcurrentModificationException
|
|
|
| The exception arised by doAfterBody method of IterateTag class, namely
| at /logic:iterate. It means that at least one time the body of
| iteration was done. I can guarantee that inside itereator tags -
| logic:iterate.../logic:iterate I do not change nor iterator either
| session attributes - just reading of session beans. So if smth of that
| changes is that only due to some kind of requests interaction. I don't
| know how it could be. This is really painful to me since I can't even
| think what could it be and the issue persists from time to time. And
| again - the application works smoothly when there is no collision of
| requests.
|
| - Original Message - 
| From: Brad Balmer [EMAIL PROTECTED]
| To: Struts Users Mailing List [EMAIL PROTECTED]
| Sent: Tuesday, March 02, 2004 8:49 PM
| Subject: Re: ConcurrentModificationException
|
|
| |
| | Any chance that you were iterating through your HttpSession removing
| | attributes?
| |
| | Sergei P. Volin wrote:
| |
| | Greetings!
| | 
| | Why did I get this message when sending two concurent requests to the
| same page?
| | I'm using:
| | 1) RH8.0, Linux 2.4.18 #2 SMP
| | 2) java version 1.4.0
| | Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0)
| | Classic VM (build 1.4.0, J2RE 1.4.0 IBM build cxia32140-20020917a
| | (JIT
| enabled: jitc))
| | 3) Tomcat 5.0.19
| | 4) Struts 1.1
| | 
| | The same exception I've got on 4.1.24. I really have problems (with
| | other
| symptoms) with concurrent requests. Not often (because server is not
| highly
| exploited) but persisted. And more often on Linux platform than on
| Windows. Why so? Could it be a jvm issue? Or may be Tomcat? Or Struts?
| Or mine? Without concurrent requests application works smoothly.
| | 
| | Regards,
| | 
| | Sergei Volin.
| | 
| | HTTP Status 500 -
| | 



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



Date attribute in ActionForm

2004-03-02 Thread Vanessa Monteiro
Hello,

I have and ActionForm with one element refering to a Date (from Util)
property and I get the following exception

java.lang.IllegalArgumentException: argument type mismatch


Is there a special treatment for these kind of attributes?

Thanks,

_
Vanessa Monteiro
Analista de Sistemas
Quality Software
3475-3000 r:5062

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



RE: Showing selected in struts option tag

2004-03-02 Thread as as
Wendy,
 
Thanks for the prompt reply.Had a quick question.
where do we mention this method? in the form's action class?
updateAccounts();
 
Meanwhile I am running the new code so I will post my results shortly.
 
Thanks,
Samy
 
 

 

 


Wendy Smoak [EMAIL PROTECTED] wrote:
 From: as as [mailto:[EMAIL PROTECTED] 
   =employeeID/  

An example from my project that may get you started:

labelProperty=value/


You can drop the '-el' in the tags, there are no expressions in this one
anyway. The docs for and are here:
http://jakarta.apache.org/struts/userGuide/dev_html.html

Give it a try and post what you come up with!

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

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


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Should Action or ActionForm be accessing business delegates?

2004-03-02 Thread Barnett, Brian W.
The reading I've done suggested that one of the Action class's primary
responsibilities was to access the business layer. Then today I was looking
at the core j2ee patterns and it showed the View Helper accessing the
business layer. I associated (maybe mistakenly) the View Helper pattern with
the ActionForm and was then wondering if I should design our ActionForm's to
have direct access to the business layer.

 

Thoughts?

 

Thanks,

Brian Barnett



Re: Date attribute in ActionForm

2004-03-02 Thread Larry Meadors
Bean utils (what struts uses in this case) sucks when it comes to
parsing anything but Strings.

Generally what I do is make put String getter/setter methods on the
Form, then in those (or in the Action) use a SimpleDateFormat to parse
the string into a date. One other thing to note there is that the date
format MM/dd/yy will parse 1/1/04 as 01/01/2004, but 1/1/4 as
01/01/0004, so you need to handle that yourself.

Same trick with numeric classes.

Larry

 [EMAIL PROTECTED] 03/02/04 11:36 AM 
Hello,

I have and ActionForm with one element refering to a Date (from Util)
property and I get the following exception

java.lang.IllegalArgumentException: argument type mismatch


Is there a special treatment for these kind of attributes?

Thanks,

_
Vanessa Monteiro
Analista de Sistemas
Quality Software
3475-3000 r:5062

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



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



RE: Should Action or ActionForm be accessing business delegates?

2004-03-02 Thread Smith, Darrin
I'd say no.  Don't have the ActionForm (just a JavaBean with some validation
in it...maybe) access the business layer.

To me, the Action acts as the local Java class talked about in the Business
Delegate Pattern that creates and caches a Stateful Session Bean.  Use them
(the actions) or add a true form of the Business Delegate Pattern maybe.

Of course, this is just my opinion...don't recall reading that it should be
done this way for every case.



-Original Message-
From: Barnett, Brian W. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 1:01 PM
To: [EMAIL PROTECTED]
Subject: Should Action or ActionForm be accessing business delegates?


The reading I've done suggested that one of the Action class's primary
responsibilities was to access the business layer. Then today I was looking
at the core j2ee patterns and it showed the View Helper accessing the
business layer. I associated (maybe mistakenly) the View Helper pattern with
the ActionForm and was then wondering if I should design our ActionForm's to
have direct access to the business layer.

 

Thoughts?

 

Thanks,

Brian Barnett


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



How do I get a cookie under a different path within the same doma in with bean:cookie tag?

2004-03-02 Thread Lee, Yau-Pang
Is it possible to retrieve the cookie at:
www.abcd.com/cookie/path

from www.abcd.com/another/path

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



pure Struts implementation of form with an html:checkbox that enables/disables an html:text ?

2004-03-02 Thread Mike R. Phelan
Hi all,

Is there a better way to use a checkbox to dynamically disable/enable a text box, 
within a form?
I want the end user to be unable to fill out the text field until after she has 
checked the check box.
I would prefer not to use javascript. Is there a pure Struts way to do this?
My searches have come up with some vaguely related material, but nothing that provides 
a javascript-free solution.

the jsp:
...
body
script
function GrayOut(obj_checkbox)
{
  if(obj_checkbox.checked)
  {
obj_checkbox.form.boundIP.disabled = false;
  }
  else
  {
obj_checkbox.form.boundIP.disabled = true;
  }
}
/script

...
html:form action=/NewIPRecordSubmit focus=baseIP
...
IP Address
...
html:text property=baseIP styleClass=textbox style=size:114/
...
html:checkbox property=ipRangeEnabled value=no onclick=GrayOut(this)/
Upper Range html:text property=boundIP styleclass=textbox style=size:114 
disabled=true /
...
/html:form
/body

thanks,

Mike Phelan

ps - I got the javascript from this site:
http://www.faqts.com/knowledge_base/view.phtml/aid/13354/fid/310

 


RE: Semi-OT: Saving state when using EJB Session Beans and Struts

2004-03-02 Thread Smith, Darrin
Currently the design is to cache the instances of the Stateful Session
beans, and do that in the Actions themselves.  One SSB per Action. The
reason for the SSB is primarily for the transaction support (online
ordering) but also because addition EJB use will be needed in the future
anyway (interfacing with an existing system that will eventually use Message
Driven Beans to communicate...using simply JDBC to populate a posting
table now).

You are correct in that the web interface is for an existing application
(the one that will eventually talk through a message queue...but today only
works with posting tables...another reason why transaction support is a good
thing).

I guess it might make sense to keep the intermediate information (the lists
that can be ordered, the patients the items can be order for, etc.) in the
servlet's session as you say.  The SSB's though would still be used though
to get the intermediate data to be passed back and held in the servlet.  

Example...the user needs to get a list of patients that the order will be
applied to.  The RetrievePatientsAction gets invoked, and it in turn creates
a SSB (if one isn't already cached) to perform the actual business logic
needed to do this step. 

Using that data, a JSP is created and the user selects a patient, and then
requests a list of items applicable to that patient. Then the request to
retrieve that information is passed in and a similar process occurs to the
one above.

Finally, all of the information is available, and an order is place that
goes through a similar process.


This is a semi-contrived example of course but it is an example of what the
thinking is.



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 12:21 PM
To: Struts Users Mailing List
Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
Struts


It's difficult to know what scenario you are talking about here.

I assume you mean to cache the EJBs in the user's servlet session, so
you will have several remote EJBs in there depending on how many
different actions the user has accessed.

It sounds like you need to do this to allow transaction management
across a group of data operations?

I would not do it by caching the EJBs at all, or having stateful session
beans. I would keep my actionformbean in the user's servlet session
instead, accumulating the data over several http requests and then
marshall the whole collection of data across to the EJB session in one.

Struts is good at that. I expect you'd give yourself more headaches than
it's worth, trying to collect the user's session data in the EJB layer.

It sounds like you are writing a web interface for an already existing
client-server app.


On 03/02/2004 03:42 PM Smith, Darrin wrote:
 Thanks for the reply!
 
 That is kind of what is going on already.  The Action's act as the local
 Java class talked about in the Business Delegate Pattern that create and
 cache the Stateful Session Bean (a different one per Action).  They (the
 Actions) then use the Session Bean's business logic. This is done in a
 standard way though where each Session Bean will implement an interface
that
 is common to all of the other Session Beans in the application. This way
 each action simply calls a factory and based on the way the factory is
 called, a Stateful Session Bean for that type of action is returned, then
 cached in the Action.  All actions then can make the submit(...),
 inspect(...), etc. calls common to all types of Session Beans (but
performed
 differently by each one).
 
 The question is though, for these actions, shouldn't they keep session
state
 that will match the Stateful Session Beans?  Typically, I know you want
have
 your Model hold Session state while your client holds request state, but
in
 this case, where the Action needs to remember the cached Session Bean,
 doesn't it seem to make sense to mark the Action as session scope in the
 struts config file as well?
 
   
 
 -Original Message-
 From: Adam Hardy [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 01, 2004 5:35 PM
 To: Struts Users Mailing List
 Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
 Struts
 
 
 On 03/01/2004 05:47 PM Smith, Darrin wrote:
 
In short, the Actions will be calling various Stateful Session Beans to do
the actual work.  These are used for various reasons with the main one
 
 being
 
their built-in transaction support (online orders...need to be either
done...or not done). How should state be handled and at what level
(page...request...session...) in the upstream struts portion? 
 
 
 Hmmm. Thought someone more knowledgeable would answer this, and was 
 waiting with interest myself. Oh well. Without too much experience with 
 EJBs myself, I can say a couple of things: the gurus say 'use the 
 business delegate pattern with an EJB session facade'. Secondly, it 
 depends heavily on what your stateful session beans are holding as 
 state. Care to name 

RE: How do I get a cookie under a different path within the same domain with bean:cookie tag?

2004-03-02 Thread Dhaliwal, Pritpal (HQP)
Some cookie spec says:

The path attribute is used to specify the subset of URLs in a domain for
which the cookie is valid. If a cookie has already passed domain matching,
then the pathname component of the URL is compared with the path attribute,
and if there is a match, the cookie is considered valid and is sent along
with the URL request. The path /foo would match /foobar and
/foo/bar.html. The path / is the most general path. 
If the path is not specified, it as assumed to be the same path as the
document being described by the header which contains the cookie.

So, YES it is possible. Just set the cookies for the domain  www.abcd.com
and to path /, and you should be able to get cookies from every page under
www.abcd.com, You can actually make it more general by specifying the domain
abcd.com, and now www2.abcd.com can access the cookies too. 

BTW, the spec I read was :
http://wp.netscape.com/newsref/std/cookie_spec.html , it might be old but it
made sense..

HTH,
Pritpal Dhaliwal

-Original Message-
From: Lee, Yau-Pang [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 11:18 AM
To: 'Struts Users Mailing List'
Subject: How do I get a cookie under a different path within the same domain
with bean:cookie tag?


Is it possible to retrieve the cookie at: www.abcd.com/cookie/path

from www.abcd.com/another/path

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



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



RE: How do I get a cookie under a different path within the same domain with bean:cookie tag?

2004-03-02 Thread Lee, Yau-Pang
Thks for the reply.  However the problem is I have no control in setting the
cookie.

It's set to www.abcd.com/cookie/path  and I can't change that to just /

So, from my path www.abcd.com/another/path, I guess I can't read that
cookie.

-Original Message-
From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 3:00 PM
To: 'Struts Users Mailing List'
Subject: RE: How do I get a cookie under a different path within the
same domain with bean:cookie tag?


Some cookie spec says:

The path attribute is used to specify the subset of URLs in a domain for
which the cookie is valid. If a cookie has already passed domain matching,
then the pathname component of the URL is compared with the path attribute,
and if there is a match, the cookie is considered valid and is sent along
with the URL request. The path /foo would match /foobar and
/foo/bar.html. The path / is the most general path. 
If the path is not specified, it as assumed to be the same path as the
document being described by the header which contains the cookie.

So, YES it is possible. Just set the cookies for the domain  www.abcd.com
and to path /, and you should be able to get cookies from every page under
www.abcd.com, You can actually make it more general by specifying the domain
abcd.com, and now www2.abcd.com can access the cookies too. 

BTW, the spec I read was :
http://wp.netscape.com/newsref/std/cookie_spec.html , it might be old but it
made sense..

HTH,
Pritpal Dhaliwal

-Original Message-
From: Lee, Yau-Pang [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 11:18 AM
To: 'Struts Users Mailing List'
Subject: How do I get a cookie under a different path within the same domain
with bean:cookie tag?


Is it possible to retrieve the cookie at: www.abcd.com/cookie/path

from www.abcd.com/another/path

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



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

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



RE: Showing selected in struts option tag

2004-03-02 Thread Wendy Smoak
 From: as as [mailto:[EMAIL PROTECTED] 
 Thanks for the prompt reply.Had a quick question.
 where do we mention this method? in the form's action class?
 updateAccounts();

It's in the 'onchange' attribute of html:select.  The docs are here:
http://jakarta.apache.org/struts/userGuide/struts-html.html#select

Specifically:
onchange - JavaScript event handler executed when this element loses
input focus and its value has changed. [RT Expr]

So 'updateAccounts()' is a JavaScript method [or function??] in my page.
You can probably take that part out. :)

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

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



RE: Showing selected in struts option tag

2004-03-02 Thread as as
Wendy,
 
Sounds good.
So updateAccounts() is in the jsp..I have similar functionality to update the backend 
struts classes on changing the value in this drop downm, especially wondering how to 
tie in struts with javascript becuase i want to do something like the following in my 
javascript function:


SCRIPT LANGUAGE=JavaScript

function onChange(){

//call another struts class - window.location.href=booksDsiplay.do or something like 
that

}
/script
can we invoke struts mapings and navigation from javascript.
also i got following error using htmlOptions, though I have the getter for the BEAN 
property supervisor.wondering why. Thanks in advance.
javax.servlet.jsp.JspException: No getter method for property supervisors of bean 
org.apache.struts.taglib.html.BEAN
 

Wendy Smoak [EMAIL PROTECTED] wrote:
 From: as as [mailto:[EMAIL PROTECTED] 
 Thanks for the prompt reply.Had a quick question.
 where do we mention this method? in the form's action class?
 updateAccounts();

It's in the 'onchange' attribute of . The docs are here:
http://jakarta.apache.org/struts/userGuide/struts-html.html#select

Specifically:
onchange - JavaScript event handler executed when this element loses
input focus and its value has changed. [RT Expr]

So 'updateAccounts()' is a JavaScript method [or function??] in my page.
You can probably take that part out. :)

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

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


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

RE: Showing selected in struts option tag

2004-03-02 Thread Wendy Smoak
 From: as as [mailto:[EMAIL PROTECTED] 
 can we invoke struts mapings and navigation from javascript.

Sure.  The Struts tags have attributes for all the JavaScript handlers--
onclick, onblur, etc.  Just keep it clear in your mind that in the
simplest case, Struts code executes on the server, then HTML is
delivered to the client, at which point the JavaScript runs.  So you
can't call a method in your Action class directly from JavaScript*,
instead you'd have to cause another request to the server, usually by
submitting the form.

[*Actually I think something like this _is_ possible, but not with the
basic JavaScript knowledge I have!  Anyone care to toss out some search
terms?  How to replace a section of HTML on the page by making a request
behind the scenes without actually submitting the form?]  

 also i got following error using htmlOptions, though I have 
 the getter for the BEAN property supervisor.wondering why. 
 Thanks in advance.
 javax.servlet.jsp.JspException: No getter method for property 
 supervisors of bean org.apache.struts.taglib.html.BEAN

You will need to study the documentation for the html:options tag.  It
has many attributes, and they do different things when used in various
combinations.  

For a start, post the section of JSP that's supposed to render this
select tag, and tell us about 'supervisors'.  Is it in the ActionForm?
What type of Collection is it?

What's happening is that Struts is calling the getSupervisors() method
on some bean, and it's not the one that has that method.  How you fix
that depends on where 'supervisors' lives.

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

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



OT - java.sun.com is not accecsible

2004-03-02 Thread Ramachandiran, Karuna
Hello guys-,
Does anybody noticed and know why java.sun.com is not
accessible today?


Thanks

Karuna

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



RE: OT - java.sun.com is not accecsible

2004-03-02 Thread Barnett, Brian W.
I can access it.

-Original Message-
From: Ramachandiran, Karuna [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 2:03 PM
To: Struts Users Mailing List
Subject: OT - java.sun.com is not accecsible

Hello guys-,
Does anybody noticed and know why java.sun.com is not
accessible today?


Thanks

Karuna

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

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



RE: OT - java.sun.com is not accecsible

2004-03-02 Thread Ramachandiran, Karuna
Ummm... I can access all sites other than the java.sun.com don't know
why?

-Original Message-
From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 4:02 PM
To: 'Struts Users Mailing List'
Subject: RE: OT - java.sun.com is not accecsible


I can access it.

-Original Message-
From: Ramachandiran, Karuna [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 2:03 PM
To: Struts Users Mailing List
Subject: OT - java.sun.com is not accecsible

Hello guys-,
Does anybody noticed and know why java.sun.com is not
accessible today?


Thanks

Karuna

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

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


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



RE: OT - java.sun.com is not accecsible

2004-03-02 Thread Wendy Smoak
Karuna wrote:
 Does anybody noticed and know why java.sun.com is not
 accessible today?

http://java.sun.com works fine for me, however you might want to try
http://192.18.97.175.

Someone posted to cljp that the server changed IP addresses and the DNS
change hasn't propagated all the way through yet.

I was able to get 1.5.0 Beta 1 from there with no problems.

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

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



Re: Date attribute in ActionForm

2004-03-02 Thread Mark Lowe
Its also usually the case with dates that downs make less work for the 
user. This along with beanutils conversions hassles mean s its usually 
easier to have a day, month , year properties of type String or Integer 
which then you use to create a Date or Calendar object before passing 
up to your model or even have gets and sets in you model that do the 
conversion.

On 2 Mar 2004, at 20:03, Larry Meadors wrote:

Bean utils (what struts uses in this case) sucks when it comes to
parsing anything but Strings.
Generally what I do is make put String getter/setter methods on the
Form, then in those (or in the Action) use a SimpleDateFormat to parse
the string into a date. One other thing to note there is that the date
format MM/dd/yy will parse 1/1/04 as 01/01/2004, but 1/1/4 as
01/01/0004, so you need to handle that yourself.
Same trick with numeric classes.

Larry

[EMAIL PROTECTED] 03/02/04 11:36 AM 
Hello,

I have and ActionForm with one element refering to a Date (from Util)
property and I get the following exception
java.lang.IllegalArgumentException: argument type mismatch

Is there a special treatment for these kind of attributes?

Thanks,

_
Vanessa Monteiro
Analista de Sistemas
Quality Software
3475-3000 r:5062
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


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


Re: Tiles problem

2004-03-02 Thread Mark Lowe
put name=foo value=${bar} type=string/definition/page /

On 2 Mar 2004, at 22:15, Anderson, James H [IT] wrote:

There's something I'm not understanding :-( I've got the following 
tiles definitions.

definition name=.mainLayout 
path=/tiles/layouts/mainLayout1.jsp
  put name=header  value=/tiles/header.jsp/
  put name=footer  value=/tiles/footer.jsp/
  put name=content value=${content}/ variable for 
substitution
/definition

definition name=.portfolioLayout 
path=/tiles/layouts/portfolioLayout.jsp
  put name =marketdata value=.marketdata/
  put name =userinput  value=.userinput/
  put name =dataview   value=/tiles/dataview.jsp/
/definition

definition name=.marketdata 
path=/tiles/layouts/marketdataLayout.jsp
  put name =quotes  value=/tiles/quotes.jsp/
  put name =smithbarneyresearch value=/tiles/research.jsp/
  put name =marketwatch value=/tiles/marketwatch.jsp/
/definition

definition name=.userinput 
path=/tiles/layouts/userinputLayout.jsp
  put name =accountview   value=/tiles/accountview.jsp/
  put name =app-specific  value=${app-specific}/		 
variable for substitution
/definition

and I want to create a new tile, substituting values for both variable:

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp/
/definition
But this doesn't work! The content variable is replaced as expected, 
but the app-specific variable
is ignored and doesn't show up at all. It looks like the only tile for 
which variable substitution
is supported is the one that's specified in the extends 
attribute--not in any nested tile. Surely
there must be a way to get around this...

jim

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


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


RE: Tiles problem

2004-03-02 Thread Anderson, James H [IT]
Maybe I didn't follow you, but I changed 

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp/
/definition

to

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp type=page/
/definition

and it didn't make any difference. What am I missing?

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 4:40 PM
To: Struts Users Mailing List
Subject: Re: Tiles problem


put name=foo value=${bar} type=string/definition/page /

On 2 Mar 2004, at 22:15, Anderson, James H [IT] wrote:

 There's something I'm not understanding :-( I've got the following 
 tiles definitions.

 definition name=.mainLayout 
 path=/tiles/layouts/mainLayout1.jsp
   put name=header  value=/tiles/header.jsp/
   put name=footer  value=/tiles/footer.jsp/
   put name=content value=${content}/
 variable for 
 substitution
 /definition

 definition name=.portfolioLayout 
 path=/tiles/layouts/portfolioLayout.jsp
   put name =marketdata value=.marketdata/
   put name =userinput  value=.userinput/
   put name =dataview   value=/tiles/dataview.jsp/
 /definition

 definition name=.marketdata 
 path=/tiles/layouts/marketdataLayout.jsp
   put name =quotes  value=/tiles/quotes.jsp/
   put name =smithbarneyresearch value=/tiles/research.jsp/
   put name =marketwatch value=/tiles/marketwatch.jsp/
 /definition

 definition name=.userinput 
 path=/tiles/layouts/userinputLayout.jsp
   put name =accountview   value=/tiles/accountview.jsp/
   put name =app-specific  value=${app-specific}/ 
 variable for substitution
 /definition

 and I want to create a new tile, substituting values for both variable:

 definition name=.activity.detail extends=.mainLayout
   put name=content  value=.portfolioLayout/
   put name=app-specific value=/tiles/activityinfo.jsp/
 /definition

 But this doesn't work! The content variable is replaced as expected, 
 but the app-specific variable
 is ignored and doesn't show up at all. It looks like the only tile for 
 which variable substitution
 is supported is the one that's specified in the extends 
 attribute--not in any nested tile. Surely
 there must be a way to get around this...

 jim

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



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


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



Re: OT - java.sun.com is not accecsible

2004-03-02 Thread Adam Hardy
On 03/02/2004 10:08 PM Wendy Smoak wrote:
Karuna wrote:

Does anybody noticed and know why java.sun.com is not
accessible today?


http://java.sun.com works fine for me, however you might want to try
http://192.18.97.175.
Someone posted to cljp that the server changed IP addresses and the DNS
change hasn't propagated all the way through yet.
I was able to get 1.5.0 Beta 1 from there with no problems.

read that they've just released the jdk 1.5 preview and the traffic is 
slowing everything down.

Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


BODY onLoad Workaround

2004-03-02 Thread Alan Weissman
Hey everyone -

 

So I have a Struts/Tiles page that I need to have a
Javascript function called on when the page loads.  Normally this is of
course accomplished with the BODY onLoad event however this event isn't
fired when my page loads and from doing extensive Googling I've found
that this has something to do with the nature of Struts/Tiles pages
(though I'm not sure what).  What is the best workaround for this?

 

Thanks so much,

Alan



Re: Tiles problem

2004-03-02 Thread Mark Lowe
all the puts should be have

type=string
type=definition
type=page
depending on what it is.

For example if .portfolioLayout is a definition

put name=content   value=.portfolioLayout type=definition /

if its a layout then it should be in the definition tag as the 
content of the path attribute. The naming convention for layouts 
usually refers to those files that are layouts not definitions as such.

definition name=main.base path=/layouts/mainLayout.jsp
...
I've used some of your names but i doubt they are that relevent to you.

definition name=activity.detail extends=main.base
put name=title value=Mellow World!!! type=string /
put name=content value=portfolio.default type=definition /
put name=app-specific value=/tiles/activityInfo.jsp type=page /
/definition
When did all this .somename business start then, i've seen this else 
where. Looks  like dirty php to me :o)

On 2 Mar 2004, at 22:49, Anderson, James H [IT] wrote:

Maybe I didn't follow you, but I changed

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp/
/definition
to

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp 
type=page/
/definition

and it didn't make any difference. What am I missing?

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 4:40 PM
To: Struts Users Mailing List
Subject: Re: Tiles problem
put name=foo value=${bar} type=string/definition/page /

On 2 Mar 2004, at 22:15, Anderson, James H [IT] wrote:

There's something I'm not understanding :-( I've got the following
tiles definitions.
definition name=.mainLayout
path=/tiles/layouts/mainLayout1.jsp
  put name=header  value=/tiles/header.jsp/
  put name=footer  value=/tiles/footer.jsp/
  put name=content value=${content}/
 variable for
substitution
/definition
definition name=.portfolioLayout
path=/tiles/layouts/portfolioLayout.jsp
  put name =marketdata value=.marketdata/
  put name =userinput  value=.userinput/
  put name =dataview   value=/tiles/dataview.jsp/
/definition
definition name=.marketdata
path=/tiles/layouts/marketdataLayout.jsp
  put name =quotes  value=/tiles/quotes.jsp/
  put name =smithbarneyresearch value=/tiles/research.jsp/
  put name =marketwatch 
value=/tiles/marketwatch.jsp/
/definition

definition name=.userinput
path=/tiles/layouts/userinputLayout.jsp
  put name =accountview   value=/tiles/accountview.jsp/
  put name =app-specific  value=${app-specific}/
variable for substitution
/definition
and I want to create a new tile, substituting values for both 
variable:

definition name=.activity.detail extends=.mainLayout
  put name=content  value=.portfolioLayout/
  put name=app-specific value=/tiles/activityinfo.jsp/
/definition
But this doesn't work! The content variable is replaced as expected,
but the app-specific variable
is ignored and doesn't show up at all. It looks like the only tile for
which variable substitution
is supported is the one that's specified in the extends
attribute--not in any nested tile. Surely
there must be a way to get around this...
jim

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


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


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


html:link problem

2004-03-02 Thread mucus snot
Hi list,

Just wondering if anyone has any bright ideas. Things that you can do 
easily with an a ... tag, are not (easily) acheivable with a html:link. 
For instance in the following code:

nested:iterate id=title name=%= Constants.TITLES_COLLECTION % 
scope=request indexId=counter
html:link page=/findtitles.do 
onmouseover=MM_swapImage('details%= counter %,...)...
/nested:iterate

counter will not resolve, although it will if the tag is an ordinary anchor.

Does anyone know a way around this? I have been resorting to using ordinary 
a... tags but have just realised that there is no session control if 
cookies are disabled. I have to use html:link...

thanks, al 

Multiple Forms

2004-03-02 Thread Daniel Czaban
I am working on a web project in which there is a need to submit two
forms from a same html file. 

Does anybody have such experience as submitting two forms separately?

Thanks!



Re: BODY onLoad Workaround

2004-03-02 Thread Mark Lowe
Iframe would be one possible hack. Have the page that loads run a 
javascript function that drills back up to your page.

or an onload on an image, or simply execute the function in the page.

lastly have something like this in your layout

tile:get name=javascriptHack scope=page /

script language=javascript type=text/javascript
!--
function myfuction() {
c:out value=${javascriptHack} /;
}
//--
/script
body onload=myfuction()
Stick your method as a put in that tile and have it empty for those 
page where not required.

put name=javascriptHack value=alert('my javascript hack') 
type=string /

the rest of the time

put name=javascriptHack value= type=string /

So the function always runs just usually contains nothing.

On 2 Mar 2004, at 23:14, Alan Weissman wrote:

Hey everyone -



So I have a Struts/Tiles page that I need to have a
Javascript function called on when the page loads.  Normally this is of
course accomplished with the BODY onLoad event however this event isn't
fired when my page loads and from doing extensive Googling I've found
that this has something to do with the nature of Struts/Tiles pages
(though I'm not sure what).  What is the best workaround for this?


Thanks so much,

Alan



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


Re: Semi-OT: Saving state when using EJB Session Beans and Struts

2004-03-02 Thread Adam Hardy
OK, go for it then. I think the only thing to be really concerned about 
is memory availability. If you're storing stuff in the user's session 
and maintaining SSBs, memory usage might build up quickly.

Plus, depending on how critical your application is, you might have to 
worry about failure wiping out your SSBs before they're done. If you had 
stateless SBs, it wouldn't be a problem with fail-over support and a web 
farm :)

On 03/02/2004 08:58 PM Smith, Darrin wrote:
Currently the design is to cache the instances of the Stateful Session
beans, and do that in the Actions themselves.  One SSB per Action. The
reason for the SSB is primarily for the transaction support (online
ordering) but also because addition EJB use will be needed in the future
anyway (interfacing with an existing system that will eventually use Message
Driven Beans to communicate...using simply JDBC to populate a posting
table now).
You are correct in that the web interface is for an existing application
(the one that will eventually talk through a message queue...but today only
works with posting tables...another reason why transaction support is a good
thing).
I guess it might make sense to keep the intermediate information (the lists
that can be ordered, the patients the items can be order for, etc.) in the
servlet's session as you say.  The SSB's though would still be used though
to get the intermediate data to be passed back and held in the servlet.  

Example...the user needs to get a list of patients that the order will be
applied to.  The RetrievePatientsAction gets invoked, and it in turn creates
a SSB (if one isn't already cached) to perform the actual business logic
needed to do this step. 

Using that data, a JSP is created and the user selects a patient, and then
requests a list of items applicable to that patient. Then the request to
retrieve that information is passed in and a similar process occurs to the
one above.
Finally, all of the information is available, and an order is place that
goes through a similar process.
This is a semi-contrived example of course but it is an example of what the
thinking is.


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 12:21 PM
To: Struts Users Mailing List
Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
Struts
It's difficult to know what scenario you are talking about here.

I assume you mean to cache the EJBs in the user's servlet session, so
you will have several remote EJBs in there depending on how many
different actions the user has accessed.
It sounds like you need to do this to allow transaction management
across a group of data operations?
I would not do it by caching the EJBs at all, or having stateful session
beans. I would keep my actionformbean in the user's servlet session
instead, accumulating the data over several http requests and then
marshall the whole collection of data across to the EJB session in one.
Struts is good at that. I expect you'd give yourself more headaches than
it's worth, trying to collect the user's session data in the EJB layer.
It sounds like you are writing a web interface for an already existing
client-server app.
On 03/02/2004 03:42 PM Smith, Darrin wrote:

Thanks for the reply!

That is kind of what is going on already.  The Action's act as the local
Java class talked about in the Business Delegate Pattern that create and
cache the Stateful Session Bean (a different one per Action).  They (the
Actions) then use the Session Bean's business logic. This is done in a
standard way though where each Session Bean will implement an interface
that

is common to all of the other Session Beans in the application. This way
each action simply calls a factory and based on the way the factory is
called, a Stateful Session Bean for that type of action is returned, then
cached in the Action.  All actions then can make the submit(...),
inspect(...), etc. calls common to all types of Session Beans (but
performed

differently by each one).

The question is though, for these actions, shouldn't they keep session
state

that will match the Stateful Session Beans?  Typically, I know you want
have

your Model hold Session state while your client holds request state, but
in

this case, where the Action needs to remember the cached Session Bean,
doesn't it seem to make sense to mark the Action as session scope in the
struts config file as well?
 

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Monday, March 01, 2004 5:35 PM
To: Struts Users Mailing List
Subject: Re: Semi-OT: Saving state when using EJB Session Beans and
Struts
On 03/01/2004 05:47 PM Smith, Darrin wrote:


In short, the Actions will be calling various Stateful Session Beans to do
the actual work.  These are used for various reasons with the main one
being


their built-in transaction support (online orders...need to be either
done...or not done). How should state be handled and at what level

Re: html:link problem

2004-03-02 Thread Mark Lowe
When i have the misfortune of porting the mother of all abominations 
known as dreamweaver generated code I tend to use c:url instead

a href=c:url value=/findtitle.do /

this will do what i think you want.

On 2 Mar 2004, at 23:19, mucus snot wrote:

Hi list,

Just wondering if anyone has any bright ideas. Things that you can do 
easily with an a ... tag, are not (easily) acheivable with a 
html:link. For instance in the following code:

nested:iterate id=title name=%= Constants.TITLES_COLLECTION % 
scope=request indexId=counter
html:link page=/findtitles.do 
onmouseover=MM_swapImage('details%= counter %,...)...
/nested:iterate

counter will not resolve, although it will if the tag is an ordinary 
anchor.

Does anyone know a way around this? I have been resorting to using 
ordinary a... tags but have just realised that there is no session 
control if cookies are disabled. I have to use html:link...

thanks, al 


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


RE: BODY onLoad Workaround

2004-03-02 Thread Alan Weissman
Thanks Mark for your response.

The issue is that even without my layout, which contains the body tag,
if I add an onLoad event it is not fired.  

I have already tried calling the javascript function from somewhere in
the page however it is always called before the entire page is actually
rendered, which means that certain items on the page that the function
operates on do not have all of their properties.

Is there no way to mimic a body onLoad completely?

Thanks,
Alan


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 02, 2004 5:34 PM
To: Struts Users Mailing List
Subject: Re: BODY onLoad Workaround

Iframe would be one possible hack. Have the page that loads run a 
javascript function that drills back up to your page.

or an onload on an image, or simply execute the function in the page.

lastly have something like this in your layout

tile:get name=javascriptHack scope=page /

script language=javascript type=text/javascript
!--
function myfuction() {
c:out value=${javascriptHack} /;
}
//--
/script
body onload=myfuction()

Stick your method as a put in that tile and have it empty for those 
page where not required.

put name=javascriptHack value=alert('my javascript hack') 
type=string /

the rest of the time

put name=javascriptHack value= type=string /

So the function always runs just usually contains nothing.


On 2 Mar 2004, at 23:14, Alan Weissman wrote:

 Hey everyone -



 So I have a Struts/Tiles page that I need to have a
 Javascript function called on when the page loads.  Normally this is
of
 course accomplished with the BODY onLoad event however this event
isn't
 fired when my page loads and from doing extensive Googling I've found
 that this has something to do with the nature of Struts/Tiles pages
 (though I'm not sure what).  What is the best workaround for this?



 Thanks so much,

 Alan



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



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



  1   2   >