Formatting numbers in text field

2006-12-05 Thread chamal desilva
Hi,

Is there a way display numbers in a text field in a
formatted way.

For example I want to display 100 as 1,000 in a text
field.

My form field attribute type is Double.


Thanking You,
Chamal.


 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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



RE: Map backed properties

2006-12-05 Thread Gundersen, Richard
Hi

Thanks for replying. I have tried that actually and it didn't work. In
fact that particular example wont work for me unfortunately because my
property isn't part of a map inside a DynaActionForm - it's just a
normal member variable of a class that extends ActionForm. 

I don't think the problem is getting hold of the values - they are there
and I can write scriptlets to extract them. I think the problem is that
EL isn't capable of accessing these types of properties. But, I could be
wrong (I hope so because I hate having scriptlets in my JSPs)

Thanks

Richard

-Original Message-
From: Strachan, Paul [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 11:23 PM
To: Struts Users Mailing List
Subject: RE: Map backed properties

try something like:

c:if test=${formname.map.checklistItemNoteIds[120] == 7}
...
/c:if


-Original Message-
From: Gundersen, Richard [mailto:[EMAIL PROTECTED] 
Sent: Monday, 4 December 2006 11:00 PM
To: user@struts.apache.org
Subject: Map backed properties

Hi

 

I've been happily working with map based properties in my forms for a
while now, but I've come across something that I really can't figure
out. 

 

I started off with a DynaValidatorForm, and in the mapping, I had this:

 

form-property name=checklistItemNoteIds type=java.util.HashMap/

 

I was able to use this nicely, by populating it in the action class, and
storing it as a hidden field in my JSP like so:

 

html:hidden property=checklistItemNoteIds(${checklistItem.id})/

 

That results in a nice: input type=hidden
name=checklistItemNoteIds(120) value=7

 

But, I need to access the value of the property now to do some extra
processing, something along the lines of

 

c:if test=${checklistItemNoteIds(120) == 7})

// do this

/c:if

 

And it doesn't work. I've even made my own concrete ActionForm class
with these kinds of methods:

 

public Object getChecklistItemNoteId(String key) {

return checklistItemNoteIds.get(key);

}

 

With no success. Has anyone got this working? 

 

Thanks

 

Richard


*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use
of the addressee. It may contain private and confidential information.
The information, attachments and opinions contained in this E-mail are
those of its author only and do not necessarily represent those of
London Scottish Bank PLC or any other members of the London Scottish
Group. 

If you are not the intended addressee, you are prohibited from any
disclosure, distribution or further copying or use of this communication
or the information in it or taking any action in reliance on it. If you
have received this communication in error please notify the Information
Security Manager at [EMAIL PROTECTED] as soon as possible and
delete the message from all places in your computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security
of electronic communications and you are advised to check any
attachments for viruses. We do not accept liability for any loss
resulting from any corruption or alteration of data or importation of
any virus as a result of receiving this electronic communication. 

Replies to this E-mail may be monitored for operational or business
reasons. London Scottish Bank PLC is regulated by the Financial Services
Authority.
__
This email has been scanned by the MessageLabs Email Security System.
**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

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


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

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the 
addressee. It may contain private and confidential information. The 
information, attachments and opinions contained in this E-mail are those of its 
author only and do not necessarily represent those of London Scottish Bank PLC 
or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, 
distribution or further copying or use of this communication or the information 
in it or taking any action in reliance on it. If you have received this 
communication in error please notify the Information Security Manager at 

RE: Formatting numbers in text field

2006-12-05 Thread Gundersen, Richard
If you are using an ActionForm, you could modify your getter to do the
formatting. Or, have an additional getter method e.g. 

Double amount;

Double getAmount() {
// bog standard method
}
String getFormattedAmount() {
// do some formatting
}

Then, in the form, do something like html:text
property=formattedAmount/

You can manipulate the setters in a similar way to accept the formatted
text submitted by the form.

There are probably other ways for dealing with the same problem in
DynaActionForms that I don't know of.

Hope this helps

Richard

-Original Message-
From: chamal desilva [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 05, 2006 8:52 AM
To: user@struts.apache.org
Subject: Formatting numbers in text field

Hi,

Is there a way display numbers in a text field in a
formatted way.

For example I want to display 100 as 1,000 in a text
field.

My form field attribute type is Double.


Thanking You,
Chamal.


 


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


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

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the 
addressee. It may contain private and confidential information. The 
information, attachments and opinions contained in this E-mail are those of its 
author only and do not necessarily represent those of London Scottish Bank PLC 
or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, 
distribution or further copying or use of this communication or the information 
in it or taking any action in reliance on it. If you have received this 
communication in error please notify the Information Security Manager at [EMAIL 
PROTECTED] as soon as possible and delete the message from all places in your 
computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of 
electronic communications and you are advised to check any attachments for 
viruses. We do not accept liability for any loss resulting from any corruption 
or alteration of data or importation of any virus as a result of receiving this 
electronic communication. 

Replies to this E-mail may be monitored for operational or business reasons. 
London Scottish Bank PLC is regulated by the Financial Services Authority.
__
This email has been scanned by the MessageLabs Email Security System.

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



Re: more than one parameter in a link

2006-12-05 Thread Mikolaj Rydzewski

Pierre Goupil wrote:

http://localhost/myApp/myAction.do?type=2id=12

Of course, I could use a Map from my bean. But the problem is that, in my
case, the bean have no way to know which value to give to the JSP : 
it's the

JSP and it only who knows the values...

jsp:useBean id=map class=java.util.HashMap /
c:set target=${map} property=key1 value=value1/
c:set target=${map} property=key2 value=value2/
html:link action=/action name=maplink/html:link

--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Query

2006-12-05 Thread Jagaran Das

Hi all,



How to install a simple application in Struts?

I am new to this field.

Please let me know what is good way to start exploring STRUTS.



Thanks in Advance

Jagaran





 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

NEW t oStruts

2006-12-05 Thread Jagaran Bubai Das
Hi,
  Please let me know what is right point to start off with Struts.
  Please point me to a good tutorial to start off.
   
  Thanks in Advance
  Jagaran 


-
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

more than one parameter in a link

2006-12-05 Thread Pierre Goupil

Hi again !

Yes, of course, but it seems that doign things this way, you loose all other
parameters of the request like, in particular, the jsessionid. Am I right or
wrong ? If right, is there a workaround ?

Regards,

Pierre




eg:

c:url=myAction.do var=myLink
c:param name=type value=${user.value}/
c:param name=id value=${ user.id}/
/c:url

a href='c:out  vaue=${myLink}/'My Link/a

Thanks,

Nuwan
--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.


Re: more than one parameter in a link

2006-12-05 Thread Mikolaj Rydzewski

Pierre Goupil wrote:
Yes, of course, but it seems that doign things this way, you loose all 
other
parameters of the request like, in particular, the jsessionid. Am I 
right or

wrong ?
Wrong. c:url rewrites url if necessary. Unfortunately it's not xhtml 
aware and will produce  as param separator instead of amp;



--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: more than one parameter in a link

2006-12-05 Thread Nuwan Chandrasoma

Hi,

This is something to do with url rewriteing and how the session is handleing 
happens on your server.., c:url tag will do the proper url re-writeing 
according to my understanding.. so i dont think there would be any issue in 
that, i am not sure plese try it and see..


Regards,

Nuwan
- Original Message - 
From: Pierre Goupil [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Tuesday, December 05, 2006 9:39 AM
Subject: more than one parameter in a link



Hi again !

Yes, of course, but it seems that doign things this way, you loose all 
other
parameters of the request like, in particular, the jsessionid. Am I right 
or

wrong ? If right, is there a workaround ?

Regards,

Pierre




eg:

c:url=myAction.do var=myLink
c:param name=type value=${user.value}/
c:param name=id value=${ user.id}/
/c:url

a href='c:out  vaue=${myLink}/'My Link/a

Thanks,

Nuwan
--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.




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



RE: Query

2006-12-05 Thread Narayanaswamy, Mohan

First download the struts from http://struts.apache.org/downloads.html
and play with the sample programs.

-Original Message-
From: Jagaran Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 5:04 PM
To: user@struts.apache.org
Subject: Query


Hi all,




How to install a simple application in Struts?

I am new to this field.

Please let me know what is good way to start exploring STRUTS.





Thanks in Advance

Jagaran







 CAUTION - Disclaimer * This e-mail
contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the
use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further,
you are not to copy, disclose, or distribute this e-mail or its contents
to any other person and any such actions are unlawful. This e-mail may
contain viruses. Infosys has taken every reasonable precaution to
minimize this risk, but is not liable for any damage you may sustain as
a result of any virus in this e-mail. You should carry out your own
virus checks before opening the e-mail or attachment. Infosys reserves
the right to monitor and review the content of all messages sent to or
from this e-mail address. Messages sent to or from this e-mail address
may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***
This email is confidential. If you are not the addressee tell the sender 
immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer 
errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries (SCGroup) 
do not accept liability for
damage caused by this email and may monitor email traffic.


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



RE: NEW t oStruts

2006-12-05 Thread Narayanaswamy, Mohan

First download the struts from http://struts.apache.org/downloads.html
and play with the sample programs.

-Original Message-
From: Jagaran Bubai Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 5:38 PM
To: user@struts.apache.org
Subject: NEW t oStruts

Hi,
  Please let me know what is right point to start off with Struts.
  Please point me to a good tutorial to start off.

  Thanks in Advance
  Jagaran


-
 Find out what India is talking about on  - Yahoo! Answers India  Send
FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it
NOW
This email is confidential. If you are not the addressee tell the sender 
immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer 
errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries (SCGroup) 
do not accept liability for
damage caused by this email and may monitor email traffic.


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



RE: Cannot create JDBC driver of class '' for connect URL 'null'

2006-12-05 Thread Krishna, Hari \(FTT-CInternet\)
Hi Chandra How are uu and how is ur life?
   May i know what Open Source Technologies u are using now?

With Best Regards,
I.Hari krishna.
--
Franklin Templeton Investments(FTT-CInternet)
+91- 44 - 24407000 Extn:17123
--



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, December 04, 2006 1:34 PM
To: user@struts.apache.org
Subject: RE: Cannot create JDBC driver of class '' for connect URL
'null'


Did you check
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml - examples

Chandra

 

-Original Message-
From: nagesh.kumar [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 9:43 AM
To: Struts Users Mailing List
Subject: Cannot create JDBC driver of class '' for connect URL 'null'

Hi iam working on jakarta-tomcat-5.5.9

iam trying to read DATASOuRCE configured from the server.xml  as defined
in the http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

But iam getting this same error message on console iam strucked please
help me Thanks in ADVANCE.

DEBUG  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class '' for connect URL 'null'



Context path=/myapp docBase=myapp
debug=5 reloadable=true crossContext=true


debug=5 reloadable=true crossContext=true

Resource name=jdbc/ORAdb auth=Container
  type=javax.sql.DataSource/

ResourceParams name=jdbc/ORAdb
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
...

/ResourceParams

Thanks
Nagesh




-
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]
Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

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



RE: Cannot create JDBC driver of class '' for connect URL 'null'

2006-12-05 Thread nagesh.kumar
org.apache.commons.dbcp.BasicDataSourceFactory   we are using JNDI data
source and  it is configured  in server.xml  file

in web.xml; we have configured  as


resource-ref
 descriptionOracle Datasource /description
 res-ref-namejdbc/ORA_IPRICE/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
/resource-ref
display-nameApache-Axis/display-name
..

thanka
Nagesh


-Original Message-
From: Krishna, Hari (FTT-CInternet) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 4:16 PM
To: Struts Users Mailing List
Subject: RE: Cannot create JDBC driver of class '' for connect URL
'null'


Hi Chandra How are uu and how is ur life?
   May i know what Open Source Technologies u are using now?

With Best Regards,
I.Hari krishna.
--
Franklin Templeton Investments(FTT-CInternet)
+91- 44 - 24407000 Extn:17123
--



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, December 04, 2006 1:34 PM
To: user@struts.apache.org
Subject: RE: Cannot create JDBC driver of class '' for connect URL
'null'


Did you check
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml - examples

Chandra



-Original Message-
From: nagesh.kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, December 04, 2006 9:43 AM
To: Struts Users Mailing List
Subject: Cannot create JDBC driver of class '' for connect URL 'null'

Hi iam working on jakarta-tomcat-5.5.9

iam trying to read DATASOuRCE configured from the server.xml  as defined
in the http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

But iam getting this same error message on console iam strucked please
help me Thanks in ADVANCE.

DEBUG  org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class '' for connect URL 'null'



Context path=/myapp docBase=myapp
debug=5 reloadable=true crossContext=true


debug=5 reloadable=true crossContext=true

Resource name=jdbc/ORAdb auth=Container
  type=javax.sql.DataSource/

ResourceParams name=jdbc/ORAdb
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
...

/ResourceParams

Thanks
Nagesh




-
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]
Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

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

2006-12-05 Thread Jagaran Bubai Das
I hav done that...
  but how to install and run the sample application i am not clear..
  it would be great if could get some simple steps and some simple application 

Narayanaswamy, Mohan [EMAIL PROTECTED] wrote:
  
First download the struts from http://struts.apache.org/downloads.html
and play with the sample programs.

-Original Message-
From: Jagaran Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 5:04 PM
To: user@struts.apache.org
Subject: Query


Hi all,




How to install a simple application in Struts?

I am new to this field.

Please let me know what is good way to start exploring STRUTS.





Thanks in Advance

Jagaran







 CAUTION - Disclaimer * This e-mail
contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the
use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further,
you are not to copy, disclose, or distribute this e-mail or its contents
to any other person and any such actions are unlawful. This e-mail may
contain viruses. Infosys has taken every reasonable precaution to
minimize this risk, but is not liable for any damage you may sustain as
a result of any virus in this e-mail. You should carry out your own
virus checks before opening the e-mail or attachment. Infosys reserves
the right to monitor and review the content of all messages sent to or
from this e-mail address. Messages sent to or from this e-mail address
may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***
This email is confidential. If you are not the addressee tell the sender 
immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer 
errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries (SCGroup) 
do not accept liability for
damage caused by this email and may monitor email traffic.


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




-
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

validation

2006-12-05 Thread Juan Espinosa
Hi i have a question about validators (struts2), i was using fileld
validator, and when i have an error (filling some filed) the error appears
on top of the input box, now i change to visitor validator and the erros all
appear in the top of the page.
Anyone knows why is happening this, only changing the type of validator
changes the rendering of the erros ???
 
Thanks to all
 
Regards,
Juan

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.7/569 - Release Date: 05/12/2006
03:00 a.m.
 


Detailed TagDocs download ?

2006-12-05 Thread Sakari Isoniemi

Where detailed tag desc ( http://struts.apache.org/2.x/tagreference.html )
can be downloaded ?
 
I didn't found this information from struts-2.0.1-docs.zip   (2006-11-06)
 



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



working with radio buttons with html tags.

2006-12-05 Thread Anil Kumar T

Hi All,



Am trying to display a radio button according to the value in the
database.

The way am trying is ...

  logic:equal property=realStatus
value=%=TIMKeys.ACT_FLAG%

html:radio property=realStatus
value=A checked=true/%=TIMKeys.IM_ACTIVE_STATUS%

html:radio property=realStatus
value=D /%=TIMKeys.IM_INACTIVE_STATUS%

  /logic:equal   



But the IDE shows the below msg during compilation.

JspTranslate: Attribute selected invalid according to the specified TLD.




Can any body help me how to rectify this.? Any links would be helpful..

Anil.



Information transmitted by this e-mail is proprietary to Infinite Computer 
Solutions and / or its Customers and is intended for use only by the individual 
or the entity to which it is addressed, and may contain information that is 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
notify us immediately at [EMAIL PROTECTED] and delete this email from your 
records.

[S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread Dave Newton
Howdy,

Is it possible to split up tile definition files using the startup
listener under S2?

Thanks,
Dave


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



Re: Query

2006-12-05 Thread Ed Griebel

Start here, it doesn't get much clearer than this, and google for
unfamiliar terms: http://www.learntechnology.net/struts-lesson-1.do

On 12/5/06, Jagaran Bubai Das [EMAIL PROTECTED] wrote:

I hav done that...
  but how to install and run the sample application i am not clear..
  it would be great if could get some simple steps and some simple application

Narayanaswamy, Mohan [EMAIL PROTECTED] wrote:

First download the struts from http://struts.apache.org/downloads.html
and play with the sample programs.

-Original Message-
From: Jagaran Das [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 5:04 PM
To: user@struts.apache.org
Subject: Query


Hi all,




How to install a simple application in Struts?

I am new to this field.

Please let me know what is good way to start exploring STRUTS.





Thanks in Advance

Jagaran







 CAUTION - Disclaimer * This e-mail
contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the
use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further,
you are not to copy, disclose, or distribute this e-mail or its contents
to any other person and any such actions are unlawful. This e-mail may
contain viruses. Infosys has taken every reasonable precaution to
minimize this risk, but is not liable for any damage you may sustain as
a result of any virus in this e-mail. You should carry out your own
virus checks before opening the e-mail or attachment. Infosys reserves
the right to monitor and review the content of all messages sent to or
from this e-mail address. Messages sent to or from this e-mail address
may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***
This email is confidential. If you are not the addressee tell the sender 
immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer 
errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries (SCGroup) 
do not accept liability for
damage caused by this email and may monitor email traffic.


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




-
 Find out what India is talking about on  - Yahoo! Answers India
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW



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



Re: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread David H. DeWolf
Yes, the context init parameter org.apache.tiles.DEFINITION_CONFIG takes 
a comma separated list of files/resources.


Are you having issues with it or just couldn't find the documentation 
for it?  Either way, enter a bug for it in jira so that we can get it 
resolved (even if it's a documentation problem).



David

Dave Newton wrote:

Howdy,

Is it possible to split up tile definition files using the startup
listener under S2?

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



[OT] Re: Tiles 2 - How to dispatch to tiles servlet????

2006-12-05 Thread Antonio Petrelli

David H. DeWolf ha scritto:
Just to avoid confusion, I don't think Antonio meant to imply that the 
Container.render returns a ComponentContext.


Err... right, my confusion was due to wrong cut'n'paste :-)
And the confusion continues, since I posted the same email to Struts 
Developers list...

AND IT'S ONLY TUESDAY! :-P

Antonio

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



[Tiles] Defining insert points in derived definitions

2006-12-05 Thread Jean-Baptiste Lièvremont

Hi folks,

I am using Tiles with Struts 1.2.9. I have a 'standard' JSP defining
the global layout used by all pages, as in the snippets below:

#

* File: /WEB-INF/tiles-defs.xml

tiles-definitions

 definition name=standard path=/WEB-INF/tiles/standard.jsp
   put name=jsphead  content=/WEB-INF/tiles/standard/jsphead.jsp/
   put name=htmlhead content=/WEB-INF/tiles/standard/htmlhead.jsp/
   put name=titlecontent=/WEB-INF/tiles/standard/title.jsp/
   put name=content  content=/WEB-INF/tiles/standard/content.jsp/
   put name=footer   content=/WEB-INF/tiles/standard/footer.jsp/
 /definition

 definition name=default extends=standard
   put name=content content=/WEB-INF/tiles/default/content.jsp/
 /definition

 !-- Other definitions extending standard... --

/tiles-definition

#

* File: /WEB-INF/tiles/standard.jsp

?xml version=1.0 encoding=UTF-8?
jsp:root version= 1.2
   xmlns=http://www.w3.org/1999/xhtml;
   xmlns:jsp=http://java.sun.com/JSP/Page;
   xmlns:html=/tags/struts-html
   xmlns:bean=/tags/struts-bean
   xmlns:tiles=/tags/struts-tiles

   tiles:insert attribute=jsphead /
   html:html xhtml=false
   tiles:insert attribute=htmlhead /
   body
   tiles:insert attribute=title /
   tiles:insert attribute=content /
   tiles:insert attribute=footer /
   /body
   /html:html

/jsp:root

#


Now, I would like to have a definition that extends 'standard' while
defining new entry points. I have tried using the following approach:


#

* File: /WEB-INF/tiles-defs.xml

 definition name=multiPane extends=standard
   put name=content content=/WEB-INF/tiles/multiPane/content.jsp/
   putList name=pgList
 add value=/WEB-INF/tiles/multiPane/blank.jsp/
   /putList
 /definition

 definition name=test extends=multiPane
   putList name=pgList
 add value=/WEB-INF/tiles/test/page1.jsp/
 add value=/WEB-INF/tiles/test/page2.jsp/
   /putList
 /definition

File: /WEB-INF/tiles/multiPane/content.jsp

?xml version=1.0 encoding=UTF-8?
jsp:root version=1.2
 xmlns=http://www.w3.org/1999/xhtml;
 xmlns:jsp=http://java.sun.com/JSP/Page;
 xmlns:html=/tags/struts-html
 xmlns:tiles=/tags/struts-tiles
 xmlns:logic=/tags/struts-logic
 xmlns:bean=/tags/struts-bean

html:xhtml/

div id=content

 tiles:useAttribute name=pgList id=pgList classname=java.util.List/

 logic:iterate name=pgList id=pg
   tiles:insert flush=false
 jsp:attribute name=pagebean:write name=pg//jsp:attribute
   /tiles:insert
 /logic:iterate

/div

/jsp:root

#

* File: /test/index.jsp

%@ page contentType=text/html pageEncoding=UTF-8 %
%@ taglib prefix=tiles uri=/tags/struts-tiles %

tiles:insert definition=test/

#

In my understanding of how Tiles work, this should insert into the
index.jsp page the result of the evaluation of content.jsp, iterating
through the list provided in the tiles-defs.xml to output each tab's
content.

However, when running the above code, I end up with the following trace:

#

javax.servlet.jsp.JspException: Error - tag useAttribute : attribute
'pgList' not found in context. Check tag syntax
   at 
org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:182)
   at 
org.apache.jsp.WEB_002dINF.tiles.multiPane.content_jsp._jspService(content_jsp.java:83)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
...

#

What am I doing wrong here ? Is there a way to get this working ? For
the moment, the only way I have to get the expected result, is having
every page define the raw list in its 'content' tile using
tiles:insert page=.../ , which induces heavily duplicated code.

Thanks in advance,
J.B Lièvremont


RV: validation

2006-12-05 Thread Juan Espinosa
Hi i have a question about validators (struts2), i was using fileld
validator, and when i have an error (filling some filed) the error appears
on top of the input box, now i change to visitor validator and the erros all
appear in the top of the page.
Anyone knows why is happening this, only changing the type of validator
changes the rendering of the erros ???
 
Thanks to all
 
Regards,
Juan

 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.7/569 - Release Date: 05/12/2006
03:00 a.m.
 


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



RE: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread Dave Newton
 Yes, the context init parameter org.apache.tiles.DEFINITION_CONFIG
 takes a comma separated list of files/resources.
 
 Are you having issues with it or just couldn't find the documentation
 for it?  Either way, enter a bug for it in jira so that we can get it
 resolved (even if it's a documentation problem).

Done; just couldn't find docs :)

Most things have been working beautifully; docs are the only real issue.
I've put together a couple tutorials on some fun things (like the *very*
cool I'll just add one to your list (should we open a more-official
cookbook/tutorial section on the wiki? A few other people are also
putting things together.) 
 
Dave


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



more than one parameter in a link

2006-12-05 Thread Pierre Goupil

Hi all again, and thank you for the fast support ! ^ ^




jsp:useBean id=map class=java.util.HashMap /
c:set target=${map} property=key1 value=value1/
c:set target=${map} property=key2 value=value2/
html:link action=/action name=maplink/html:link


Ho yes ! Here's a clean way to fill a map in a JSP ! By clean, I mean
without a scriptlet that a Web developper wouldn't understand. Great !





This is something to do with url rewriteing and how the session is handleing
happens on your server.., c:url tag will do the proper url re-writeing
according to my understanding.. so i dont think there would be any issue in
that, i am not sure plese try it and see..


OK, I'll give it a try. Both solutions fit me ! A good day to be a Struster
! =)




Regards,


Pierre




--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.


Re: more than one parameter in a link

2006-12-05 Thread Mikolaj Rydzewski

Pierre Goupil wrote:

Ho yes ! Here's a clean way to fill a map in a JSP ! By clean, I mean
without a scriptlet that a Web developper wouldn't understand. Great !
I doubt whether web developer with no programming background would 
understand JSTL solution either...


--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread David H. DeWolf
Great to hear, thanks for the update!  Docs definitely need to be 
flushed out.  Once we get the TLP resolution finalized, we should have 
some more cycles to get this thing documented and out the door :)



David

Dave Newton wrote:

Yes, the context init parameter org.apache.tiles.DEFINITION_CONFIG
takes a comma separated list of files/resources.

Are you having issues with it or just couldn't find the documentation
for it?  Either way, enter a bug for it in jira so that we can get it
resolved (even if it's a documentation problem).


Done; just couldn't find docs :)

Most things have been working beautifully; docs are the only real issue.
I've put together a couple tutorials on some fun things (like the *very*
cool I'll just add one to your list (should we open a more-official
cookbook/tutorial section on the wiki? A few other people are also
putting things together.) 
 
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]



Using tiles and validator framework

2006-12-05 Thread Deep Blue

Hi,

I'm using tiles component in my .jsp page (eg. main.jsp). It is a poll
component, which user can submit the vote.
Commons validator framework is used to validate the poll submission.
When the validation failed on the tiles component, the tiles component's jsp
(e.g. poll.jsp) is showed, instead of the original jsp page (main.jsp).

Is there anyway I can return to main.jsp when the validation failed?

Thanks!

Best Regards,
Deep Blue


Filter problem

2006-12-05 Thread Hehl, Thomas
OK, I've collided with struts over an issue and would like to know if people
have suggestions on how to solve.

I am reading stuff from an XML file and building parts of my UI from for use
in a JSP. I thought it would be good for some of them to have HTML markup in
them, so I put lt;, etc in the html file. It goes all the way to struts as
 and then struts converts it at the last second so that what gets
displayed is B.:(

So how do I stop struts from doing this? So far, I dunno. Here's the code
that causes the problem in ResourceUtils(1.3.5):


/**
 * Filter the specified string for characters that are senstive to HTML
 * interpreters, returning the string with these characters replaced by
 * the corresponding character entities.
 *
 * @param value The string to be filtered and returned
 */
public static String filter(String value) {
if ((value == null) || (value.length() == 0)) {
return value;
}

StringBuffer result = null;
String filtered = null;

for (int i = 0; i  value.length(); i++) {
filtered = null;

switch (value.charAt(i)) {
case '':
filtered = lt;;

break;

case '':
filtered = gt;;

break;

case '':
filtered = amp;;

break;

case '':
filtered = quot;;

break;

case '\'':
filtered = #39;;

break;
}

if (result == null) {
if (filtered != null) {
result = new StringBuffer(value.length() + 50);

if (i  0) {
result.append(value.substring(0, i));
}

result.append(filtered);
}
} else {
if (filtered == null) {
result.append(value.charAt(i));
} else {
result.append(filtered);
}
}
}

return (result == null) ? value : result.toString();
}

I think it is uncharitable for struts to change these with no option to
prevent it. I am thinking about adding open; and close; and resolving them
here to turn them back into  and  respectively. Any other ideas, comments,
suggestions?

Thanks.




Re: 404 when enabling StrutsTilesListener in struts2

2006-12-05 Thread Jared Blitzstein
It's a NoClassDef. It's referencing a package I don't have. Am I  
supposed to have that there or is that supposed to be in the core  
libraries?


2006-12-05 10:08:05 StandardContext[/struts2]Error configuring  
application listener of class  
org.apache.struts2.tiles.StrutsTilesListener

java.lang.NoClassDefFoundError: org/apache/tiles/listener/TilesListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass 
(SecureClassLoader.java:124)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal 
(WebappClassLoader.java:1634)
	at org.apache.catalina.loader.WebappClassLoader.findClass 
(WebappClassLoader.java:860)
	at org.apache.catalina.loader.WebappClassLoader.loadClass 
(WebappClassLoader.java:1307)
	at org.apache.catalina.loader.WebappClassLoader.loadClass 
(WebappClassLoader.java:1189)
	at org.apache.catalina.core.StandardContext.listenerStart 
(StandardContext.java:3775)
	at org.apache.catalina.core.StandardContext.start 
(StandardContext.java:4343)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 
1083)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 
1083)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java: 
478)
	at org.apache.catalina.core.StandardService.start 
(StandardService.java:480)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java: 
2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)


On Dec 4, 2006, at 10:16 PM, David H. DeWolf wrote:

Hmm, we have another open issue about tiles failure with 2.0.1.
The problem seems to be with the version of tiles that's being  
used. Unfortunately, since 2.0.1 was rolled with a snapshot, it's  
hard to figure out exactly what it should be. . .


Do you have a stack trace?  there should be one in catalina.out.   
Can you send it along?  thanks.


All of this should be fixed as soon as 2.0.2 comes out since we've  
got a versioned snapshot we rely on now.



Sorry for the frustration,

David

Jared Blitzstein wrote:

When I add:
listener
  listener- 
classorg.apache.struts2.tiles.StrutsTilesListener/listener- 
class /listener
to my web.xml, all my actions are 404's now. If I comment that  
line out, my actions go back to working. I set break points in the  
actions to make sure they're just not finding JSP's, but it's not  
hitting the actions.  My config is below, any help would be  
appreciated.

struts jars:
struts2-api-2.0.1.jar
struts2-core-2.0.1.jar
struts2-tiles-plugin-2.0.1.jar
web.xml:
display-nameMy Test App/display-name
filter
filter-namestruts2/filter-name
filter- 
classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class

/filter
filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
/filter-mapping
listener
listener- 
classorg.springframework.web.context.ContextLoaderListener/ 
listener-class /listener

listener
  listener- 
classorg.apache.struts2.tiles.StrutsTilesListener/listener- 
class /listener   context-param

  param-nametilesDefinitions/param-name
 param-value/WEB-INF/tiles-def.xml/param-value
/context-param
welcome-file-list
welcome-fileindex.html/welcome-file
/welcome-file-list
struts.xml
struts
include file=customer.xml/
/struts
customer.xml
struts
package name=customer namespace=/customer extends=struts- 
default

result-types
  result-type name=tiles  
class=org.apache.struts2.views.tiles.TilesResult/

/result-types
action name=*  
class=net.blitzstein.struts2.test.Customer method={1}

result name=list/pages/customer/list.jsp/result
result name=edit/pages/customer/edit.jsp/result
result name=test type=tilestilesWorks/result
/action
!-- Add actions here --
/package
/struts


-
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: Detailed TagDocs download ?

2006-12-05 Thread Wendy Smoak

On 12/5/06, Sakari Isoniemi [EMAIL PROTECTED] wrote:


Where detailed tag desc ( http://struts.apache.org/2.x/tagreference.html )
can be downloaded ?

I didn't found this information from struts-2.0.1-docs.zip   (2006-11-06)


That looks like it was generated by the Maven Taglib Plugin.  It's
dated August 24th, so my guess is that it's an old page that is no
longer generated.  I removed it and a few other old pages from the
server, they'll disappear in a day or so.


From the Struts 2 home page, 'Tag Reference' links to this:

http://struts.apache.org/WW/tag-reference.html

Assuming that existed when 2.0.1 was done, it should be in the docs.
If not, it will be in the next build.

--
Wendy

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



Re: [Tiles] Defining insert points in derived definitions

2006-12-05 Thread Antonio Petrelli

See inline comments...

Jean-Baptiste Lièvremont ha scritto:

* File: /WEB-INF/tiles-defs.xml

tiles-definitions

 definition name=standard path=/WEB-INF/tiles/standard.jsp
   put name=jsphead  content=/WEB-INF/tiles/standard/jsphead.jsp/
   put name=htmlhead content=/WEB-INF/tiles/standard/htmlhead.jsp/
   put name=titlecontent=/WEB-INF/tiles/standard/title.jsp/
   put name=content  content=/WEB-INF/tiles/standard/content.jsp/
   put name=footer   content=/WEB-INF/tiles/standard/footer.jsp/
 /definition

 definition name=default extends=standard
   put name=content content=/WEB-INF/tiles/default/content.jsp/
 /definition

 !-- Other definitions extending standard... --

/tiles-definition


File: /WEB-INF/tiles/multiPane/content.jsp

?xml version=1.0 encoding=UTF-8?
jsp:root version=1.2
 xmlns=http://www.w3.org/1999/xhtml;
 xmlns:jsp=http://java.sun.com/JSP/Page;
 xmlns:html=/tags/struts-html
 xmlns:tiles=/tags/struts-tiles
 xmlns:logic=/tags/struts-logic
 xmlns:bean=/tags/struts-bean

html:xhtml/

div id=content

 tiles:useAttribute name=pgList id=pgList 
classname=java.util.List/


 logic:iterate name=pgList id=pg
   tiles:insert flush=false
 jsp:attribute name=pagebean:write name=pg//jsp:attribute
   /tiles:insert
 /logic:iterate

/div

/jsp:root



The problems is that you want to read attributes inside non-layout 
pages. In your case your layout page is standard.jsp and you can read 
attributes (i.e. using tiles:insert attribute, 
tiles:useAttribute, tiles:importAttribute) only in that page.
To solve your problem, use tiles:importAttribute to import your 
attribute in request scope in standard.jsp:

tiles:importAttribute name=pgList scope=request
Then use it as a normal request-scoped bean.

HTH
Antonio

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



Re: Tiles 2 - How to dispatch to tiles servlet????

2006-12-05 Thread David H. DeWolf

Moving to Struts Users list, please reply there.

Antonio Petrelli wrote:
First of all this is a typical question to be submitted in Struts Users 
mailing list.

Anyway, since Tiles 2 is under development, I will answer anyway.

Stone, Sam ha scritto:

I can instantiate the DefinitionsFactory. I can get a
ComponentDefinition OK. I cannot figure out how to forward the request
from MyServlet to dispatch to my tiles servlet. Any help is greatly
appreciated.
  
Err... you can't, since TilesServlet does not accept connections (it is 
used without a servlet-mapping).

Anyway you can forward to (or include) your definition.

snip
   ComponentContext context = 
TilesAccess.getContainer(request.getSession().getServletContext())

   .render(request, response, my.definition.name);
/snip


Just to avoid confusion, I don't think Antonio meant to imply that the 
Container.render returns a ComponentContext.


TilesContainer tc = TilesAccess.getContainer(servletContext)
ComponentContext context = tc.getComponentContext(req, res);
// do something with the component context if needed,
tc.render(req, res, my.definition.name);


David



HTH
Antonio

-
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: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread Dave Newton
From: David H. DeWolf [mailto:[EMAIL PROTECTED] On Behalf Of David H.
 Yes, the context init parameter org.apache.tiles.DEFINITION_CONFIG
 takes a comma separated list of files/resources.

  context-param
param-nameorg.apache.tiles.DEFINITION_CONFIG/param-name
param-value/WEB-INF/tiles.xml,/WEB-INF/tiles-foo.xml/param-value
  /context-param

Like that? Startup is saying they're not defined in the web.xml but I'm
assuming I've just forgotten how to do that. Could it be a tiles version
thing? 

Dave


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



Re: Filter problem

2006-12-05 Thread Martin Gainty
Hi Thomas-
Perhaps an implementation where you register your own pre-result listener 
(example located at)
http://struts.apache.org/2.x/docs/can-we-access-an-actions-result.html

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: Hehl, Thomas [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tuesday, December 05, 2006 10:05 AM
Subject: Filter problem


 OK, I've collided with struts over an issue and would like to know if people
 have suggestions on how to solve.
 
 I am reading stuff from an XML file and building parts of my UI from for use
 in a JSP. I thought it would be good for some of them to have HTML markup in
 them, so I put lt;, etc in the html file. It goes all the way to struts as
  and then struts converts it at the last second so that what gets
 displayed is B.:(
 
 So how do I stop struts from doing this? So far, I dunno. Here's the code
 that causes the problem in ResourceUtils(1.3.5):
 
 
/**
 * Filter the specified string for characters that are senstive to HTML
 * interpreters, returning the string with these characters replaced by
 * the corresponding character entities.
 *
 * @param value The string to be filtered and returned
 */
public static String filter(String value) {
if ((value == null) || (value.length() == 0)) {
return value;
}
 
StringBuffer result = null;
String filtered = null;
 
for (int i = 0; i  value.length(); i++) {
filtered = null;
 
switch (value.charAt(i)) {
case '':
filtered = lt;;
 
break;
 
case '':
filtered = gt;;
 
break;
 
case '':
filtered = amp;;
 
break;
 
case '':
filtered = quot;;
 
break;
 
case '\'':
filtered = #39;;
 
break;
}
 
if (result == null) {
if (filtered != null) {
result = new StringBuffer(value.length() + 50);
 
if (i  0) {
result.append(value.substring(0, i));
}
 
result.append(filtered);
}
} else {
if (filtered == null) {
result.append(value.charAt(i));
} else {
result.append(filtered);
}
}
}
 
return (result == null) ? value : result.toString();
}
 
 I think it is uncharitable for struts to change these with no option to
 prevent it. I am thinking about adding open; and close; and resolving them
 here to turn them back into  and  respectively. Any other ideas, comments,
 suggestions?
 
 Thanks.
 
 


Re: [Tiles] Defining insert points in derived definitions [SOLVED]

2006-12-05 Thread Jean-Baptiste Lièvremont

Well, I got it working defining the 'pgList' attribute at top level
(in the 'standard' definition) and using 'importAttribute' in the
standard layout page to put it into the request scope, for the
'multiPane' content page to use it.

IMHO, it is a bit annoying to have do define it for all pages derived
from the standard layout, whereas only a few use it actually. Well,
it is still better than having to duplicate the entire layout page :)

Thanks for the quick and accurate answer, regards,
J.B.L

2006/12/5, Antonio Petrelli [EMAIL PROTECTED]:

See inline comments...

Jean-Baptiste Lièvremont ha scritto:
 * File: /WEB-INF/tiles-defs.xml


*** SNIP ***



The problems is that you want to read attributes inside non-layout
pages. In your case your layout page is standard.jsp and you can read
attributes (i.e. using tiles:insert attribute,
tiles:useAttribute, tiles:importAttribute) only in that page.
To solve your problem, use tiles:importAttribute to import your
attribute in request scope in standard.jsp:
tiles:importAttribute name=pgList scope=request
Then use it as a normal request-scoped bean.

HTH
Antonio

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




How to align form fields in struts 2

2006-12-05 Thread walidito

Hi, I have a problem with aligning my form's fields to the right using struts
2.
Here is my code :

s:textfield  label=%{getText('username')} name=username/
s:password  label=%{getText('password')} name=password /

I have tried requiredposition=right and the size attritbute, but it
doesn't work neither.

Could sbdy help please?

thanks in advance
-- 
View this message in context: 
http://www.nabble.com/How-to-align-form-fields-in-struts-2-tf2762717.html#a7702699
Sent from the Struts - User mailing list archive at Nabble.com.


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



problem with using dispatchaction

2006-12-05 Thread Joe Yuen
 

I am currently using dispatchaction with good success however I recently 
encountered a situation that I hope someone has a suggestion for.
 
I am implementing dependent drop down lists in one of my pages. I would like to 
use the onchange attribute with the html:select tag.
 
My question is what should my javascript routine look like so that the form is 
submitted to the right method in my action class that uses dispatchaction.
 
I tried doing this to get it to submit to my edit method, but it doesn't seem 
to work:
script language=JavaScript

function sub() {

document.forms[0].action.value='edit';

document.forms[0].submit();

}

/script

 
 
Thanks,
-Joe Yuen

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

debug in eclipse using tomcat plug-in

2006-12-05 Thread Lim Hock-Chai
When I try to debug my application by starting tomcat using tomcat
eclipse plug-in, eclipse keeps telling me that it can not find the
source.  
 
I'm not sure if there is a setting problem in eclipse, tomcat or struts.
Can somebody give me some pointer?
 
thanks.


Re: debug in eclipse using tomcat plug-in

2006-12-05 Thread Jorge Martín Cuervo
Try to use wtp from eclipse. Remember to start tomcat in debug mode.

http://www.eclipse.org/webtools/

El mar, 05 de 12 de 2006 a las 18:05, Lim Hock-Chai escribió:

 When I try to debug my application by starting tomcat using tomcat
 eclipse plug-in, eclipse keeps telling me that it can not find the
 source.  
  
 I'm not sure if there is a setting problem in eclipse, tomcat or struts.
 Can somebody give me some pointer?
  
 thanks.

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email [EMAIL PROTECTED]
voz +34 985 129 820
voz +34 660 026 384



Re: debug in eclipse using tomcat plug-in

2006-12-05 Thread Jared Blitzstein

What version of everything are you using?

On Dec 5, 2006, at 12:05 PM, Lim Hock-Chai wrote:


When I try to debug my application by starting tomcat using tomcat
eclipse plug-in, eclipse keeps telling me that it can not find the
source.

I'm not sure if there is a setting problem in eclipse, tomcat or  
struts.

Can somebody give me some pointer?

thanks.



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



[s2] Making LazyDynaBean work with ModelDriven interface

2006-12-05 Thread Mark Shifman
Some folks may be as pig-headed as me or may need to use LazyDynaBeans 
as they are translating
from struts1 to struts2.  After fooling around, I figured it out but it 
is pretty clear to me this is not the way to go.

Below is a simple example.

public final class MyAction extends ActionSupport implements ModelDriven{

   private LazyDynaBean f = new LazyDynaBean();
   public String execute() throws Exception  {
  
   String[] text_field = (String[])f.get(text_field);
   //do something with the text_field that came from LazyDynaBean 
as a String array

  return SUCCESS;
   }
  
  public Object getModel(){

   return f;
   }
}

s:form action=MyAction
   s:textfield name=map.text_field /
   s:submit /
/s:form

validators
   field name=map.text_field
   field-validator type=required
   messageText Field is required./message
   /field-validator
   /field
/validators

There were 2 things that bit me:
1.  You have to get the field name  from map.text field so that 
s:textfield can get it from the map on the valuestack and
2.  The textfield seems to get a String[] rather than a String and I 
don't have any idea how to do it differently.


mas



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



RE: Filter problem

2006-12-05 Thread Hehl, Thomas
Nope. This is a struts 2 thing and I'm on 1.2.x.

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 11:21 AM
To: Struts Users Mailing List
Subject: Re: Filter problem


Hi Thomas-
Perhaps an implementation where you register your own pre-result listener
(example located at)
http://struts.apache.org/2.x/docs/can-we-access-an-actions-result.html

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient,
you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination,
distribution or copying of it or its 
contents
- Original Message - 
From: Hehl, Thomas [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tuesday, December 05, 2006 10:05 AM
Subject: Filter problem


 OK, I've collided with struts over an issue and would like to know if
people
 have suggestions on how to solve.
 
 I am reading stuff from an XML file and building parts of my UI from for
use
 in a JSP. I thought it would be good for some of them to have HTML markup
in
 them, so I put lt;, etc in the html file. It goes all the way to struts
as
  and then struts converts it at the last second so that what gets
 displayed is B.:(
 
 So how do I stop struts from doing this? So far, I dunno. Here's the code
 that causes the problem in ResourceUtils(1.3.5):
 
 
/**
 * Filter the specified string for characters that are senstive to HTML
 * interpreters, returning the string with these characters replaced by
 * the corresponding character entities.
 *
 * @param value The string to be filtered and returned
 */
public static String filter(String value) {
if ((value == null) || (value.length() == 0)) {
return value;
}
 
StringBuffer result = null;
String filtered = null;
 
for (int i = 0; i  value.length(); i++) {
filtered = null;
 
switch (value.charAt(i)) {
case '':
filtered = lt;;
 
break;
 
case '':
filtered = gt;;
 
break;
 
case '':
filtered = amp;;
 
break;
 
case '':
filtered = quot;;
 
break;
 
case '\'':
filtered = #39;;
 
break;
}
 
if (result == null) {
if (filtered != null) {
result = new StringBuffer(value.length() + 50);
 
if (i  0) {
result.append(value.substring(0, i));
}
 
result.append(filtered);
}
} else {
if (filtered == null) {
result.append(value.charAt(i));
} else {
result.append(filtered);
}
}
}
 
return (result == null) ? value : result.toString();
}
 
 I think it is uncharitable for struts to change these with no option to
 prevent it. I am thinking about adding open; and close; and resolving
them
 here to turn them back into  and  respectively. Any other ideas,
comments,
 suggestions?
 
 Thanks.
 
 



RE: debug in eclipse using tomcat plug-in

2006-12-05 Thread Lim Hock-Chai
I'm able to access my computer at home to know the version yet.  Sees
like there might be a problem with Eclipse.  See link below:

http://www.eclipseplugincentral.com/PNphpBB2-printview-t-1244-start-0.ht
ml

-Original Message-
From: Jared Blitzstein [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 05, 2006 11:25 AM
To: Struts Users Mailing List
Subject: Re: debug in eclipse using tomcat plug-in

What version of everything are you using?

On Dec 5, 2006, at 12:05 PM, Lim Hock-Chai wrote:

 When I try to debug my application by starting tomcat using tomcat 
 eclipse plug-in, eclipse keeps telling me that it can not find the 
 source.

 I'm not sure if there is a setting problem in eclipse, tomcat or 
 struts.
 Can somebody give me some pointer?

 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: debug in eclipse using tomcat plug-in

2006-12-05 Thread Jared Blitzstein
I honestly didn't even know the sysdeo plugin still worked, I thought  
it died out a while ago. Like Jorge said, look into moving to WPT, it  
has it built in already.


http://www.eclipse.org/webtools/

On Dec 5, 2006, at 12:52 PM, Lim Hock-Chai wrote:


I'm able to access my computer at home to know the version yet.  Sees
like there might be a problem with Eclipse.  See link below:

http://www.eclipseplugincentral.com/PNphpBB2-printview-t-1244- 
start-0.ht

ml

-Original Message-
From: Jared Blitzstein [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 11:25 AM
To: Struts Users Mailing List
Subject: Re: debug in eclipse using tomcat plug-in

What version of everything are you using?

On Dec 5, 2006, at 12:05 PM, Lim Hock-Chai wrote:


When I try to debug my application by starting tomcat using tomcat
eclipse plug-in, eclipse keeps telling me that it can not find the
source.

I'm not sure if there is a setting problem in eclipse, tomcat or
struts.
Can somebody give me some pointer?

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]




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



Validate length of array

2006-12-05 Thread O'Shea, Sean
Hi all,

I'm using struts 1.2.7 with commons-validator 1.1.4

I've this DynaValidatorActionForm which has the following properties:

form-bean name=TOAForm dynamic=true
type=org.apache.struts.validator.DynaValidatorActionForm
form-property name=fundsTransfer type=com.myform.Transfer[]
size=3 /
form-property name=id type=java.lang.String /
/form-bean

I have the corresponding rules defined:

form name=/brokeragePartialTransfer
field property=fundName  indexedListProperty =fundsTransfer
depends=required,minlength,maxlength 
arg key=TOAForm.fundName position=0/
arg1 name=minlength key=${var:minlength} resource=false
position=1/
arg2 name=maxlength key=${var:maxlength} resource=false
position=1/
var
var-nameminlength/var-name
var-value3/var-value
/var
var
   var-namemaxlength/var-name
   var-value20/var-value
/var
/field
field property=noOfShares indexedListProperty
=fundsTransfer depends=required,minlength,maxlength

arg key=TOAForm.noOfShares /
arg name=minlength key=${var:minlength} resource=false
position=1/
arg name=maxlength key=${var:maxlength} resource=false
position=1/  
var
   var-nameminlength/var-name
   var-value3/var-value
/var
var
   var-namemaxlength/var-name
   var-value20/var-value
/var
/field

/form

From my understanding, these validations will validate the noOfShares
and fundName properties which are part of the com.myform.Transfer POJO.
In addition to these individual validations I also need to ensure that
the user has entered at least one com.myform.Transfer bean. ie. I need
to make sure that the fundsTransfer array has a size of greater than 1.
Is there a way to include this type of validation in XML format?

Hope someone has come across this problem before and can offer some help

Thanks

Sean O Shea


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



Re: debug in eclipse using tomcat plug-in

2006-12-05 Thread Jorge Martín Cuervo
i've use sysdeo plugin in debug mode time ago, but IMHO wtp has better
integration with eclipse.

I don't remember if sysdeo can debug jsps, but wtp does.

Checkout a new eclipse with WTP and tell us.

El mar, 05 de 12 de 2006 a las 18:57, Jared Blitzstein escribió:

 I honestly didn't even know the sysdeo plugin still worked, I thought  
 it died out a while ago. Like Jorge said, look into moving to WPT, it  
 has it built in already.
 
 http://www.eclipse.org/webtools/
 
 On Dec 5, 2006, at 12:52 PM, Lim Hock-Chai wrote:
 
  I'm able to access my computer at home to know the version yet.  Sees
  like there might be a problem with Eclipse.  See link below:
 
  http://www.eclipseplugincentral.com/PNphpBB2-printview-t-1244- 
  start-0.ht
  ml
 
  -Original Message-
  From: Jared Blitzstein [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, December 05, 2006 11:25 AM
  To: Struts Users Mailing List
  Subject: Re: debug in eclipse using tomcat plug-in
 
  What version of everything are you using?
 
  On Dec 5, 2006, at 12:05 PM, Lim Hock-Chai wrote:
 
  When I try to debug my application by starting tomcat using tomcat
  eclipse plug-in, eclipse keeps telling me that it can not find the
  source.
 
  I'm not sure if there is a setting problem in eclipse, tomcat or
  struts.
  Can somebody give me some pointer?
 
  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]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email [EMAIL PROTECTED]
voz +34 985 129 820
voz +34 660 026 384



Re: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread David H. DeWolf



Dave Newton wrote:

From: David H. DeWolf [mailto:[EMAIL PROTECTED] On Behalf Of David H.

Yes, the context init parameter org.apache.tiles.DEFINITION_CONFIG
takes a comma separated list of files/resources.


  context-param
param-nameorg.apache.tiles.DEFINITION_CONFIG/param-name
param-value/WEB-INF/tiles.xml,/WEB-INF/tiles-foo.xml/param-value
  /context-param


Theoretically, yes.  You may need to enter a bug for it, I thought we 
had a test for that in the testsuite, but apparently do not.


What stack trace and/or specific error message do you get?



Like that? Startup is saying they're not defined in the web.xml but I'm
assuming I've just forgotten how to do that. Could it be a tiles version
thing? 


If you're not getting a ClassNotFoundExceptions then I wouldn't guess 
so, but perhaps.  It seems to me like those with version issues are 
having problems starting up with a basic configuration. . .whereas 
you've been able to get past that.





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: [s2] Making LazyDynaBean work with ModelDriven interface

2006-12-05 Thread Mark Menard
On 12/5/06 12:25 PM, Mark Shifman [EMAIL PROTECTED] wrote:
 2.  The textfield seems to get a String[] rather than a String and I
 don't have any idea how to do it differently.

I don¹t know if you can do this because I've never really worked with Struts
1. Can you make the Map in your form a MapObject,String? That might make
the values be String instead of String[]. This is only an idea.

I'm not sure OGNL will do this with generics. You could test it easily
enough by making your model just a MapObject,String and see if that works.

Mark

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



Re: How to align form fields in struts 2

2006-12-05 Thread Mark Menard
On 12/5/06 11:29 AM, walidito [EMAIL PROTECTED] wrote:

 
 Hi, I have a problem with aligning my form's fields to the right using struts
 2.
 Here is my code :
 
 s:textfield  label=%{getText('username')} name=username/
 s:password  label=%{getText('password')} name=password /
 
 I have tried requiredposition=right and the size attritbute, but it
 doesn't work neither.
 
 Could sbdy help please?

I don't have time to dig into it. If you're using the default theme, in the
S2 source code look at:

core/src/main/resources/template/xhtml

Look at text.ftl and follow the bouncing ball to see how the HTML is being
output, and if it support right alignment.

Mark

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



very basic bean/iterator question

2006-12-05 Thread Rick Schumeyer

I'm slowly improving with struts, but have a basic question.

I query a database using hibernate, which returns a List.

On the other end, I have a jsp page that displays the result.  I know 
that the jsp can access beans using tags like logic:iterate and  bean:write.


(Here is the dumb question:) Can a List be used directly as a bean in a 
jsp page?  Currently I am copying the contents of the List into my own 
bean that contains an ArrayList.  The jsp then gets the ArrayList from 
the bean and iterates over it.  It would obviously be more efficient to 
do away with the intermediate bean and just use the List.  I'm just not 
sure if I can do that, and if I can, what would be the proper use of the 
jsp tags?


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



RE: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread Dave Newton
From: David H. DeWolf [mailto:[EMAIL PROTECTED] On Behalf Of David H.
 What stack trace and/or specific error message do you get?

No exception, just the startup message saying that it couldn't find the
definition in the web.xml so it's looking for tiles.xml.

I'll wait until the 2.0.2 drop; I believe this particular project is
using a 2.0.1 so... yeah.

It's irritating having several simultaneous projects using different
versions; it's my own fault but they've been start-stop-start-stoppy and
I've been bad.

Dave


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



RE: very basic bean/iterator question

2006-12-05 Thread Dave Newton
From: Rick Schumeyer [mailto:[EMAIL PROTECTED]
 On the other end, I have a jsp page that displays the result.  I know
 that the jsp can access beans using tags like logic:iterate and
 bean:write.

I would just use JSTL c:forEach with the list in scope.

In general I avoid the S1 tags except the form ones.

Dave


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



The first request

2006-12-05 Thread Thom Burnett

I need to set up my first page with a sequence of database interactions
before the execute() method is called (I think). What's the recommended
struts way of doing so.


When a first request to my jsp page arrives, I need to read some key
parameters of the request, contact my database, and then fill in some fields
of the page based on what the parameters and database tell me. I'm not clear
on how to hook that in. I don't seem to have access to the doPost() and
doGet() methods that I would with a standard servlet.

1. One obvious solution is to extend the struts ActionServlet so that I can
override the doGet() and/or doPost(). Does that interfere with standard
struts behavior?

2. I could also use a standard servlet to handle the request and then
forward or redirect to my struts pages and servlet. That seems to somewhat
defeat the purpose of struts but it could be done.

3. I could also put a lot of java into my jsp page to do all my processing
but that's a violation of MVC and pretty messy as well.

4. I thought about using the constructor of my ActionForm since it gets
called at the right time but I don't have the request object available (and
I need those parameters).

5. Any other ideas?

I need a solution (preferably an example) that works for struts 1.3.5. with
an ActionForm (not the DynaActionForm).


RE: The first request

2006-12-05 Thread Wesley Wannemacher
Could it be done in a regular Custom Tag? 

 -Original Message-
 From: Thom Burnett [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 05, 2006 2:59 PM
 To: Struts Users Mailing List
 Subject: The first request
 
 I need to set up my first page with a sequence of database 
 interactions
 before the execute() method is called (I think). What's the 
 recommended
 struts way of doing so.
 
 
 When a first request to my jsp page arrives, I need to read some key
 parameters of the request, contact my database, and then fill 
 in some fields
 of the page based on what the parameters and database tell 
 me. I'm not clear
 on how to hook that in. I don't seem to have access to the 
 doPost() and
 doGet() methods that I would with a standard servlet.
 
 1. One obvious solution is to extend the struts ActionServlet 
 so that I can
 override the doGet() and/or doPost(). Does that interfere 
 with standard
 struts behavior?
 
 2. I could also use a standard servlet to handle the request and then
 forward or redirect to my struts pages and servlet. That 
 seems to somewhat
 defeat the purpose of struts but it could be done.
 
 3. I could also put a lot of java into my jsp page to do all 
 my processing
 but that's a violation of MVC and pretty messy as well.
 
 4. I thought about using the constructor of my ActionForm 
 since it gets
 called at the right time but I don't have the request object 
 available (and
 I need those parameters).
 
 5. Any other ideas?
 
 I need a solution (preferably an example) that works for 
 struts 1.3.5. with
 an ActionForm (not the DynaActionForm).
 

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



RE: The first request

2006-12-05 Thread Asthana, Rahul
Actually org.apache.struts.tiles.Controller is called just before the tile is 
inserted, and that would be after the action forwards to the JSP.That may not 
satisfy your requirement.

-Original Message-
From: Asthana, Rahul [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 3:13 PM
To: Struts Users Mailing List
Subject: RE: The first request


Look at  org.apache.struts.tiles.Controller 
I couldnt find a decent example though.
Here is an article.
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101
That of course means that you will have to use Tiles.


-Original Message-
From: Thom Burnett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 2:59 PM
To: Struts Users Mailing List
Subject: The first request


I need to set up my first page with a sequence of database interactions
before the execute() method is called (I think). What's the recommended
struts way of doing so.


When a first request to my jsp page arrives, I need to read some key
parameters of the request, contact my database, and then fill in some fields
of the page based on what the parameters and database tell me. I'm not clear
on how to hook that in. I don't seem to have access to the doPost() and
doGet() methods that I would with a standard servlet.

1. One obvious solution is to extend the struts ActionServlet so that I can
override the doGet() and/or doPost(). Does that interfere with standard
struts behavior?

2. I could also use a standard servlet to handle the request and then
forward or redirect to my struts pages and servlet. That seems to somewhat
defeat the purpose of struts but it could be done.

3. I could also put a lot of java into my jsp page to do all my processing
but that's a violation of MVC and pretty messy as well.

4. I thought about using the constructor of my ActionForm since it gets
called at the right time but I don't have the request object available (and
I need those parameters).

5. Any other ideas?

I need a solution (preferably an example) that works for struts 1.3.5. with
an ActionForm (not the DynaActionForm).

-
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: Filter problem

2006-12-05 Thread George.Dinwiddie
How are you inserting your XML/HTML into the JSP?

I don't think the filter method is causing your problem.  I think you're
not expressing that the output should not be filtered.  If you're using
c:out you might want to add 'escapeXml=false', for example.

 -Original Message-
 From: Hehl, Thomas [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, December 05, 2006 12:08 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Filter problem
 
 
 Nope. This is a struts 2 thing and I'm on 1.2.x.
 
 -Original Message-
 From: Martin Gainty [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 05, 2006 11:21 AM
 To: Struts Users Mailing List
 Subject: Re: Filter problem
 
 
 Hi Thomas-
 Perhaps an implementation where you register your own 
 pre-result listener (example located at) 
 http://struts.apache.org/2.x/docs/can-we-access-an-actions-result.html
 
 Anyone else?
 M-
 This e-mail communication and any attachments may contain 
 confidential and privileged information for the use of the 
 designated recipients named above. If you are not the 
 intended recipient, you are hereby notified that you have 
 received this communication in error and that any review, 
 disclosure, dissemination, distribution or copying of it or its 
 contents
 - Original Message - 
 From: Hehl, Thomas [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Tuesday, December 05, 2006 10:05 AM
 Subject: Filter problem
 
 
  OK, I've collided with struts over an issue and would like 
 to know if
 people
  have suggestions on how to solve.
  
  I am reading stuff from an XML file and building parts of 
 my UI from 
  for
 use
  in a JSP. I thought it would be good for some of them to have HTML 
  markup
 in
  them, so I put lt;, etc in the html file. It goes all the way to 
  struts
 as
   and then struts converts it at the last second so that 
 what gets 
  displayed is B.:(
  
  So how do I stop struts from doing this? So far, I dunno. 
 Here's the 
  code that causes the problem in ResourceUtils(1.3.5):
  
  
 /**
  * Filter the specified string for characters that are 
 senstive to HTML
  * interpreters, returning the string with these 
 characters replaced by
  * the corresponding character entities.
  *
  * @param value The string to be filtered and returned
  */
 public static String filter(String value) {
 if ((value == null) || (value.length() == 0)) {
 return value;
 }
  
 StringBuffer result = null;
 String filtered = null;
  
 for (int i = 0; i  value.length(); i++) {
 filtered = null;
  
 switch (value.charAt(i)) {
 case '':
 filtered = lt;;
  
 break;
  
 case '':
 filtered = gt;;
  
 break;
  
 case '':
 filtered = amp;;
  
 break;
  
 case '':
 filtered = quot;;
  
 break;
  
 case '\'':
 filtered = #39;;
  
 break;
 }
  
 if (result == null) {
 if (filtered != null) {
 result = new StringBuffer(value.length() + 50);
  
 if (i  0) {
 result.append(value.substring(0, i));
 }
  
 result.append(filtered);
 }
 } else {
 if (filtered == null) {
 result.append(value.charAt(i));
 } else {
 result.append(filtered);
 }
 }
 }
  
 return (result == null) ? value : result.toString();
 }
  
  I think it is uncharitable for struts to change these with 
 no option 
  to prevent it. I am thinking about adding open; and close; and 
  resolving
 them
  here to turn them back into  and  respectively. Any other ideas,
 comments,
  suggestions?
  
  Thanks.
  
  
 
 

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



RE: The first request

2006-12-05 Thread Asthana, Rahul
Look at  org.apache.struts.tiles.Controller 
I couldnt find a decent example though.
Here is an article.
http://www.theserverside.com/tt/articles/article.tss?l=Tiles101
That of course means that you will have to use Tiles.


-Original Message-
From: Thom Burnett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 05, 2006 2:59 PM
To: Struts Users Mailing List
Subject: The first request


I need to set up my first page with a sequence of database interactions
before the execute() method is called (I think). What's the recommended
struts way of doing so.


When a first request to my jsp page arrives, I need to read some key
parameters of the request, contact my database, and then fill in some fields
of the page based on what the parameters and database tell me. I'm not clear
on how to hook that in. I don't seem to have access to the doPost() and
doGet() methods that I would with a standard servlet.

1. One obvious solution is to extend the struts ActionServlet so that I can
override the doGet() and/or doPost(). Does that interfere with standard
struts behavior?

2. I could also use a standard servlet to handle the request and then
forward or redirect to my struts pages and servlet. That seems to somewhat
defeat the purpose of struts but it could be done.

3. I could also put a lot of java into my jsp page to do all my processing
but that's a violation of MVC and pretty messy as well.

4. I thought about using the constructor of my ActionForm since it gets
called at the right time but I don't have the request object available (and
I need those parameters).

5. Any other ideas?

I need a solution (preferably an example) that works for struts 1.3.5. with
an ActionForm (not the DynaActionForm).

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



packages organisation in struts 2

2006-12-05 Thread walidito

Hi,
I'm developping a new web app with struts 2 using eclipse and I would like
to organize my code like I am used to do with struts 1. 
I mean putting Interfaces, beans, actions in separate folders/packages.
It seems impossible to add a package/source floder under the main packages
given with example apps of struts 2 ( the one with build.bat). I don't know
if it comes from eclipse or from struts, or if I must add new
packages/sources folder to the root directory...
-- 
View this message in context: 
http://www.nabble.com/packages-organisation-in-struts-2-tf2764518.html#a7708542
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: The first request

2006-12-05 Thread Wendy Smoak

On 12/5/06, Thom Burnett [EMAIL PROTECTED] wrote:


I need to set up my first page with a sequence of database interactions
before the execute() method is called (I think). What's the recommended
struts way of doing so.


All requests go through the controller, never straight to the JSP.

Once that pattern is established, you can either have a separate
'setup' action, or use a dispatch-style action with a setup method.

There are several good tutorials here, I believe 'Lesson 2' shows a
setup action.  http://learntechnology.net/

--
Wendy

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



Re: packages organisation in struts 2

2006-12-05 Thread Wendy Smoak

I'm developping a new web app with struts 2 using eclipse and I would like
to organize my code like I am used to do with struts 1.
I mean putting Interfaces, beans, actions in separate folders/packages.
It seems impossible to add a package/source floder under the main packages
given with example apps of struts 2 ( the one with build.bat). I don't know
if it comes from eclipse or from struts, or if I must add new
packages/sources folder to the root directory...


I assume you're working with the Blank example, as that's the only
build.bat file I can find in the source code repository.  This is just
a simple example for you to start with, I believe Ted uses it in his
tutorial.

You should definitely establish your own package structure.

How you build your project is up to you.  I recommend Maven 2, which
can generate config files for Eclipse and IDEA.

--
Wendy

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



Displaying a JSP in a pop-up window

2006-12-05 Thread Pierre Goupil

Hello, Strusters !

My question is quite simple. As you should have guessed : is there a way, in
Struts / Tomcat to display a JSP, not in the main browser window but rather
in a pop-up window ?

This would but great for confirm requests, errors displaying and such.

Regards,


Pierre

--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.


Re: Map backed properties

2006-12-05 Thread Laurie Harper
Did you try adding a public Map getChecklistItemNoteIds() method to your 
form bean, and access it with the JSTL syntax Paul provided?


L.

Gundersen, Richard wrote:

Hi

Thanks for replying. I have tried that actually and it didn't work. In
fact that particular example wont work for me unfortunately because my
property isn't part of a map inside a DynaActionForm - it's just a
normal member variable of a class that extends ActionForm. 


I don't think the problem is getting hold of the values - they are there
and I can write scriptlets to extract them. I think the problem is that
EL isn't capable of accessing these types of properties. But, I could be
wrong (I hope so because I hate having scriptlets in my JSPs)

Thanks

Richard

-Original Message-
From: Strachan, Paul [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 11:23 PM

To: Struts Users Mailing List
Subject: RE: Map backed properties

try something like:

c:if test=${formname.map.checklistItemNoteIds[120] == 7}

/c:if


-Original Message-
From: Gundersen, Richard [mailto:[EMAIL PROTECTED] 
Sent: Monday, 4 December 2006 11:00 PM

To: user@struts.apache.org
Subject: Map backed properties

Hi

 


I've been happily working with map based properties in my forms for a
while now, but I've come across something that I really can't figure
out. 

 


I started off with a DynaValidatorForm, and in the mapping, I had this:

 


form-property name=checklistItemNoteIds type=java.util.HashMap/

 


I was able to use this nicely, by populating it in the action class, and
storing it as a hidden field in my JSP like so:

 


html:hidden property=checklistItemNoteIds(${checklistItem.id})/

 


That results in a nice: input type=hidden
name=checklistItemNoteIds(120) value=7

 


But, I need to access the value of the property now to do some extra
processing, something along the lines of

 


c:if test=${checklistItemNoteIds(120) == 7})

// do this

/c:if

 


And it doesn't work. I've even made my own concrete ActionForm class
with these kinds of methods:

 


public Object getChecklistItemNoteId(String key) {

return checklistItemNoteIds.get(key);

}

 

With no success. Has anyone got this working? 

 


Thanks

 


Richard


*** Disclaimer *** 


This electronic communication is confidential and for the exclusive use
of the addressee. It may contain private and confidential information.
The information, attachments and opinions contained in this E-mail are
those of its author only and do not necessarily represent those of
London Scottish Bank PLC or any other members of the London Scottish
Group. 


If you are not the intended addressee, you are prohibited from any
disclosure, distribution or further copying or use of this communication
or the information in it or taking any action in reliance on it. If you
have received this communication in error please notify the Information
Security Manager at [EMAIL PROTECTED] as soon as possible and
delete the message from all places in your computer where it is stored. 


We utilise virus scanning software but we cannot guarantee the security
of electronic communications and you are advised to check any
attachments for viruses. We do not accept liability for any loss
resulting from any corruption or alteration of data or importation of
any virus as a result of receiving this electronic communication. 


Replies to this E-mail may be monitored for operational or business
reasons. London Scottish Bank PLC is regulated by the Financial Services
Authority.
__
This email has been scanned by the MessageLabs Email Security System.
**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

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


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


*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this 

Re: Displaying a JSP in a pop-up window

2006-12-05 Thread Ed Griebel

The trick is to use the target=xx parameter in the generated a
tag. Try something like this: In your jsp you will have html:link
target=_blank action=SomeAction/. In your struts-config you will
have action path=SomeAction forward=/mypage.jsp/action

http://struts.apache.org/1.2.7/userGuide/struts-html.html#link
http://www.onjava.com/pub/a/onjava/2002/10/30/jakarta.html?page=3

-ed

On 12/5/06, Pierre Goupil [EMAIL PROTECTED] wrote:

Hello, Strusters !

My question is quite simple. As you should have guessed : is there a way, in
Struts / Tomcat to display a JSP, not in the main browser window but rather
in a pop-up window ?

This would but great for confirm requests, errors displaying and such.

Regards,


Pierre

--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.



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



Re: [S2/Tiles] Multiple tile def files w/ S2 Tiles listener?

2006-12-05 Thread David H. DeWolf
The snapshot you're using may still use the parameter name 
'definitions-config' instead of org.apache.tiles.DEFINITION_CONFIG


Grr. . .lesson learned, don't release with a snapshot!

Dave Newton wrote:

From: David H. DeWolf [mailto:[EMAIL PROTECTED] On Behalf Of David H.

What stack trace and/or specific error message do you get?


No exception, just the startup message saying that it couldn't find the
definition in the web.xml so it's looking for tiles.xml.

I'll wait until the 2.0.2 drop; I believe this particular project is
using a 2.0.1 so... yeah.

It's irritating having several simultaneous projects using different
versions; it's my own fault but they've been start-stop-start-stoppy and
I've been bad.

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: Pre-populated option values of a select not got on Submit

2006-12-05 Thread Laurie Harper
Please keep discussion on the mailing list, so others have the chance  
to respond and/or benefit. Comments in-line:


On 5-Dec-06, at 8:51 AM, Sridhar Raman wrote:

This is how the the getter and setter of the category property  
looks like:


public void setCategory(String[] category)
 {
  this.category = category;
 }

   /**
* @return Returns the catlist.
*/
   public String[] getCatlist()
   {
  return catlist;
   }


The getter and setter names don't match here. Also, you're not using  
the correct signatures for indexed properties. The following  
documentation may help clarify things:


http://struts.apache.org/1.2.9/faqs/indexedprops.html

L.


Apart from that I have this method to populate the category values:
public CollectionHtmlSelectOption getCatSelList()
   {
  RepoOperations ro = new RepoOperations();
  catSelList = null;

  try
  {
 catSelList = ro.getNodeIDs(session, category);
  }
  catch (Exception e)
  {
 System.err.println(e);
  }
  return catSelList;
   }

What am I doing wrong?

On 12/5/06, Laurie Harper  [EMAIL PROTECTED] wrote:
What do the 'category' property's getter and setter (getCategory and
setCategory methods) in the form bean look like?

L.

Sridhar Raman wrote:
 I have a select/option in my JSP like this:
 html:select size=3 styleClass=menu styleId=catsel
 property=category
 multiple=yes
html:options collection=catSelList labelProperty=displayName
 property=id/
 /html:select

 I have also defined the bean for catSelList:
 bean:define id='catSelList' property='catSelList'  
name='editEPForm'/


 In the Form java file, I have the method public Collection  
getCatSelList(),

 that returns the list of values that needs to be displayed in the
 select/option menu.

 The page works fine when opened. The values that need to be  
displayed in

 the
 options are displayed correctly. But the problem occurs on submit.

 Whatever I do, the property category (which refers to the  
html:select) is
 always null. Even if I add values from another list into this  
select/option

 menu, the value of category on submit is null. How do I rectify this
 problem?

 This is what I want - if the user doesn't change anything in that  
field,

 the
 pre-populated values needs to be stored under category. If he  
does change

 anything, the new values needs to be stored under category.

 How do I do this?

 Thanks,
 Sridhar



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




--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/





Updating a config(.ini) file in Action class

2006-12-05 Thread chuanjiang lo

Hi all,

I have this web app that allows user to change the config (.ini) file via a
form. When the user submits the form, it goes into the action class and the
action class is supposed to update the ini file accordingly.

The ini file is lumped together with my action class.

FileInputStream in = new FileInputStream(test.ini);
Properties p = new Properties();
p.load(in);
p.setProperty(User name, username);
p.setProperty(Password, password);
p.store(new FileOutputStream(test.ini), null);

However the ini file is not updated in the webapp directory.
if i change p.store(new FileOutputStream(test.ini), null); to p.store(new
FileOutputStream(c:\\test.ini), null);
The test.ini will appear in c:\

How should i go abt updating the ini file that is together with the webapp?

Appreciate any advice


Re: Updating a config(.ini) file in Action class

2006-12-05 Thread Venkata Phani Kumar
Hi,
You can get any resource path wich is under context path using
ServeletContext.getRealPath().
The usage of this method is here,
String iniFilePath =
request.getSession().getServletContext().getRealPath(test.ini);

you can use the 'iniFilePath' to instatiate FileOutStream, and do what ever
you want.

Hope this will help you out

Regards,
Venkata Phanikumar. G
- Original Message - 
From: chuanjiang lo [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Wednesday, December 06, 2006 12:21 PM
Subject: Updating a config(.ini) file in Action class


 Hi all,

 I have this web app that allows user to change the config (.ini) file via
a
 form. When the user submits the form, it goes into the action class and
the
 action class is supposed to update the ini file accordingly.

 The ini file is lumped together with my action class.

 FileInputStream in = new FileInputStream(test.ini);
 Properties p = new Properties();
 p.load(in);
 p.setProperty(User name, username);
 p.setProperty(Password, password);
 p.store(new FileOutputStream(test.ini), null);

 However the ini file is not updated in the webapp directory.
 if i change p.store(new FileOutputStream(test.ini), null); to
p.store(new
 FileOutputStream(c:\\test.ini), null);
 The test.ini will appear in c:\

 How should i go abt updating the ini file that is together with the
webapp?

 Appreciate any advice




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