How to pass sql variable from jsp to Action?

2005-09-01 Thread 梁炳場
I retrieve a group id by JSP.
sql:query  ...SELECT group_id../

When user clicks a link 
html:link .../

Before another page is shown, in my struts-config.xml,
I try to make a ActionForward function to capture the group_id
and then update a session attribute .

Then the resulting jsp is like this
sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /

Is this a proper way to do this?

I do not know how to write in the Action class so that
it can retrieve the sql value from the passing in jsp file.

Your help is very much appreicated.

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



DAOs in service methods

2005-09-01 Thread Paul Benedict
Hey guys.

I have alot of service objects called from Struts, and
each have a good deal of service methods. Service
methods mainly do business logic and talk to DAO
objects.

Question:
I've taken the approach of service methods having the
responsibility of instantiating DAO objects locally
and using them. Is this correct? Or should I
instantiate all the DAO objects that could ever be
needed in my service constructor, and use them as
instance variables?

Or is there a better design?

Thanks!




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: resource not found error

2005-09-01 Thread Swapnil Patil
Hi Nirmala,

You might have some errors in struts servlet mapping.

check your web.xml with 
http://www.reumann.net/struts/lesson1/step7.do
.

On 9/1/05, Nirmala Dhara [EMAIL PROTECTED] wrote:
 
 Hi,
 I am new to struts. I tried http://www.reumann.net/struts/lesson1.doexample
 with tomacat. I am getting error
 The requested resource (/nstart) is not available., when I tried to run 
 it
 (http://localhost:8080/nstart)
 tocat -- 4.1 version
 struts -- 1.2.7 version
 
 I am able to run another application using tomcat and that works fine
 (http://localhost:8080/transfer/login.jsp)
 
 My web.xml ( in $tomcat_home$/webapps/nstart/WEB-INF/web.xml) file 
 contains
 tags as
 
 !-- tag libs --
 taglib
 taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
 taglib-location/WEB-INF/struts-bean.tld/taglib-location
 /taglib
 
 taglib
 taglib-uri/WEB-INF/struts-html.tld/taglib-uri
 taglib-location/WEB-INF/struts-html.tld/taglib-location
 /taglib
 
 taglib
 taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
 taglib-location/WEB-INF/struts-logic.tld/taglib-location
 /taglib
 taglib
 taglib-urijstl/c/taglib-uri
 taglib-location/WEB-INF/c.tld/taglib-location
 /taglib
 Thanks,
 Nirmala
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: resource not found error

2005-09-01 Thread Murugesan, Kathiresan \(Cognizant\)
---BeginMessage---
if you deployed the war then check in which name it is deployed in the your 
tomcat context and try with that name.



From: Swapnil Patil [mailto:[EMAIL PROTECTED]
Sent: Thu 9/1/2005 12:14 PM
To: Struts Users Mailing List
Subject: Re: resource not found error



Hi Nirmala,

You might have some errors in struts servlet mapping.

check your web.xml with
http://www.reumann.net/struts/lesson1/step7.do
.

On 9/1/05, Nirmala Dhara [EMAIL PROTECTED] wrote:

 Hi,
 I am new to struts. I tried http://www.reumann.net/struts/lesson1.doexample
 with tomacat. I am getting error
 The requested resource (/nstart) is not available., when I tried to run
 it
 (http://localhost:8080/nstart)
 tocat -- 4.1 version
 struts -- 1.2.7 version

 I am able to run another application using tomcat and that works fine
 (http://localhost:8080/transfer/login.jsp)

 My web.xml ( in $tomcat_home$/webapps/nstart/WEB-INF/web.xml) file
 contains
 tags as

 !-- tag libs --
 taglib
 taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
 taglib-location/WEB-INF/struts-bean.tld/taglib-location
 /taglib

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

 taglib
 taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
 taglib-location/WEB-INF/struts-logic.tld/taglib-location
 /taglib
 taglib
 taglib-urijstl/c/taglib-uri
 taglib-location/WEB-INF/c.tld/taglib-location
 /taglib
 Thanks,
 Nirmala



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




winmail.dat---End Message---
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply 
e-mail and destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing 
or copying of this email or any action taken in reliance on this e-mail is 
strictly 
prohibited and may be unlawful.

  Visit us at http://www.cognizant.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to pass sql variable from jsp to Action?

2005-09-01 Thread 梁炳場
I wonder if it is a proper way to do it because
the 1st query displays a no of rows with different group ids.
Can the html:link pass a value to Action?
If it can, it is excellent.

Should it be done like this?
change the layout from a no of links html:link
to a no of forms html:form
In each form, it has hidden value of group id.

How will you do this? Thank you very much for your help.

2005/9/1, 梁炳場 [EMAIL PROTECTED]:
 I retrieve a group id by JSP.
 sql:query  ...SELECT group_id../
 
 When user clicks a link
 html:link .../
 
 Before another page is shown, in my struts-config.xml,
 I try to make a ActionForward function to capture the group_id
 and then update a session attribute .
 
 Then the resulting jsp is like this
 sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
 
 Is this a proper way to do this?
 
 I do not know how to write in the Action class so that
 it can retrieve the sql value from the passing in jsp file.
 
 Your help is very much appreicated.



AW: How to pass SQL variable from JSP to Action?

2005-09-01 Thread R. Markham
Hallo Nobody(??)

It is bad practice to put SQL Statement in a JSP page.

Regards

Richard Markham


-Ursprüngliche Nachricht-
Von: ??? [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 1. September 2005 05:30
An: Struts Users Mailing List
Betreff: Re: How to pass sql variable from jsp to Action?

I wonder if it is a proper way to do it because
the 1st query displays a no of rows with different group ids.
Can the html:link pass a value to Action?
If it can, it is excellent.

Should it be done like this?
change the layout from a no of links html:link
to a no of forms html:form
In each form, it has hidden value of group id.

How will you do this? Thank you very much for your help.

2005/9/1, 梁炳場 [EMAIL PROTECTED]:
 I retrieve a group id by JSP.
 sql:query  ...SELECT group_id../
 
 When user clicks a link
 html:link .../
 
 Before another page is shown, in my struts-config.xml,
 I try to make a ActionForward function to capture the group_id
 and then update a session attribute .
 
 Then the resulting jsp is like this
 sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
 
 Is this a proper way to do this?
 
 I do not know how to write in the Action class so that
 it can retrieve the sql value from the passing in jsp file.
 
 Your help is very much appreicated.



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



Struts Documentation

2005-09-01 Thread Gonella Jayprakash

Hi,
 Can anyone please tell where to get the documentation for Struts.
I cannot find any link for downloading the struts doc on
struts.apache.org.

Thanks  Regards,
Jayprakash



*
Disclaimer:   
The contents of this E-mail (including the contents of the enclosure(s) or 
attachment(s) if any) are privileged and confidential material of MBT and 
should not be disclosed to, used by or copied in any manner by anyone other 
than the intended addressee(s).   In case you are not the desired addressee, 
you should delete this message and/or re-direct it to the sender.  The views 
expressed in this E-mail message (including the enclosure(s) or attachment(s) 
if any) are those of the individual sender, except where the sender expressly, 
and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of 
any virus.  However, it is the responsibility of the recipient to ensure that 
it is virus free and MBT is not responsible for any loss or damage arising in 
any way from its use
 


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



Re: DAOs in service methods

2005-09-01 Thread Leon Rosenberg
On Wed, 2005-08-31 at 21:19 -0700, Paul Benedict wrote:
 Hey guys.
 
 I have alot of service objects called from Struts, and
 each have a good deal of service methods. Service
 methods mainly do business logic and talk to DAO
 objects.
 
 Question:
 I've taken the approach of service methods having the
 responsibility of instantiating DAO objects locally
 and using them. Is this correct? Or should I
 instantiate all the DAO objects that could ever be
 needed in my service constructor, and use them as
 instance variables?
 
 Or is there a better design?

Hi,

design is always the matter of the desired functionality, so it's hard
to say what is best for you without knowing your business goals.

But what can be said for sure, is, that instantiating DAOs locally on
each call is a waste of ressources, since each new DAO will probably
create a new connection to the db.

Having one instance per service is generelly better, but you must keep
an eye on synchronization and concurrency.

regards
Leon

 
 Thanks!
 
 
   
 
 Start your day with Yahoo! - make it your home page 
 http://www.yahoo.com/r/hs 
 
 
 -
 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]



writing a FWRequestProcessor

2005-09-01 Thread Markus Wallner
Hello!

I would like to write my own FWRequestProcessor. The reason is that I would like
to catch some common exception in my Web application (e.g., general database
failures). Everything else is done by the superclass. The following code
basically works fine, but my problem is that I would like to add error
information for the user (what is usually done within the action with
context.addErrors(...)). So I wonder if there a way to access the context of the
action forwarded to in the request processor? 

Thanks in advance,
Markus




protected ActionForward processActionPerform(
javax.servlet.http.HttpServletRequest request, 
javax.servlet.http.HttpServletResponse response, 
org.apache.struts.action.Action action, 
org.apache.struts.action.ActionForm form, 
org.apache.struts.action.ActionMapping mapping) throws
java.io.IOException, javax.servlet.ServletException {
log.debug(processActionPerform());
try {
return super.processActionPerform(request, response, action, form,
mapping);
} catch (Exception e) {
log.error(FWRequestProcessor caught exception:  + e.getMessage());
Throwable ex = e;
while (ex instanceof ServletException)
ex = ((ServletException) ex).getRootCause();

if (ex instanceof HibernateException) {
ActionErrors errors = new ActionErrors();
errors.add(Persistenzfehler, new
ActionMessage(error.hibernate.general, ApplicationListAction  +
e.getMessage()));
// HibernateSessionFactory.getSession().connection().rollback();
// context.addErrors(errors);
ActionForward f = new ActionForward(mapping.getInputForward());
return mapping.getInputForward();
} else if (ex instanceof SQLException) {
log.error(SQLException!);
}
log.error(throwing new ServletException());
throw new ServletException(e);
}
}



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



RE: Struts Documentation

2005-09-01 Thread Ayusman dikshit

Hi Jay,
You must have downloaded the jakarta-struts-1.1.zip from (or tar),
Extract that to a folder, you will find a webapps directory,
Inside that you will find a struts-documentation.war file.
Just place it in the webapps directory of tomcat server(I think u must
be using tomcat) and start the server, you will find a new directory
named struts-documentation just cut and place it at a location you like.

Regards
Ayusman

-Original Message-
From: Gonella Jayprakash [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 1:43 PM
To: Struts Users Mailing List
Subject: Struts Documentation


Hi,
 Can anyone please tell where to get the documentation for Struts.
I cannot find any link for downloading the struts doc on
struts.apache.org.

Thanks  Regards,
Jayprakash



*
Disclaimer:  

The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s).   In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender.  The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be
free of any virus.  However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use




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


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

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



AW: Struts Documentation

2005-09-01 Thread R. Markham
Hi Jay,

this is a good place too.

http://wiki.apache.org/struts/

Regards

Richard Markham




-Ursprüngliche Nachricht-
Von: Ayusman dikshit [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 1. September 2005 10:53
An: Struts Users Mailing List
Betreff: RE: Struts Documentation


Hi Jay,
You must have downloaded the jakarta-struts-1.1.zip from (or tar),

Extract that to a folder, you will find a webapps directory,
Inside that you will find a struts-documentation.war file.
Just place it in the webapps directory of tomcat server(I think u must
be using tomcat) and start the server, you will find a new directory
named struts-documentation just cut and place it at a location you like.

Regards
Ayusman


-Original Message-
From: Gonella Jayprakash [mailto:[EMAIL PROTECTED]

Sent: Thursday, September 01, 2005 1:43 PM
To: Struts Users Mailing List
Subject: Struts Documentation


Hi,
 Can anyone please tell where to get the documentation for Struts.
I cannot find any link for downloading the struts doc on
struts.apache.org.

Thanks  Regards,
Jayprakash



*
Disclaimer:  


The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s).   In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender.  The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be
free of any virus.  However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use





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


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

-
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: writing a FWRequestProcessor

2005-09-01 Thread Joe Germuska
I'd suggest that you check out Struts' support for declarative 
exception handling before extending the request processor; I would 
think that it will do what you need.


Joe


At 8:11 AM + 9/1/05, Markus Wallner wrote:

Hello!

I would like to write my own FWRequestProcessor. The reason is that 
I would like

to catch some common exception in my Web application (e.g., general database
failures). Everything else is done by the superclass. The following code
basically works fine, but my problem is that I would like to add error
information for the user (what is usually done within the action with
context.addErrors(...)). So I wonder if there a way to access the 
context of the

action forwarded to in the request processor?

Thanks in advance,
Markus




protected ActionForward processActionPerform(
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.apache.struts.action.Action action,
org.apache.struts.action.ActionForm form,
org.apache.struts.action.ActionMapping mapping) throws
java.io.IOException, javax.servlet.ServletException {
log.debug(processActionPerform());
try {
return super.processActionPerform(request, response, action, form,
mapping);
} catch (Exception e) {
log.error(FWRequestProcessor caught exception:  + 
e.getMessage());

Throwable ex = e;
while (ex instanceof ServletException)
ex = ((ServletException) ex).getRootCause();
   
if (ex instanceof HibernateException) {

ActionErrors errors = new ActionErrors();
errors.add(Persistenzfehler, new
ActionMessage(error.hibernate.general, ApplicationListAction  +
e.getMessage()));
// 
HibernateSessionFactory.getSession().connection().rollback();

// context.addErrors(errors);
ActionForward f = new 
ActionForward(mapping.getInputForward());

return mapping.getInputForward();
} else if (ex instanceof SQLException) {
log.error(SQLException!);
}
log.error(throwing new ServletException());
throw new ServletException(e);
}
}



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



--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex


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



Re: The latest stable version of struts

2005-09-01 Thread Ted Husted
On 8/31/05, Niall Pemberton [EMAIL PROTECTED] wrote:
 Depends on the size of your project, the features you've used and how you've
 developed it. The following notes should help you assess it yourself:

 Notes on upgrading from 1.1 to 1.2.4:
 http://wiki.apache.org/struts/StrutsUpgradeNotes11to124
 
 Notes on upgrading from 1.2.4 to 1.2.7:
 http://wiki.apache.org/struts/StrutsUpgradeNotes124to127

And, most importantly, how many deprecated features a team is using.
We do retain backward compatability between 1.x releases. So, if we
did our job right, and if a1.1 release compiles *without* deprecation
warnings, then it should be compile-and-go for 1.2, with zero code
changes. Again, if the 1.1 compiles *without* deprecation warnings.

Ditto for 1.2. If a 1.2 application compiles *without* deprecation
warnings, then it should be compile-and-go for 1.3. (And if it isn't,
we want to hear about it!)

But, if an application already has deprecation warnings for 1.1 and a
team waits for 1.3, then there will be that much more work to do.

Of course, the real fun is taking advantage of the new features, like
wildcard mappings and lazy validator forms in 1.2, and the very cool
extends that's coming in 1.3.

-- HTH, Ted.
http://www.husted.com/poe/

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



Re: OT: Good Java host

2005-09-01 Thread chhum
I’ve recently started moving my jsp/servlet/ based sites to Kattare 
(see https://www.kattare.com/index.kvws) who have a good reputation and 
so far I’ve been pretty impressed.

You might also want to have a look at the list other at Jason Hunter’s 
site (see http://www.servlets.com/isps/servlet/ISPViewAll)

Obviously it depends a lot what your requirements are in terms of app 
server etc.

chhum




Quoting John Henry Xu [EMAIL PROTECTED]:

 Choosing java hosting company depends on how much you want to pay
 and
 what features you need.
 
 For example, we need customized Java forum and Java blogs (like PHP
 hosting) and  customized search engine; Also we have EJBs in
 applications
 and not many can do that.
 
 John H. Xu
 
 http://www.usanalyst.com
 http://www.GetusJobs.com (The largest free job portal in North
 America)
 
   - Original Message -
   From: klute
   To: Struts Users Mailing List
   Subject: OT: Good Java host
   Date: Sun, 31 Jul 2005 06:47:08 -0700 (PDT)
 
   
Hey all,
   
Can anyone recommend a good Java hosting company? My
current one is good when it comes to the features it
provides but the support is almost insulting.
   
Thanks,
James
   
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
   
   
  
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 Jack H. Xu
 Technology columnist and editor
 
 http://www.usanalyst.com
 
 http://www.getusjobs.com (The largest free job portal in North
 America)
 
 -- 
 ___
 Sign-up for Ads Free at Mail.com
 http://promo.mail.com/adsfreejump.htm
 
 


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



Re: OT: Good Java host

2005-09-01 Thread Emmanouil Batsis

[EMAIL PROTECTED] wrote:

I’ve recently started moving my jsp/servlet/ based sites to Kattare 
(see https://www.kattare.com/index.kvws) who have a good reputation and 
so far I’ve been pretty impressed.
 



RE kattare, i signed with them more than a year ago and never had any 
serious issues. Their support team has demonstrated solid know-how and 
are quite responsive. Their setups are also very flexible. I have no 
complaints.


Manos

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



custom date converters

2005-09-01 Thread Rivka Shisman
Hi friends

 

I'm not sure I understand the use of custom converters:

 

If for example I have 2 VO's and each has a Timestamp property. But -
each one takes a different date format from the user. Do I need a
different StringToTimestamp converter for each one? If yes - how does
BeanUtils.copyProperties() know which converter to use (both the above
properties are the same type - Timestamp)?

 

Thanks

Rivka


OT: Design Issue.

2005-09-01 Thread karthikeyan balasubramanian
Hi all,

This may not be exactly struts question but here is my scenario:

1. I will be reading data from a single table and displaying it to some 
users.
2. Assuming that there are 5 users at one time records read by one user 
should 
not be seen by others.
3. This single table size can be huge.

What is the efficient way to achieve this solution without getting into
table locking issues.

Looking forward for your response.

Karthikeyan B


Re: OT: Design Issue.

2005-09-01 Thread netsql
You won't get into any problems w/ only 5 users if you just have a field 
in table viewed_by_userId.

.V


karthikeyan balasubramanian wrote:

Hi all,

This may not be exactly struts question but here is my scenario:

1. I will be reading data from a single table and displaying it to some 
users.
2. Assuming that there are 5 users at one time records read by one user 
should 
not be seen by others.

3. This single table size can be huge.

What is the efficient way to achieve this solution without getting into
table locking issues.

Looking forward for your response.

Karthikeyan B




--
thx,
.V

Broadband interface (RIA) + mail box safety = Roomity.com
http://roomity.com/demo.jsp
*Your* clubs, no sign up to read, ad supported; try broadband internet.

cell: 917 825 3035 in DFW
email: netsql at roomity.com


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



Re: Struts Documentation

2005-09-01 Thread netsql

From home page of Struts, there is a link to wiki, which has a book/w labs:
http://wiki.apache.org/struts

.V

Gonella Jayprakash wrote:

Hi,
 Can anyone please tell where to get the documentation for Struts.
I cannot find any link for downloading the struts doc on
struts.apache.org.

Thanks  Regards,
Jayprakash



*
Disclaimer:   


The contents of this E-mail (including the contents of the enclosure(s) or 
attachment(s) if any) are privileged and confidential material of MBT and 
should not be disclosed to, used by or copied in any manner by anyone other 
than the intended addressee(s).   In case you are not the desired addressee, 
you should delete this message and/or re-direct it to the sender.  The views 
expressed in this E-mail message (including the enclosure(s) or attachment(s) 
if any) are those of the individual sender, except where the sender expressly, 
and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of 
any virus.  However, it is the responsibility of the recipient to ensure that 
it is virus free and MBT is not responsible for any loss or damage arising in 
any way from its use
 






--
thx,
.V

Broadband interface (RIA) + mail box safety = Roomity.com
http://roomity.com/demo.jsp
*Your* clubs, no sign up to read, ad supported; try broadband internet.

cell: 917 825 3035 in DFW
email: netsql at roomity.com


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



RE: OT: Good Java host

2005-09-01 Thread Taylor, Kevin
I have used kattare for several years and they are a top-notch operation. Good 
support, solid systems, good prices.

 Kevin Taylor
 
 -Original Message-
 From: Emmanouil Batsis [SMTP:[EMAIL PROTECTED]
 Sent: Thursday, September 01, 2005 6:33 AM
 To:   Struts Users Mailing List
 Subject:  Re: OT: Good Java host
 
 [EMAIL PROTECTED] wrote:
 
 I ' ve recently started moving my jsp/servlet/ based sites to Kattare 
 (see https://www.kattare.com/index.kvws) who have a good reputation and 
 so far I ' ve been pretty impressed.
   
 
 
 RE kattare, i signed with them more than a year ago and never had any 
 serious issues. Their support team has demonstrated solid know-how and 
 are quite responsive. Their setups are also very flexible. I have no 
 complaints.
 
 Manos
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: custom date converters

2005-09-01 Thread Joe Germuska

At 3:27 PM +0200 9/1/05, Rivka Shisman wrote:

Hi friends



I'm not sure I understand the use of custom converters:



If for example I have 2 VO's and each has a Timestamp property. But -
each one takes a different date format from the user. Do I need a
different StringToTimestamp converter for each one? If yes - how does
BeanUtils.copyProperties() know which converter to use (both the above
properties are the same type - Timestamp)?


It does not.  Frankly, this is a limitation of the BeanUtils design 
model.  It assumes for any given process (instance of BeanUtils), a 
single conversion strategy applies to all objects of a given type.


I have solved this sometimes by writing a Converter which expects a 
few specific variations of a date format and then tests the string 
length to look up the format string -- obviously this is imperfect, 
but it may work for you.


(something like this:

if (str.length() == 10) {
// parse date using mm/dd/
} else if (str.length() == 8) {
// parse date using hh:mm a
} else {
   throw new IllegalArgumentException(Unrecognized date format);
}

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex


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



Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
Richard

Are you suggesting something like Hibernate or iBatis?

Daniel


2005/9/1, R. Markham [EMAIL PROTECTED]:
 Hallo Nobody(??)
 
 It is bad practice to put SQL Statement in a JSP page.
 
 Regards
 
 Richard Markham
 
 
 -Ursprüngliche Nachricht-
 Von: ??? [mailto:[EMAIL PROTECTED]
 Gesendet: Donnerstag, 1. September 2005 05:30
 An: Struts Users Mailing List
 Betreff: Re: How to pass sql variable from jsp to Action?
 
 I wonder if it is a proper way to do it because
 the 1st query displays a no of rows with different group ids.
 Can the html:link pass a value to Action?
 If it can, it is excellent.
 
 Should it be done like this?
 change the layout from a no of links html:link
 to a no of forms html:form
 In each form, it has hidden value of group id.
 
 How will you do this? Thank you very much for your help.
 
 2005/9/1, 梁炳�� [EMAIL PROTECTED]:
  I retrieve a group id by JSP.
  sql:query  ...SELECT group_id../
 
  When user clicks a link
  html:link .../
 
  Before another page is shown, in my struts-config.xml,
  I try to make a ActionForward function to capture the group_id
  and then update a session attribute .
 
  Then the resulting jsp is like this
  sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
 
  Is this a proper way to do this?
 
  I do not know how to write in the Action class so that
  it can retrieve the sql value from the passing in jsp file.
 
  Your help is very much appreicated.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



Select Options Question

2005-09-01 Thread BHansard
I am sure there is a slick way to do this, but it escapes me at the moment.

I have a Select Box that I am populating with the html:options tag  The
result is:

select name=cmbGroup id=groupList
option value=jk12341Group 1/option
option value=34t1fv1Group 2/option
option value=32fq21Group 3/option
   ...
/select

I need the value for DAO actions performed from the search which will
return a detail bean for display on an output JSP.

On the output JSP I need to Display the Group Name that I selected from the
input.  My Form holds the group id and a field for the group name.  The
options that I can see are:

1.  Requery the Database for the output page to retrieve the name given I
have the key.  This would work, but seems like a lot of overhead to go to
the database each time.
2.  Create a delimited value (ie option value=jk12341, Group 1Group
1/option) and use the String Split to get the value and label.  (I am
leaning toward this)
3.  use javascript to update the field each time the select changes.  The
problem with this is that the select box can be very large based on the
users selections on previous entries.
4.  Store the Value Label list in the session (Don't like this at all
because the volume of users that will use this application).

Any other suggestions?


Error: Cannot forward after response has been committed?

2005-09-01 Thread 梁炳場
Within a Tiles layout,
I try to forward to another jsp when a bean not exist?

But it leads to the subject line error message?

In the header layout jsp, I put this

logic:notPresent scope=session name=loginForm
jsp:forward page=/index.jsp/
/logic:notPresent
  
If it is not allowed or it is not a good way,
what is the better way or another way to do so?

Thanks
PC Leung

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



RE: OT: Good Java host

2005-09-01 Thread lchalupa

I've been with eapps.com in Atlanta, Ga. for over two years.
I have a virtual private server on a linux box which is to say I have root
access. I have everything I need to support my Java development.  Their 
service is excellent and their prices are fair. I can change my hosting plan 
on a daily basis if I needed more or less resources. I really like that 
flexibility. They have been quick to respond to my needs.I recently moved to 
the midwest but I'm staying with eapps.

lee


On Thu, 1 Sep 2005 08:52:29 -0500, Taylor, Kevin wrote
 I have used kattare for several years and they are a top-notch 
 operation. Good support, solid systems, good prices.
 
  Kevin Taylor
  
  -Original Message-
  From:   Emmanouil Batsis [SMTP:[EMAIL PROTECTED]
  Sent:   Thursday, September 01, 2005 6:33 AM
  To: Struts Users Mailing List
  Subject:Re: OT: Good Java host
  
  [EMAIL PROTECTED] wrote:
  
  I ' ve recently started moving my jsp/servlet/ based sites to Kattare 
  (see https://www.kattare.com/index.kvws) who have a good reputation and 
  so far I ' ve been pretty impressed.

  
  
  RE kattare, i signed with them more than a year ago and never had any 
  serious issues. Their support team has demonstrated solid know-how and 
  are quite responsive. Their setups are also very flexible. I have no 
  complaints.
  
  Manos
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


Lee Chalupa
[EMAIL PROTECTED]


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



Re: OT: Good Java host

2005-09-01 Thread Guillermo Castro
I use eapps (http://www.eapps.com) to host my sites, and I'm very happy with 
them. They offer a true Virtual Private Server (VPS), which means I have my 
own server, on which I even have root access to modify it as I see fit. 
They also offer unlimited domains for the same price (with bandwidth and 
disk space being the only restrictions).

The control panel is also very nice.

Regards.


On 9/1/05, Taylor, Kevin [EMAIL PROTECTED] wrote:
 
 I have used kattare for several years and they are a top-notch operation. 
 Good support, solid systems, good prices.
 
  Kevin Taylor
 
  -Original Message-
  From: Emmanouil Batsis [SMTP:[EMAIL PROTECTED]
  Sent: Thursday, September 01, 2005 6:33 AM
  To: Struts Users Mailing List
  Subject: Re: OT: Good Java host
 
  [EMAIL PROTECTED] wrote:
 
  I ' ve recently started moving my jsp/servlet/ based sites to Kattare
  (see https://www.kattare.com/index.kvws) who have a good reputation and
  so far I ' ve been pretty impressed.
  
  
 
  RE kattare, i signed with them more than a year ago and never had any
  serious issues. Their support team has demonstrated solid know-how and
  are quite responsive. Their setups are also very flexible. I have no
  complaints.
 
  Manos
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-- 
Guillermo Castro [EMAIL PROTECTED]
Monterrey NL, Mexico http://www.javageek.org/


Re: Select Options Question

2005-09-01 Thread netsql
Chapter 16 in wiki struts book will tell you how to use options 
collections w/ DAO, and it has a lab.

hth,
.V

[EMAIL PROTECTED] wrote:

I am sure there is a slick way to do this, but it escapes me at the moment.

I have a Select Box that I am populating with the html:options tag  The
result is:

select name=cmbGroup id=groupList
option value=jk12341Group 1/option
option value=34t1fv1Group 2/option
option value=32fq21Group 3/option
   ...
/select

I need the value for DAO actions performed from the search which will
return a detail bean for display on an output JSP.

On the output JSP I need to Display the Group Name that I selected from the
input.  My Form holds the group id and a field for the group name.  The
options that I can see are:

1.  Requery the Database for the output page to retrieve the name given I
have the key.  This would work, but seems like a lot of overhead to go to
the database each time.
2.  Create a delimited value (ie option value=jk12341, Group 1Group
1/option) and use the String Split to get the value and label.  (I am
leaning toward this)
3.  use javascript to update the field each time the select changes.  The
problem with this is that the select box can be very large based on the
users selections on previous entries.
4.  Store the Value Label list in the session (Don't like this at all
because the volume of users that will use this application).

Any other suggestions?




--
thx,
.V

Broadband interface (RIA) + mail box safety = Roomity.com
http://roomity.com/demo.jsp
*Your* clubs, no sign up to read, ad supported; try broadband internet.

cell: 917 825 3035 in DFW
email: netsql at roomity.com


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



Re: Error: Cannot forward after response has been committed?

2005-09-01 Thread Guillermo Castro
The error happens when part of your jsp page has already been sent to the 
client.

My recommendation would be to define a Tiles Controller (see 
org.apache.struts.tiles.ControllerSupport) that would do the forwarding 
logic.

I hope this helps.

On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
 
 Within a Tiles layout,
 I try to forward to another jsp when a bean not exist?
 
 But it leads to the subject line error message?
 
 In the header layout jsp, I put this
 
 logic:notPresent scope=session name=loginForm
 jsp:forward page=/index.jsp/
 /logic:notPresent
 
 If it is not allowed or it is not a good way,
 what is the better way or another way to do so?
 
 Thanks
 PC Leung
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Guillermo Castro [EMAIL PROTECTED]
Monterrey NL, Mexico http://www.javageek.org/


Re: OT: Good Java host

2005-09-01 Thread netsql

It be great if this freqeunt OT question was on wiki.
.V

lchalupa wrote:
I've been with eapps.com 



--
thx,
.V

Broadband interface (RIA) + mail box safety = Roomity.com
http://roomity.com/demo.jsp
*Your* clubs, no sign up to read, ad supported; try broadband internet.

cell: 917 825 3035 in DFW
email: netsql at roomity.com


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



Re: Error: Cannot forward after response has been committed?

2005-09-01 Thread 梁炳場
What if the Tiles layout composing header, menu and body.

Where the Tiles Controller belongs to?
Does it stick one layout?

Thanks

2005/9/1, Guillermo Castro [EMAIL PROTECTED]:
 The error happens when part of your jsp page has already been sent to the
 client.
 
 My recommendation would be to define a Tiles Controller (see
 org.apache.struts.tiles.ControllerSupport) that would do the forwarding
 logic.
 
 I hope this helps.
 
 On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
 
  Within a Tiles layout,
  I try to forward to another jsp when a bean not exist?
 
  But it leads to the subject line error message?
 
  In the header layout jsp, I put this
 
  logic:notPresent scope=session name=loginForm
  jsp:forward page=/index.jsp/
  /logic:notPresent
 
  If it is not allowed or it is not a good way,
  what is the better way or another way to do so?
 
  Thanks
  PC Leung
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 --
 Guillermo Castro [EMAIL PROTECTED]
 Monterrey NL, Mexico http://www.javageek.org/
 



RE: Struts-Tiles Design question

2005-09-01 Thread Dharmendra . Sharan
Hi,

   Just a follow question to a similar scenario, what's the recomended approach 
with Struts-Tiles to handle the different modes in which a JSP may be 
displayed. i.e. Add/Edit/View especially for say a JSP page which has multiple 
sections.

   e.g. Dish.jsp which can be composed of multiple sections, such as 
summary.jsp, picture.jsp, ingredients.jsp, preparation.jsp, cost.jsp 

   Here are the approaches I can think of:-

   1. Tile Definition say dish.content which has all the JSPs inserts for the 
dish.jsp page, and each section's 
(summary/picture/ingredients/preparation/cost) JSP expectinig some request 
attribute say mode to determine how to display that individual section in Add 
or Edit or View mode.

definition name=main.dish path=/jsp/layout/classicLayout.jsp
  put name=header value=/jsp/dish/header_dish.jsp/
put name=body value=dish.content/
/definition

definition name=dish.content path=/jsp/layout/columnsLayout.jsp
  put name=numCols value=1 /
  putList name=list0 
add value=/jsp/dish/summary.jsp /
add value=/jsp/dish/picture.jsp /
add value=/jsp/dish/ingredients.jsp /
add value=/jsp/dish/preparation.jsp /
add value=/jsp/dish/cost.jsp /
  /putList
/definition

And say in the DishAction class doing the forward to the tiles definition 
say main.dish and passing the request attribute say mode having value 
edit, view and so on...

   2. Having the JSP pages for each section split further as separate JSPs for 
each mode say summary_add.jsp, summary_edit.jsp, summary_view.jsp and using 
multiple tile definitions having the same layout!!! such as below:-

definition name=main.dish.edit path=/jsp/layout/classicLayout.jsp
  put name=header value=/jsp/dish/header_dish_edit.jsp/
put name=body value=dish.content.edit/
/definition

definition name=main.dish.view path=/jsp/layout/classicLayout.jsp
  put name=header value=/jsp/dish/header_dish_view.jsp/
put name=body value=dish.content.view/
/definition

definition name=dish.content.edit path=/jsp/layout/columnsLayout.jsp
  put name=numCols value=1 /
  putList name=list0 
add value=/jsp/dish/summary_edit.jsp /
add value=/jsp/dish/picture_edit.jsp /
add value=/jsp/dish/ingredients_edit.jsp /
add value=/jsp/dish/preparation_edit.jsp /
add value=/jsp/dish/cost_edit.jsp /
  /putList
/definition

definition name=dish.content.view path=/jsp/layout/columnsLayout.jsp
  put name=numCols value=1 /
  putList name=list0 
add value=/jsp/dish/summary_view.jsp /
add value=/jsp/dish/picture_view.jsp /
add value=/jsp/dish/ingredients_view.jsp /
add value=/jsp/dish/preparation_view.jsp /
add value=/jsp/dish/cost_view.jsp /
  /putList
/definition

And the having the DishAction class forward to appropriate tiles 
definition main.dish.edit or main.dish.view..but in this case we are 
duplicating the Tile definitions even though the page layout is exactly the 
same!!!

Any thoughts/comments/suggestions are most welcome. Thanks in advance!,

Regards,

Dharmendra
ps: have a good day!
-Original Message-
From: Michael Rasmussen [mailto:[EMAIL PROTECTED]
Sent: Friday, August 26, 2005 11:37 AM
To: Struts Users Mailing List
Subject: Re: Struts-Tiles Design question


Dilip,
The tiles controller sounds like an interesting way to do it, but I
have never used it.  I agree with Nels that you should stay away from
a JSP implementation of this.  I have stretched tiles pretty far as to
what it can do conditionally, and I have been very happy with it.  I
would suggest using an action to make decisions about where to go, and
use tiles templates to put the right fragments in the right places.

Michael

On 8/25/05, Nels Overgaard-Cook [EMAIL PROTECTED] wrote:
 If you put the business logic in the JSPs, then it seems to me that you're
 essentially mixing the business and presentation layers. I would put the
 business login in an action and figure out which tile to forward to from
 there. Of course, I haven't used the Tiles Controller that Greg suggested...
 
 Nels
 
 On 8/25/05, Dilip Ladhani [EMAIL PROTECTED] wrote:
 
  I have an application built on struts and tiles. I have a design question
  and would like some of your valuable opinions.
 
  I have a huge jsp, which is broken into many includes, say abc.jsp and
  includes one.jsp, two.jsp etc.
  As, I mentioned I use tiles so in the config file, I have a forward
  element,
  which is like this
  forward name=abc path=abc contextRelative=true/
 
  The abc is defined in the tiles as
  put name=body-content value=/abc.jsp /
 
  Now for the design question...
  I am going to have to switch the includes (one.jsp, two.jsp etc) based on
  some business rules like the 

Re: DAOs in service methods

2005-09-01 Thread Frank W. Zammetti
As Leon said, there probably isn't any one right answer, although I 
think it's fair to say that best practices is as Leon says, to *not* 
create a DAO per service method.


What I tend to do, and I'm not claiming this is any more right than 
anything else, is to have a DAO factory where I get my DAOs from.  It is 
the factory's responsibility to get a database connection from the pool 
and hand it off to the DAO.  In this way I can have a single factory and 
get multiple DAOs from it, each sharing the same database connection. 
The factory I instantiate for each request, so if I use 10 DAOs during a 
single request, it's still only a single database connection.


Using something like iBatis or Hibernate would in effect take the place 
of the factory and should deal with these concerns for you, but I have 
not yet used either product in a production app, I've always done it 
myself (getting away from that!).


Frank

Leon Rosenberg wrote:

On Wed, 2005-08-31 at 21:19 -0700, Paul Benedict wrote:


Hey guys.

I have alot of service objects called from Struts, and
each have a good deal of service methods. Service
methods mainly do business logic and talk to DAO
objects.

Question:
I've taken the approach of service methods having the
responsibility of instantiating DAO objects locally
and using them. Is this correct? Or should I
instantiate all the DAO objects that could ever be
needed in my service constructor, and use them as
instance variables?

Or is there a better design?



Hi,

design is always the matter of the desired functionality, so it's hard
to say what is best for you without knowing your business goals.

But what can be said for sure, is, that instantiating DAOs locally on
each call is a waste of ressources, since each new DAO will probably
create a new connection to the db.

Having one instance per service is generelly better, but you must keep
an eye on synchronization and concurrency.

regards
Leon



Thanks!




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 



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







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


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



RE: How to pass SQL variable from JSP to Action?

2005-09-01 Thread Mark Benussi
No he is saying don’t look up data in a JSP.

Look it up in a Struts action and place in the presentation layer via an
ActionForm etc before showing the JSP

-Original Message-
From: ??? [mailto:[EMAIL PROTECTED] 
Sent: 01 September 2005 15:09
To: Struts Users Mailing List
Subject: Re: How to pass SQL variable from JSP to Action?

Richard

Are you suggesting something like Hibernate or iBatis?

Daniel


2005/9/1, R. Markham [EMAIL PROTECTED]:
 Hallo Nobody(??)
 
 It is bad practice to put SQL Statement in a JSP page.
 
 Regards
 
 Richard Markham
 
 
 -Ursprüngliche Nachricht-
 Von: ??? [mailto:[EMAIL PROTECTED]
 Gesendet: Donnerstag, 1. September 2005 05:30
 An: Struts Users Mailing List
 Betreff: Re: How to pass sql variable from jsp to Action?
 
 I wonder if it is a proper way to do it because
 the 1st query displays a no of rows with different group ids.
 Can the html:link pass a value to Action?
 If it can, it is excellent.
 
 Should it be done like this?
 change the layout from a no of links html:link
 to a no of forms html:form
 In each form, it has hidden value of group id.
 
 How will you do this? Thank you very much for your help.
 
 2005/9/1, 梁炳�� [EMAIL PROTECTED]:
  I retrieve a group id by JSP.
  sql:query  ...SELECT group_id../
 
  When user clicks a link
  html:link .../
 
  Before another page is shown, in my struts-config.xml,
  I try to make a ActionForward function to capture the group_id
  and then update a session attribute .
 
  Then the resulting jsp is like this
  sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
 
  Is this a proper way to do this?
 
  I do not know how to write in the Action class so that
  it can retrieve the sql value from the passing in jsp file.
 
  Your help is very much appreicated.
 
 
 
 -
 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: Error: Cannot forward after response has been committed?

2005-09-01 Thread Guillermo Castro
Ok... 

Assuming you have a tiles layout definition like:

definition name=.basic.layout path=/common/mainLayout.jsp
put name=header value=/common/headerTile.jsp /
put name=content value= /
put name=footer value=/common/footerTile.jsp /
/definition

You can make the header content a tile definition by itself, and use that 
definition to declare your Controller class, which will be the one with the 
logic for forwarding:

definition name=.basic.layout path=/common/mainLayout.jsp
put name=header value=.basic.layout.header /
put name=content value= /
put name=footer value=/common/footerTile.jsp /
/definition

definition name=.basic.layout.header page=/common/headerTile.jsp
controllerClass=my.package.HeaderController
/definition


And put the forward inside the HeaderController class:

public void execute(ComponentContext tileContext, HttpServletRequest 
request,
HttpServletResponse response, ServletContext servletContext) throws 
Exception {
HttpSession session = request.getSession(false);
if(null == session || null == session.getAttribute(loginForm)) {
response.sendRedirect(/index.jsp);
}
}

Also, make sure that your '/common/mainLayout.jsp' page doesn't have any 
html code before the tiles:insert attribute=header / invocation, or it 
will make a response being sent to the client.

Regards.

On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
 
 What if the Tiles layout composing header, menu and body.
 
 Where the Tiles Controller belongs to?
 Does it stick one layout?
 
 Thanks
 
 2005/9/1, Guillermo Castro [EMAIL PROTECTED]:
  The error happens when part of your jsp page has already been sent to 
 the
  client.
 
  My recommendation would be to define a Tiles Controller (see
  org.apache.struts.tiles.ControllerSupport) that would do the forwarding
  logic.
 
  I hope this helps.
 
  On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
  
   Within a Tiles layout,
   I try to forward to another jsp when a bean not exist?
  
   But it leads to the subject line error message?
  
   In the header layout jsp, I put this
  
   logic:notPresent scope=session name=loginForm
   jsp:forward page=/index.jsp/
   /logic:notPresent
  
   If it is not allowed or it is not a good way,
   what is the better way or another way to do so?
  
   Thanks
   PC Leung
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  Guillermo Castro [EMAIL PROTECTED]
  Monterrey NL, Mexico http://www.javageek.org/
 
 
 



-- 
Guillermo Castro [EMAIL PROTECTED]
Monterrey NL, Mexico http://www.javageek.org/


Re: Select Options Question

2005-09-01 Thread Frank W. Zammetti
I'm not sure I understand... do you just need to have the group name 
when you display the detail for the selected item, or do you need the 
entire select list (to avoid getting it from the datavase each time?)


If you just need the grou pname, could you simply put the group name in 
session?  May or may not work depending on the flow of your app, but it 
would be a nice, simple solution if it'll work... just remember to clear 
it out at an appropriate time.


The other option that comes to mind immediately is indeed to use 
Javascript... seems like all you'd need is a form with two hidden 
fields, groupName and value... onChange of the select, populate those 
two fields and submit() the form.  You'd then have both pieces of 
information to render your detail page.


Or maybe I don't understand the problem?

Frank

[EMAIL PROTECTED] wrote:

I am sure there is a slick way to do this, but it escapes me at the moment.

I have a Select Box that I am populating with the html:options tag  The
result is:

select name=cmbGroup id=groupList
option value=jk12341Group 1/option
option value=34t1fv1Group 2/option
option value=32fq21Group 3/option
   ...
/select

I need the value for DAO actions performed from the search which will
return a detail bean for display on an output JSP.

On the output JSP I need to Display the Group Name that I selected from the
input.  My Form holds the group id and a field for the group name.  The
options that I can see are:

1.  Requery the Database for the output page to retrieve the name given I
have the key.  This would work, but seems like a lot of overhead to go to
the database each time.
2.  Create a delimited value (ie option value=jk12341, Group 1Group
1/option) and use the String Split to get the value and label.  (I am
leaning toward this)
3.  use javascript to update the field each time the select changes.  The
problem with this is that the select box can be very large based on the
users selections on previous entries.
4.  Store the Value Label list in the session (Don't like this at all
because the volume of users that will use this application).

Any other suggestions?



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


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



Re: DAOs in service methods

2005-09-01 Thread Larry Meadors
Actually, the iBATIS DAO stuff works well with darn near any data
access technology - sqlmaps, hibernate, jdbc, and about 5-6 more
out-of-the-box, so don't think that using the iBATIS DAO means you
have to use iBATIS SQL Maps - they are very seperate tools.

What it does is similar to what you are describing - it creates a Map
of DAO implementations that are keyed by the interfaces for them. One
assumption that it does make is that the DAO implementations are
thread-safe. It will also allow you to use the implementation as the
key, but IMO this is not the best practice.

Anyway, you can define an AccountDao interface with the basic CRUD
operations, then implement that interface using any data access
technology you prefer. Then you use the iBATIS DaoManager to get
(shared) instances of those DAO classes.

It will also help manage transactions, too.

Larry

On 9/1/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
 As Leon said, there probably isn't any one right answer, although I
 think it's fair to say that best practices is as Leon says, to *not*
 create a DAO per service method.
 
 What I tend to do, and I'm not claiming this is any more right than
 anything else, is to have a DAO factory where I get my DAOs from.  It is
 the factory's responsibility to get a database connection from the pool
 and hand it off to the DAO.  In this way I can have a single factory and
 get multiple DAOs from it, each sharing the same database connection.
 The factory I instantiate for each request, so if I use 10 DAOs during a
 single request, it's still only a single database connection.
 
 Using something like iBatis or Hibernate would in effect take the place
 of the factory and should deal with these concerns for you, but I have
 not yet used either product in a production app, I've always done it
 myself (getting away from that!).
 
 Frank
 
 Leon Rosenberg wrote:
  On Wed, 2005-08-31 at 21:19 -0700, Paul Benedict wrote:
 
 Hey guys.
 
 I have alot of service objects called from Struts, and
 each have a good deal of service methods. Service
 methods mainly do business logic and talk to DAO
 objects.
 
 Question:
 I've taken the approach of service methods having the
 responsibility of instantiating DAO objects locally
 and using them. Is this correct? Or should I
 instantiate all the DAO objects that could ever be
 needed in my service constructor, and use them as
 instance variables?
 
 Or is there a better design?
 
 
  Hi,
 
  design is always the matter of the desired functionality, so it's hard
  to say what is best for you without knowing your business goals.
 
  But what can be said for sure, is, that instantiating DAOs locally on
  each call is a waste of ressources, since each new DAO will probably
  create a new connection to the db.
 
  Having one instance per service is generelly better, but you must keep
  an eye on synchronization and concurrency.
 
  regards
  Leon
 
 
 Thanks!
 
 
 
 
 Start your day with Yahoo! - make it your home page
 http://www.yahoo.com/r/hs
 
 
 -
 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]
 
 
 
 
 
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: Select Options Question

2005-09-01 Thread BHansard

On the result page I only need the Label for the selected option.  Not the entire list.  The problem is that when you submit the form, you only submit the value in the form object and loose the label.  I need to pass the label as well so that I do not have to requery for it.

The way that i have it currently is that the value contains a comma delemited string containing both the label and key (overkill on the bandwidth I know).  In my action class, I do a string.split on the comma and pass the first value to my DAO processor and the Second value I put in my form for display.  It is the only way I could think of without iterating through the options or storing the initial results which populate the option list.


Frank W. Zammetti [EMAIL PROTECTED]








Frank W. Zammetti [EMAIL PROTECTED] 
09/01/2005 11:28 AM

Please respond to
Struts Users Mailing List user@struts.apache.org








To
Struts Users Mailing List user@struts.apache.org


cc



Subject
Re: Select Options Question








I'm not sure I understand... do you just need to have the group name 
when you display the detail for the selected item, or do you need the 
entire select list (to avoid getting it from the datavase each time?)

If you just need the grou pname, could you simply put the group name in 
session? May or may not work depending on the flow of your app, but it 
would be a nice, simple solution if it'll work... just remember to clear 
it out at an appropriate time.

The other option that comes to mind immediately is indeed to use 
_javascript_... seems like all you'd need is a form with two hidden 
fields, groupName and value... onChange of the select, populate those 
two fields and submit() the form. You'd then have both pieces of 
information to render your detail page.

Or maybe I don't understand the problem?

Frank

[EMAIL PROTECTED] wrote:
 I am sure there is a slick way to do this, but it escapes me at the moment.
 
 I have a Select Box that I am populating with the html:options tag The
 result is:
 
 select name=cmbGroup id=groupList
   option value=jk12341Group 1/option
   option value=34t1fv1Group 2/option
   option value=32fq21Group 3/option
  ...
 /select
 
 I need the value for DAO actions performed from the search which will
 return a detail bean for display on an output JSP.
 
 On the output JSP I need to Display the Group Name that I selected from the
 input. My Form holds the group id and a field for the group name. The
 options that I can see are:
 
 1. Requery the Database for the output page to retrieve the name given I
 have the key. This would work, but seems like a lot of overhead to go to
 the database each time.
 2. Create a delimited value (ie option value=jk12341, Group 1Group
 1/option) and use the String Split to get the value and label. (I am
 leaning toward this)
 3. use _javascript_ to update the field each time the select changes. The
 problem with this is that the select box can be very large based on the
 users selections on previous entries.
 4. Store the Value Label list in the session (Don't like this at all
 because the volume of users that will use this application).
 
 Any other suggestions?
 

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


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





Re: Select Options Question

2005-09-01 Thread glenn . deschenes
You can also build a javascript array of the descriptions.
When the user selects the option from the list, execute a javascript 
function that will do a lookup for the description in the array and set a 
hidden form field with the description found in the array.

It may happen that the character you use to delimit the key and value will 
end up in the value and then the fun starts !

HTH,
Glenn




[EMAIL PROTECTED] 
01/09/2005 12:07 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc
Struts Users Mailing List user@struts.apache.org
Subject
Re: Select Options Question






On the result page I only need the Label for the selected option. Not the 
entire list. The problem is that when you submit the form, you only submit 
the value in the form object and loose the label. I need to pass the label 
as well so that I do not have to requery for it.

The way that i have it currently is that the value contains a comma 
delemited string containing both the label and key (overkill on the 
bandwidth I know). In my action class, I do a string.split on the comma 
and pass the first value to my DAO processor and the Second value I put in 
my form for display. It is the only way I could think of without iterating 
through the options or storing the initial results which populate the 
option list.


Frank W. Zammetti [EMAIL PROTECTED]


Frank W. Zammetti [EMAIL PROTECTED] 
09/01/2005 11:28 AM 

Please respond to
Struts Users Mailing List user@struts.apache.org




To

Struts Users Mailing List user@struts.apache.org

cc


Subject

Re: Select Options Question





I'm not sure I understand... do you just need to have the group name 
when you display the detail for the selected item, or do you need the 
entire select list (to avoid getting it from the datavase each time?)

If you just need the grou pname, could you simply put the group name in 
session?  May or may not work depending on the flow of your app, but it 
would be a nice, simple solution if it'll work... just remember to clear 
it out at an appropriate time.

The other option that comes to mind immediately is indeed to use 
Javascript... seems like all you'd need is a form with two hidden 
fields, groupName and value... onChange of the select, populate those 
two fields and submit() the form.  You'd then have both pieces of 
information to render your detail page.

Or maybe I don't understand the problem?

Frank

[EMAIL PROTECTED] wrote:
 I am sure there is a slick way to do this, but it escapes me at the 
moment.
 
 I have a Select Box that I am populating with the html:options tag The
 result is:
 
 select name=cmbGroup id=groupList
 option value=jk12341Group 1/option
 option value=34t1fv1Group 2/option
 option value=32fq21Group 3/option
...
 /select
 
 I need the value for DAO actions performed from the search which will
 return a detail bean for display on an output JSP.
 
 On the output JSP I need to Display the Group Name that I selected from 
the
 input.  My Form holds the group id and a field for the group name.  The
 options that I can see are:
 
 1.  Requery the Database for the output page to retrieve the name given 
I
 have the key.  This would work, but seems like a lot of overhead to go 
to
 the database each time.
 2.  Create a delimited value (ie option value=jk12341, Group 1Group
 1/option) and use the String Split to get the value and label.  (I am
 leaning toward this)
 3.  use javascript to update the field each time the select changes. The
 problem with this is that the select box can be very large based on the
 users selections on previous entries.
 4.  Store the Value Label list in the session (Don't like this at all
 because the volume of users that will use this application).
 
 Any other suggestions?
 

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


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




[OT] Application context URL

2005-09-01 Thread DGraham
I'm using iText to dynamically create PDF and I'd like to make them 
available by appending the location of the generated file to the 
application context URL.  I'll be using a filter to prevent the files from 
being generally availalable.

So is it possible to programmatically determine the app context url?

Thanks,
Denis

Re: DAOs in service methods

2005-09-01 Thread Frank W. Zammetti

Sounds quite cool :)

Unfortunately, I already lost the argument at work to use iBatis instead 
of Hibernate.  Hibernate isn't bad, but I would have preferred iBatis. 
Oh well.


Frank

Larry Meadors wrote:

Actually, the iBATIS DAO stuff works well with darn near any data
access technology - sqlmaps, hibernate, jdbc, and about 5-6 more
out-of-the-box, so don't think that using the iBATIS DAO means you
have to use iBATIS SQL Maps - they are very seperate tools.

What it does is similar to what you are describing - it creates a Map
of DAO implementations that are keyed by the interfaces for them. One
assumption that it does make is that the DAO implementations are
thread-safe. It will also allow you to use the implementation as the
key, but IMO this is not the best practice.

Anyway, you can define an AccountDao interface with the basic CRUD
operations, then implement that interface using any data access
technology you prefer. Then you use the iBATIS DaoManager to get
(shared) instances of those DAO classes.

It will also help manage transactions, too.

Larry

On 9/1/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:


As Leon said, there probably isn't any one right answer, although I
think it's fair to say that best practices is as Leon says, to *not*
create a DAO per service method.

What I tend to do, and I'm not claiming this is any more right than
anything else, is to have a DAO factory where I get my DAOs from.  It is
the factory's responsibility to get a database connection from the pool
and hand it off to the DAO.  In this way I can have a single factory and
get multiple DAOs from it, each sharing the same database connection.
The factory I instantiate for each request, so if I use 10 DAOs during a
single request, it's still only a single database connection.

Using something like iBatis or Hibernate would in effect take the place
of the factory and should deal with these concerns for you, but I have
not yet used either product in a production app, I've always done it
myself (getting away from that!).

Frank

Leon Rosenberg wrote:


On Wed, 2005-08-31 at 21:19 -0700, Paul Benedict wrote:



Hey guys.

I have alot of service objects called from Struts, and
each have a good deal of service methods. Service
methods mainly do business logic and talk to DAO
objects.

Question:
I've taken the approach of service methods having the
responsibility of instantiating DAO objects locally
and using them. Is this correct? Or should I
instantiate all the DAO objects that could ever be
needed in my service constructor, and use them as
instance variables?

Or is there a better design?



Hi,

design is always the matter of the desired functionality, so it's hard
to say what is best for you without knowing your business goals.

But what can be said for sure, is, that instantiating DAOs locally on
each call is a waste of ressources, since each new DAO will probably
create a new connection to the db.

Having one instance per service is generelly better, but you must keep
an eye on synchronization and concurrency.

regards
Leon




Thanks!




Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs


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







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


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










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


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



Re: Trim all fields before validation

2005-09-01 Thread Kishore Senji
Wouldn't this be easier, without mucking with the form, to let this be 
handled by the validator itself. For any field validation you would just 
have to have the requires validation before you do any other validation, 
and that way you would take care of empty strings or as Joe said you could 
do this in javascript as well pretty easily.


Re: [OT] Application context URL

2005-09-01 Thread Kishore Senji
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()

On 9/1/05, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:
 
 I'm using iText to dynamically create PDF and I'd like to make them
 available by appending the location of the generated file to the
 application context URL. I'll be using a filter to prevent the files from
 being generally availalable.
 
 So is it possible to programmatically determine the app context url?
 
 Thanks,
 Denis



Re: [OT] Application context URL

2005-09-01 Thread DGraham
Not  exactly what I was looking for, but I did find this: 
http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html?l=new

Thanks,
Dennis





Kishore Senji [EMAIL PROTECTED] 
09/01/2005 12:47 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: [OT] Application context URL






http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()


On 9/1/05, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:
 
 I'm using iText to dynamically create PDF and I'd like to make them
 available by appending the location of the generated file to the
 application context URL. I'll be using a filter to prevent the files 
from
 being generally availalable.
 
 So is it possible to programmatically determine the app context url?
 
 Thanks,
 Denis




Re: DAOs in service methods

2005-09-01 Thread Christian Bollmeyer

Hi,

my suggestion would be to have a closer look at the
Spring framework. IoC / dependency injection is
really cool once you get a grasp of it. Instead of
having the service look up a DAO instance, you
simply inject the fitting implementation class into
the service via Spring. The service itself only knows
the DAO interface and has a setter property for it.
Note that this way you also have to deal with
shared instances (like with iBATIS DAO)  and
therefore have to keep heed of thread issues, but
luckily Spring also provides template implementations
for most common database access solutions (JDBC,
iBATIS, Hibernate, JDO, Toplink (by Oracle) which
are said (I still have to check that out) to be
inherently thread-safe. Btw. can anybody here
confirm this? Currently, we are probably too
cautious in this direction (using iBATIS).

-- Chris.

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

To: user@struts.apache.org
Sent: Thursday, September 01, 2005 6:19 AM
Subject: DAOs in service methods



Hey guys.

I have alot of service objects called from Struts, and
each have a good deal of service methods. Service
methods mainly do business logic and talk to DAO
objects.

Question:
I've taken the approach of service methods having the
responsibility of instantiating DAO objects locally
and using them. Is this correct? Or should I
instantiate all the DAO objects that could ever be
needed in my service constructor, and use them as
instance variables?

Or is there a better design?

Thanks!




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



Re: DAOs in service methods

2005-09-01 Thread Larry Meadors
iBATIS is 100% thread-safe.

Larry


PS: can you point me to a good example of a Spring-based DAO implementation?


On 9/1/05, Christian Bollmeyer [EMAIL PROTECTED] wrote:
 Hi,
 
 my suggestion would be to have a closer look at the
 Spring framework. IoC / dependency injection is
 really cool once you get a grasp of it. Instead of
 having the service look up a DAO instance, you
 simply inject the fitting implementation class into
 the service via Spring. The service itself only knows
 the DAO interface and has a setter property for it.
 Note that this way you also have to deal with
 shared instances (like with iBATIS DAO)  and
 therefore have to keep heed of thread issues, but
 luckily Spring also provides template implementations
 for most common database access solutions (JDBC,
 iBATIS, Hibernate, JDO, Toplink (by Oracle) which
 are said (I still have to check that out) to be
 inherently thread-safe. Btw. can anybody here
 confirm this? Currently, we are probably too
 cautious in this direction (using iBATIS).
 
 -- Chris.
 
 - Original Message -
 From: Paul Benedict [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Thursday, September 01, 2005 6:19 AM
 Subject: DAOs in service methods
 
 
  Hey guys.
 
  I have alot of service objects called from Struts, and
  each have a good deal of service methods. Service
  methods mainly do business logic and talk to DAO
  objects.
 
  Question:
  I've taken the approach of service methods having the
  responsibility of instantiating DAO objects locally
  and using them. Is this correct? Or should I
  instantiate all the DAO objects that could ever be
  needed in my service constructor, and use them as
  instance variables?
 
  Or is there a better design?
 
  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: Specifying MessageResource for Title information.

2005-09-01 Thread Kishore Senji
one way is to define a CustomMessageResources and a 
CustomMessageResourcesFactory to take care of this. The basic idea is that 
we would define something like this in the struts-config.xml

message-resources 
parameter=hints,otherhints,ApplicationResources
factory=com.a.b.c.CustomMessageResourcesFactory
null=true/ 
and let our CustomMessageResources in it's loadBundle method parse the 
parameter with the , delimiter and loadBundles for all the properties 
files. One thing to note here would be that although they would be different 
properties files for us, it would get compiled as a single Map so, any 
properties with the same key will get silently overridden. (having a unique 
prefix for a given property file should take of this)

Take a look at 
http://javaboutique.internet.com/tutorials/Dynaform/index-7.html
Although the author overrode the Servlet there in his implementation, just 
providing a new factory to create your Custom Message Resources should 
suffice.

On 8/31/05, Ajaya Agrawalla [EMAIL PROTECTED] wrote:
 
 Folks,
 
 I am trying to have all my form fields to have a title. The way I
 approached this was to pass title information to the html:* tags like 
 below.
 
 html:text bundle=hints titleKey=somekey properties=some /
 
 I have the hints.properties file in the classes folder.
 
 I separated all the title related keys to hints.properties. The problem
 with this approach is I have to specify the bundle information every time 
 I
 have pass title information. The only other way I could get away from
 passing bundle info is to put the keys in ApplicationResource file. But i
 really wanted to keep it separate. We envision having title information in
 multiple languages.
 
 Anyone have any better idea??
 
 Thanks
 
 AJ
 
 



test mail..pls. ignore...

2005-09-01 Thread Dharmendra . Sharan
Hi,

 Sorry but I wasn't able to see my post on the mailing list. I need to 
verify if this is okay... Apologies for the inconvenience.

 - Dharmendra

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

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

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


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



Re: Trim all fields before validation

2005-09-01 Thread Dilip Ladhani
I am not a fan of javascript, I know, I can use this, but I have always had 
browser compatibility issues with javascript. I still use javascript, when 
absolutely necessary, but I prefer to avoid it.


As far as required goes, that probably won't work because I could have a 
string like test which would pass the required test, wouldn't it? 
unless I misunderstood what you are suggesting.


I did try a generic loop as per Joe's suggestion and that worked pretty 
well. Here is a what I did.


java.util.Map map = thisForm.getMap();
java.util.Iterator it = map.keySet().iterator();
while(it.hasNext()){
 String key = (String) it.next();
 Object obj = map.get(key);
 if (obj instanceof String){
   obj = ((String) obj).trim();
 }
 else if(obj instanceof String[]){
String[] temp = (String[]) obj;
for(int i=0;itemp.length; i++){
  temp[i] = temp[i].trim();
}
   obj = temp;
 }
map.put(key, obj);
}



From: Kishore Senji [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 1 Sep 2005 09:40:42 -0700

Wouldn't this be easier, without mucking with the form, to let this be
handled by the validator itself. For any field validation you would just
have to have the requires validation before you do any other validation,
and that way you would take care of empty strings or as Joe said you could
do this in javascript as well pretty easily.




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



Specified RequestProcessor not compatible with TilesRequestProcessor

2005-09-01 Thread Jane Eisenstein
I am integrating Struts into an existing web application. It seemed like
a good idea to have our custom RequestProcessor extend
org.apache.struts.tiles.TilesRequestProcessor rather than
org.apache.struts.action.RequestProcessor, so we would have the option
of using Tiles. However, when I change the struts-config.xml controller
tag to:
controller
processorClass=com.med.struts.action.CustomRequestProcessor/
where previously it had been:
controller
processorClass=org.apache.struts.tiles.TilesRequestProcessor/

I get the following errors if the CustomRequestProcessor extends the
TilesRequestProcessor and the application is configured to use the Tiles
tab library and plug-in:

org.apache.struts.tiles.TilesPlugin TilesPlugin : Specified
RequestProcessor not compatible with TilesRequestProcessor

org.apache.struts.action.ActionServlet Unable to initialize Struts
ActionServlet due to an unexpected exception or error thrown, so marking
the servlet as unavailable. Most likely, this is due to an incorrect or
missing library dependency.

org.apache.struts.action.ActionServlet TRAS0014I: The following
exception was logged javax.servlet.ServletException: TilesPlugin :
Specified RequestProcessor not compatible with TilesRequestProcessor

Beyond extending org.apache.struts.tiles.TilesRequestProcessor, what is
needed to make the CustomRequestProcessor compatible with
TilesRequestProcessor?

--
Jane Eisenstein
MEDecision, Inc.
phone: 610-540-0202 ext. 1285
email:  [EMAIL PROTECTED]

 


RE: custom date converters

2005-09-01 Thread Rivka Shisman
Thanks Joe

When you say - 
this is a limitation of the BeanUtils design 
model.  It assumes for any given process (instance of BeanUtils), a 
single conversion strategy applies to all objects of a given type.

Do you mean that the converter applies thru my all application?
As much as I know - copyProperties() is a static method of BeanUtils so
I'm don't really know where (if at all) BeanUtils is instanciated.

Thanks
Rivka


-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 01, 2005 3:55 PM
To: Rivka Shisman; Struts Users Mailing List
Subject: Re: custom date converters

At 3:27 PM +0200 9/1/05, Rivka Shisman wrote:
Hi friends



I'm not sure I understand the use of custom converters:



If for example I have 2 VO's and each has a Timestamp property. But -
each one takes a different date format from the user. Do I need a
different StringToTimestamp converter for each one? If yes - how does
BeanUtils.copyProperties() know which converter to use (both the above
properties are the same type - Timestamp)?

It does not.  Frankly, this is a limitation of the BeanUtils design 
model.  It assumes for any given process (instance of BeanUtils), a 
single conversion strategy applies to all objects of a given type.

I have solved this sometimes by writing a Converter which expects a 
few specific variations of a date format and then tests the string 
length to look up the format string -- obviously this is imperfect, 
but it may work for you.

(something like this:

if (str.length() == 10) {
// parse date using mm/dd/
} else if (str.length() == 8) {
// parse date using hh:mm a
} else {
throw new IllegalArgumentException(Unrecognized date format);
}

Joe
-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex


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



Re: [OT] Not struts but u guys know a good Spell Check

2005-09-01 Thread Wendy Smoak

From: Ajaya Agrawalla [EMAIL PROTECTED]


I am trying to validate some long input from the browser with a spell
checker.. Any suggestions??


JSpellHTML [not free] runs as a webapp and does a great job of spell 
checking HTML form elements.


http://www.thesolutioncafe.com/html-spell-checker.html

One of my webapps has the users entering long text descriptions of their 
activities which then get emailed out to a large group of people.  They love 
having the ability to spell check their work before submitting the form.


--
Wendy Smoak


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



Re: Trim all fields before validation

2005-09-01 Thread Dilip Ladhani
I am going to try that out in our new application Frank. The trim issue 
was with our older app, which is the big sustaining force (cash cow) for our 
company, and I wasn't able to push through the new jar and web.xml changes 
there, as people are nervous whenever I suggest anything major there.


I do like the JWP concept, and will try it out in our new app and let you 
know of any shortcommings I find. Thanks for your help and your work in 
making it available.


Dilip



From: Frank W. Zammetti [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 01 Sep 2005 14:57:36 -0400

The ParameterMungerFilter in JWP didn't do the trick for you?  I'd love to 
know what shortcomings you found so that I can work to improve it :)


Frank

Dilip Ladhani wrote:
I am not a fan of javascript, I know, I can use this, but I have always 
had browser compatibility issues with javascript. I still use javascript, 
when absolutely necessary, but I prefer to avoid it.


As far as required goes, that probably won't work because I could have a 
string like test which would pass the required test, wouldn't 
it? unless I misunderstood what you are suggesting.


I did try a generic loop as per Joe's suggestion and that worked pretty 
well. Here is a what I did.


java.util.Map map = thisForm.getMap();
java.util.Iterator it = map.keySet().iterator();
while(it.hasNext()){
 String key = (String) it.next();
 Object obj = map.get(key);
 if (obj instanceof String){
   obj = ((String) obj).trim();
 }
 else if(obj instanceof String[]){
String[] temp = (String[]) obj;
for(int i=0;itemp.length; i++){
  temp[i] = temp[i].trim();
}
   obj = temp;
 }
map.put(key, obj);
}



From: Kishore Senji [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 1 Sep 2005 09:40:42 -0700

Wouldn't this be easier, without mucking with the form, to let this be
handled by the validator itself. For any field validation you would just
have to have the requires validation before you do any other 
validation,
and that way you would take care of empty strings or as Joe said you 
could

do this in javascript as well pretty easily.





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







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


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





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



Re: Trim all fields before validation

2005-09-01 Thread Frank W. Zammetti
The ParameterMungerFilter in JWP didn't do the trick for you?  I'd love 
to know what shortcomings you found so that I can work to improve it :)


Frank

Dilip Ladhani wrote:
I am not a fan of javascript, I know, I can use this, but I have always 
had browser compatibility issues with javascript. I still use 
javascript, when absolutely necessary, but I prefer to avoid it.


As far as required goes, that probably won't work because I could have 
a string like test which would pass the required test, 
wouldn't it? unless I misunderstood what you are suggesting.


I did try a generic loop as per Joe's suggestion and that worked pretty 
well. Here is a what I did.


java.util.Map map = thisForm.getMap();
java.util.Iterator it = map.keySet().iterator();
while(it.hasNext()){
 String key = (String) it.next();
 Object obj = map.get(key);
 if (obj instanceof String){
   obj = ((String) obj).trim();
 }
 else if(obj instanceof String[]){
String[] temp = (String[]) obj;
for(int i=0;itemp.length; i++){
  temp[i] = temp[i].trim();
}
   obj = temp;
 }
map.put(key, obj);
}



From: Kishore Senji [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 1 Sep 2005 09:40:42 -0700

Wouldn't this be easier, without mucking with the form, to let this be
handled by the validator itself. For any field validation you would just
have to have the requires validation before you do any other 
validation,
and that way you would take care of empty strings or as Joe said you 
could

do this in javascript as well pretty easily.





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







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


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



Not struts but u guys know a good Spell Check

2005-09-01 Thread Ajaya Agrawalla
I am trying to validate some long input from the browser with a spell
checker.. Any suggestions??

aj


ImageButtonBean and DynaActionForm

2005-09-01 Thread Richard Yee
Has anyone used an ImageButtonBean in a
DynaActionForm? I'm getting the following error:
org.apache.commons.beanutils.ConversionException:
Cannot assign value of type 'java.lang.String' to
property 'submitButton' of type
'org.apache.struts.util.ImageButtonBean'

My jsp page has this in it:
html:image src=images/bw_request_card.gif
property=submitButton alt=Submit /
html:image src=images/bw_cancel.gif
property=cancelButton alt=Cancel /

My struts-config.xml has this:
   form-bean ...
...
  form-property name=cancelButton
type=org.apache.struts.util.ImageButtonBean/
  form-property name=submitButton
type=org.apache.struts.util.ImageButtonBean/
/form-bean
Thanks,

Richard

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: DAOs in service methods

2005-09-01 Thread Christian Bollmeyer
On Thursday 01 September 2005 19:26, Larry Meadors wrote:
 iBATIS is 100% thread-safe.

 Larry


 PS: can you point me to a good example of a Spring-based DAO
 implementation?

Hm...IMHO one good example would be the JPetstore sample
app that comes with the Spring distribution, for instance.
Good in particular, as its not overly complex, plus you can
compare it to the 'traditional' iBATIS JPetStore app. The
architecture has slightly changed (the former 'service'
functionality now rather completely wandered underneath
'domain.logic', in the Facade implementation, which
is IMHO ok in this case, as it's mostly delegating everything
anyway). This is one of the samples I profited the most from
when evaluating Spring. Another good starting point would be
Matt Raible's AppFuse, which is basically for Hibernate and
a little bit more complex. Those two are kind of my 'reference
samples' when it comes to Spring :-) Note that in both cases,
the DAOs are very lean and don't contain any messy
synchronization code.

But IMHO the really cool thing about IoC (not to mention the
AOP functionality) is that you finally can achieve really
loose coupling throughout your entire app, and its simple.
In fact, we could replace virtually anything in our current
app by a different implementation, declaratively (apart
from providing the new implementation class, implemen-
ting the same interface). Another benefit is that Spring
is non-intrusive by design and you can happily stick to
the technology stack you already know it works. For
instance, we still use Struts/Tiles instead of Spring MVC
or JSF. Clearly worth a look, but be warned: if you've
used it once, you won't ever want to go back :-)

-- Chris.

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



Re: Tech-Stack Choices

2005-09-01 Thread James Mitchell

You are likely to hear many differing opinions on this list.

You should evaluate your criteria.  Are you wanting something slick?   
Fast development?  Easier maintenance?  Scalable?  Flexible?


If you are wanting something fast.  Take a look at Ruby on Rails, or  
stay tuned to this channel for updates on Struts Ti.


If you want to leverage your existing team's talent (based on your  
comment below), stay with Struts.


If you have to hire new help, you will find the largest talent base  
has Struts experience over anything else we've mentioned.


If you are wanting something standard (as in J2EE standards), I'd say  
go with JSF.  While you are not as likely to find as many developers  
with JSF experience as you will with Struts experience, JSF is not  
something to ignore.  In fact, the MyFaces (http:// 
myfaces.apache.org) community is vibrant and growing.


Unltimately, the decision is yours, I'm just along for the ride ;)   
and I'm excited to part of all of this.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 3:06 PM, Balasubramaniam, Sezhiyan wrote:


I am kind of new to this forum... Need some advice from the gurus.



In eBay, for our all intranet applications, we use JSP presentation,
STRUTS 1.0.1 as controller, java based application objects for  
business

logics and custom built XML based data access layer.



Now we are in the process of upgrading all our apps/apis/servers.



I thought of utilizing this opportunity and try to upgrade our STRUTS
applications, to come back to the industry-wide tech-stack.



But by following the forum, I am getting confused which one to choose
and what are their purposes:



STRUTS 1.2.x?

JSF?

SHALE?

SPRING?

HIBERNATE?



Can someone give a high level some idea and some pointers?



Our main focus is to align with the viable industry standards, the
same time not to jump into the usage of beta API's which are not  
tested

out thoroughly.



Appreciate the help.



Bala





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



jasper exception

2005-09-01 Thread Nirmala Dhara
Hello,

I am trying my first application using struts. I got /struts/bean-el not
found  error msg from tomcat 5.0.
my configuration is:

ApplicationResources.properties in tomcat/webapps/app-dir/WEB-INF/class
directory
web.xml and struts-config.xml are located at tomcat/webapps/app-dir
along with my *.jsp files
struts-*.tld exists in tomcat/webapps/app-dir/WEB-INF
struts jar files in tomcat/webapps/app-dir/WEB-INF/lib

-
type Exception report

message

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

exception

org.apache.jasper.JasperException: File /struts/bean-el not found

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler
.java:50)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:41
1)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:11
8)

org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.jav
a:159)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)

org.apache.jasper.compiler.ParserController.doParse(ParserController.java:2
20)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:101
)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:
511)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
---

my web.xml

?xml version=1.0 encoding=ISO-8859-1?

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

web-app

  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-valueApplicationResources/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value3/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value3/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

  !-- Action Servlet Mapping --
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern/do/*/url-pattern
  /servlet-mapping

  !-- The Welcome File List --
  welcome-file-list
welcome-fileindex.jsp/welcome-file
  /welcome-file-list

  !-- tag libs --
  taglib
taglib-uristruts/bean-el/taglib-uri
taglib-location/WEB-INF/struts-bean-el.tld/taglib-location
  /taglib

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

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

  taglib
taglib-urijstl/c/taglib-uri
taglib-location/WEB-INF/c.tld/taglib-location
  /taglib

/web-app
--
my index.jsp:
%@ taglib uri=struts/bean-el prefix=bean %
%@ taglib uri=struts/html-el prefix=html %
html
head
link href=html:rewrite page=/rr.css / rel=stylesheet
type=text/css
titlebean:message key=title.employeeApp//title
/head
body
h1bean:message key=title.employeeApp//h1
br
html:link page=/do/setupEmployeeFormAdd An Employee/html:link
/body
/html
-
resource bundle: (AapplicationResources.properties)
#-- titles --
title.employeeApp=EMPLOYEE APPLICATION
title.employee.employeeform=EMPLOYEE FORM
title.employee.insert.confirmation=EMPLOYEE INSERT CONFIRMATION
#-- buttons --
button.submit=SUBMIT
-



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



Re: custom date converters

2005-09-01 Thread Joe Germuska

At 4:32 PM -0400 9/1/05, Laurie Harper wrote:

Rivka Shisman wrote:

Thanks Joe

When you say -
this is a limitation of the BeanUtils design model.  It assumes 
for any given process (instance of BeanUtils), a single conversion 
strategy applies to all objects of a given type.



Do you mean that the converter applies thru my all application?
As much as I know - copyProperties() is a static method of BeanUtils so
I'm don't really know where (if at all) BeanUtils is instanciated.

Thanks
Rivka


You can register specific converters per call to copyProperties() to 
get the one you need in a particular situation. Here's what I do:


BeanUtilsBean util = new BeanUtilsBean();
ConvertUtilsBean converter = util.getConvertUtils();
converter.register(myConverter, SomeType.class);
util.copyProperties(bo, vo);

That way, you can register an instance of Converter that knows what 
format string to use each time you call copyProperties().


However, if you have one bean that has two properties of the same 
type that will be set with strings which require different 
translation strategies, you're stuck.


A counter example is how Spring approaches it; I don't have first 
hand experience, but I was recently piqued by this sentence in the 
Spring JavaDoc: [SpringBindingActionForm is ]A thin Struts 
ActionForm adapter that delegates to Spring's more complete and 
advanced data binder and Errors object underneath the covers to bind 
to POJOs and manage rejected values.


http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/web/struts/SpringBindingActionForm.html

If one had access to the Spring libraries, one could extend 
SpringBindingActionForm instead of Struts ActionForm -- not sure if 
the Spring DataBinder knows how to deal with DynaClasses or not.


Joe

--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex


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



Re: custom date converters

2005-09-01 Thread Laurie Harper

Rivka Shisman wrote:

Thanks Joe

When you say - 

this is a limitation of the BeanUtils design 
model.  It assumes for any given process (instance of BeanUtils), a 
single conversion strategy applies to all objects of a given type.



Do you mean that the converter applies thru my all application?
As much as I know - copyProperties() is a static method of BeanUtils so
I'm don't really know where (if at all) BeanUtils is instanciated.

Thanks
Rivka


You can register specific converters per call to copyProperties() to get 
the one you need in a particular situation. Here's what I do:


BeanUtilsBean util = new BeanUtilsBean();
ConvertUtilsBean converter = util.getConvertUtils();
converter.register(myConverter, SomeType.class);
util.copyProperties(bo, vo);

That way, you can register an instance of Converter that knows what 
format string to use each time you call copyProperties().


L.


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



re: Tech-Stack Choices

2005-09-01 Thread Leon Rosenberg
As james said it in his first reply, you should become clear what you need
and what you want.
How critical and how important is it for the company? 

If it is important or even critical for the core business of the company (or
say if it doesn't work, it costs 100.000 per hour) I would engage you to
write it by yourself. Otherwise it can happen to you, that features you
considered important are droped down from the framework or your
technological or organizational direction is considered obsolete. There is
always a risk factor working with open source projects (there are chances
too), but the biggest problem is, that you just have noone to kick in the
ass if something is broken. By the way, the abovementioned direction cut
seem just to happen to us (with struts) so we are thinking about abandoning
it, but thats a different story.

If it's not THAT important, you should still choose something which isn't
just in the first release. 
Talking about frontend I wouldn't even think about JSF or SHALE, since they
are extremely new. Struts 1.2.7 is believed to be a high quality, stable
product, so it could be a very reasonable option, but you should test it
yourself first. 

Moving along the application, for the mid-tier spring or pico-container seem
to be the best available choice. On the other hand, what's wrong with your
POJOs? Do you really need a container? Spring is a lightweight container,
but it's still a container.  My first choice would be POJOs, as you already
seem to have, and in case you need distribution CORBA or RMI (last if
performance isn't an issue).

For the persistence layer, there are many frameworks available, iBatis and
Hibernate among them. I don't know enough about your application to give you
reasonable advices (which I normally bill by 100$ per hour :-)), but I think
you should make a requirement analyses and compare the frameworks. Since you
already work with XML on the persistence side (my interpretation of a
custom built XML 
based data access layer) you maybe should look into XML-DBs.

After all, you should really invest some time into proper requirements
analysis to make the right decision, based on your requirements and not
someone else's preferences.

Regards
Leon



 -Ursprüngliche Nachricht-
 Von: Balasubramaniam, Sezhiyan [mailto:[EMAIL PROTECTED] 
 Gesendet: Donnerstag, 1. September 2005 21:07
 An: user@struts.apache.org
 Betreff: Tech-Stack Choices
 
 I am kind of new to this forum... Need some advice from the gurus.
 
  
 
 In eBay, for our all intranet applications, we use JSP 
 presentation, STRUTS 1.0.1 as controller, java based 
 application objects for business logics and custom built XML 
 based data access layer.
 
  
 
 Now we are in the process of upgrading all our apps/apis/servers.
 
  
 
 I thought of utilizing this opportunity and try to upgrade 
 our STRUTS applications, to come back to the industry-wide tech-stack.
 
  
 
 But by following the forum, I am getting confused which one 
 to choose and what are their purposes:
 
  
 
 STRUTS 1.2.x?
 
 JSF? 
 
 SHALE? 
 
 SPRING? 
 
 HIBERNATE? 
 
  
 
 Can someone give a high level some idea and some pointers?   
 
  
 
 Our main focus is to align with the viable industry 
 standards, the same time not to jump into the usage of beta 
 API's which are not tested out thoroughly.
 
  
 
 Appreciate the help.
 
  
 
 Bala
 
 



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



Re: Struts Ti [was RE: Tech-Stack Choices]

2005-09-01 Thread James Mitchell
The discussions about Ti are happening on the Struts Developers list,  
which is why you won't hear much on this list.


Here's where Ti status is...

http://wiki.apache.org/struts/StrutsTi


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 4:15 PM, Abdullah Jibaly wrote:

This seems to be more of an inside joke than anything else. Where  
can we find anything on Struts Ti, I'm really interested in  
learning something worthwhile about it besides what's on https:// 
www.twdata.org/projects/struts-ti, which doesn't seem to have been  
updated for a couple months.


Thanks!
Abdullah

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 2:51 PM
To: Struts Users Mailing List
Subject: Re: Tech-Stack Choices


You are likely to hear many differing opinions on this list.

You should evaluate your criteria.  Are you wanting something slick?
Fast development?  Easier maintenance?  Scalable?  Flexible?

If you are wanting something fast.  Take a look at Ruby on Rails, or
stay tuned to this channel for updates on Struts Ti.

If you want to leverage your existing team's talent (based on your
comment below), stay with Struts.

If you have to hire new help, you will find the largest talent base
has Struts experience over anything else we've mentioned.

If you are wanting something standard (as in J2EE standards), I'd say
go with JSF.  While you are not as likely to find as many developers
with JSF experience as you will with Struts experience, JSF is not
something to ignore.  In fact, the MyFaces (http://
myfaces.apache.org) community is vibrant and growing.

Unltimately, the decision is yours, I'm just along for the ride ;)
and I'm excited to part of all of this.


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 3:06 PM, Balasubramaniam, Sezhiyan wrote:



I am kind of new to this forum... Need some advice from the gurus.



In eBay, for our all intranet applications, we use JSP presentation,
STRUTS 1.0.1 as controller, java based application objects for
business
logics and custom built XML based data access layer.



Now we are in the process of upgrading all our apps/apis/servers.



I thought of utilizing this opportunity and try to upgrade our STRUTS
applications, to come back to the industry-wide tech-stack.



But by following the forum, I am getting confused which one to choose
and what are their purposes:



STRUTS 1.2.x?

JSF?

SHALE?

SPRING?

HIBERNATE?



Can someone give a high level some idea and some pointers?



Our main focus is to align with the viable industry standards, the
same time not to jump into the usage of beta API's which are not
tested
out thoroughly.



Appreciate the help.



Bala






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


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





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



Re: Tech-Stack Choices

2005-09-01 Thread James Mitchell

I hit send too soon

Just to be clear, Spring and Hibernate are really irrelevant in the  
context of this discussion, unless you mean Spring MVC.  I can't  
speak for Spring MVC, so I'll let others discuss the merits.



My professional opinion (if it means anything) is to go with Spring/ 
Hibernate no matter which choice of web framework you decide.  The  
benefits you get with O/R and IoC *far* outweigh any learning curve  
that you may encounter.  I think anyone who's been down that road  
would agree.


Anyway, that's all, I'll shut up now.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 3:50 PM, James Mitchell wrote:


You are likely to hear many differing opinions on this list.

You should evaluate your criteria.  Are you wanting something  
slick?  Fast development?  Easier maintenance?  Scalable?  Flexible?


If you are wanting something fast.  Take a look at Ruby on Rails,  
or stay tuned to this channel for updates on Struts Ti.


If you want to leverage your existing team's talent (based on your  
comment below), stay with Struts.


If you have to hire new help, you will find the largest talent base  
has Struts experience over anything else we've mentioned.


If you are wanting something standard (as in J2EE standards), I'd  
say go with JSF.  While you are not as likely to find as many  
developers with JSF experience as you will with Struts experience,  
JSF is not something to ignore.  In fact, the MyFaces (http:// 
myfaces.apache.org) community is vibrant and growing.


Unltimately, the decision is yours, I'm just along for the ride ;)   
and I'm excited to part of all of this.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 3:06 PM, Balasubramaniam, Sezhiyan wrote:



I am kind of new to this forum... Need some advice from the gurus.



In eBay, for our all intranet applications, we use JSP presentation,
STRUTS 1.0.1 as controller, java based application objects for  
business

logics and custom built XML based data access layer.



Now we are in the process of upgrading all our apps/apis/servers.



I thought of utilizing this opportunity and try to upgrade our STRUTS
applications, to come back to the industry-wide tech-stack.



But by following the forum, I am getting confused which one to choose
and what are their purposes:



STRUTS 1.2.x?

JSF?

SHALE?

SPRING?

HIBERNATE?



Can someone give a high level some idea and some pointers?



Our main focus is to align with the viable industry standards, the
same time not to jump into the usage of beta API's which are not  
tested

out thoroughly.



Appreciate the help.



Bala






-
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: jasper exception

2005-09-01 Thread Wendy Smoak

From: Nirmala Dhara [EMAIL PROTECTED]


%@ taglib uri=struts/bean-el prefix=bean %
%@ taglib uri=struts/html-el prefix=html %



org.apache.jasper.JasperException: File /struts/bean-el not found


I suggest removing the taglib tags from web.xml, and using the URIs found 
in the tld files themselves (which are stored in struts.jar and 
struts-el.jar).  The tlds can be found within the .jar files, there's no 
longer any need to store them loose under WEB-INF and configure them in 
web.xml.


Try:
  %@ taglib uri=http://struts.apache.org/tags-html-el; prefix=html %
  %@ taglib uri=http://struts.apache.org/tags-bean-el; prefix=bean %

(As for the original question, I wonder if either the TLD files are not 
under WEB-INF, or if in one JSP you have uri=/struts/bean-el with a 
leading slash.)


--
Wendy Smoak 



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



Re: Trim all fields before validation

2005-09-01 Thread Frank W. Zammetti
Sounds good.  I certainly understand the jitters, my organization is 
very much like that as well (in fact, I had to sneak some JWP code in 
too, disguised as part of the app itself!)  Just wanted to know if there 
was a problem with it that I could have done something about.  As always 
though, I very much appreciate any feedback, so if you do have any 
suggestions down the road, I'll be here :)


Frank

Dilip Ladhani wrote:
I am going to try that out in our new application Frank. The trim 
issue was with our older app, which is the big sustaining force (cash 
cow) for our company, and I wasn't able to push through the new jar and 
web.xml changes there, as people are nervous whenever I suggest anything 
major there.


I do like the JWP concept, and will try it out in our new app and let 
you know of any shortcommings I find. Thanks for your help and your work 
in making it available.


Dilip



From: Frank W. Zammetti [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 01 Sep 2005 14:57:36 -0400

The ParameterMungerFilter in JWP didn't do the trick for you?  I'd 
love to know what shortcomings you found so that I can work to improve 
it :)


Frank

Dilip Ladhani wrote:

I am not a fan of javascript, I know, I can use this, but I have 
always had browser compatibility issues with javascript. I still use 
javascript, when absolutely necessary, but I prefer to avoid it.


As far as required goes, that probably won't work because I could 
have a string like test which would pass the required 
test, wouldn't it? unless I misunderstood what you are suggesting.


I did try a generic loop as per Joe's suggestion and that worked 
pretty well. Here is a what I did.


java.util.Map map = thisForm.getMap();
java.util.Iterator it = map.keySet().iterator();
while(it.hasNext()){
 String key = (String) it.next();
 Object obj = map.get(key);
 if (obj instanceof String){
   obj = ((String) obj).trim();
 }
 else if(obj instanceof String[]){
String[] temp = (String[]) obj;
for(int i=0;itemp.length; i++){
  temp[i] = temp[i].trim();
}
   obj = temp;
 }
map.put(key, obj);
}



From: Kishore Senji [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: Trim all fields before validation
Date: Thu, 1 Sep 2005 09:40:42 -0700

Wouldn't this be easier, without mucking with the form, to let this be
handled by the validator itself. For any field validation you would 
just
have to have the requires validation before you do any other 
validation,
and that way you would take care of empty strings or as Joe said you 
could

do this in javascript as well pretty easily.






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







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


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










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


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



test mail... pls. ignore...

2005-09-01 Thread Dharmendra . Sharan
test mail...

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

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

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


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



Struts Ti [was RE: Tech-Stack Choices]

2005-09-01 Thread Abdullah Jibaly
This seems to be more of an inside joke than anything else. Where can we find 
anything on Struts Ti, I'm really interested in learning something worthwhile 
about it besides what's on https://www.twdata.org/projects/struts-ti, which 
doesn't seem to have been updated for a couple months.

Thanks!
Abdullah

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 01, 2005 2:51 PM
To: Struts Users Mailing List
Subject: Re: Tech-Stack Choices


You are likely to hear many differing opinions on this list.

You should evaluate your criteria.  Are you wanting something slick?   
Fast development?  Easier maintenance?  Scalable?  Flexible?

If you are wanting something fast.  Take a look at Ruby on Rails, or  
stay tuned to this channel for updates on Struts Ti.

If you want to leverage your existing team's talent (based on your  
comment below), stay with Struts.

If you have to hire new help, you will find the largest talent base  
has Struts experience over anything else we've mentioned.

If you are wanting something standard (as in J2EE standards), I'd say  
go with JSF.  While you are not as likely to find as many developers  
with JSF experience as you will with Struts experience, JSF is not  
something to ignore.  In fact, the MyFaces (http:// 
myfaces.apache.org) community is vibrant and growing.

Unltimately, the decision is yours, I'm just along for the ride ;)   
and I'm excited to part of all of this.


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: callto://jmitchtx





On Sep 1, 2005, at 3:06 PM, Balasubramaniam, Sezhiyan wrote:

 I am kind of new to this forum... Need some advice from the gurus.



 In eBay, for our all intranet applications, we use JSP presentation,
 STRUTS 1.0.1 as controller, java based application objects for  
 business
 logics and custom built XML based data access layer.



 Now we are in the process of upgrading all our apps/apis/servers.



 I thought of utilizing this opportunity and try to upgrade our STRUTS
 applications, to come back to the industry-wide tech-stack.



 But by following the forum, I am getting confused which one to choose
 and what are their purposes:



 STRUTS 1.2.x?

 JSF?

 SHALE?

 SPRING?

 HIBERNATE?



 Can someone give a high level some idea and some pointers?



 Our main focus is to align with the viable industry standards, the
 same time not to jump into the usage of beta API's which are not  
 tested
 out thoroughly.



 Appreciate the help.



 Bala




-
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: Not struts but u guys know a good Spell Check

2005-09-01 Thread Mark Benussi
You can make a div editable and if you have control over the client (i.e. an
Intranet) plug in Microsoft Words spell checker

-Original Message-
From: Ajaya Agrawalla [mailto:[EMAIL PROTECTED] 
Sent: 01 September 2005 20:05
To: 'user@struts.apache.org'
Subject: Not struts but u guys know a good Spell Check 

I am trying to validate some long input from the browser with a spell
checker.. Any suggestions??

aj

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



Re: custom date converters

2005-09-01 Thread Hubert Rabago
shameless_plug

(with slow music playing in background)

On 9/1/05, Joe Germuska [EMAIL PROTECTED] wrote:
 At 4:32 PM -0400 9/1/05, Laurie Harper wrote:
 You can register an instance of Converter that knows what
 format string to use each time you call copyProperties().
 
 However, if you have one bean that has two properties of the same
 type that will be set with strings which require different
 translation strategies, you're stuck.

(now the faster tune TV ad jingle)

Not if you're using FormDef !

form name=myForm
beanType=com.my.dto.MyBean
field property=dateField1
converter param=MMM dd, /
/field
field property=dateField2
converter param=-MM-dd/
/field
/form

Combined with getFormValues()/setFormValues(), parse and format each
field the way you want!  You can even specify a key into your resource
bundle so different locales have different formats!
/shameless_plug

Fortunately, Rivka's initial example had two forms whose date formats
were different.  In those cases, Rivka can use Laurie's approach.

Hubert

(A few more hours and it'll be Friday.)

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



Tiles and JSF?

2005-09-01 Thread Bjørn T Johansen
I have used Tiles with Struts before and as I understand, one can use Tiles 
with JSF?
Any difference in how to use it compared to Struts?
Where can I download a standalone package of Tiles?


Regards,

BTJ

-- 
---
Bjørn T Johansen

[EMAIL PROTECTED]
---
Someone wrote:
I understand that if you play a Windows CD backwards you hear strange Satanic 
messages
To which someone replied:
It's even worse than that; play it forwards and it installs Windows
---

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



Re: Tiles and JSF?

2005-09-01 Thread Greg Reddin

On Sep 1, 2005, at 4:44 PM, Bjørn T Johansen wrote:

I have used Tiles with Struts before and as I understand, one can  
use Tiles with JSF?

Any difference in how to use it compared to Struts?
Where can I download a standalone package of Tiles?


http://svn.apache.org/builds/struts/nightly/sandbox/tiles-core/

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



Re: Tiles and JSF?

2005-09-01 Thread Bjørn T Johansen
How stable are these?

BTJ

Greg Reddin wrote:
 On Sep 1, 2005, at 4:44 PM, Bjørn T Johansen wrote:
 
 I have used Tiles with Struts before and as I understand, one can  use
 Tiles with JSF?
 Any difference in how to use it compared to Struts?
 Where can I download a standalone package of Tiles?
 
 
 http://svn.apache.org/builds/struts/nightly/sandbox/tiles-core/
 
 Greg
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: Tiles and JSF?

2005-09-01 Thread Greg Reddin

On Sep 1, 2005, at 4:48 PM, Bjørn T Johansen wrote:


How stable are these?


They haven't changed significantly in about 3 weeks :-)

If you're just *using* Tiles and not extending the APIs I would  
consider it pretty stable.  If you'll be extending the API's there's  
still more work to be done, namely some refactoring out of orphaned  
classes and removing the dependency on the Servlet API replacing it  
with a Tiles-specific context object.


Greg


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



Initialize Dynamic Form

2005-09-01 Thread Raj Bhalla
Hi ,
I am moving from one struts module to another .
I am using org.apache.struts.actions.SwitchAction.
 I need to initialize a form in action class before reaching Switch Action.
I have coded like this .
 DynaValidatorForm checkOutForm = ( DynaValidatorForm ) new 
CheckoutDynaValidatorForm( ) ;
checkOutForm.set( CheckoutConstants.PRODUCT_TYPE ,PHConstants.P_ITEM );
 is this the correct way to do it . Can someone suggest better way to do it.
I am getting null pointer at checkOutForm.set( 
CheckoutConstants.PRODUCT_TYPE ,PHConstants.P_ITEM );
 Thanks
Raj


Tiles: Unique body attributes for each part.

2005-09-01 Thread oracle411
Sorry if this got posted twice.  

Hi I'm new to Struts and Tiles, but I was able to build a basic web
application that worked fine. Tiles def was pretty standard with
header, body, footer, etc

My problem now is that I'm required to use a more advanced header.
They gave me a header.jsp page to use and it has it's own body tag with
a backgroud attribute assigned to an image.

When I just replace my old header.jsp page with the new one, no
background image is displayed on my header.  Instead it seems to
display on my body page instead.

I think tiles is combining all my pages so that I can only have one
body tag.  IE: start a body tag in the header and end the body tag in
the footer.

Is their a way to assign unique body  attributes  for each part of my
tiles?

Thank You



---
Broadband interface (RIA) + mail box saftey = a 
href=http://Struts_User_List.roomity.com;Roomity.com/a
*Your* clubs, no sign up to read, ad supported; try broadband internet. 
~~1125615702048~~
---


Re: The latest stable version of struts

2005-09-01 Thread amos
On Wed, 2005-08-31 at 18:15 -0700, Randy Shepherd wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 How many man hours are associated with moving from 1.1 to 1.2.7? What 
 are the major challenges?

As others indicated it depends, but if it helps I've just upgraded
a web application with 2200+ files, 300k lines from 1.1 to 1.2.7 in
two days.

I had to find a new way to do some things but these were the
exceptions. The bulk of the code needed simple bulk adjustments
or no touching at all.

IntelliJ IDEA's refactoring and code analysis was priceless
in the process.

Cheers,

--Amos



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



Re: Trim all fields before validation

2005-09-01 Thread amos
On Wed, 2005-08-31 at 13:58 -0500, Joe Germuska wrote:
 You can't really intervene in the form population process on the 
 Struts side right now (although arguably that's something which 
 should be exposed for user customization better).

We already have a BaseProcessor class which extends
TilesRequestProcessor. I added the following code there and it
seems to work:

protected void processPopulate(HttpServletRequest httpServletRequest,
 HttpServletResponse httpServletResponse, ActionForm actionForm,
 ActionMapping actionMapping) throws ServletException
{
  super.processPopulate(httpServletRequest, httpServletResponse,
actionForm, actionMapping);

  if (actionForm instanceof DynaActionForm)
  {
DynaActionForm dynaActionForm = (DynaActionForm)actionForm;
for (IteratorMap.Entry iterator =
 dynaActionForm.getMap().entrySet().iterator();
 iterator.hasNext();)
{
  Map.Entry entry = iterator.next();
  if (entry.getValue() instanceof String)
dynaActionForm.set((String)entry.getKey(),
  ((String)entry.getValue()).trim());
}
  }
}

Is there something I'm missing?

Thanks,

--Amos



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



Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
Thanks 

2005/9/1, Mark Benussi [EMAIL PROTECTED]:
 No he is saying don't look up data in a JSP.
 
 Look it up in a Struts action and place in the presentation layer via an
 ActionForm etc before showing the JSP
 
 -Original Message-
 From: ??? [mailto:[EMAIL PROTECTED]
 Sent: 01 September 2005 15:09
 To: Struts Users Mailing List
 Subject: Re: How to pass SQL variable from JSP to Action?
 
 Richard
 
 Are you suggesting something like Hibernate or iBatis?
 
 Daniel
 
 
 2005/9/1, R. Markham [EMAIL PROTECTED]:
  Hallo Nobody(??)
 
  It is bad practice to put SQL Statement in a JSP page.
 
  Regards
 
  Richard Markham
 
 
  -Ursprüngliche Nachricht-
  Von: ??? [mailto:[EMAIL PROTECTED]
  Gesendet: Donnerstag, 1. September 2005 05:30
  An: Struts Users Mailing List
  Betreff: Re: How to pass sql variable from jsp to Action?
 
  I wonder if it is a proper way to do it because
  the 1st query displays a no of rows with different group ids.
  Can the html:link pass a value to Action?
  If it can, it is excellent.
 
  Should it be done like this?
  change the layout from a no of links html:link
  to a no of forms html:form
  In each form, it has hidden value of group id.
 
  How will you do this? Thank you very much for your help.
 
  2005/9/1, 梁炳�� [EMAIL PROTECTED]:
   I retrieve a group id by JSP.
   sql:query  ...SELECT group_id../
  
   When user clicks a link
   html:link .../
  
   Before another page is shown, in my struts-config.xml,
   I try to make a ActionForward function to capture the group_id
   and then update a session attribute .
  
   Then the resulting jsp is like this
   sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
  
   Is this a proper way to do this?
  
   I do not know how to write in the Action class so that
   it can retrieve the sql value from the passing in jsp file.
  
   Your help is very much appreicated.
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
After 2nd thought, what if I want to display a no of lines which are
actually links html:link.

How can it be done with selecting data in Action via ActionForm
and displaying them by jsp?



2005/9/1, Mark Benussi [EMAIL PROTECTED]:
 No he is saying don't look up data in a JSP.
 
 Look it up in a Struts action and place in the presentation layer via an
 ActionForm etc before showing the JSP
 
 -Original Message-
 From: ??? [mailto:[EMAIL PROTECTED]
 Sent: 01 September 2005 15:09
 To: Struts Users Mailing List
 Subject: Re: How to pass SQL variable from JSP to Action?
 
 Richard
 
 Are you suggesting something like Hibernate or iBatis?
 
 Daniel
 
 
 2005/9/1, R. Markham [EMAIL PROTECTED]:
  Hallo Nobody(??)
 
  It is bad practice to put SQL Statement in a JSP page.
 
  Regards
 
  Richard Markham
 
 
  -Ursprüngliche Nachricht-
  Von: ??? [mailto:[EMAIL PROTECTED]
  Gesendet: Donnerstag, 1. September 2005 05:30
  An: Struts Users Mailing List
  Betreff: Re: How to pass sql variable from jsp to Action?
 
  I wonder if it is a proper way to do it because
  the 1st query displays a no of rows with different group ids.
  Can the html:link pass a value to Action?
  If it can, it is excellent.
 
  Should it be done like this?
  change the layout from a no of links html:link
  to a no of forms html:form
  In each form, it has hidden value of group id.
 
  How will you do this? Thank you very much for your help.
 
  2005/9/1, 梁炳�� [EMAIL PROTECTED]:
   I retrieve a group id by JSP.
   sql:query  ...SELECT group_id../
  
   When user clicks a link
   html:link .../
  
   Before another page is shown, in my struts-config.xml,
   I try to make a ActionForward function to capture the group_id
   and then update a session attribute .
  
   Then the resulting jsp is like this
   sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
  
   Is this a proper way to do this?
  
   I do not know how to write in the Action class so that
   it can retrieve the sql value from the passing in jsp file.
  
   Your help is very much appreicated.
  
 
 
  -
  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: Error: Cannot forward after response has been committed?

2005-09-01 Thread 梁炳場
Thank you so much.

2005/9/1, Guillermo Castro [EMAIL PROTECTED]:
 Ok...
 
 Assuming you have a tiles layout definition like:
 
 definition name=.basic.layout path=/common/mainLayout.jsp
 put name=header value=/common/headerTile.jsp /
 put name=content value= /
 put name=footer value=/common/footerTile.jsp /
 /definition
 
 You can make the header content a tile definition by itself, and use that
 definition to declare your Controller class, which will be the one with the
 logic for forwarding:
 
 definition name=.basic.layout path=/common/mainLayout.jsp
 put name=header value=.basic.layout.header /
 put name=content value= /
 put name=footer value=/common/footerTile.jsp /
 /definition
 
 definition name=.basic.layout.header page=/common/headerTile.jsp
 controllerClass=my.package.HeaderController
 /definition
 
 
 And put the forward inside the HeaderController class:
 
 public void execute(ComponentContext tileContext, HttpServletRequest
 request,
 HttpServletResponse response, ServletContext servletContext) throws
 Exception {
 HttpSession session = request.getSession(false);
 if(null == session || null == session.getAttribute(loginForm)) {
 response.sendRedirect(/index.jsp);
 }
 }
 
 Also, make sure that your '/common/mainLayout.jsp' page doesn't have any
 html code before the tiles:insert attribute=header / invocation, or it
 will make a response being sent to the client.
 
 Regards.
 
 On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
 
  What if the Tiles layout composing header, menu and body.
 
  Where the Tiles Controller belongs to?
  Does it stick one layout?
 
  Thanks
 
  2005/9/1, Guillermo Castro [EMAIL PROTECTED]:
   The error happens when part of your jsp page has already been sent to
  the
   client.
  
   My recommendation would be to define a Tiles Controller (see
   org.apache.struts.tiles.ControllerSupport) that would do the forwarding
   logic.
  
   I hope this helps.
  
   On 9/1/05, 梁炳場 [EMAIL PROTECTED] wrote:
   
Within a Tiles layout,
I try to forward to another jsp when a bean not exist?
   
But it leads to the subject line error message?
   
In the header layout jsp, I put this
   
logic:notPresent scope=session name=loginForm
jsp:forward page=/index.jsp/
/logic:notPresent
   
If it is not allowed or it is not a good way,
what is the better way or another way to do so?
   
Thanks
PC Leung
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
   --
   Guillermo Castro [EMAIL PROTECTED]
   Monterrey NL, Mexico http://www.javageek.org/
  
  
 
 
 
 
 --
 Guillermo Castro [EMAIL PROTECTED]
 Monterrey NL, Mexico http://www.javageek.org/
 



Re: How to pass SQL variable from JSP to Action?

2005-09-01 Thread 梁炳�
I just read the Struts user guide again.

Is it the right track to go?

In Action: 
   ResultSet rs = ...;
   ResultSetDynaClass rsdc = new ResultSetDynaClass(rs);
   Iterator rows = rsdc.iterator();
   while (rows.hasNext())  {
 DynaBean row = (DynaBean) rows.next();
 ... process this row ...
   }
   rs.close();
 

In JSP:
   logic-el:iterate name=stringbean property=stringArray id=foo
 indexId=ctr
html-el:text name=stringbean
  property=labelValue[${ctr}].label /
   /logic-el:iterate


2005/9/2, 梁炳�� [EMAIL PROTECTED]:
 After 2nd thought, what if I want to display a no of lines which are
 actually links html:link.
 
 How can it be done with selecting data in Action via ActionForm
 and displaying them by jsp?
 
 
 
 2005/9/1, Mark Benussi [EMAIL PROTECTED]:
  No he is saying don't look up data in a JSP.
 
  Look it up in a Struts action and place in the presentation layer via an
  ActionForm etc before showing the JSP
 
  -Original Message-
  From: ??? [mailto:[EMAIL PROTECTED]
  Sent: 01 September 2005 15:09
  To: Struts Users Mailing List
  Subject: Re: How to pass SQL variable from JSP to Action?
 
  Richard
 
  Are you suggesting something like Hibernate or iBatis?
 
  Daniel
 
 
  2005/9/1, R. Markham [EMAIL PROTECTED]:
   Hallo Nobody(??)
  
   It is bad practice to put SQL Statement in a JSP page.
  
   Regards
  
   Richard Markham
  
  
   -Ursprüngliche Nachricht-
   Von: ??? [mailto:[EMAIL PROTECTED]
   Gesendet: Donnerstag, 1. September 2005 05:30
   An: Struts Users Mailing List
   Betreff: Re: How to pass sql variable from jsp to Action?
  
   I wonder if it is a proper way to do it because
   the 1st query displays a no of rows with different group ids.
   Can the html:link pass a value to Action?
   If it can, it is excellent.
  
   Should it be done like this?
   change the layout from a no of links html:link
   to a no of forms html:form
   In each form, it has hidden value of group id.
  
   How will you do this? Thank you very much for your help.
  
   2005/9/1, 梁炳�� [EMAIL PROTECTED]:
I retrieve a group id by JSP.
sql:query  ...SELECT group_id../
   
When user clicks a link
html:link .../
   
Before another page is shown, in my struts-config.xml,
I try to make a ActionForward function to capture the group_id
and then update a session attribute .
   
Then the resulting jsp is like this
sql:query SELECT someValue FROM .. WHERE group_id = ???groupId??? /
   
Is this a proper way to do this?
   
I do not know how to write in the Action class so that
it can retrieve the sql value from the passing in jsp file.
   
Your help is very much appreicated.
   
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Tiles: Unique body attributes for each part.

2005-09-01 Thread Lucas Bern
Hi, that sis a limitation of html. You con nota have more than one body in the 
same document.
 
The only sokution u can see is using frames, or replacing de body t ag by a div 
tag, apllying a styke with the background settings...
 
i wish it helps
Lucas


oracle411 [EMAIL PROTECTED] escribió:
Sorry if this got posted twice. 

Hi I'm new to Struts and Tiles, but I was able to build a basic web
application that worked fine. Tiles def was pretty standard with
header, body, footer, etc

My problem now is that I'm required to use a more advanced header.
They gave me a header.jsp page to use and it has it's own body tag with
a backgroud attribute assigned to an image.

When I just replace my old header.jsp page with the new one, no
background image is displayed on my header. Instead it seems to
display on my body page instead.

I think tiles is combining all my pages so that I can only have one
body tag. IE: start a body tag in the header and end the body tag in
the footer.

Is their a way to assign unique body attributes for each part of my
tiles?

Thank You



---
Broadband interface (RIA) + mail box saftey = Roomity.com
*Your* clubs, no sign up to read, ad supported; try broadband internet. 
~~1125615702048~~
---


-
 1GB gratis, Antivirus y Antispam
 Correo Yahoo!, el mejor correo web del mundo
 Abrí tu cuenta aquí