Re: Pass parameter to javascript function

2005-06-13 Thread amitava . basak

Avjit its not working!

Amitava Basak
ASE
Tata Consultancy Services Limited
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Notice: The information contained in this e-mail message and/or attachments to 
it may contain confidential or privileged information.   If you are not the 
intended recipient, any dissemination, use, review, distribution, printing or 
copying of the information contained in this e-mail message and/or attachments 
to it are strictly prohibited.   If you have received this communication in 
error, please notify us by reply e-mail or telephone and immediately and 
permanently delete the message and any attachments.  Thank you

Re: Pass parameter to javascript function

2005-06-13 Thread amitava . basak

Thanks martin, its so simpledidn't click in my mind.

Amitava Basak
ASE
Tata Consultancy Services Limited
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com

Notice: The information contained in this e-mail message and/or attachments to 
it may contain confidential or privileged information.   If you are not the 
intended recipient, any dissemination, use, review, distribution, printing or 
copying of the information contained in this e-mail message and/or attachments 
to it are strictly prohibited.   If you have received this communication in 
error, please notify us by reply e-mail or telephone and immediately and 
permanently delete the message and any attachments.  Thank you

Re: Pass parameter to javascript function

2005-06-13 Thread Van
On 6/12/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 Avjit its not working!

As someone else already pointed out on this thread, you can only use
the Java expression syntax for an *entire* attribute. You can't use it
the way it was shown in Avjit's suggested example for you. It has to
be:

tag attrName=%=someExpression%/

You can either use scriptlet logic before the tag to build up more
complex expressions and assign the final thing into a single variable
or do string concatenation inside the %= %. There is also the issue
of quoting when you want some string literal to be part of the
contatenation inside the expression. In those cases, I typically use a
single quote for the outermost delimiters and double quotes for any
inner string literals like so:

tag attrName='%= var1 + some string literal + var2 %' /

I believe it will work either way though. You could also use double
quotes for the outermost delimiters and single quotes for any inner
string literals. You just can't use the same type of quote character
for both inner and outer delimiters.

Hope this helps, Van

-- 
- Mike Van Riper
  [EMAIL PROTECTED]

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



Sending value from popup to parent window

2005-06-13 Thread faisal.shoukat
Hi,
 
I am a bit stuck on implementing the following so all help is
appreciated.
 
I open up a search page as a pop up window. The user implements the
search options and is returned a number of rows. The user then selects
one of these rows using a check box which I have defined as a multibox
in my jsp.

The problem I have is populating the field on the parent window with the
value of the multibox? 

In the JSP i define my multibox as such 

html:multibox name=actionClientForm property=resourceIds
bean:write name=client property=resourceId/
/html:multibox

The link to close this page and send the value is as follows:

td align=right
html:link href=javascript:sendValue();Add Client/html:link
/td

The javascript function:

script language=JavaScript
function sendValue(s)
{

var selvalue = s
out.println(variable =  + selvalue);
window.opener.document.createClnForm.clientId.value = selvalue;
window.close();
}
/script

If I put a value of 1 in the link where i call the javascript it works
fine and puts 1 into the correct field on the parent window.
td align=right
html:link href=javascript:sendValue(1);Add Client/html:link
/td

However what i want to send back is the 
bean:write name=client property=resourceId/ of the selected
multibox.

i tried using bean define but that did not seem to work.

The property resourceIds of the actionClientForm is a collection.

Anyone know how to do this?

thanks
fez
 


Possible Bug in Struts Workflow Extension?

2005-06-13 Thread Stefan Langer
Hi!

I'am a newbie in STRUTS WORKFLOW EXTENSION. I installed the Demo
Application and everything works fine. But the following situation seems
to lead to a bug in the workflow extension:

a) Start the wizard and insert the first operand
b) Click the next-button and go to the second page
c) Now press the back-button of your browser - a Workflow-Violation
occurs and you stay on page 2.
d) Click the back-button of the wizard (not of the browser) and go back
to the first page
e) Submit page 1 with the next-Button and go to page 2
f) Finally: Hit the back-button of the browser and: You are on page 1
and no workflow-violation occurs. Why? Any ideas?

Thx for your help!

Kind regards
Stefan Langer

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



[fully-OT] File replication between webapps

2005-06-13 Thread Nicolas De Loof


Hi all,

this mail is totaly of topic, so sory sory sory...
... but there is so much java masters on this list !

I have to replicate some datas between two servers running my app (with 
a load balancer, but not using a cluster mode). We are going to build a 
home-made solution, and I wonder if any open-source tool could help me 
on this.
I'm looking for something like a 2 phase commit or rsync Java lib, 
that could be used to assert an update on one server will be 
automagically replicated on the other one.


Thanks.

Nico.

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: [fully-OT] File replication between webapps

2005-06-13 Thread delbd
Just my two cents

I'll suggest storing the datas on a central database (which could be clustered 
amongst your servers)


Le Lundi 13 Juin 2005 14:06, Nicolas De Loof a écrit :
 Hi all,

 this mail is totaly of topic, so sory sory sory...
 ... but there is so much java masters on this list !

 I have to replicate some datas between two servers running my app (with
 a load balancer, but not using a cluster mode). We are going to build a
 home-made solution, and I wonder if any open-source tool could help me
 on this.
 I'm looking for something like a 2 phase commit or rsync Java lib,
 that could be used to assert an update on one server will be
 automagically replicated on the other one.

 Thanks.

 Nico.

 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is intended only for the
 person to whom it is addressed. If you are not the intended recipient,  you
 are not authorized to read, print, retain, copy, disseminate,  distribute,
 or use this message or any part thereof. If you receive this  message in
 error, please notify the sender immediately and delete all  copies of this
 message.


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

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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



Re: Confused

2005-06-13 Thread glenn . deschenes
Pierre,

Struts is no longer a sub-project of Jakarta but is now on its own.
Struts is alive and kicking: http://struts.apache.org/

You can look at section 6 [this might help]: 
http://struts.apache.org/userGuide/index.html

As for JBoss... the last time I used it (can't exactly remember when)... 
JBoss has a version that is already bundled with Tomcat.

As for the Mac, I cannot really help.

HTH,
Glenn





Pierre Thibault [EMAIL PROTECTED] 
13/06/2005 12:01 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Confused






Hello,

I am new to Struts and I am a bit confused. I would like some light.

I have just installed Tomcat 5 for Java WSDP. Do I need this version 
to make Struts development or can I use the regular 5.5 version too? 
I have installed both.

I also saw that Struts is listed in the Ex-Jakarta section of the 
Jakarta web site. Is this mean that Struts is now replaced by Tapestry?

Also, I would like to know how can I have access to J2EE? I am on Mac 
OS 10.4 and as I know I need JBoss to have access to J2EE. I have 
installed JBoss on my machine too. But I don't understand how can I 
use Tomcat, JBoss and Struts altogether. Can you help me?

Regards.

-
Pierre


Re: [fully-OT] File replication between webapps

2005-06-13 Thread delbd
Le Lundi 13 Juin 2005 14:27, Nicolas De Loof a écrit :
 Our customer defines architecture restriction for it's applications. One
 of them is that the (only) usable database is Oracle. As we don't use a
 database for the app, adding orcale only to get DB replication may be
 difficult to explain (and will add a significant cost)

Sure it does :)
If oracle is only 'clustered' database possible but other non lcustered ones 
are available, maybe C-JDBC could help you (it provide RAID like ontop of any 
database).

If not, maybe the transactional Collections in 
http://jakarta.apache.org/commons/transaction/ may be of interrest (they 
supports 2 phases commits using XAressources if am not wrong)


 delbd a écrit :
 Just my two cents
 
 I'll suggest storing the datas on a central database (which could be
  clustered amongst your servers)
 
 Le Lundi 13 Juin 2005 14:06, Nicolas De Loof a écrit :
 Hi all,
 
 this mail is totaly of topic, so sory sory sory...
 ... but there is so much java masters on this list !
 
 I have to replicate some datas between two servers running my app (with
 a load balancer, but not using a cluster mode). We are going to build a
 home-made solution, and I wonder if any open-source tool could help me
 on this.
 I'm looking for something like a 2 phase commit or rsync Java lib,
 that could be used to assert an update on one server will be
 automagically replicated on the other one.
 
 Thanks.
 
 Nico.
 
 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is intended only for the
 person to whom it is addressed. If you are not the intended recipient, 
  you are not authorized to read, print, retain, copy, disseminate, 
  distribute, or use this message or any part thereof. If you receive this
   message in error, please notify the sender immediately and delete all 
  copies of this message.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is intended only for the
 person to whom it is addressed. If you are not the intended recipient,  you
 are not authorized to read, print, retain, copy, disseminate,  distribute,
 or use this message or any part thereof. If you receive this  message in
 error, please notify the sender immediately and delete all  copies of this
 message.


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

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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



Re: [fully-OT] File replication between webapps

2005-06-13 Thread Nicolas De Loof


Oracle is the only aproved database (clusterable or not). This is the 
reason I was looking for a rsync-linke solution.


Nico.


delbd a écrit :


Le Lundi 13 Juin 2005 14:27, Nicolas De Loof a écrit :
 


Our customer defines architecture restriction for it's applications. One
of them is that the (only) usable database is Oracle. As we don't use a
database for the app, adding orcale only to get DB replication may be
difficult to explain (and will add a significant cost)
   



Sure it does :)
If oracle is only 'clustered' database possible but other non lcustered ones 
are available, maybe C-JDBC could help you (it provide RAID like ontop of any 
database).


If not, maybe the transactional Collections in 
http://jakarta.apache.org/commons/transaction/ may be of interrest (they 
supports 2 phases commits using XAressources if am not wrong)


 


delbd a écrit :
   


Just my two cents

I'll suggest storing the datas on a central database (which could be
clustered amongst your servers)

Le Lundi 13 Juin 2005 14:06, Nicolas De Loof a écrit :
 


Hi all,

this mail is totaly of topic, so sory sory sory...
... but there is so much java masters on this list !

I have to replicate some datas between two servers running my app (with
a load balancer, but not using a cluster mode). We are going to build a
home-made solution, and I wonder if any open-source tool could help me
on this.
I'm looking for something like a 2 phase commit or rsync Java lib,
that could be used to assert an update on one server will be
automagically replicated on the other one.

Thanks.

Nico.

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient, 
you are not authorized to read, print, retain, copy, disseminate, 
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all 
copies of this message.



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


This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,  you
are not authorized to read, print, retain, copy, disseminate,  distribute,
or use this message or any part thereof. If you receive this  message in
error, please notify the sender immediately and delete all  copies of this
message.


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



 



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: [fully-OT] File replication between webapps

2005-06-13 Thread Leon Rosenberg
Do you hold the data inmemory or in a file system? 

In later case you'll be just fine with mounting a common share, like NFS
or SMB.
In first case you'd need a software synchronization inbetween, which is
typically solved by a publisher/subscriber pattern. You can use MDB
(message-driven beans, there are enough (open source) solutions
available without an obligatory application server.
Personally I'd prefer an ORB with an EventService like JacORB -
www.jacorb.org.

regards
Leon

P.S. Still you have to build the
say-the-other-one-that-the-data-has-been-updated logic by yourself. But
this is about 5 lines of code, so i don't think you should search for a
tool herefore.



On Mon, 2005-06-13 at 14:06 +0200, Nicolas De Loof wrote:
 Hi all,
 
 this mail is totaly of topic, so sory sory sory...
 ... but there is so much java masters on this list !
 
 I have to replicate some datas between two servers running my app (with 
 a load balancer, but not using a cluster mode). We are going to build a 
 home-made solution, and I wonder if any open-source tool could help me 
 on this.
 I'm looking for something like a 2 phase commit or rsync Java lib, 
 that could be used to assert an update on one server will be 
 automagically replicated on the other one.
 
 Thanks.
 
 Nico.
 
 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is intended only for the person to 
 whom it is addressed. If you are not the intended recipient,  you are not 
 authorized to read, print, retain, copy, disseminate,  distribute, or use 
 this message or any part thereof. If you receive this  message in error, 
 please notify the sender immediately and delete all  copies of this message.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



Can struts-1.1 support multiple configurations and multiple resources

2005-06-13 Thread Venkat Reddy Valluri
Hi

   Can struts-1.1 support multiple configurations and multiple resources. Can 
some body please throw some light on this. I need it very urgent

Thanks in advance

--Venkat

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

Re: Can struts-1.1 support multiple configurations and multiple resources

2005-06-13 Thread Manfred Wolff


Yes it can with multiple module support.

http://struts.apache.org/userGuide/configuration.html#dd_config_modules

Manfred

Venkat Reddy Valluri wrote:


Hi

  Can struts-1.1 support multiple configurations and multiple resources. Can 
some body please throw some light on this. I need it very urgent

Thanks in advance

--Venkat

 




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




--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-0
fax neusta: +49 421 20696-99
phone private : +49 421 534522
eFax  : +49 1212 6 62663 96533
---

Diese E-Mail enthlt mglicherweise vertrauliche und/oder rechtlich geschtzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtmlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte 
Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

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


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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Frank W. Zammetti
On Mon, June 13, 2005 12:54 am, Paul Goepfert said:
 Well I just created a test jsp file to see if I got to the page.  I
 didn't.  I just want to  be sure about one thing.  I am soppose to have
 multiple actions in my struts config? One for each  page? Right?

How your app is configured is completely up to you... there are no rules
per se (there's some commonly-accepted pattersn though).  You might have
10 Actions for a single page (reasonable in some cases), or one Action for
10 pages (probably not a good idea generally), or one per page (most
common I'd say), or something else I haven't thought of.

I'm guessing, based on the config you posted, that you are submitting a
form to /Menu when any of a number of menu items are clicked?  Then in the
Action you are determine which was clicked and forwarding to the
appropriate Velocity template?  If so, that's a reasonable approach...
some would say you should probably use a DispatchAction, but it's more a
matter of what you prefer than what is right or wrong.

Now... why you aren't seeing the JSP... I think you want to solve that
before anything else... The first thing to do is be sure what forward is
being returned... As a matter of fact, how about posting your Action's
code?  I assume it isn't too big... There might be something obvious that
I or someone else can point out right away... You either have something
configured wrong, or the Action's code is wrong... Are you sure the Action
is being reached at all?  If so then most of your configuration it
obviously correct, the only remaining point could be the forward
declarations.  Nothing stands out as wrong to me though, so seeing the
code might help.

Frank

 -Paul

 Frank W. Zammetti wrote:

 Ok... I probably can't be of too much help then... I've never used
 Velocity.

 One thing to try though... change your forwards to go to a test JSP...
 if you get to it, then the problem is in the Velocity side of things
 (or the forward to the Velocity templates).  At least you'll narrow
 down your focus a bit.

 Frank

 Paul Goepfert wrote:

 I am forwarding to a web page.  The .vm file extension is mapped to
 org.apache.velocity.tools.view.servlet.VelocityViewServlet.  I am
 using Apache Velocity for my Web page design.  Should I be forwarding
 to Actions?

 My intention is to go to a Velocity page rather then an html or JSP.

 -Paul
 Frank W. Zammetti wrote:

 What are you forwarding to in this mapping Paul?  Is .vm the
 extension your application uses to map to ActionServlet, in which
 case you are forwarding to Actions?  Or is it something else?

 Most commonly, the forwards go to JSPs (although not necessarily).

 You are correct in your thinking with regard to what Martin said...
 there are no special meaning forward names that I am aware of, you
 can name your forwards whatever you wish.  Success and Failure are
 two very common names however.

 Is your intention to go to a JSP when you return a given forward
 from your Action?  If so, I suspect that is what is wrong... change
 the paths  on the forwards... if your intention is something else,
 please explain so we can try and help :)




 Frank

 Paul Goepfert wrote:

 Ok, here is the problem.  When I load up my web app the page loads
 fine.  When I try to advance to another web page in my web app all
 I get is a blank screen.  For every page I have a form.java and an
 action.java file so I can move through the web app.  Here is part
 of my struts-config file that handles the actions.

 action path=/Menu
 type=actions.MenuAction
 name=menuForm
 scope=request
   forward name=enterInfo
path=/info.vm /
   forward name=default
path=/results.vm /
   forward name=sort
path=/sort.vm /
 /action

 In the form.java files I have getters and setters for the
 information I pass through the address bar.  In the action.java
 files I  have method calls to my logic for the program as well as
 forwards for the next page I wannt to go to.

 If anyone can help me out that would be great.  If more information
 is needed let me know.

 -Paul

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







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







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




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



Re: Possible Bug in Struts Workflow Extension?

2005-06-13 Thread Michael Jouravlev
Struts Workflow Extension is not part of Struts. You need to consult
its author. Also, there are alternatives to it, like Struts Flow
http://struts.sourceforge.net/struts-flow or Easy Wizard
http://www.superinterface.com/easywizard.htm. The last project is
written by me, and is in the process of refactoring for better Struts
integration, expect new version in about a week.

Michael.

 I'am a newbie in STRUTS WORKFLOW EXTENSION. I installed the Demo
 Application and everything works fine. But the following situation seems
 to lead to a bug in the workflow extension:

removed

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



Iterating Hashtable collection in ActionForm

2005-06-13 Thread Mark Benussi
I wish to write out some values of a Hashtable using the nested tags.

I have read the documentation and know I have to refer to either the key or
the value property to access the underlying data but get the following
message when accessing the JSP/Form bean combination detailed below.

Error 500: No getter method for property x(5).key of bean formBean

This suggests to me it has a problem with the last element or has gone
outside of the Hashtable size?

I would really appreciate your help, my Collection and simple property tests
work fine but really need to get Hashtable working.

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested %
html:form action=/submit.do method=post
nested:iterate property=x
Key: nested:write property=key /
   nested:nest property=value
Value: nested:write property=stuff /br /
/nested:nest
/nested:iterate
/html:form

public class SubmitForm extends ActionForm {

private Hashtable x = new Hashtable();

public SubmitForm() {

x.put(1, new MyTest());
x.put(2, new MyTest());
x.put(3, new MyTest());
x.put(4, new MyTest());
   x.put(5, new MyTest());
}
public Hashtable getX() {
return x;
}
public void setX(Hashtable hashtable) {
x = hashtable;
}
}

public class MyTest {

private String stuff = stuffing;
public String getStuff() {
return stuff;
}
public void setStuff(String string) {
stuff = string;
}
}

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



form field is not populating immediately

2005-06-13 Thread Ramkumar Krishnan
Hi All,
 I have a form which has two fields.One is a string array and
another field which determines the size of the first field. i have
indexed methods to populate the string array.

i need to initialize the string[] based on the size(another form
field) when the indexed method gets invoked. But my second form field
is not populated by the struts.
Because of this i am getting null pointer exception.

This is my indexed method in my form
..
 public void setDisabledUser(int index, String object)
{
if (arr == null)
arr = new String[Integer.parseInt(getTotalSizePerPage())];
arr[index] = object;
}
...

getTotalSizePerPage() returns null because the form field is not yet
populated by struts when this method gets invoked.


Any clues to solve this problem?

thanks in advance,
-- 
Ramkumar Yadav K,

a href=http://www.spreadfirefox.com/?q=affiliatesamp;id=0amp;t=65;img
border=0 alt=Get Firefox! title=Get Firefox!
src=http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif//a

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



struts and sessions

2005-06-13 Thread marc
How do I easy and smart make a bean and put it in the client's session, 
when the client logs on. So no mather where the client is, I can access 
the bean.

Like a bean that holes name, adr, age and so on.


I use jaas, jboss and the servelt sercurity when I logon.


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



Re: How do I use JAAS(JbossSX) in Struts?

2005-06-13 Thread marc

Thank you for all your help.

I finnaly solved it. I had misundestod the servlet login method. Once 
read 5 times more I got.


But again thank you for all your help.

Best regards


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



Re: struts and sessions

2005-06-13 Thread Michael Jouravlev
HttpSession is the same everywhere: in plain servlet/JSP, in Struts or in JBoss.

On 6/13/05, marc [EMAIL PROTECTED] wrote:
 How do I easy and smart make a bean and put it in the client's session,
 when the client logs on. So no mather where the client is, I can access
 the bean.
 Like a bean that holes name, adr, age and so on.
 
 
 I use jaas, jboss and the servelt sercurity when I logon.
 
 
 -
 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]



urlencoding

2005-06-13 Thread Franck

Hi,

in my webapp,  I have the following tag :

html:link action=folder paramName=folder  paramId=folder 
paramProperty=fullNamefolder/html:link


In some case, fullName has special chars
In the result source I can see :

a href=folder.do?folder=Courrier+ind%C%A9sirablefolder/a

The URL seems  to be correctly UTF-8 encoded

In the folder.do Action, if I SysOut the folder parameter, I just can 
see some other special chars in the String (a special A and a copyright)

an URLDecode.decode(myString, UTF-8) doesn't work.

Where is my mistake ?

Thanks
Bye 






Orange Caraibe 
IMPORTANT.  
CONFIDENTIEL : Les informations contenues dans ce message sont confidentielles et peuvent etre protegees par la loi. Ce message est etabli a l'intention exclusive de ses destinataires. Si vous recevez ce message par erreur, toute lecture, exploitation ou transmission des informations contenues dans ce message est interdite. Merci de prevenir l'expediteur et de supprimer de votre ordinateur le message et tous les fichiers eventuellement attaches.  
Tout message electronique est susceptible d'alteration. Orange Caraibe decline toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie ; de meme, il appartient au destinataire de s'assurer de l'absence de tout virus.http:/www.orangecaraibe.com 
IMPORTANT.  
CONFIDENTIALITY : this e-mail is confidential and meant for only the intended recipients of the transmission, and may be a communication privileged by law.  If you received this e-mail in error, any review, use, dissemination, distribution or copying of this e-mail is strictly prohibited. Please notify the sender immediately of the error by return e-mail and please delete this message and any attachments from your system. Thank you in advance for your cooperation.  
E-mails are susceptible to alteration. Orange Caraibe shall not be liable for the message if altered, changed or falsified. the recipient should ensure they are actually virus free. Orange Caraibe may monitor all incoming and outgoing e-mails in line with current legislation. http:/www.orangecaraibe.com 





RE: urlencoding

2005-06-13 Thread Deb, Sujan
Hi there,

Try to use the following before you write anything to response:

response.setContentType(text/html; charset=UTF-8);

Make sure you use this before any call - response.getWriter();

Cheers
Sujan

-Original Message-
From: Franck [mailto:[EMAIL PROTECTED]
Sent: Monday, June 13, 2005 11:45 AM
To: struts-user@jakarta.apache.org
Subject: urlencoding


Hi,

in my webapp,  I have the following tag :

html:link action=folder paramName=folder  paramId=folder 
paramProperty=fullNamefolder/html:link

In some case, fullName has special chars
In the result source I can see :

a href=folder.do?folder=Courrier+ind%C%A9sirablefolder/a

The URL seems  to be correctly UTF-8 encoded

In the folder.do Action, if I SysOut the folder parameter, I just can 
see some other special chars in the String (a special A and a copyright)
an URLDecode.decode(myString, UTF-8) doesn't work.

Where is my mistake ?

Thanks
Bye 
 

 
 
 
Orange Caraibe 
IMPORTANT.  
CONFIDENTIEL : Les informations contenues dans ce message sont
confidentielles et peuvent etre protegees par la loi. Ce message est etabli
a l'intention exclusive de ses destinataires. Si vous recevez ce message par
erreur, toute lecture, exploitation ou transmission des informations
contenues dans ce message est interdite. Merci de prevenir l'expediteur et
de supprimer de votre ordinateur le message et tous les fichiers
eventuellement attaches.  
Tout message electronique est susceptible d'alteration. Orange Caraibe
decline toute responsabilite au titre de ce message s'il a ete altere,
deforme ou falsifie ; de meme, il appartient au destinataire de s'assurer de
l'absence de tout virus.http:/www.orangecaraibe.com 
IMPORTANT.  
CONFIDENTIALITY : this e-mail is confidential and meant for only the
intended recipients of the transmission, and may be a communication
privileged by law.  If you received this e-mail in error, any review, use,
dissemination, distribution or copying of this e-mail is strictly
prohibited. Please notify the sender immediately of the error by return
e-mail and please delete this message and any attachments from your system.
Thank you in advance for your cooperation.  
E-mails are susceptible to alteration. Orange Caraibe shall not be liable
for the message if altered, changed or falsified. the recipient should
ensure they are actually virus free. Orange Caraibe may monitor all incoming
and outgoing e-mails in line with current legislation.
http:/www.orangecaraibe.com 
 
 

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



RE: Test whether an application resource is empty

2005-06-13 Thread Chris Loschen
As I understand it, this would return the error only if there are no
messages at all in the application resource, which is not at all likely
in this context. We're testing whether a particular application resource
(that is, a particular key-value pair in the application resource file)
is empty, not the whole file. 

That said, I still didn't get the results I had hoped for with the new
version either, unfortunately. I didn't get any errors, but it returned
true even when the value was empty. For example, when I had an
application resource key set up like so:

module.admin.manageHierarchy.businessStruc.add.directionToUser=

And my JSP code is set up like this:

bean:define id=messages
name=org.apache.struts.action.MESSAGE/
 logic:notEmpty name=messages
property=message(%=directionToUserKey.toString()%)
 div class=modFormBoxbean:message
key=%=directionToUserKey.toString()%//div
 /logic:notEmpty

It returns notEmpty as true, because I get this in the page:

 div class=modFormBox/div

I presume it must be testing that the key exists and is non-zero-length
rather than testing the value. Oh well.

Chris

-Original Message-
From: Nitish Kumar [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 13, 2005 12:54 AM
To: 'Struts Users Mailing List'
Subject: RE: Test whether an application resource is empty


bean:define id=messages name=org.apache.struts.action.MESSAGE/

I dont understand some things here, If the application resource is empty
above code would throw this error, Define tag cannot set a null value.


So how does this code helps in checking wether an application resouce is
empty?

Am I missing some thing here? or may be the subject is misleading.. 


Thanks and Regards,
Nitish Kumar
Tavant Technologies Ltd
Bangalore


-Original Message-
From: Laurie Harper [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 12, 2005 6:30 AM
To: user@struts.apache.org
Subject: Re: Test whether an application resource is empty


Doh, I'm an idiot! :-( What I suggested is like trying to call getFoo()
on the resource bundle bean, where 'Foo' is what ever
%=directionToUserKey.toString()% evaluates to. Clearly not what's
needed. The following works for me:

 bean:define id=messages
name=org.apache.struts.action.MESSAGE/
 logic:notEmpty name=messages property=message(errors.cancel)
 pusing Struts bean/logic/p
 /logic:notEmpty

Just replace 'errors.cancel' with '%=directionToUserKey.toString()%' 
and you should be set.

Sorry for the confusion,

L.

Chris Loschen wrote:
 Thanks again, Laurie, but for some reason it still returns false every

 time, even if there is something under that key.  I'm pretty sure I 
 followed your directions exactly:
 
   tiles:useAttribute id=directionToUserKey
 name=directionToUserKey scope=request classname=java.lang.String
 ignore=true/
   
   logic:present name=org.apache.struts.action.MESSAGE
 property=%=directionToUserKey.toString()%
   div class=modFormBoxbean:message 
 key=%=directionToUserKey.toString()%//div
   /logic:present
 
 Although I did have to pull the key back out of the request in my 
 second tile -- do I have to do that here as well? I may have to give 
 up for now, since I have it working the other way, but I'm still 
 curious what I did wrong.
 
 Chris
 
 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
 Sent: Friday, June 10, 2005 2:49 PM
 To: user@struts.apache.org
 Subject: Re: Test whether an application resource is empty
 
 You want to use the name of the attribute the resource bundle is 
 stored under, not the name of the properties file. You're not 
 specifying it in your Struts config so you want the following:
 
logic:present name=org.apache.struts.action.MESSAGE
property=%=directionToUserKey.toString()%
  div class=modFormBox.../div
/logic:present
 
 L.
 
 Chris Loschen wrote:
 
Thanks Laurie,

I tried to set it up this way, but wasn't able to make it work. My 
struts-config file defines the message-resources parameter like so:

  message-resources parameter=ApplicationResources
null=false/

So I tried putting that in, and also tried some variants like 
org.apache.struts.ApplicationResources and 
org.apache.struts.util.MessageResources in code like this:

  tiles:useAttribute id=directionToUserKey
name=directionToUserKey scope=request classname=java.lang.String
ignore=true/
  
  logic:present name=ApplicationResources
property=%=directionToUserKey.toString()%
  div class=modFormBoxbean:message 
key=%=directionToUserKey.toString()%//div
  /logic:present

But it always returned false, even if there was a value for the key, 
so I apparently set up something wrong.

I did get it working using the alternate path, however -- I set up a 
new tile in the tiles-defs file which was defined as a zero-length 
file in the default case and a small JSP for those cases where I had
 
 directions.
 
The calling 

Re: urlencoding

2005-06-13 Thread Leon Rosenberg
aehm... dont trust what you see in the system.out. What you see depends
on what encoding your console actually drives, and that would be
probably something different from what java does (typically iso-8589-1)

regards
leon

On Mon, 2005-06-13 at 11:44 -0400, Franck wrote:
 Hi,
 
 in my webapp,  I have the following tag :
 
 html:link action=folder paramName=folder  paramId=folder 
 paramProperty=fullNamefolder/html:link
 
 In some case, fullName has special chars
 In the result source I can see :
 
 a href=folder.do?folder=Courrier+ind%C%A9sirablefolder/a
 
 The URL seems  to be correctly UTF-8 encoded
 
 In the folder.do Action, if I SysOut the folder parameter, I just can 
 see some other special chars in the String (a special A and a copyright)
 an URLDecode.decode(myString, UTF-8) doesn't work.
 
 Where is my mistake ?
 
 Thanks
 Bye 
  
 
  
 
 
 Orange Caraibe 
 IMPORTANT.  
 CONFIDENTIEL : Les informations contenues dans ce message sont 
 confidentielles et peuvent etre protegees par la loi. Ce message est etabli a 
 l'intention exclusive de ses destinataires. Si vous recevez ce message par 
 erreur, toute lecture, exploitation ou transmission des informations 
 contenues dans ce message est interdite. Merci de prevenir l'expediteur et de 
 supprimer de votre ordinateur le message et tous les fichiers eventuellement 
 attaches.  
 Tout message electronique est susceptible d'alteration. Orange Caraibe 
 decline toute responsabilite au titre de ce message s'il a ete altere, 
 deforme ou falsifie ; de meme, il appartient au destinataire de s'assurer de 
 l'absence de tout virus.http:/www.orangecaraibe.com 
 IMPORTANT.  
 CONFIDENTIALITY : this e-mail is confidential and meant for only the intended 
 recipients of the transmission, and may be a communication privileged by law. 
  If you received this e-mail in error, any review, use, dissemination, 
 distribution or copying of this e-mail is strictly prohibited. Please notify 
 the sender immediately of the error by return e-mail and please delete this 
 message and any attachments from your system. Thank you in advance for your 
 cooperation.  
 E-mails are susceptible to alteration. Orange Caraibe shall not be liable for 
 the message if altered, changed or falsified. the recipient should ensure 
 they are actually virus free. Orange Caraibe may monitor all incoming and 
 outgoing e-mails in line with current legislation. 
 http:/www.orangecaraibe.com 
  
 



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



i8n of File Upload tag

2005-06-13 Thread Kat Luna
Hi all,

I found a rather lengthy discussion of how to modify the default Browse
button that comes with the html:file tag on another struts list, but the
discussion ended with no solution posted.  I am currently trying to implement
File Upload on a multi-lingual application (based on User profile, not
browser locale) and cannot find a way to change the language on the Browse
button.  I have tried several javascript solutions, but none actually upload
the file.  Does anyone have a working solution or know of one posted on the
web?

thanks,

Kat



__ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

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



[OT]Templates of various documents

2005-06-13 Thread Ashish Kulkarni
Hi
I remmember having a website which had templates of
various documents, like project requirement document,
or project proposal or design specifications etc
does any one know this website or similar kind of
website
I have to do some project proposals and need some
standar template documents 

Ashish



__ 
Discover Yahoo! 
Get on-the-go sports scores, stock quotes, news and more. Check it out! 
http://discover.yahoo.com/mobile.html

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



html:errors does not display

2005-06-13 Thread Song Wang
Hello everyone,

I cannot display html:errors property=blah/, but if I add

%
ActionErrors ae = ( ActionErrors) request.getAttribute( Action.ERROR_KEY);
boolean err = false;
if( ae != null) {
 Iterator iter = ae.properties();
 while(iter.hasNext()){
  System.out.println((String)iter.next());  
 }
}
%

I can see that blah is printed out. That being said, the errors does hold the 
value. Does anyone know where I should configure? Or how to check if the value 
is an empty string? I'm using WSAD 5.1.

Thanks.
Song


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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Paul Goepfert

Here is my MenuAction.java

package actions;

import org.apache.struts.action.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Arrays.*;
import java.io.*;
import forms.*;
import beans.InfoBean;
import logic.DB;

public class MenuAction extends Action 
{

   public ActionForward execute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws IOException, ServletException
   {
   String action;
   HttpSession session;   


   DB data = new DB();
   InfoBean sorted [] = new InfoBean [data.getInformation().size()]; 
   try

   {
   session = request.getSession();
   action = request.getParameter(action);


   if(action.equals(enterInfo))
   {
   return (mapping.findForward(enter));
   }
   else if(action.equals(default))
   {
   sorted = data.createSortedArray(ascending, first);
   data.removeInsert(sorted);
   data.createContext(sorted);
   return (mapping.findForward(default));
   }
   else
   {
   return  (mapping.findForward(sort));
   }
   }
   catch (Exception e)
   {
   e.printStackTrace();
   }
   return (mapping.findForward(menu));
   }
}


I am also including part of the webpage source file incase the problem 
is in there and its a html error.


form name=menu action=$link.setAction(Menu) method=get
  input type=hidden name=action value=menu
   table width=200 cellspacing=0 cellpadding=0
   tr
   td
   labelinput type=radio name=displayMenu value=enterInfo 
onchange=menu.action.value='enterInfo'  $text.get(menuEnter)/label
   /td
   /tr
   tr
   td
   labelinput type=radio name=displayMenu value=default 
onchange=menu.action.value='default'$text.get(menuDefault)/label
   /td
   /tr
   tr
   td
   labelinput type=radio name=displayMenu value=sort 
onchange=menu.action.value='sort'$text.get(menuSort)/label
   /td
   /tr
   /table
   input type=submit name=Submit value=$text.get(menuSubmit) 
   /form

The $text variable is a varable that is defined in the velocity tools  
package. The variables are defined in a properties file I defined.  When 
displayed on the web the $text variable is exchanged with the mapping in 
the properties file.


-Paul

Frank W. Zammetti wrote:


On Mon, June 13, 2005 12:54 am, Paul Goepfert said:
 


Well I just created a test jsp file to see if I got to the page.  I
didn't.  I just want to  be sure about one thing.  I am soppose to have
multiple actions in my struts config? One for each  page? Right?
   



How your app is configured is completely up to you... there are no rules
per se (there's some commonly-accepted pattersn though).  You might have
10 Actions for a single page (reasonable in some cases), or one Action for
10 pages (probably not a good idea generally), or one per page (most
common I'd say), or something else I haven't thought of.

I'm guessing, based on the config you posted, that you are submitting a
form to /Menu when any of a number of menu items are clicked?  Then in the
Action you are determine which was clicked and forwarding to the
appropriate Velocity template?  If so, that's a reasonable approach...
some would say you should probably use a DispatchAction, but it's more a
matter of what you prefer than what is right or wrong.

Now... why you aren't seeing the JSP... I think you want to solve that
before anything else... The first thing to do is be sure what forward is
being returned... As a matter of fact, how about posting your Action's
code?  I assume it isn't too big... There might be something obvious that
I or someone else can point out right away... You either have something
configured wrong, or the Action's code is wrong... Are you sure the Action
is being reached at all?  If so then most of your configuration it
obviously correct, the only remaining point could be the forward
declarations.  Nothing stands out as wrong to me though, so seeing the
code might help.

Frank

 


-Paul

Frank W. Zammetti wrote:

   


Ok... I probably can't be of too much help then... I've never used
Velocity.

One thing to try though... change your forwards to go to a test JSP...
if you get to it, then the problem is in the Velocity side of things
(or the forward to the Velocity templates).  At least you'll narrow
down your focus a bit.

Frank

Paul Goepfert wrote:

 


I am forwarding to a web page.  The .vm file extension is mapped to
org.apache.velocity.tools.view.servlet.VelocityViewServlet.  I am
using 

Re: html:errors does not display

2005-06-13 Thread Andrew Tomaka
Song,

I was having a similar problem using WSAD 5.0.0.  Client side
validation using the Validator component worked, but server side
validation did not.  Since WSAD included Struts 1.1(beta 2), I decided
to update struts to the newest version.  This seemed to correct the
problem.  If you need further instructions on updating Struts to the
most recent version using WSAD, please refer to
http://struts.whoisandy.com/archives/2005/05/26/validator_serverside_validation.php.

~ Andrew Tomaka

On 6/13/05, Song Wang [EMAIL PROTECTED] wrote:
 Hello everyone,
 
 I cannot display html:errors property=blah/, but if I add
 
 %
 ActionErrors ae = ( ActionErrors) request.getAttribute( Action.ERROR_KEY);
 boolean err = false;
 if( ae != null) {
  Iterator iter = ae.properties();
  while(iter.hasNext()){
   System.out.println((String)iter.next());
  }
 }
 %
 
 I can see that blah is printed out. That being said, the errors does hold 
 the value. Does anyone know where I should configure? Or how to check if the 
 value is an empty string? I'm using WSAD 5.1.
 
 Thanks.
 Song
 
 
 -
 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: Having ttruble with actions and buttons

2005-06-13 Thread Martin Gainty

This is straight from  BEA doc
An object of this type is returned from an action methods in a 
PageFlowController to determine the next URI to be displayed.
It is constructed on the name of a forward defined by the @jpf:forward tag, 
and resolves to the URI specified in that forward


The name of the variable forward's name (sucesss,failure,fred) paths you to 
the URI identitied to the path of the associated forward via  the supplied 
name attribute
'success' and 'failure' are used as they are relatively easy forward names 
to remember

You may even code these programmatically thru setForward
Take a look at ActionForward doc for your implementation
http://struts.apache.org/api/org/apache/struts/config/ActionConfig.html#getForward()
HTH,
Martin
- Original Message - 
From: Paul Goepfert [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Sunday, June 12, 2005 11:10 PM
Subject: Re: Having ttruble with actions and buttons


I am still new too struts so I don't understand why I would need to 
incluide forwards with names of success and failure in my struts-config. 
Those forward names just look like their just general forward names that 
have no real effect on where the page goes.  Am I wrong in my thinking?


-Paul
Martin Gainty wrote:


Paul-
you need forwards defined for both success and failure name identified 
such as what you see in the struts doc
http://struts.apache.org/userGuide/building_controller.html e.g. 
struts-config.xml

!-- Edit mail subscription --
action
   path=/editSubscription
   type=org.apache.struts.webapp.example.EditSubscriptionAction
   name=subscriptionForm
   scope=request
   validate=false
   forward
   name=failure
   path=/mainMenu.jsp/
   forward
   name=success
   path=/subscription.jsp/
/action
HTH,
Martin-

- Original Message - From: Paul Goepfert 
[EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Sunday, June 12, 2005 9:37 PM
Subject: Having ttruble with actions and buttons


Ok, here is the problem.  When I load up my web app the page loads fine. 
When I try to advance to another web page in my web app all I get is a 
blank screen.  For every page I have a form.java and an action.java file 
so I can move through the web app.  Here is part of my struts-config 
file that handles the actions.


action path=/Menu
type=actions.MenuAction
name=menuForm
scope=request
  forward name=enterInfo
   path=/info.vm /
  forward name=default
   path=/results.vm /
  forward name=sort
   path=/sort.vm /
/action

In the form.java files I have getters and setters for the information I 
pass through the address bar.  In the action.java files I  have method 
calls to my logic for the program as well as forwards for the next page 
I wannt to go to.


If anyone can help me out that would be great.  If more information is 
needed let me know.


-Paul

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




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




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




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



RE: Sending value from popup to parent window

2005-06-13 Thread Greg Pelly
Fez,

Perhaps I am missing something simple, but couldn't your sendValue()
function just get the .selectedIndex of the multiBox, then you can
iterate through the select's options and get the one your need?  

This seems to be more a question of some JS engineering, at least that
is the simplest way in my mind.  I haven't used html:multibox, though,
so it could be more complicated.

HTH,
Greg


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 13, 2005 7:39 AM
To: user@struts.apache.org
Subject: RE: Sending value from popup to parent window 

Has anybody any advice on this at all...?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 June 2005 11:33
To: user@struts.apache.org
Subject: Sending value from popup to parent window 

Hi,
 
I am a bit stuck on implementing the following so all help is
appreciated.
 
I open up a search page as a pop up window. The user implements the
search options and is returned a number of rows. The user then selects
one of these rows using a check box which I have defined as a multibox
in my jsp.

The problem I have is populating the field on the parent window with the
value of the multibox? 

In the JSP i define my multibox as such 

html:multibox name=actionClientForm property=resourceIds
bean:write name=client property=resourceId/ /html:multibox

The link to close this page and send the value is as follows:

td align=right
html:link href=javascript:sendValue();Add Client/html:link /td

The javascript function:

script language=JavaScript
function sendValue(s)
{

var selvalue = s
out.println(variable =  + selvalue);
window.opener.document.createClnForm.clientId.value = selvalue;
window.close(); } /script

If I put a value of 1 in the link where i call the javascript it works
fine and puts 1 into the correct field on the parent window.
td align=right
html:link href=javascript:sendValue(1);Add Client/html:link /td

However what i want to send back is the bean:write name=client
property=resourceId/ of the selected multibox.

i tried using bean define but that did not seem to work.

The property resourceIds of the actionClientForm is a collection.

Anyone know how to do this?

thanks
fez
 

-
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: Having ttruble with actions and buttons

2005-06-13 Thread Dave Newton

Paul Goepfert wrote:


[...]  try
   {
   session = request.getSession();
   action = request.getParameter(action);   
   if(action.equals(enterInfo))

   {
   return (mapping.findForward(enter));
   }
   else if(action.equals(default))
   {
   sorted = data.createSortedArray(ascending, first);
   data.removeInsert(sorted);
   data.createContext(sorted);
   return (mapping.findForward(default));
   }
   else
   {
   return  (mapping.findForward(sort));
   }
   } [...]


This code reeks of code smell, regardless of any other issues, 
especially if you have to do something similar in any other action. This 
is, more or less, what DispatchAction (?) was created for. Here you've 
duplicated controller logic inside an action, which is really supposed 
to be a target of the controller.


So here you are expecting forwards named enter, default, and sort.


form name=menu action=$link.setAction(Menu) method=get
  input type=hidden name=action value=menu


menu


onchange=menu.action.value='enterInfo'  $text.get(menuEnter)/label


enterInfo


onchange=menu.action.value='default'$text.get(menuDefault)/label


default


onchange=menu.action.value='sort'$text.get(menuSort)/label


sort


action path=/Menu
   type=actions.MenuAction
   name=menuForm
   scope=request
 forward name=enterInfo
  path=/info.vm /
 forward name=default
  path=/results.vm /
 forward name=sort
  path=/sort.vm /
/action



Okay, so that looks good.

Have you done a sanity check with a plain 'ol action with a forward to a 
JSP like Frank suggested?


Have you put in logging statements to make sure that the action 
parameter is what you expect it to be when you hit your action?


Have you been able to get _any_ Velocity file to render, i.e., hit one 
without going through Struts? An the related Have you checked on the 
Velocity list to make sure you have the VelocityViewServlet set up properly?


Have you checked the log files for error messages?

Dave



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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Dave Newton
You don't need to have forwards named success or failure; I'm not 
sure how this part of the thread got started. If they don't make sense 
for your app obviously you can call them whatever you want.


Although I'd shy away from 'Fred' ;)

Dave

Martin Gainty wrote:


This is straight from  BEA doc
An object of this type is returned from an action methods in a 
PageFlowController to determine the next URI to be displayed.
It is constructed on the name of a forward defined by the @jpf:forward 
tag, and resolves to the URI specified in that forward


The name of the variable forward's name (sucesss,failure,fred) paths 
you to the URI identitied to the path of the associated forward via  
the supplied name attribute
'success' and 'failure' are used as they are relatively easy forward 
names to remember

You may even code these programmatically thru setForward
Take a look at ActionForward doc for your implementation
http://struts.apache.org/api/org/apache/struts/config/ActionConfig.html#getForward() 


HTH,
Martin
- Original Message - From: Paul Goepfert 
[EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Sunday, June 12, 2005 11:10 PM
Subject: Re: Having ttruble with actions and buttons


I am still new too struts so I don't understand why I would need to 
incluide forwards with names of success and failure in my 
struts-config. Those forward names just look like their just general 
forward names that have no real effect on where the page goes.  Am I 
wrong in my thinking?


-Paul
Martin Gainty wrote:


Paul-
you need forwards defined for both success and failure name 
identified such as what you see in the struts doc
http://struts.apache.org/userGuide/building_controller.html e.g. 
struts-config.xml

!-- Edit mail subscription --
action
   path=/editSubscription
   type=org.apache.struts.webapp.example.EditSubscriptionAction
   name=subscriptionForm
   scope=request
   validate=false
   forward
   name=failure
   path=/mainMenu.jsp/
   forward
   name=success
   path=/subscription.jsp/
/action
HTH,
Martin-

- Original Message - From: Paul Goepfert 
[EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Sunday, June 12, 2005 9:37 PM
Subject: Having ttruble with actions and buttons


Ok, here is the problem.  When I load up my web app the page loads 
fine. When I try to advance to another web page in my web app all I 
get is a blank screen.  For every page I have a form.java and an 
action.java file so I can move through the web app.  Here is part 
of my struts-config file that handles the actions.


action path=/Menu
type=actions.MenuAction
name=menuForm
scope=request
  forward name=enterInfo
   path=/info.vm /
  forward name=default
   path=/results.vm /
  forward name=sort
   path=/sort.vm /
/action

In the form.java files I have getters and setters for the 
information I pass through the address bar.  In the action.java 
files I  have method calls to my logic for the program as well as 
forwards for the next page I wannt to go to.


If anyone can help me out that would be great.  If more information 
is needed let me know.


-Paul

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




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




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




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



AW: [OT]Templates of various documents

2005-06-13 Thread Leon Rosenberg
Try http://www-306.ibm.com/software/rational/ and search / try for RUP.

Regards
Leon 

 -Ursprüngliche Nachricht-
 Von: Ashish Kulkarni [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 13. Juni 2005 20:08
 An: user@struts.apache.org
 Betreff: [OT]Templates of various documents
 
 Hi
 I remmember having a website which had templates of various 
 documents, like project requirement document, or project 
 proposal or design specifications etc does any one know this 
 website or similar kind of website I have to do some project 
 proposals and need some standar template documents 
 
 Ashish
 
 
   
 __
 Discover Yahoo! 
 Get on-the-go sports scores, stock quotes, news and more. 
 Check it out! 
 http://discover.yahoo.com/mobile.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



AW: [OT]Templates of various documents

2005-06-13 Thread Leon Rosenberg
Try http://www-306.ibm.com/software/rational/ and search / try for RUP.

Regards
Leon 

 -Ursprüngliche Nachricht-
 Von: Ashish Kulkarni [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 13. Juni 2005 20:08
 An: user@struts.apache.org
 Betreff: [OT]Templates of various documents
 
 Hi
 I remmember having a website which had templates of various 
 documents, like project requirement document, or project 
 proposal or design specifications etc does any one know this 
 website or similar kind of website I have to do some project 
 proposals and need some standar template documents 
 
 Ashish
 
 
   
 __
 Discover Yahoo! 
 Get on-the-go sports scores, stock quotes, news and more. 
 Check it out! 
 http://discover.yahoo.com/mobile.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



Re: AW: [OT]Templates of various documents- got the site

2005-06-13 Thread Ashish Kulkarni
Hi
found this site
http://readyset.tigris.org/

very good site for templates

ashish

--- Leon Rosenberg [EMAIL PROTECTED] wrote:

 Try http://www-306.ibm.com/software/rational/ and
 search / try for RUP.
 
 Regards
 Leon 
 
  -Ursprüngliche Nachricht-
  Von: Ashish Kulkarni
 [mailto:[EMAIL PROTECTED] 
  Gesendet: Montag, 13. Juni 2005 20:08
  An: user@struts.apache.org
  Betreff: [OT]Templates of various documents
  
  Hi
  I remmember having a website which had templates
 of various 
  documents, like project requirement document, or
 project 
  proposal or design specifications etc does any one
 know this 
  website or similar kind of website I have to do
 some project 
  proposals and need some standar template documents
 
  
  Ashish
  
  
  
  __
  Discover Yahoo! 
  Get on-the-go sports scores, stock quotes, news
 and more. 
  Check it out! 
  http://discover.yahoo.com/mobile.html
  
 

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

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




__ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

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



RE: Can struts-1.1 support multiple configurations and multiple resources

2005-06-13 Thread Venkat Reddy Valluri
Hi Manfred,
   I have given null=false  for my main module struts config file and still 
the error message is not displayed

 instead it is just dipaying like below
   en.us.error.user.user_name.required. (It is just displaying property 
but not value)

Thank you very much

--Venkat

  



-Original Message-
From:   Manfred Wolff [mailto:[EMAIL PROTECTED]
Sent:   Mon 6/13/2005 1:47 PM
To: Struts Users Mailing List
Cc: 
Subject:Re: Can struts-1.1 support multiple configurations and multiple 
resources
Venkat

I think you don't have to deal with suffixes (like sub) because struts 
itsselfs concatinate the module in the key, stored into the session. I 
have a little example written for my struts book (only in german) that 
deals with multiple struts config files. You may download it under

http://struts-ge-packt.de/download/code.zip

Because it is no maven project it comes with a lot of libraries.

1st Struts config: (struts-config.xml)
message-resources parameter=MessageResources null=false /

2nd Struts config with Module (struts-modul-confix.xml)
message-resources parameter=MessageModulResources /

It is a struts 1.2 application but the module support is fine in 1.1

-Manfred

Venkat Reddy Valluri wrote:

Hi  Manfred,
 Thank you very much for responding immediately. I ended up multiple  
 struts config files successfully. But the thing is when I tried to use 
 separate resources for each struts config file using bundle parametre,  It 
 seems not to be working.  

Here is my struts configurations

  In my main module struts config file
I included below one
struts-main.xml---
 message-resources
parameter=com.main.examp.ApplicationResources/


In my sub module struts config file

I included below one
struts-sub.xml---
   message-resources
parameter=com.sub.examp.SubResources key=sub
/message-resources

SubResources.properties
error.user.user_name.required=UserName is required

Here in my sub module
   
SubEditActionForm.java---

In validate method I have given like this

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

if (user_name == null || user_name.length() == 0) {
errors.add(user_name, new  
 ActionError(error.user.user_name.required));
}
   return errors;
 }
 
But here the error messgae UserName is required  is not able to be displyed 
on screen  when I submit the page with out entering user_name

So I thought of passing buddle  attribute sub  which is used 
 struts-sub.xml  to ActionError class
(
message-resources
parameter=com.sub.examp.SubResources key=sub
/message-resources)

   But there is no option to pass that attribute in ActionError or 
 ActionMessage class
  
SO here where I struck 

Can you please  throw some light on this

Thanks in advace

--Venkat



   





   
-Original Message-
From:  Manfred Wolff [mailto:[EMAIL PROTECTED]
Sent:  Mon 6/13/2005 10:00 AM
To:Struts Users Mailing List
Cc:
Subject:   Re: Can struts-1.1 support multiple configurations and multiple 
resources

Yes it can with multiple module support.

http://struts.apache.org/userGuide/configuration.html#dd_config_modules

Manfred

Venkat Reddy Valluri wrote:

  

Hi

  Can struts-1.1 support multiple configurations and multiple resources. Can 
 some body please throw some light on this. I need it very urgent

Thanks in advance

--Venkat

 



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





  



-- 
===
Dipl.-Inf. Manfred Wolff
Software Engineer
---
http://www.manfred-wolff.de
http://www.struts-it.org
---

Die fatale Neigung der Menschen,
vom Nachdenken ber eine Sache nachzulassen,
wenn sie nicht lnger zweifelhaft ist,
ist die Ursache der Hlfte ihrer Irrtmer.
- John Stuart Mil -
___


-
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: Having ttruble with actions and buttons

2005-06-13 Thread Frank W. Zammetti
On Mon, June 13, 2005 2:41 pm, Dave Newton said:
 Have you put in logging statements to make sure that the action
 parameter is what you expect it to be when you hit your action?

Dave is right... throw some println's in that Action and make sure your
getting there in the first place.  The code looks like it should work,
putting aside the code smell observation :) , and as near as I can tell it
should work, at least going to a plain JSP.  Any chance the action you are
passing in isn't the same case?  I always use EqualsIgnoreCase() unless I
know I require case sensitivity... saves a lot of headache that way.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

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




Test, please ignore

2005-06-13 Thread Frank W. Zammetti
Sorry for the disturbance... trying to troubleshoot a posting issue...
this will be the only such post to this list from me.  Sorry again!

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



Switching between http and https in struts-config

2005-06-13 Thread Dan Tenenbaum
Hi, I'm new to the list.

I'm working on a webapp where some of the pages should be accessed
through HTTPS and others through HTTP.

For example, login and registration need to be secure, but once the
registration is done and we go to the user home page, we can go back
to the nonsecure site.

All pages, secure and nonsecure, are being served by the same Tomcat instance.

I'm wondering about the best way to handle this in the struts config
file. If you are allowed to put fully qualified URLS in a forward
path attribute, that could be one solution, but it loses portability
and that file has to be edited every time we want to deploy the app to
another machine with another hostname.

To be more concrete, let's say we go to this page:
https://mysite.com/appname/login.do

The action contains multiple forwards, all of which will continue to
be served by https since we started with an https url. But I want at
least one of those forwards to return to the nonsecure site. (I also
want to do the converse).

Anyone have some ideas on this?
Thanks

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



ensuring valid forwards

2005-06-13 Thread Dan Tenenbaum
My codebase has a lot of lines like this in struts actions:
return mapping.findForward(foo);

If I make a typo and it turns out that foo is not a valid forward
according to the struts config file, when I hit the action in the
browser, I get a blank page. Not my designated error page.

Is there some sort of struts-centric way to ensure that an exception
is thrown and my error page appears? I just want to know if there is
an existing mechanism to do this. I could easily write a method to do
it (to be called instead of mapping.findForward()) but it seems that
this is something Struts should handle.

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



RE: Switching between http and https in struts-config

2005-06-13 Thread Mark Benussi
Yep you need to use http://sslext.sourceforge.net/

-Original Message-
From: Dan Tenenbaum [mailto:[EMAIL PROTECTED] 
Sent: 13 June 2005 20:45
To: user@struts.apache.org
Subject: Switching between http and https in struts-config

Hi, I'm new to the list.

I'm working on a webapp where some of the pages should be accessed
through HTTPS and others through HTTP.

For example, login and registration need to be secure, but once the
registration is done and we go to the user home page, we can go back
to the nonsecure site.

All pages, secure and nonsecure, are being served by the same Tomcat
instance.

I'm wondering about the best way to handle this in the struts config
file. If you are allowed to put fully qualified URLS in a forward
path attribute, that could be one solution, but it loses portability
and that file has to be edited every time we want to deploy the app to
another machine with another hostname.

To be more concrete, let's say we go to this page:
https://mysite.com/appname/login.do

The action contains multiple forwards, all of which will continue to
be served by https since we started with an https url. But I want at
least one of those forwards to return to the nonsecure site. (I also
want to do the converse).

Anyone have some ideas on this?
Thanks

-
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: Having ttruble with actions and buttons

2005-06-13 Thread Paul Goepfert
I figured it out.  It was a stupid mistake, the mappings didn't match 
between my struts-config and my Action Class.  By the way, the Dispacher 
looks like a better way to handle actions.  I  don't suppose anyone 
would know where I would call the reset method to clear out the form onn 
a reload?


-Paul

Dave Newton wrote:


Paul Goepfert wrote:


[...]  try
   {
   session = request.getSession();
   action = request.getParameter(action);   
   if(action.equals(enterInfo))

   {
   return (mapping.findForward(enter));
   }
   else if(action.equals(default))
   {
   sorted = data.createSortedArray(ascending, first);
   data.removeInsert(sorted);
   data.createContext(sorted);
   return (mapping.findForward(default));
   }
   else
   {
   return  (mapping.findForward(sort));
   }
   } [...]



This code reeks of code smell, regardless of any other issues, 
especially if you have to do something similar in any other action. 
This is, more or less, what DispatchAction (?) was created for. Here 
you've duplicated controller logic inside an action, which is really 
supposed to be a target of the controller.


So here you are expecting forwards named enter, default, and sort.


form name=menu action=$link.setAction(Menu) method=get
  input type=hidden name=action value=menu



menu

onchange=menu.action.value='enterInfo'  
$text.get(menuEnter)/label



enterInfo


onchange=menu.action.value='default'$text.get(menuDefault)/label



default


onchange=menu.action.value='sort'$text.get(menuSort)/label



sort


action path=/Menu
   type=actions.MenuAction
   name=menuForm
   scope=request
 forward name=enterInfo
  path=/info.vm /
 forward name=default
  path=/results.vm /
 forward name=sort
  path=/sort.vm /
/action




Okay, so that looks good.

Have you done a sanity check with a plain 'ol action with a forward to 
a JSP like Frank suggested?


Have you put in logging statements to make sure that the action 
parameter is what you expect it to be when you hit your action?


Have you been able to get _any_ Velocity file to render, i.e., hit one 
without going through Struts? An the related Have you checked on the 
Velocity list to make sure you have the VelocityViewServlet set up 
properly?


Have you checked the log files for error messages?

Dave



-
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: ensuring valid forwards

2005-06-13 Thread Frank W. Zammetti
You can configure a global exception handler, although I'm not 100% sure
it will catch this type of problem.

You can find the documentation online in the usual place, but it basically
amounts to this in struts-config:

  global-exceptions
exception handler=com.my.company.handlers.GlobalExceptionHandler
type=java.lang.Exception
key=key_is_required_by_dtd_but_this_app_does_not_need_it_so_this_is_just_a_dummy_value
/
  /global-exceptions

As the rather long text indicates, key is required, but at least in my
case I have never used it, so I just stick any old value in there.  Come
to think of it, I am not even sure how it is meant to be used!

Beyond that, your exception handler class has to extend ExceptionHandler,
and beyond that it looks very much like an Action with a slightly
different execute() signature:


public ActionForward execute(Exception e, ExceptionConfig config,
   ActionMapping mapping, ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws ServletException

You can do whatever you like, and ultimately return a forward to your
exception page... I suggest getting this particular forward right at least
:) LOL

But again, I'm not certain this type of problem will be caught because I'm
not even sure an exception is thrown in such a case.  If it isn't that
strikes me as a bug.  Anyone else know for sure?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, June 13, 2005 3:45 pm, Dan Tenenbaum said:
 My codebase has a lot of lines like this in struts actions:
 return mapping.findForward(foo);

 If I make a typo and it turns out that foo is not a valid forward
 according to the struts config file, when I hit the action in the
 browser, I get a blank page. Not my designated error page.

 Is there some sort of struts-centric way to ensure that an exception
 is thrown and my error page appears? I just want to know if there is
 an existing mechanism to do this. I could easily write a method to do
 it (to be called instead of mapping.findForward()) but it seems that
 this is something Struts should handle.

 -
 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: ensuring valid forwards

2005-06-13 Thread Hubert Rabago
I recently checked in a change that would log a warning if
mapping.findForward was called with a forward name that wasn't
recognized.  This change didn't make it to the 1.2.7 release, but is
available from nightly builds.  Apart from that, it wouldn't be too
hard to customize/extend your Struts installation to handle it the way
you'd wish.  You can use a custom request processor that'd log or
redirect or even use a custom ActionMapping class that can intercept
findForward() calls.

Hubert


On 6/13/05, Dan Tenenbaum [EMAIL PROTECTED] wrote:
 My codebase has a lot of lines like this in struts actions:
 return mapping.findForward(foo);
 
 If I make a typo and it turns out that foo is not a valid forward
 according to the struts config file, when I hit the action in the
 browser, I get a blank page. Not my designated error page.
 
 Is there some sort of struts-centric way to ensure that an exception
 is thrown and my error page appears? I just want to know if there is
 an existing mechanism to do this. I could easily write a method to do
 it (to be called instead of mapping.findForward()) but it seems that
 this is something Struts should handle.
 
 -
 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: Confused

2005-06-13 Thread Pierre Thibault

Le 13 juin 2005 à 08:00, [EMAIL PROTECTED] a écrit :


Pierre,

Struts is no longer a sub-project of Jakarta but is now on its own.
Struts is alive and kicking: http://struts.apache.org/




Happy to hear that.


You can look at section 6 [this might help]:
http://struts.apache.org/userGuide/index.html

As for JBoss... the last time I used it (can't exactly remember  
when)...

JBoss has a version that is already bundled with Tomcat.


There are talking about Tomcat but not about JBoss. I'll continue  
with JBoss because I want to access J2EE.




As for the Mac, I cannot really help.

HTH,
Glenn




Thank you Glenn.


Re: Confused

2005-06-13 Thread Dave Newton

Pierre Thibault wrote:

There are talking about Tomcat but not about JBoss. I'll continue  
with JBoss because I want to access J2EE.


I think you might be confused about what J2EE is. If you need EJBs, 
then yeah, JBoss would be one way to go. If you don't, there's a lot of 
other parts of J2EE, like servlets, JSP, taglibs, etc..


Dave



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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Michael Jouravlev
What do you mean clear out and what do you mean by reload? If you
need a stateful component to obtain user data, and to be able to to
redisplay the page with error messages, and to store intermediate
data, and to correctly process Refresh and Back buttons, you might
want to take a look at the class that I put together last week:
http://struts.sourceforge.net/strutsdialogs

If you totally against storing data in the session, this class is not
for you, though ;-)

Michael.

P.S. Damn, that download counter did reset, when I updated the zip :-(
P.P.S. The live samples are not available right at this moment, the
server is down. It should be up soon.

On 6/13/05, Paul Goepfert [EMAIL PROTECTED] wrote:
 I figured it out.  It was a stupid mistake, the mappings didn't match
 between my struts-config and my Action Class.  By the way, the Dispacher
 looks like a better way to handle actions.  I  don't suppose anyone
 would know where I would call the reset method to clear out the form onn
 a reload?
 
 -Paul
 
 Dave Newton wrote:
 
  Paul Goepfert wrote:
 
  [...]  try
 {
 session = request.getSession();
 action = request.getParameter(action);
 if(action.equals(enterInfo))
 {
 return (mapping.findForward(enter));
 }
 else if(action.equals(default))
 {
 sorted = data.createSortedArray(ascending, first);
 data.removeInsert(sorted);
 data.createContext(sorted);
 return (mapping.findForward(default));
 }
 else
 {
 return  (mapping.findForward(sort));
 }
 } [...]
 
 
  This code reeks of code smell, regardless of any other issues,
  especially if you have to do something similar in any other action.
  This is, more or less, what DispatchAction (?) was created for. Here
  you've duplicated controller logic inside an action, which is really
  supposed to be a target of the controller.
 
  So here you are expecting forwards named enter, default, and sort.
 
  form name=menu action=$link.setAction(Menu) method=get
input type=hidden name=action value=menu
 
 
  menu
 
  onchange=menu.action.value='enterInfo'
  $text.get(menuEnter)/label
 
 
  enterInfo
 
  onchange=menu.action.value='default'$text.get(menuDefault)/label
 
 
  default
 
  onchange=menu.action.value='sort'$text.get(menuSort)/label
 
 
  sort
 
  action path=/Menu
 type=actions.MenuAction
 name=menuForm
 scope=request
   forward name=enterInfo
path=/info.vm /
   forward name=default
path=/results.vm /
   forward name=sort
path=/sort.vm /
  /action
 
 
  Okay, so that looks good.
 
  Have you done a sanity check with a plain 'ol action with a forward to
  a JSP like Frank suggested?
 
  Have you put in logging statements to make sure that the action
  parameter is what you expect it to be when you hit your action?
 
  Have you been able to get _any_ Velocity file to render, i.e., hit one
  without going through Struts? An the related Have you checked on the
  Velocity list to make sure you have the VelocityViewServlet set up
  properly?
 
  Have you checked the log files for error messages?
 
  Dave
 
 
 
  -
  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: ensuring valid forwards

2005-06-13 Thread Dan Tenenbaum
On 6/13/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 But again, I'm not certain this type of problem will be caught because I'm
 not even sure an exception is thrown in such a case.  If it isn't that
 strikes me as a bug.  Anyone else know for sure?
 

I don't think it does throw an exception. I tried putting just the
findForward() line in a try/catch block and nothing was thrown. Also,
no stack traces appear in my tomcat log except a broken pipe error
when trying to render the error page (there is nothing weird in the
error page itself that would cause this).

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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Paul Goepfert
ok here is what I am talking about.  I have a form that takes in first 
name, last name, street address, city, state and zipcode.  When I press 
on the button to enter that information into a database.  I want the 
page to  reload with clear input fields. 


-Paul

Michael Jouravlev wrote:


What do you mean clear out and what do you mean by reload? If you
need a stateful component to obtain user data, and to be able to to
redisplay the page with error messages, and to store intermediate
data, and to correctly process Refresh and Back buttons, you might
want to take a look at the class that I put together last week:
http://struts.sourceforge.net/strutsdialogs

If you totally against storing data in the session, this class is not
for you, though ;-)

Michael.

P.S. Damn, that download counter did reset, when I updated the zip :-(
P.P.S. The live samples are not available right at this moment, the
server is down. It should be up soon.

On 6/13/05, Paul Goepfert [EMAIL PROTECTED] wrote:
 


I figured it out.  It was a stupid mistake, the mappings didn't match
between my struts-config and my Action Class.  By the way, the Dispacher
looks like a better way to handle actions.  I  don't suppose anyone
would know where I would call the reset method to clear out the form onn
a reload?

-Paul

Dave Newton wrote:

   


Paul Goepfert wrote:

 


[...]  try
  {
  session = request.getSession();
  action = request.getParameter(action);
  if(action.equals(enterInfo))
  {
  return (mapping.findForward(enter));
  }
  else if(action.equals(default))
  {
  sorted = data.createSortedArray(ascending, first);
  data.removeInsert(sorted);
  data.createContext(sorted);
  return (mapping.findForward(default));
  }
  else
  {
  return  (mapping.findForward(sort));
  }
  } [...]
   


This code reeks of code smell, regardless of any other issues,
especially if you have to do something similar in any other action.
This is, more or less, what DispatchAction (?) was created for. Here
you've duplicated controller logic inside an action, which is really
supposed to be a target of the controller.

So here you are expecting forwards named enter, default, and sort.

 


form name=menu action=$link.setAction(Menu) method=get
 input type=hidden name=action value=menu
   


menu

 


onchange=menu.action.value='enterInfo'
   


$text.get(menuEnter)/label
 


enterInfo

 


onchange=menu.action.value='default'$text.get(menuDefault)/label
   


default

 


onchange=menu.action.value='sort'$text.get(menuSort)/label
   


sort

 


action path=/Menu
  type=actions.MenuAction
  name=menuForm
  scope=request
forward name=enterInfo
 path=/info.vm /
forward name=default
 path=/results.vm /
forward name=sort
 path=/sort.vm /
/action
   

 


Okay, so that looks good.

Have you done a sanity check with a plain 'ol action with a forward to
a JSP like Frank suggested?

Have you put in logging statements to make sure that the action
parameter is what you expect it to be when you hit your action?

Have you been able to get _any_ Velocity file to render, i.e., hit one
without going through Struts? An the related Have you checked on the
Velocity list to make sure you have the VelocityViewServlet set up
properly?

Have you checked the log files for error messages?

Dave



-
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: html:errors does not display

2005-06-13 Thread Vincent

Hi,

Does simple html:errors/ with no property specified works for you ?
Cause I get a similar problem - using same Java code in JSP display the 
fields with errors, but html:errors/ does nothing.


Thanks.

Vincent.

Song Wang wrote:

Hello everyone,

I cannot display html:errors property=blah/, but if I add

%
ActionErrors ae = ( ActionErrors) request.getAttribute( Action.ERROR_KEY);
boolean err = false;
if( ae != null) {
 Iterator iter = ae.properties();
 while(iter.hasNext()){
  System.out.println((String)iter.next());  
 }

}
%

I can see that blah is printed out. That being said, the errors does hold the 
value. Does anyone know where I should configure? Or how to check if the value is an 
empty string? I'm using WSAD 5.1.

Thanks.
Song



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



Re: Having ttruble with actions and buttons

2005-06-13 Thread Michael Jouravlev
On 6/13/05, Paul Goepfert [EMAIL PROTECTED] wrote:
 ok here is what I am talking about.  I have a form that takes in first
 name, last name, street address, city, state and zipcode.  When I press
 on the button to enter that information into a database.  I want the
 page to  reload with clear input fields.
 
 -Paul

So you want to be able to click Save, and you app would:
* pick up values you entered
* store them in database
* respond with the same page, but with cleaned up fields

So, you need web interface for inserting data record by record, with
no stupid messages and intermediate screens. Something like
bookkeeping or banking app. Right?

Have you thought on the following:
* What happens if data is incorrect? (usually redisplay the same page
with error message)
* What happens if a user clicks Refresh browser button?
* What happens if a user clicks Back browser button?
* What if the same data is entered twice? On the same note, where do
you create/assign unique ID to your records? Can you detect that same
data is entered twice, or you want web framework to check this for
you?
* Do you care if a user saw nagging Do you want to resend POSTDATA? message?
* Do you think regular users understand what this message mean? ;)
* Do you want to create new record by duplicating existing one?

If you just started web development, the whole double submit thing
is a huge issue and you will need to address it in some way.

(Option 1)

Basically, if you do not care much for Refresh, Back and Forward
buttons, and you are OK that a user would see POSTDATA message when he
refreshes a page, then you can go with tokens. Struts has built-in
support for tokens. You will need to do this to ensure that same data
is not posted twice. You can use tokens with any data.

You can also ensure that your data is not posted twice by using object
ID. Before server shows a form with empty fields to fill in, it
generates object ID (or database PK) and uses it as hidden field in
the HTML FORM. If a user tries to resubmit the same data, database
would reject it, because it cannot insert data with the same key. But
still, you would see POSTDATA message, if you try to refresh a page.

Well, how many people refresh a dialog page? Apparently, not many. So
you might get away with this simple design. So, to do this:
* read about tokens.
* use action form with request scope.
* Use some flavor of DispatchAction to better structure your code,
using methods as event handlers.

When you receive the request, validate it. If it is not valid,
generate error messages. If you defined input property with the same
JSP name as your input form, Struts will show it for you. If data is
ok, your action class will be called. Store it in the database, then
manually clean fields in the form bean, and forward to your JSP.
That's it.

(Option 2)

If you want something that look more easy on user, and behaves more
robust and professional, but with a little more involvement, you might
use two-phase I/O processing: process data input via POST request,
then redirect, then load result page with GET request. This way a user
would be able to click as many reload buttons as he likes. And data
will be there.

In this case you might want to look at my DialogAction, which I wrote
specifically for cases like this:
http://struts.sourceforge.net/strutsdialogs/dialogaction.html See live
demo, check the source code, it is simple. You might like it.

You would have only one page, so you will need to define one view
mapping in your config file, nothing to code in action class. Then see
login() method. It redisplays the same page on error, and moves to
different page on success. Your case is even simpler, you need to
display the same page anyway. You just need to validate input data. If
it is valid, store it, clean form fields, and forward to
DialogConstants.DIALOG_RELOAD_KEY, which will reload same action. If
data is wrong, stick error message to session, and forward to the same
DialogConstants.DIALOG_RELOAD_KEY, it will show the page with errors.
Cannot be simpler.

Michael.

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



Re: html:text and html:textarea same width

2005-06-13 Thread Dave Newton

Tony Smith wrote:


html:form...
html:text ... size=20
html:textarea... cols=20
/html:form

I want the text and textarea have the same widths. But
it is not true with the above code when displayed in
the browser. 


How can I fix it?
 


CSS?

This isn't a Struts issue, but HTML.

Dave



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



ActionMessages not being displayed!!!

2005-06-13 Thread Harland, David
I am using the following code in an Action

ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE,new
ActionMessage(errors.maxbookingsreached));
saveMessages(request,messages);

And the following in the page this is forwarding to, but the message is
not being displayed. Can anyone tell me why not?

Thanks

Dave.

  logic:messagesPresent
  tr
td width=6%nbsp;/td
td colspan=5 class=style1bean:message
key=errors.problem//td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /trhtml:messages id=error
  tr
td width=6%nbsp;/td
td colspan=5 class=style1font color=redli%= error
%/li/font/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr
  tr
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
tdnbsp;/td
  /tr/html:messages/logic:messagesPresent

This e mail is from DLA Piper Rudnick Gray Cary UK LLP.

The contents of this email and any attachments are confidential to the intended 
recipient. They may not be disclosed to or used by or copied in any way by 
anyone other than the intended recipient. If this email is received in error, 
please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 
quoting the name of the sender and the email address to which it has been sent 
and then delete it.

Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender 
accept any responsibility for viruses and it is your responsibility to scan or 
otherwise check this email and any attachments. 

DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership 
registered in England and Wales (registered number OC307847) which provides 
services from offices in England, Belgium, Germany and the People's Republic of 
China.  A list of members is open for inspection at its registered office and 
principal place of business 3 Noble Street, London EC2V 7EE.  Partner denotes 
member of a limited liability partnership.

DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a 
member of DLA Piper Rudnick Gray Cary, a global legal services organisation, 
the members of which are separate and distinct legal entities.  For further 
information, please refer to www.dlapiper.com.




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



Re: Switching between http and https in struts-config

2005-06-13 Thread Frank W. Zammetti
You can, I believe, have fully-qualified URLs in forward paths... One
thing you might be able to do is have mappings something like:

forward name=non_secured_forward
path=/whatever/jsp/page1.jsp /
forward name=secured_forward
path=/whatever/jsp/page2.jsp /

Then, in your Action, do something  like this:

boolean isSecure = true;
if (isSecure) {
  ActionForward af = mapping.findForward(secured_forward);
  ActionForward af1 = new ActionForward(af);
  af1.setRedirect(true);
  return af1.setPath(https:/ + af.getPath());
} else {
  ActionForward af = mapping.findForward(non_secured_forward);
  ActionForward af1 = new ActionForward(af);
  af1.setRedirect(true);
  return af1.setPath(http:/ + af.getPath());
}

A bit ugly, and probably ripe for making an external utility method
somewhere, but should work I think.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, June 13, 2005 3:44 pm, Dan Tenenbaum said:
 Hi, I'm new to the list.

 I'm working on a webapp where some of the pages should be accessed
 through HTTPS and others through HTTP.

 For example, login and registration need to be secure, but once the
 registration is done and we go to the user home page, we can go back
 to the nonsecure site.

 All pages, secure and nonsecure, are being served by the same Tomcat
 instance.

 I'm wondering about the best way to handle this in the struts config
 file. If you are allowed to put fully qualified URLS in a forward
 path attribute, that could be one solution, but it loses portability
 and that file has to be edited every time we want to deploy the app to
 another machine with another hostname.

 To be more concrete, let's say we go to this page:
 https://mysite.com/appname/login.do

 The action contains multiple forwards, all of which will continue to
 be served by https since we started with an https url. But I want at
 least one of those forwards to return to the nonsecure site. (I also
 want to do the converse).

 Anyone have some ideas on this?
 Thanks

 -
 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: ensuring valid forwards

2005-06-13 Thread Michael Jouravlev
It was discussed, but I could not find a bug in Bugzilla. Yep,
choosing between an exception and blank screen, I would prefer an
exception with forward name.

Michael.

On 6/13/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 Yeah, that seemed a little too easy :)
 
 I would think it should throw an exception... Any Struts devs out there
 have an opinion?  I know someone (I forget who, sorry!) just mentioned
 they added a warning that didn't make it into 1.2.7... A warning is
 good, but I would personally think an exception would be better because
 it's a pretty severe situation that deserves immediate attention (also a
 situation that theoretically would never happen outside development...
 at least, QA procedures better make that true! :) ).
 
 Frank
 
 Dan Tenenbaum wrote:
  On 6/13/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 
 But again, I'm not certain this type of problem will be caught because I'm
 not even sure an exception is thrown in such a case.  If it isn't that
 strikes me as a bug.  Anyone else know for sure?
 
 
 
  I don't think it does throw an exception. I tried putting just the
  findForward() line in a try/catch block and nothing was thrown. Also,
  no stack traces appear in my tomcat log except a broken pipe error
  when trying to render the error page (there is nothing weird in the
  error page itself that would cause this).
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: [fully-OT] File replication between webapps

2005-06-13 Thread Nicolas De Loof


Thanks a lot, I'll take a loot at this ORB.

Nico.

Leon Rosenberg a écrit :

Do you hold the data inmemory or in a file system? 


In later case you'll be just fine with mounting a common share, like NFS
or SMB.
In first case you'd need a software synchronization inbetween, which is
typically solved by a publisher/subscriber pattern. You can use MDB
(message-driven beans, there are enough (open source) solutions
available without an obligatory application server.
Personally I'd prefer an ORB with an EventService like JacORB -
www.jacorb.org.

regards
Leon

P.S. Still you have to build the
say-the-other-one-that-the-data-has-been-updated logic by yourself. But
this is about 5 lines of code, so i don't think you should search for a
tool herefore.



On Mon, 2005-06-13 at 14:06 +0200, Nicolas De Loof wrote:
 


Hi all,

this mail is totaly of topic, so sory sory sory...
... but there is so much java masters on this list !

I have to replicate some datas between two servers running my app (with 
a load balancer, but not using a cluster mode). We are going to build a 
home-made solution, and I wonder if any open-source tool could help me 
on this.
I'm looking for something like a 2 phase commit or rsync Java lib, 
that could be used to assert an update on one server will be 
automagically replicated on the other one.


Thanks.

Nico.

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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


   





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

 



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



RE: Date UI

2005-06-13 Thread Martin Ravell
Yes, I agree Javascript is at times a necessary evil. 

My current strategy is to rely on it as little as possible and only in
situations where is does not form a structural part of the app. If someone
is using a browser without Javascript support or with it turned off I need
to have the app still usable.

I guess that just means I am using it for bells and whistles. A date picker
for example is OK but only if the plain text input is still on the page and
does not depend on the script to work. You of course have to have good
validity checking in the backend whether there is script or not.

To give you some background, my aversion to using Javascript comes from
having been forced to work on an app recently which totally depends upon
Javascript for pretty much everything that is done. Every single link and
form was being handled by generated scripts in each page. The resulting
pages were twice the size of straight HTML, almost unreadable and if you
were not using the right browser and version chances are the whole thing
fell down around you. Nasty! A good example of what not to do for my way of
thinking.

Having had this general dislike of Javascript for a good number of years
however I would like to say that the sophistication of an HTML only
front-end can be pretty damn good. I have some lovely hierarchical trees
(expand and contract branches etc), calendar representations etc that are
completely server based with zero script on the client. It takes a bit of
imagination but you can have a damn nice UI without a lot of JS.


flame-retardant
I'll hold off looking for a new career path just yet.
/flame-retardant



Regards
Marty


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 8 June 2005 2:59 AM
To: Struts Users Mailing List
Subject: Re: Date UI

On 07/06/05 12:55nbsp;Larry Meadors wrote:
I am generally allergic to Javascript which I guess limits what can be
done
with fancy pop-up pickers. Am open to suggestions should there be a nice
robust script out there I guess.
 
 
 flame-retardant
 Get over it. Like it or not, JavaScript is here to stay. Anyone who
 looks at any modern framework (including Struts, JSF, and .net) and
 says Ew, JavaScript... should consider a new career path. Sorry, but
 it is just a fact of life, get used to it.
 /flame-retardant

Yes sure but just make sure you don't make javascript mandatory for the 
user - because surfers will always use browsers (e.g. PDA, linux 
console) that don't do javascript.


-
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: Test whether an application resource is empty

2005-06-13 Thread Laurie Harper

Chris Loschen wrote:

As I understand it, this would return the error only if there are no
messages at all in the application resource, which is not at all likely
in this context. We're testing whether a particular application resource
(that is, a particular key-value pair in the application resource file)
is empty, not the whole file. 


No, it should return the error only if the resource named resource 
string exists. The key is the 'special' property name 'message(foo)', 
which translates into 'messages.getMessage(foo).


For me, if 'foo' is a valid message key I get the body of the 
logic:notEmpty/ tag displayed; if 'foo' is not defined in my resource 
bundle, I don't.



That said, I still didn't get the results I had hoped for with the new
version either, unfortunately. I didn't get any errors, but it returned
true even when the value was empty. For example, when I had an
application resource key set up like so:

module.admin.manageHierarchy.businessStruc.add.directionToUser=


Hmm, I hadn't tried that; I just tested it and it worked for me.


And my JSP code is set up like this:

bean:define id=messages
name=org.apache.struts.action.MESSAGE/
 logic:notEmpty name=messages
property=message(%=directionToUserKey.toString()%)
 div class=modFormBoxbean:message
key=%=directionToUserKey.toString()%//div
 /logic:notEmpty

It returns notEmpty as true, because I get this in the page:

 div class=modFormBox/div

I presume it must be testing that the key exists and is non-zero-length
rather than testing the value. Oh well.


That's odd. Here's a copy/paste of my test, which works as expected:

bean:define id=messages name=org.apache.struts.action.MESSAGE/
logic:notEmpty name=messages property=message(errors.cancel)
ptest 1/p
/logic:notEmpty

bean:define id=messages name=org.apache.struts.action.MESSAGE/
logic:notEmpty name=messages 
property=message(errors.cancel.missing)

ptest 2/p
/logic:notEmpty

% String foo = errors.cancel.missing; %
bean:define id=messages name=org.apache.struts.action.MESSAGE/
logic:notEmpty name=messages property=message(%=foo%)
ptest 3/p
/logic:notEmpty

That gives me a single paragraph, 'test 1'. Works whether 
'errors.cancel.missing' is actually missing, or defined with an empty 
value as in your example.


If it doesn't work for you I'm out of ideas! :-/

L.



Chris

-Original Message-
From: Nitish Kumar [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 13, 2005 12:54 AM

To: 'Struts Users Mailing List'
Subject: RE: Test whether an application resource is empty


bean:define id=messages name=org.apache.struts.action.MESSAGE/

I dont understand some things here, If the application resource is empty
above code would throw this error, Define tag cannot set a null value.


So how does this code helps in checking wether an application resouce is
empty?

Am I missing some thing here? or may be the subject is misleading.. 



Thanks and Regards,
Nitish Kumar
Tavant Technologies Ltd
Bangalore


-Original Message-
From: Laurie Harper [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 12, 2005 6:30 AM
To: user@struts.apache.org
Subject: Re: Test whether an application resource is empty


Doh, I'm an idiot! :-( What I suggested is like trying to call getFoo()
on the resource bundle bean, where 'Foo' is what ever
%=directionToUserKey.toString()% evaluates to. Clearly not what's
needed. The following works for me:

 bean:define id=messages
name=org.apache.struts.action.MESSAGE/
 logic:notEmpty name=messages property=message(errors.cancel)
 pusing Struts bean/logic/p
 /logic:notEmpty

Just replace 'errors.cancel' with '%=directionToUserKey.toString()%' 
and you should be set.


Sorry for the confusion,

L.

Chris Loschen wrote:


Thanks again, Laurie, but for some reason it still returns false every



time, even if there is something under that key.  I'm pretty sure I 
followed your directions exactly:


tiles:useAttribute id=directionToUserKey
name=directionToUserKey scope=request classname=java.lang.String
ignore=true/

logic:present name=org.apache.struts.action.MESSAGE
property=%=directionToUserKey.toString()%
		div class=modFormBoxbean:message 
key=%=directionToUserKey.toString()%//div

/logic:present

Although I did have to pull the key back out of the request in my 
second tile -- do I have to do that here as well? I may have to give 
up for now, since I have it working the other way, but I'm still 
curious what I did wrong.


Chris

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Friday, June 10, 2005 2:49 PM
To: user@struts.apache.org
Subject: Re: Test whether an application resource is empty

You want to use the name of the attribute the resource bundle is 
stored under, not the name of the properties file. You're not 
specifying it in your Struts config so you want the following:


  

Re: Test whether an application resource is empty

2005-06-13 Thread Laurie Harper
What you're missing is the next line of code which performs the test. 
The define just makes the resource bundle available. As long as you have 
at least one message resource bundle defined in struts-config.xml the 
line you quote won't fail.


L.

Nitish Kumar wrote:


bean:define id=messages name=org.apache.struts.action.MESSAGE/

I dont understand some things here, If the application resource is empty
above code would throw this error,
Define tag cannot set a null value. 


So how does this code helps in checking wether an application resouce is
empty?

Am I missing some thing here? or may be the subject is misleading.. 



Thanks and Regards,
Nitish Kumar
Tavant Technologies Ltd
Bangalore


-Original Message-
From: Laurie Harper [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 12, 2005 6:30 AM
To: user@struts.apache.org
Subject: Re: Test whether an application resource is empty


Doh, I'm an idiot! :-( What I suggested is like trying to call getFoo() 
on the resource bundle bean, where 'Foo' is what ever 
%=directionToUserKey.toString()% evaluates to. Clearly not what's 
needed. The following works for me:


 bean:define id=messages name=org.apache.struts.action.MESSAGE/
 logic:notEmpty name=messages property=message(errors.cancel)
 pusing Struts bean/logic/p
 /logic:notEmpty

Just replace 'errors.cancel' with '%=directionToUserKey.toString()%' 
and you should be set.


Sorry for the confusion,

L.

Chris Loschen wrote:


Thanks again, Laurie, but for some reason it still returns false every
time, even if there is something under that key.  I'm pretty sure I
followed your directions exactly:

tiles:useAttribute id=directionToUserKey
name=directionToUserKey scope=request classname=java.lang.String
ignore=true/

logic:present name=org.apache.struts.action.MESSAGE
property=%=directionToUserKey.toString()%
div class=modFormBoxbean:message
key=%=directionToUserKey.toString()%//div
/logic:present

Although I did have to pull the key back out of the request in my second
tile -- do I have to do that here as well? I may have to give up for
now, since I have it working the other way, but I'm still curious what I
did wrong.

Chris 


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Friday, June 10, 2005 2:49 PM
To: user@struts.apache.org
Subject: Re: Test whether an application resource is empty

You want to use the name of the attribute the resource bundle is stored
under, not the name of the properties file. You're not specifying it in
your Struts config so you want the following:

  logic:present name=org.apache.struts.action.MESSAGE
  property=%=directionToUserKey.toString()%
div class=modFormBox.../div
  /logic:present

L.

Chris Loschen wrote:



Thanks Laurie,

I tried to set it up this way, but wasn't able to make it work. My 
struts-config file defines the message-resources parameter like so:


message-resources parameter=ApplicationResources
null=false/

So I tried putting that in, and also tried some variants like 
org.apache.struts.ApplicationResources and 
org.apache.struts.util.MessageResources in code like this:


tiles:useAttribute id=directionToUserKey
name=directionToUserKey scope=request classname=java.lang.String
ignore=true/

logic:present name=ApplicationResources
property=%=directionToUserKey.toString()%
		div class=modFormBoxbean:message 
key=%=directionToUserKey.toString()%//div

/logic:present

But it always returned false, even if there was a value for the key, 
so I apparently set up something wrong.


I did get it working using the alternate path, however -- I set up a 
new tile in the tiles-defs file which was defined as a zero-length 
file in the default case and a small JSP for those cases where I had


directions.



The calling JSP looks like this:

tiles:useAttribute id=directionToUserKey
name=directionToUserKey scope=request classname=java.lang.String
ignore=true/

!-- Next is the inserted tile --
tiles:insert attribute=directionToUserTile/

And the inserted tile (when I insert a non-zero-length file) looks 
like

this:

%
String directionsKey = (String)
request.getAttribute(directionToUserKey);
%

div class=modFormBoxbean:message key=%=directionsKey%//div

That is working ok, though of course I don't have the flexibility of 
having a value for some locales and no value for other locales. That's




not terribly important.

By the way, just for my own learning: I initially tried to put the 
attribute in page scope, but I kept getting a null value: is page 
scope specific to a particular JSP (I would have thought that was tile



scope...), or should it be available throughout the sub-elements of a 
given page? It works when I use request scope instead, but is that 
what is required here?


Thanks again for everyone's help!

Chris Loschen

-Original Message-
From: 

Wildcard action paths

2005-06-13 Thread Laurie Harper

I didn't get any response to this last time so I'm asking again... :-)

I'd like to replace URLs like this:

  /Sections/Subsections/?section=Section1subsection=SubSection1

with URLs like this:

  /Sections/Section1/Subsections/Subsection1

An action mapping like this will match that URL:

  action path=/Sections/*/Subsections/*
  type=org.apache.struts.actions.ForwardAction
  parameter=.tiles.mytile/

The problem is, there's then no way to get what the wildcards matched in 
the view (JSP). For reasons discussed elsewhere I don't want to put a 
different action in front of each view, so I need a more general solution.


I'd like to sub-class ForwardAction and put the wildcard matches from 
the URL into a map which can then go into request context. But how can I 
pass the matches *into* the action? I can't user the 'parameter' 
attribute since it's already used to specify where to forward to.


I thought about this:

  action path=/Sections/*/Subsections/*
  type=org.apache.struts.actions.ForwardAction
  parameter=.tiles.mytile
set-property property=extraInfo
  value=section={1},subsection={2}/
  /action

But the wildcard URL matching stops working if I do that and anyway I 
don't think dereferencing the matches would work in that context.


So, any other suggestions? The only thing I can think of right now is 
overloading 'parameter', something like


  parameter=.tiles.mytile;section={1},subsection={2}

and doing the necessary fixup in my action class. Can anyone suggest 
anything better?


L.


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



Re: Wildcard action paths

2005-06-13 Thread Van
Sorry about the typo,  I was referring to HttpServletRequest below. -Van

On 6/13/05, Van [EMAIL PROTECTED] wrote:
 On 6/13/05, Laurie Harper [EMAIL PROTECTED] wrote:
  I'd like to replace URLs like this:
 
/Sections/Subsections/?section=Section1subsection=SubSection1
 
  with URLs like this:
 
/Sections/Section1/Subsections/Subsection1
 
  An action mapping like this will match that URL:
 
action path=/Sections/*/Subsections/*
type=org.apache.struts.actions.ForwardAction
parameter=.tiles.mytile/
 
  The problem is, there's then no way to get what the wildcards matched in
  the view (JSP). For reasons discussed elsewhere I don't want to put a
  different action in front of each view, so I need a more general solution.
 
 This seems so obvious to me that I'm probably missing something about
 your requirements. Why can't you access the
 HttpServleRequest.getRequestURI() method and then process the returned
 URI string in your subclass of the Struts ForwardAction? The execute
 method for an Action class gets the incoming request object as one of
 the parameters. Your subclass can process the URI for the section and
 subsection values and set them as request attributes. For that matter,
 the request object is available to your JSP pages as well:
 
  http://tinyurl.com/9jn4d
 
 Of course, you would have to write scriptlet logic or define a JSP
 custom tag to encapsulate the logic to parse for the
 section/subsection values in order to handle it directly in the JSPs.
 All easily doable though. I'm just not seeing what the problem is
 here.
 
 -Van
 
 --
 - Mike Van Riper
  [EMAIL PROTECTED]
 


-- 
- Mike Van Riper
  [EMAIL PROTECTED]

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



Re: Wildcard action paths

2005-06-13 Thread Van
On 6/13/05, Laurie Harper [EMAIL PROTECTED] wrote:
 I'd like to replace URLs like this:
 
   /Sections/Subsections/?section=Section1subsection=SubSection1
 
 with URLs like this:
 
   /Sections/Section1/Subsections/Subsection1
 
 An action mapping like this will match that URL:
 
   action path=/Sections/*/Subsections/*
   type=org.apache.struts.actions.ForwardAction
   parameter=.tiles.mytile/
 
 The problem is, there's then no way to get what the wildcards matched in
 the view (JSP). For reasons discussed elsewhere I don't want to put a
 different action in front of each view, so I need a more general solution.

This seems so obvious to me that I'm probably missing something about
your requirements. Why can't you access the
HttpServleRequest.getRequestURI() method and then process the returned
URI string in your subclass of the Struts ForwardAction? The execute
method for an Action class gets the incoming request object as one of
the parameters. Your subclass can process the URI for the section and
subsection values and set them as request attributes. For that matter,
the request object is available to your JSP pages as well:

  http://tinyurl.com/9jn4d

Of course, you would have to write scriptlet logic or define a JSP
custom tag to encapsulate the logic to parse for the
section/subsection values in order to handle it directly in the JSPs.
All easily doable though. I'm just not seeing what the problem is
here.

-Van

-- 
- Mike Van Riper
  [EMAIL PROTECTED]

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



Re: Confused

2005-06-13 Thread Pierre Thibault

Yes, I want to use Beans.

Do you mean that I can use servlets, JSP and taglibs without J2EE?

Le 13 juin 2005 à 16:42, Dave Newton a écrit :


Pierre Thibault wrote:


There are talking about Tomcat but not about JBoss. I'll continue   
with JBoss because I want to access J2EE.




I think you might be confused about what J2EE is. If you need  
EJBs, then yeah, JBoss would be one way to go. If you don't,  
there's a lot of other parts of J2EE, like servlets, JSP, taglibs,  
etc..


Dave





RE: Themes

2005-06-13 Thread David G. Friedman
Martin,

Have you looked at any of these?

a) Tiles
http://struts.apache.org
b) SiteMesh:
http://www.opensymphony.com/sitemesh
c) XKins:
http://xkins.sourceforge.net/

Regards,
David

-Original Message-
From: Martin Ravell [mailto:[EMAIL PROTECTED]
Sent: Monday, June 13, 2005 8:22 PM
To: Struts User Mailing List
Subject: Themes

I have a requirement to build a 'Themes' (think 'skins') capability into the
UI of my Struts app and would just like to poll the list for ideas on the
best way to approach such a mechanism. Multiple customers use the same app
but they need to be presented with a view that meets their specific
requirements. For example graphics, fonts and even layout would be specific
to the user's login (actually their company/organization which is stored in
the database).

Now, for ease of use I guess something relying on CSS would be a way to go.
Since I already use stylesheets for most HTML elements specifying a
particular theme's stylesheet would not be hard.

The tricky part is that I'd also like to be able to specify different jsp
pages (mainly for Tiles layouts) in case I need to modify the layout beyond
what is easy to do with CSS. Ultimately I may well have functionality in the
app itself that is specific to a given customer so this concept should deal
with handling customisation to that level well.

Ideally I'd like to have a concept of an 'alternate source' directory that
is used by the app to load it's jsp. i.e. the app first looks under the
appropriate alternate directory for a jsp and uses the page it finds there
if it exists but falls back to the standard jsp dir if there is no
alternate. This would mean that I could create a theme with only those pages
that need to be modified rather than copying and modifying the entire jsp
source tree.

If anyone has had to implement something along these lines I'd love to hear
from you. What sort of mechanisms have you found work well within the
structure of a Struts app? My architecture is Struts, Tiles, Spring and
Hibernate if you are interested but I'm thinking that it's the Struts area
that I'll be looking at mostly for this job.

Are there any Struts sub-projects that touch on this sort of thing?


Regards

Marty



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



Re: Can struts-1.1 support multiple configurations and multiple resources

2005-06-13 Thread Manfred Wolff


--Venkat

Thats the trick. If you set null to false, than *if* a error message is not 
found, the struts framework prints the language and the key, that is not found. 
So it says: You have an error here. So you have an other mistake. It is good 
practice to set null to false in all ressurce bundles, so you can see if 
anything is wrong.


-Manfred

Venkat Reddy Valluri wrote:


Hi Manfred,
  I have given null=false  for my main module struts config file and still 
the error message is not displayed

instead it is just dipaying like below
  en.us.error.user.user_name.required. (It is just displaying property 
but not value)

Thank you very much

--Venkat

 




-Original Message-
From:   Manfred Wolff [mailto:[EMAIL PROTECTED]
Sent:   Mon 6/13/2005 1:47 PM
To: Struts Users Mailing List
Cc: 
Subject:Re: Can struts-1.1 support multiple configurations and multiple 
resources
Venkat

I think you don't have to deal with suffixes (like sub) because struts 
itsselfs concatinate the module in the key, stored into the session. I 
have a little example written for my struts book (only in german) that 
deals with multiple struts config files. You may download it under


http://struts-ge-packt.de/download/code.zip

Because it is no maven project it comes with a lot of libraries.

1st Struts config: (struts-config.xml)
message-resources parameter=MessageResources null=false /

2nd Struts config with Module (struts-modul-confix.xml)
message-resources parameter=MessageModulResources /

It is a struts 1.2 application but the module support is fine in 1.1

-Manfred

Venkat Reddy Valluri wrote:

 


Hi  Manfred,
   Thank you very much for responding immediately. I ended up multiple  struts config files successfully. But the thing is when I tried to use separate resources for each struts config file using bundle parametre,  It seems not to be working.  


Here is my struts configurations

In my main module struts config file
I included below one
struts-main.xml---
   message-resources
  parameter=com.main.examp.ApplicationResources/


In my sub module struts config file

I included below one
struts-sub.xml---
 message-resources
  parameter=com.sub.examp.SubResources key=sub
/message-resources

SubResources.properties
error.user.user_name.required=UserName is required

Here in my sub module
 
SubEditActionForm.java---


In validate method I have given like this

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

  if (user_name == null || user_name.length() == 0) {
  errors.add(user_name, new  
ActionError(error.user.user_name.required));
  }
 return errors;
}
   
But here the error messgae UserName is required  is not able to be displyed on screen  when I submit the page with out entering user_name


  So I thought of passing buddle  attribute sub  which is used struts-sub.xml 
 to ActionError class
(
message-resources
  parameter=com.sub.examp.SubResources key=sub
/message-resources)

 But there is no option to pass that attribute in ActionError or ActionMessage 
class

  SO here where I struck 


Can you please  throw some light on this

Thanks in advace

--Venkat



 






 
-Original Message-

From:   Manfred Wolff [mailto:[EMAIL PROTECTED]
Sent:   Mon 6/13/2005 10:00 AM
To: Struts Users Mailing List
Cc: 
Subject:Re: Can struts-1.1 support multiple configurations and multiple 
resources

Yes it can with multiple module support.

http://struts.apache.org/userGuide/configuration.html#dd_config_modules

Manfred

Venkat Reddy Valluri wrote:



   


Hi

Can struts-1.1 support multiple configurations and multiple resources. Can some 
body please throw some light on this. I need it very urgent

Thanks in advance

--Venkat





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




--
===
Dipl.-Inf. Manfred Wolff
---
phone neusta  : +49 421 20696-0
fax neusta: +49 421 20696-99
phone private : +49 421 534522
eFax  : +49 1212 6 62663 96533
---

Diese E-Mail enthlt mglicherweise vertrauliche und/oder rechtlich geschtzte 
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtmlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.